ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

INT WSAAPI WSAIoctl ( IN SOCKET  s,
IN DWORD  dwIoControlCode,
IN LPVOID  lpvInBuffer,
IN DWORD  cbInBuffer,
OUT LPVOID  lpvOutBuffer,
IN DWORD  cbOutBuffer,
OUT LPDWORD  lpcbBytesReturned,
IN LPWSAOVERLAPPED  lpOverlapped,
IN LPWSAOVERLAPPED_COMPLETION_ROUTINE  lpCompletionRoutine 
)

Definition at line 47 of file ioctl.c.

{
    PWSSOCKET Socket;
    INT Status;
    INT ErrorCode;
    LPWSATHREADID ThreadId;
    DPRINT("WSAIoctl: %lx, %lx\n", s, dwIoControlCode);

    /* Check for WSAStartup */
    if ((ErrorCode = WsQuickPrologTid(&ThreadId)) == ERROR_SUCCESS)
    {
        /* Get the Socket Context */
        if ((Socket = WsSockGetSocket(s)))
        {
            /* Make the call */
            Status = Socket->Provider->Service.lpWSPIoctl(s,
                                                  dwIoControlCode,
                                                  lpvInBuffer,
                                                  cbInBuffer,
                                                  lpvOutBuffer,
                                                  cbOutBuffer,
                                                  lpcbBytesReturned,
                                                  lpOverlapped,
                                                  lpCompletionRoutine,
                                                  ThreadId,
                                                  &ErrorCode);

            /* Deference the Socket Context */
            WsSockDereference(Socket);

            /* Return Provider Value */
            if (Status == ERROR_SUCCESS) return Status;
        }
        else
        {
            /* No Socket Context Found */
            ErrorCode = WSAENOTSOCK;
        }
    }

    /* Return with an Error */
    SetLastError(ErrorCode);
    return SOCKET_ERROR;
}

Generated on Fri May 25 2012 05:19:24 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.