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

SOCKET WSAAPI socket ( IN INT  af,
IN INT  type,
IN INT  protocol 
)

Definition at line 133 of file socklife.c.

{
    PWSPROCESS Process;
    PWSTHREAD Thread;
    DWORD Flags = 0;
    INT ErrorCode;
    DPRINT("socket: %lx, %lx, %lx\n", af, type, protocol);

    /* Enter prolog */
    if ((ErrorCode = WsApiProlog(&Process, &Thread)) != ERROR_SUCCESS)
    {
        /* Fail here */
        SetLastError(ErrorCode);
        return INVALID_SOCKET;
    }

    /* Check the current open type and use overlapped if it's default */
    if (!Thread->OpenType) Flags = WSA_FLAG_OVERLAPPED;

    /* Make the protocol negative if this is NETBIOS */
    if ((af == AF_NETBIOS) && (protocol > 0)) protocol *= -1;

    /* Now let WSA handle it */
    return WSASocketW(af, type, protocol, NULL, 0, Flags);
}

Generated on Sun May 27 2012 05:21:22 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.