Does any one know if the functions listed below are located in the WinSock.dll (if not where else?), I get an error tell in me "The File C:\Windows\winsock.dll apears to be damaged.". But I'm sure I've made something wrong with the import, other WinSock apps run.

WinSock functions used:
accept
bind
closesocket
gethostbyname
gethostname
htons
inet_ntoa
listen
recv
send
socket
WSAAsyncSelect
WSACleanup
WSAStartup

Posted on 2002-11-20 12:59:01 by scientica
Ok, I tried a lot of things, and I got the app to stop showing me the error message described above, I changed "winsock.dll" to "wsock32.dll". But now it crashes for another reason, I'm going to ask Olly what the error is...
Posted on 2002-11-22 08:20:02 by scientica
Maybe it would easy for people to help if you showed us a little snippet of code
Posted on 2002-11-25 15:45:48 by CyberGuy
I've got it working now, but it's not doing what I want right now because I haven't changed the storage of a value (I use a dialog controll to hold a variabe and it's trashed when I send my dialog to the tray). So I must conclude that the WinSock functions are located in Winsock32.dll an dnot winsock.dll, so if any one else intends to write a WinSock app in FASM, you'll need to import the WinSock functions (WSAStartup, WSACleanup, send, recv, etc) from winsock32.dll. Further more some WinSock structs must be added to the source code, maybe I'll see if I can collect the structs I use and post them i a file here.
Maybe I'll post the app, when I've got it stable, It's a tiny web server. It's based on the Chincy Server (written in MASM), but I've made some changes, i.e. echoing requests other than GET (like POST, quite funny actually to see what the web-browser sends to the intetrnet servers...) and add added a tray icon with a menu with icons (does any one know how to avoid the icon getting 'inverted' when the cursor is above the menu item?), and also (IMO) improved the GUI a bit (no offense to the author of Chincy :) ); but know it's buggy, I'll see if I get any time this afternoon (local time, GMT +1) to upload a pice of it.

I haven't been able to translate the code from MASM to FASM yet, I tried but failed not due to Winsock, I solved that, but due to dialog resource issues. In masm I can assign a window class to a dialog resource, I haven't been able to do that in FASM, I attached the masm resource file in case any one knows how to translate it to FASM .rsrc style (with or without macros); So for the moment the app is written in MASM, but I'll convert it to FASM sooner or later (if someone can help me with the resource "translation" I won't have to make an proc that creates the winodow)
Posted on 2002-11-25 23:40:31 by scientica
This is precisely the point of my tread posted earlier called 'dll procedures'.

Surely there must exist a chart or table outlining which procedures are located in which dll.

It is possible to determine (on a one at a time basis) which dll is used for a particular procedure by looking at a given topic (procedure) on the MSDN library. A tabular format would be much more useful if one would like to see a display of all available procedures and then delcare the appropriate dll library for the desired procedure

I have created a list of the procedures in several of the major dlls for this purpose by extracting the procedure. names from the dlls themselves.

I could compile these for others to use if there is any interest.
Posted on 2002-11-30 23:03:59 by msmith
Taken from Thomas' site
The two major versions of winsock reside in two different DLLs, wsock32.dll and ws2_32.dll, being version 1.1 and version 2.x respectively. The libraries to use are wsock32.lib and ws2_32.lib. The MASM32 package has most winsock constants in its windows.inc, for C++ programs including windows.h suffices, it will include the winsock 2 definitions if the _WIN32_WINNT constant is at least 0x400 (NT version 4). The winsock 2 API includes the full 1.1 API (with some minor changes), wsock32.dll is even just a wrapper for the actual winsock ws2_32.dll.
Posted on 2002-12-01 01:39:08 by roticv
Does this mean I should use wsock32.dll instead of ws2_32.dll, and it would work on a NT4 (with some SP) system, or should I still use wsock32.dll for compabillity?

I have given up the idea of using a dialog resurce, I've written a few procs for crearting the windiow and adding the controlls.

:o Oops, corrected teh typo...
Posted on 2002-12-01 04:48:28 by scientica
haha.. i think this question is best left to Thomas to answer you. Oh ya, it is ws2_32.dll and not ws_32.dll
Posted on 2002-12-01 06:19:29 by roticv
Does this mean I should use wsock32.dll instead of ws_32.dll, and it would work on a NT4 (with some SP) system, or should I still use wsock32.dll for compabillity?


Also from my tutorial:
The most commonly used winsock version is version 2.x, usually just called winsock 2 as there are only minor differences. The latest version before version 2 was version 1.1. Some people say you should use this version for compatibility reasons, as Windows 95 and NT 3 only ship version 1.1. However, all later windows versions (98, ME, NT4, 2000 and XP) have version 2 by default and for Windows 95 an update is available. So I recommend you just start with winsock 2, it adds a lot of nice features and windows machines without winsock 2 are getting rare.


Thomas
Posted on 2002-12-01 07:14:20 by Thomas
However, all later windows versions (98, ME, NT4, 2000 and XP) have version 2 by default and for Windows 95 an update is available. So I recommend you just start with winsock 2, it adds a lot of nice features and windows machines without winsock 2 are getting rare.


That person without winsock2 would be hutch--. :grin:
Posted on 2002-12-01 07:53:10 by roticv