Socket Win32 IO

Peter Hansen peter at engcorp.com
Tue Jul 8 15:27:20 CEST 2003


jose maria wrote:
> 
> Hello Peter tanks for you attenion and time
> 
> Yes really I forget put in the message one parameter in the function
> I put the traceback and all code I hope that this help you. Thousands
> of pardons for my bad English
> 
> Traceback:
> 
> ActivePython 2.2.1 Build 222 (ActiveState Corp.) based on
> Python 2.2.1 (#34, Apr 15 2002, 09:51:39) [MSC 32 bit (Intel)] on wi
> Type "help", "copyright", "credits" or "license" for more informatio
> >>> from socket import *
> >>> import win32api
> >>> import win32file
> >>> Ip=getprotobyname("ip")
> >>> SIO_RCVALL=0x98000001
> >>> ip=('xxx.xxx.xxx.xxx',0)
> >>> Sock=socket(AF_INET,SOCK_RAW,Ip) #Raw Socket
> >>> Sock.bind(ip) # Bind Socket to ip
> >>> fh=Sock.fileno() # Get file handle
> >>> test=win32file.DeviceIoControl(fh,SIO_RCVALL,"", 0,None) # The
> function
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> pywintypes.api_error: (1, 'DeviceIoControl', 'Incorrect function.')

I still get a different result (the second of the two that I posted
before) even if I add that "None" argument, not what you show above.
Are you certain you are cutting and pasting *exactly* what you typed?
I note you have 'xxx.xxx.xxx.xxx' above, so presumably you have
edited the transcript manually in at least one way...  any others?

I'm not likely to be able to solve the problem, since I have no idea
what DeviceIoControl is for, nor what you're trying to accomplish. 
I just thought I'd report that I do not get the results you are 
getting when I try what you show you are trying.

-Peter




More information about the Python-list mailing list