Win32 Programming


  • 1. How to get process which send packet in w2k
    Hi, I need *in my program* to identify process which send packet over network in *Windows 2000*. In XP I use Extended API (e.g. AllocateAndGetTcpExTableFromStack() ) and later process snapshot to get its name. But in w2k there aren't these functions :(. Is it possible (and how) to get process related to connection in w2k (or even in win98)? Thanks for answer Marcin
  • 2. Network monitor capture file format
    Hi, I need to create *.cap file for NM 2.0 from packets captured in other tool . Where can I found some doc about NM 2.0 capture file format ? Peter


Postby ffarsif » Thu, 30 Oct 2003 07:30:26 GMT

Hi, I'm sorry for the lame question, but could somebody please give me an
example of how to use WSPConnect() for both a SOCK_STREAM and SOCK_DGRAM
cases? in case of SOCK_DGRAM I like to listen on certain port for the
incoming DGRAM packets.

Also I like to know if its ok that I BC my posting to all the three
newsgroup instead of one. I hope that I'm not making people angry.



Postby Arkady Frenkel » Fri, 31 Oct 2003 02:23:06 GMT

Hi !

You don't need to do anything , if you( someone ) issue WSAConnect that
to call to WSPConnect in LSP leyer .
No, that is OK because people can see answer send from different NG


Postby ffarsif » Fri, 31 Oct 2003 02:55:45 GMT

thanx for the response...
I guess my question is more in LSP itself. I'm experimenting to redirect a
SOCK_STREAM to a SOCK_DGRAM. To do so I have to start from incoming
WSPSocket() calls to LSP and cover  WSPConnect() and others. So basically
I'm looking at customized LSP.
Any idea?


Similar Threads:

1.SOCK_DGRAM duplex problem

I'm wondering exactly how datagram sockets work. I have two network nodes on 
which I have bound to a certain port to listen for messages. One side (side 
A) sends a message which is ACKed by the receiving side (side B) and then the 
message from side A is forwarded to other nodes which haven't got the message 
(side C, D and E). However, when the message is forwarded to side C it also 
seems to end up at B again  looking like it is addressed from C. However, C 
has not sent this message. C does in fact not even have the program running. 
What has happened?

2.WSPConnect questions

Hello All!

I have a questions about WSPConnect LSP API.
I want to finish connect in other thread and met 2 problems:

1. I want to use call lower layer WSPConnect in other thread
 if socket is into non-blocking mode. Can I use pointers to
all parameters which were specified by my LSP layer
 or I have to make copy of parameters that were given to me?
I mean these parameters:
const sockaddr FAR *name, LPWSABUF lpCallerData, LPWSABUF lpCalleeData,

2. How to set connecting state for socket until I call
WSPConnect of lower layer? The problem is that WSPConnect
 can be non-blocking and I need to ask server whether permit or
deny of connection. This is long time operation. So before I'm calling
 WSPConnect of lower LSP layer I want to set state of my socket
 to connecting.
Is it possible to set this state or I have to store this state in
 my LSP dll and process WSPSelect, WSPAsyncSelect, ... etc
functions manually?

Best Regards,
Voronkov Konstantin

3.accept() and SOCK_DGRAM

From my tests I can see that accept() is not called when using SOCK_DGRAM, 
only when using SOCK_STREAM, when creating the SOCKET. How can you make sure 
the connection is established in SOCK_DGRAM before you start trying to send 

4.LSP and port number in WSPConnect

Hello All ,

I am usig following code to determine on which remote port the socket is
trying to connect.

int WSPConnect(SOCKET s, const struct sockaddr FAR*name , ....)
sockaddr_in FAR* sockPtr=(sockaddr_in FAR*)name;
HOSTENT* HostInfo= gethostbyaddr((char*)&(sockPtr->sin_addr),4,AF_INET);
    dbgprint("Connect req. for %d Port on
    dbgprint("Connect Req. on %d port",sockPtr->sin_port);
But I dont get correct port number , I get correct IP address.
Is there any problem with the code or I need something diff. mechanism to
determine port number. I want to identify port number 80 and 23.
Thanks for your time.

5.Reliability of SOCK_DGRAM Unix-Domain sockets

Hello there,

in unix(7) of the Linux Programmer's Manual it is stated that:

(as on most Unix implementations, Unix domain datagram
sockets are always reliable and don't reorder datagrams)

I've tried hard to find some solid evidence whether or not this also 
applies to Linux 2.6.x - but sadly, I've failed. Could anyone please 
comment on Linux' behavior concerning datagram Unix-domain sockets?


6. Why control messages are restricted to non SOCK_STREAM sockets ?

7. TSP: intercepting "WSPConnect": value of "name" parameter always ""?

Return to Win32 Programming


Who is online

Users browsing this forum: No registered users and 86 guest