none
SIO_RCVALL CAN NOT SET WITH ERROR 10022 RRS feed

  • Question

  •  

    see my code:
     #define SIO_RCVALL _WSAIOW(IOC_VENDOR,1)
    and in function main (){
    .............
    unsigned int ul=1;
    DWORD byteret=0;
    ..............
    if(WSAIoct(soc,SIO_RCVALL,&ul,sizeof(ul),NULL,0,&byteret,NULL,NULL)==SOCKET_ERROR){
    printf("\ncan not set sio_rcvall wuth error %d",WSAGetLastError());
    getch();
    }
    ............
    }
    i use window xp professional sp2,and i have already created the raw socket succesfull.
    when run the program:
    can not set sio_rcvall wuth error 10022
    help me!
    Thursday, July 26, 2007 11:36 AM

All replies

  •  

    Had same problem, tried everything and anything (I thought) and eventually gave up very frustrated and annoyed, resorting to getting the DDK and hacking together my own drivers from the samples.         Then, only by chance, a byte ordering macro (something like ntohl or htonl) got applied to that abandoned code, whereupon it worked (and even more lucky, I noticed).    Inspired by that, I find BYTE Buf[4]={1,0,0,0} instead of the DWORD* I assumed it was supposed to be, works for me (on all of 4 different wired adapters).    Its quite funny (in the psychotic sense) because I initially assumed that TRUE or –1 would do for the parameter, and I tried a lot of other things before finding that int 1 didn’t work either.


    I hope that that helps and that it makes you as happy as it made me.    At least you can try it without running the risk of losing your operating system like I did when one of these forums duped me into thinking my security settings were corrupted.


    PS I don't want it jinxed by being told that that is not why my precious program started working.

    PPS While I am having this emotional outburst, as an alternative solution I wonder whether there is some way of getting a handle to the adapter and using DeviceIoControl to set OID_GEN_CURRENT_PACKET_FILTER to NDIS_PACKET_TYPE_PROMISCUOUS, because those settings can be set from user mode processes.

     

    Thursday, November 8, 2007 8:15 PM