FASt Server - Win32 Socket Library and Tutorial ....

Started by James Ladd, January 15, 2005, 02:41:51 AM

Previous topic - Next topic

Robert Collins

Quote from: striker on May 26, 2005, 04:21:47 AM
Thanks for the feedback.
Faiseur Ill consider the VM approach for Win98 and others.

I have MASM installed on c:\masm32 so the m.bat file invokes the masm tools directly from this location because %masm_home% is set to "c:\masm32"
eg: in command prompt type "set masm_home=c:\masm32" without the quotes.

Is this where you have masm installed ?

In the latest download from www.jamesladdcode.com the m.bat in "fast/svr" is:

@echo off
cls
if exist *.obj del *.obj
%masm_home%\bin\ml /c /coff /nologo *.asm
%masm_home%\bin\Link /SUBSYSTEM:CONSOLE /NOLOGO /OUT:fastsvr.exe main.obj
%masm_home%\bin\Link /SUBSYSTEM:WINDOWS /DLL /DEF:echo.def /NOLOGO echo.obj
dir


The fifth (5) line is making the fastsvr.exe

Have you go the latest zip ?


I have exactly what you show above and my masm32 directory in on the C drive. But the %masm_home% didnt work so I changed it to read c:\masm32 in the bat file. I have the latest download because I downloaded it today. But still the program doesn't work (as described in a previous post) and also during assembling it still has the undefined symbol error (S_un is undefined).

James Ladd

#91
Note from Microsoft web site:
QuoteThe AcceptEx function is not supported on Windows Me/98/95.
Since FAStServer uses this function it wont work on these versions of windows. Sorry.

I have made a new zip download that adds more information to the batch file if its not right and
also to the code so that I can see where it executes upto.

If you have a bug, please cut and paste all the output for me to see.
eg: in the command window       press alt-space, e, s, enter
and then paste it here.

rgs, striker.

Robert Collins

Quote from: striker on May 26, 2005, 07:32:30 AM
Note from Microsoft web site:
QuoteThe AcceptEx function is not supported on Windows Me/98/95.
Since FAStServer uses this function it wont work on these versions of windows. Sorry.

It isn't supported on Windows 98 because the DLL which contains that function does not come with Windows 98. But, if you are a serious person about your project then you might think about including all the DLLs that are needed or at least have a link on your Web Site that points to a download section where one could d/l what he needs. I'm not saying you have to do this but it is what I do when I distribute my applications. 

James Ladd

#93
Robert,
Ill certainly look into finding the required dll's and providing links on the site for where to get them.
Thanks for the suggestion.

Right now you would still have compilation problems yes ?
Can you send me a cut-n-paste of the command prompt output so I can see what happens and when.

Rgs, striker

EDIT:  A new version is available. This fixes the problem with Windows 2000.

pbrennick

striker,
This is really turning into a pretty cool project!  Missing DLLs such as ws2_32.dll are going to be problematic because that particular DLL for example requires the XP version of NTDLL.DLL, so be guided accordingly.  I am not going to say more because it will cause a flame war.

I really like the work you are doing.

Paul

Robert Collins

Quote from: pbrennick on May 27, 2005, 03:46:16 PM
.... DLLs such as ws2_32.dll are going to be problematic because that particular DLL for example requires the XP version of NTDLL.DLL....

I have ws2_32.dll and ntdll.dll on my Windows 98 system and have use them in certain projects of my own but his project still doesn't work (maybe I have the incorrect versions) so maybe there are some other missing files. One alternative to this could be to include a list of the known external files and their version numbers that are required instead of including those files in the project. That way a person could go and find those files himself on the web. Anything is better than nothing.

If I took his fastsrv.exe program (which crashes right from the start) and run it through a PE Dump program wouldn't that tell me what all the DLLs are that his program uses? Maybe not if certain DLLs require other DLLs. I don't know.

pbrennick

Robert,
That is a good idea.  If I remember correctly when I tested it on ME it gave me the name of a missing procedure in the current version of NTDLL.DLL, if you want, I can run that test again.

All these DLLs sure complicate things!

Paul

pbrennick

Robert,
This is what ME reports:

Quote
ws2_32.dll is linked to missing export NTDLL.DLL:Rtlpv4StringTpAddressW

Hope that helps,
Paul

MichaelW

eschew obfuscation

Robert Collins

Quote from: MichaelW on May 27, 2005, 06:46:21 PM
ws2_32.dll was never included with anything below Windows 2000 SP1:

http://support.microsoft.com/dllhelp/?dlltype=file&l=55&alpha=ws2_32.dll&S=1


That's correct but that doesn't mean you can't have them on Windows 98. I think the two that I have came with a project that I downloaded somewhere and I just registered them into my system directory. I know they function correctly because the project that they came with works.

Robert Collins

BTW: Was Windows 2000 out in 1998? I checked the versions of those DLLS.

WS2_32.DLL Version 4.10.1998
NTDLL.DLL Version 4.10.1998

Maybe this is just the version/date of the DLLs but were only distributed with 2000 on up.

pbrennick

Actually, both of you are not correct.  ws2_32.dll was included in the Windows '98 inistallation.  I am looking at the CAB files right now and it is located in NET7.CAB

Paul

Robert Collins

Quote from: pbrennick on May 27, 2005, 07:31:03 PM
....Actually, both of you are not correct.....

What do you mean both of you, Paul? I only said that to avoid disagreeing about that, hehehe. Actually, I had no idea one way or another.

pbrennick

Robert,
You know what?  I had a feeling about that one!  Anyway, if it is in the CABS, well that makes it a no brainer!

You are funny.
Paul

Mark Jones

Quote from: striker on May 25, 2005, 08:54:07 AM
Mark,

QuoteI think your code is so complex, few can understand it... that is why you are getting so few comments

Do you really think it is complex ?  I'm happy to make it "easier". Maybe you can suggest how ? Rgs, striker.

EDIT: There is a new version of the utils available.

Thanks. Oh the FastSvr and Utils are one now, ok.

By complex I mean that FastSvr uses APIs and procedures which many of us have never seen or used before. The util(s) are straightforward but FastSvr itself is rather complex with its overlapped winsock functions and extensive parameter passing. I thought about trying to make an addition to the echo plugin to allow "press X to exit", but can't see where any parsing of actual data takes place in echo.asm - character I/O seems to be happening exclusively in main.asm. But admittedly, I'm confused. :)

I've looked through the code some and it appears that the fastsvr console goes into an endless loop of "waiting, read complete" once the initial telnet console is closed. I found this by uncommenting the stdout calls in main.asm. Because of the loop, it will not accept another connection. fastsvr.exe CPU usage also goes up to about 75% with the United Devices agent running (grid.org). :toothy

Is the server going to remain a console app? The cleanup routine is not executing because no specific console control handler has been defined. I slopped one together below... unsure if it's even remotely correct, but it returns "main cleanup, serious error" during main_cleanup and then yields an access violation reading 009A009E:


; -----------------------------------------------------------------------------
; SetConsoleCtrlHandler routine by Mark Jones
;
ctrl_handler proc
nop   ; for debugging
    invoke main_cleanup, server, error
    mov eax, input(13,10," Press ENTER to exit...") 
; or whatever, so user can read display (needs macros.asm)
   
    mov eax,1   ; control handler must return a 1 to signal successful handling
    invoke ExitProcess, eax  ; unsure if exiting to a 1 is a good idea...
ctrl_handler endp

; -----------------------------------------------------------------------------
; Executable program starting/entry point.
;
;    mov svr.FASTSVR.thing, 2
;    mov eax, svr.FASTSVR.thing
start:
; set title of console window
    szText szTitle, "FAStSvr for Win32 v1.0.0 beta RCxx"
    invoke SetConsoleTitle,addr szTitle

; setup control handler
    invoke SetConsoleCtrlHandler,offset ctrl_handler,TRUE
   
    invoke main_create, error
    cmp eax, 0
    je main_exit

    invoke main_run, server, error

    main_exit:   ; currently never executed
        invoke main_cleanup, server, error
        invoke ExitProcess, eax
end start


Oh and I made a simple .ico, .rc, and some .wap WinAsm project files, they are attached if interested. :)


[attachment deleted by admin]
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08