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

wshtcpip.c
Go to the documentation of this file.
00001 /*
00002  * COPYRIGHT:   See COPYING in the top level directory
00003  * PROJECT:     ReactOS WinSock Helper DLL for TCP/IP
00004  * FILE:        wshtcpip.c
00005  * PURPOSE:     DLL entry
00006  * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
00007  * REVISIONS:
00008  *   CSH 01/09-2000 Created
00009  */
00010 #include <wshtcpip.h>
00011 #define NDEBUG
00012 #include <debug.h>
00013 
00014 BOOL
00015 EXPORT
00016 DllMain(HANDLE hInstDll,
00017         ULONG dwReason,
00018         PVOID Reserved)
00019 {
00020     DPRINT("DllMain of wshtcpip.dll\n");
00021 
00022     switch (dwReason) {
00023     case DLL_PROCESS_ATTACH:
00024         /* Don't need thread attach notifications
00025            so disable them to improve performance */
00026         DisableThreadLibraryCalls(hInstDll);
00027         break;
00028 
00029     case DLL_THREAD_ATTACH:
00030         break;
00031 
00032     case DLL_THREAD_DETACH:
00033         break;
00034 
00035     case DLL_PROCESS_DETACH:
00036         break;
00037     }
00038     return TRUE;
00039 }
00040 
00041 
00042 INT
00043 EXPORT
00044 WSHAddressToString(
00045     IN      LPSOCKADDR Address,
00046     IN      INT AddressLength,
00047     IN      LPWSAPROTOCOL_INFOW ProtocolInfo    OPTIONAL,
00048     OUT     LPWSTR AddressString,
00049     IN OUT  LPDWORD AddressStringLength)
00050 {
00051     UNIMPLEMENTED
00052 
00053     return NO_ERROR;
00054 }
00055 
00056 
00057 INT
00058 EXPORT
00059 WSHEnumProtocols(
00060     IN      LPINT lpiProtocols  OPTIONAL,
00061     IN      LPWSTR lpTransportKeyName,
00062     IN OUT  LPVOID lpProtocolBuffer,
00063     IN OUT  LPDWORD lpdwBufferLength)
00064 {
00065     UNIMPLEMENTED
00066 
00067     return NO_ERROR;
00068 }
00069 
00070 
00071 INT
00072 EXPORT
00073 WSHGetBroadcastSockaddr(
00074     IN  PVOID HelperDllSocketContext,
00075     OUT PSOCKADDR Sockaddr,
00076     OUT PINT SockaddrLength)
00077 {
00078     INT Size = 2 * sizeof(UINT);
00079 
00080     if (*SockaddrLength < Size)
00081     {
00082         DPRINT1("Socket address length too small: %d\n", *SockaddrLength);
00083         return WSAEFAULT;
00084     }
00085 
00086     RtlZeroMemory(Sockaddr, *SockaddrLength);
00087 
00088     Sockaddr->sa_family = AF_INET;
00089     *((PUINT)Sockaddr->sa_data) = INADDR_BROADCAST;
00090 
00091     /* *SockaddrLength = Size; */
00092 
00093     return NO_ERROR;
00094 }
00095 
00096 
00097 INT
00098 EXPORT
00099 WSHGetProviderGuid(
00100     IN  LPWSTR ProviderName,
00101     OUT LPGUID ProviderGuid)
00102 {
00103     UNIMPLEMENTED
00104 
00105     return NO_ERROR;
00106 }
00107 
00108 
00109 /*
00110 Document from OSR how WSHGetSockaddrType works
00111 http://www.osronline.com/ddkx/network/37wshfun_5lyq.htm
00112 */
00113 
00114 INT
00115 EXPORT
00116 WSHGetSockaddrType(
00117     IN  PSOCKADDR Sockaddr,
00118     IN  DWORD SockaddrLength,
00119     OUT PSOCKADDR_INFO SockaddrInfo)
00120 {
00121     PSOCKADDR_IN ipv4 = (PSOCKADDR_IN)Sockaddr;
00122 
00123     if (!ipv4 || !SockaddrInfo || SockaddrLength < sizeof(SOCKADDR_IN) ||
00124         ipv4->sin_family != AF_INET)
00125     {
00126         DPRINT1("Invalid parameter: %x %x %d %u\n", ipv4, SockaddrInfo, SockaddrLength, (ipv4 ? ipv4->sin_family : 0));
00127         return WSAEINVAL;
00128     }
00129 
00130     switch (ntohl(ipv4->sin_addr.s_addr))
00131     {
00132       case INADDR_ANY:
00133            SockaddrInfo->AddressInfo = SockaddrAddressInfoWildcard;
00134            break;
00135 
00136       case INADDR_BROADCAST:
00137            SockaddrInfo->AddressInfo = SockaddrAddressInfoBroadcast;
00138            break;
00139 
00140       case INADDR_LOOPBACK:
00141            SockaddrInfo->AddressInfo = SockaddrAddressInfoLoopback;
00142            break;
00143 
00144       default:
00145            SockaddrInfo->AddressInfo = SockaddrAddressInfoNormal;
00146        break;
00147     }
00148 
00149     if (ntohs(ipv4->sin_port) == 0)
00150     SockaddrInfo->EndpointInfo = SockaddrEndpointInfoWildcard;
00151     else if (ntohs(ipv4->sin_port) < IPPORT_RESERVED)
00152     SockaddrInfo->EndpointInfo = SockaddrEndpointInfoReserved;
00153     else
00154         SockaddrInfo->EndpointInfo = SockaddrEndpointInfoNormal;
00155 
00156     return NO_ERROR;
00157 }
00158 
00159 UINT
00160 GetAddressOption(INT Level, INT OptionName)
00161 {
00162     switch (Level)
00163     {
00164        case IPPROTO_IP:
00165           switch (OptionName)
00166           {
00167              case IP_TTL:
00168                 return AO_OPTION_TTL;
00169 
00170              case IP_DONTFRAGMENT:
00171                 return AO_OPTION_IP_DONTFRAGMENT;
00172 
00173 #if 0
00174              case IP_RECEIVE_BROADCAST:
00175                 return AO_OPTION_BROADCAST;
00176 #endif
00177 
00178              case IP_HDRINCL:
00179                 return AO_OPTION_IP_HDRINCL;
00180 
00181              default:
00182                 DPRINT1("Unknown option name for IPPROTO_IP: %d\n", OptionName);
00183                 return 0;
00184           }
00185           break;
00186 
00187        case SOL_SOCKET:
00188           DPRINT1("SOL_SOCKET option %d\n", OptionName);
00189           break;
00190 
00191        default:
00192           DPRINT1("Unknown level: %d\n", Level);
00193           break;
00194     }
00195     return 0;
00196 }
00197 
00198 INT
00199 EXPORT
00200 WSHGetSocketInformation(
00201     IN  PVOID HelperDllSocketContext,
00202     IN  SOCKET SocketHandle,
00203     IN  HANDLE TdiAddressObjectHandle,
00204     IN  HANDLE TdiConnectionObjectHandle,
00205     IN  INT Level,
00206     IN  INT OptionName,
00207     OUT PCHAR OptionValue,
00208     OUT LPINT OptionLength)
00209 {
00210     UNIMPLEMENTED
00211 
00212     return NO_ERROR;
00213 }
00214 
00215 
00216 INT
00217 EXPORT
00218 WSHGetWildcardSockaddr(
00219     IN  PVOID HelperDllSocketContext,
00220     OUT PSOCKADDR Sockaddr,
00221     OUT PINT SockaddrLength)
00222 {
00223     INT Size = 2 * sizeof(UINT);
00224 
00225     if (*SockaddrLength < Size)
00226     {
00227         DPRINT1("Socket address length too small: %d\n", *SockaddrLength);
00228         return WSAEFAULT;
00229     }
00230 
00231     RtlZeroMemory(Sockaddr, *SockaddrLength);
00232 
00233     Sockaddr->sa_family = AF_INET;
00234     *((PUINT)Sockaddr->sa_data) = INADDR_ANY;
00235 
00236     /* *SockaddrLength = Size; */
00237 
00238     return NO_ERROR;
00239 }
00240 
00241 
00242 DWORD
00243 EXPORT
00244 WSHGetWinsockMapping(
00245     OUT PWINSOCK_MAPPING Mapping,
00246     IN  DWORD MappingLength)
00247 {
00248     DWORD Rows = 6;
00249     DWORD Columns = 3;
00250     DWORD Size = 2 * sizeof(DWORD) + Columns * Rows * sizeof(DWORD);
00251 
00252     if (MappingLength < Size)
00253     {
00254         DPRINT1("Mapping length too small: %d\n", MappingLength);
00255         return Size;
00256     }
00257 
00258     Mapping->Rows = Rows;
00259     Mapping->Columns = Columns;
00260 
00261     Mapping->Mapping[0].AddressFamily = AF_INET;
00262     Mapping->Mapping[0].SocketType = SOCK_STREAM;
00263     Mapping->Mapping[0].Protocol = 0;
00264 
00265     Mapping->Mapping[1].AddressFamily = AF_INET;
00266     Mapping->Mapping[1].SocketType = SOCK_STREAM;
00267     Mapping->Mapping[1].Protocol = IPPROTO_TCP;
00268 
00269     Mapping->Mapping[2].AddressFamily = AF_INET;
00270     Mapping->Mapping[2].SocketType = SOCK_DGRAM;
00271     Mapping->Mapping[2].Protocol = 0;
00272 
00273     Mapping->Mapping[3].AddressFamily = AF_INET;
00274     Mapping->Mapping[3].SocketType = SOCK_DGRAM;
00275     Mapping->Mapping[3].Protocol = IPPROTO_UDP;
00276 
00277     Mapping->Mapping[4].AddressFamily = AF_INET;
00278     Mapping->Mapping[4].SocketType = SOCK_RAW;
00279     Mapping->Mapping[4].Protocol = 0;
00280 
00281     Mapping->Mapping[5].AddressFamily = AF_INET;
00282     Mapping->Mapping[5].SocketType = SOCK_RAW;
00283     Mapping->Mapping[5].Protocol = IPPROTO_ICMP;
00284 
00285     return NO_ERROR;
00286 }
00287 
00288 
00289 INT
00290 EXPORT
00291 WSHGetWSAProtocolInfo(
00292     IN  LPWSTR ProviderName,
00293     OUT LPWSAPROTOCOL_INFOW *ProtocolInfo,
00294     OUT LPDWORD ProtocolInfoEntries)
00295 {
00296     UNIMPLEMENTED
00297 
00298     return NO_ERROR;
00299 }
00300 
00301 
00302 INT
00303 EXPORT
00304 WSHIoctl(
00305     IN  PVOID HelperDllSocketContext,
00306     IN  SOCKET SocketHandle,
00307     IN  HANDLE TdiAddressObjectHandle,
00308     IN  HANDLE TdiConnectionObjectHandle,
00309     IN  DWORD IoControlCode,
00310     IN  LPVOID InputBuffer,
00311     IN  DWORD InputBufferLength,
00312     IN  LPVOID OutputBuffer,
00313     IN  DWORD OutputBufferLength,
00314     OUT LPDWORD NumberOfBytesReturned,
00315     IN  LPWSAOVERLAPPED Overlapped,
00316     IN  LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine,
00317     OUT LPBOOL NeedsCompletion)
00318 {
00319     UNIMPLEMENTED
00320 
00321     return NO_ERROR;
00322 }
00323 
00324 
00325 INT
00326 EXPORT
00327 WSHJoinLeaf(
00328     IN  PVOID HelperDllSocketContext,
00329     IN  SOCKET SocketHandle,
00330     IN  HANDLE TdiAddressObjectHandle,
00331     IN  HANDLE TdiConnectionObjectHandle,
00332     IN  PVOID LeafHelperDllSocketContext,
00333     IN  SOCKET LeafSocketHandle,
00334     IN  PSOCKADDR Sockaddr,
00335     IN  DWORD SockaddrLength,
00336     IN  LPWSABUF CallerData,
00337     IN  LPWSABUF CalleeData,
00338     IN  LPQOS SocketQOS,
00339     IN  LPQOS GroupQOS,
00340     IN  DWORD Flags)
00341 {
00342     UNIMPLEMENTED
00343 
00344     return NO_ERROR;
00345 }
00346 
00347 INT
00348 SendRequest(
00349     IN PVOID Request,
00350     IN DWORD RequestSize,
00351     IN DWORD IOCTL)
00352 {
00353     BOOLEAN Status;
00354     HANDLE TcpCC;
00355     DWORD BytesReturned;
00356 
00357     if (openTcpFile(&TcpCC) != STATUS_SUCCESS)
00358         return WSAEINVAL;
00359 
00360     Status = DeviceIoControl(TcpCC,
00361                              IOCTL,
00362                              Request,
00363                              RequestSize,
00364                              NULL,
00365                              0,
00366                              &BytesReturned,
00367                              NULL);
00368 
00369     closeTcpFile(TcpCC);
00370 
00371     DPRINT("DeviceIoControl: %d\n", ((Status == TRUE) ? 0 : GetLastError()));
00372 
00373     if (!Status)
00374         return WSAEINVAL;
00375 
00376     return NO_ERROR;
00377 }
00378 
00379 INT
00380 EXPORT
00381 WSHNotify(
00382     IN  PVOID HelperDllSocketContext,
00383     IN  SOCKET SocketHandle,
00384     IN  HANDLE TdiAddressObjectHandle,
00385     IN  HANDLE TdiConnectionObjectHandle,
00386     IN  DWORD NotifyEvent)
00387 {
00388     PSOCKET_CONTEXT Context = HelperDllSocketContext;
00389     NTSTATUS Status;
00390     HANDLE TcpCC;
00391     TDIEntityID *EntityIDs;
00392     DWORD EntityCount, i;
00393     PQUEUED_REQUEST QueuedRequest, NextQueuedRequest;
00394 
00395     switch (NotifyEvent)
00396     {
00397         case WSH_NOTIFY_CLOSE:
00398             DPRINT("WSHNotify: WSH_NOTIFY_CLOSE\n");
00399             QueuedRequest = Context->RequestQueue;
00400             while (QueuedRequest)
00401             {
00402                 NextQueuedRequest = QueuedRequest->Next;
00403 
00404                 HeapFree(GetProcessHeap(), 0, QueuedRequest->Info);
00405                 HeapFree(GetProcessHeap(), 0, QueuedRequest);
00406 
00407                 QueuedRequest = NextQueuedRequest;
00408             }
00409             HeapFree(GetProcessHeap(), 0, HelperDllSocketContext);
00410             break;
00411 
00412 
00413         case WSH_NOTIFY_BIND:
00414             DPRINT("WSHNotify: WSH_NOTIFY_BIND\n");
00415             Status = openTcpFile(&TcpCC);
00416             if (Status != STATUS_SUCCESS)
00417                 return WSAEINVAL;
00418 
00419             Status = tdiGetEntityIDSet(TcpCC,
00420                                        &EntityIDs,
00421                                        &EntityCount);
00422 
00423             closeTcpFile(TcpCC);
00424 
00425             if (Status != STATUS_SUCCESS)
00426                 return WSAEINVAL;
00427 
00428             for (i = 0; i < EntityCount; i++)
00429             {
00430                 if (EntityIDs[i].tei_entity == CO_TL_ENTITY ||
00431                     EntityIDs[i].tei_entity == CL_TL_ENTITY ||
00432                     EntityIDs[i].tei_entity == ER_ENTITY)
00433                 {
00434                     Context->AddrFileInstance = EntityIDs[i].tei_instance;
00435                     Context->AddrFileEntityType = EntityIDs[i].tei_entity;
00436                 }
00437             }
00438 
00439             DPRINT("Instance: %x Type: %x\n", Context->AddrFileInstance, Context->AddrFileEntityType);
00440 
00441             tdiFreeThingSet(EntityIDs);
00442 
00443             Context->SocketState = SocketStateBound;
00444 
00445             QueuedRequest = Context->RequestQueue;
00446             while (QueuedRequest)
00447             {
00448                 QueuedRequest->Info->ID.toi_entity.tei_entity = Context->AddrFileEntityType;
00449                 QueuedRequest->Info->ID.toi_entity.tei_instance = Context->AddrFileInstance;
00450 
00451                 SendRequest(QueuedRequest->Info,
00452                             sizeof(*QueuedRequest->Info) + QueuedRequest->Info->BufferSize,
00453                             IOCTL_TCP_SET_INFORMATION_EX);
00454 
00455                 NextQueuedRequest = QueuedRequest->Next;
00456 
00457                 HeapFree(GetProcessHeap(), 0, QueuedRequest->Info);
00458                 HeapFree(GetProcessHeap(), 0, QueuedRequest);
00459 
00460                 QueuedRequest = NextQueuedRequest;
00461             }
00462             Context->RequestQueue = NULL;
00463             break;
00464 
00465         default:
00466             DPRINT1("Unwanted notification received! (%d)\n", NotifyEvent);
00467             break;
00468     }
00469 
00470     return NO_ERROR;
00471 }
00472 
00473 
00474 INT
00475 EXPORT
00476 WSHOpenSocket(
00477     IN OUT  PINT AddressFamily,
00478     IN OUT  PINT SocketType,
00479     IN OUT  PINT Protocol,
00480     OUT     PUNICODE_STRING TransportDeviceName,
00481     OUT     PVOID HelperDllSocketContext,
00482     OUT     PDWORD NotificationEvents)
00483 /*
00484  * FUNCTION: Opens a socket
00485  */
00486 {
00487     return WSHOpenSocket2(AddressFamily,
00488                           SocketType,
00489                           Protocol,
00490                           0,
00491                           0,
00492                           TransportDeviceName,
00493                           HelperDllSocketContext,
00494                           NotificationEvents);
00495 }
00496 
00497 
00498 INT
00499 EXPORT
00500 WSHOpenSocket2(
00501     OUT PINT AddressFamily,
00502     IN  OUT PINT SocketType,
00503     IN  OUT PINT Protocol,
00504     IN  GROUP Group,
00505     IN  DWORD Flags,
00506     OUT PUNICODE_STRING TransportDeviceName,
00507     OUT PVOID *HelperDllSocketContext,
00508     OUT PDWORD NotificationEvents)
00509 /*
00510  * FUNCTION: Opens a socket
00511  * ARGUMENTS:
00512  *     AddressFamily          = Address of buffer with address family (updated)
00513  *     SocketType             = Address of buffer with type of socket (updated)
00514  *     Protocol               = Address of buffer with protocol number (updated)
00515  *     Group                  = Socket group
00516  *     Flags                  = Socket flags
00517  *     TransportDeviceName    = Address of buffer to place name of transport device
00518  *     HelperDllSocketContext = Address of buffer to place socket context pointer
00519  *     NotificationEvents     = Address of buffer to place flags for event notification
00520  * RETURNS:
00521  *     Status of operation
00522  * NOTES:
00523  *     Mapping tripple is returned in an canonicalized form
00524  */
00525 {
00526     PSOCKET_CONTEXT Context;
00527     UNICODE_STRING String;
00528     UNICODE_STRING TcpDeviceName = RTL_CONSTANT_STRING(DD_TCP_DEVICE_NAME);
00529     UNICODE_STRING UdpDeviceName = RTL_CONSTANT_STRING(DD_UDP_DEVICE_NAME);
00530     UNICODE_STRING RawDeviceName = RTL_CONSTANT_STRING(DD_RAW_IP_DEVICE_NAME);
00531 
00532     DPRINT("WSHOpenSocket2 called\n");
00533 
00534     switch (*SocketType) {
00535     case SOCK_STREAM:
00536         String = TcpDeviceName;
00537         break;
00538 
00539     case SOCK_DGRAM:
00540         String = UdpDeviceName;
00541         break;
00542 
00543     case SOCK_RAW:
00544         if ((*Protocol < 0) || (*Protocol > 255))
00545           return WSAEINVAL;
00546 
00547         String = RawDeviceName;
00548         break;
00549 
00550     default:
00551         return WSAEINVAL;
00552     }
00553 
00554     RtlInitUnicodeString(TransportDeviceName, NULL);
00555 
00556     TransportDeviceName->MaximumLength = String.Length +        /* Transport device name */
00557                                          (4 * sizeof(WCHAR) +   /* Separator and protocol */
00558                                          sizeof(UNICODE_NULL)); /* Terminating null */
00559 
00560     TransportDeviceName->Buffer = HeapAlloc(
00561         GetProcessHeap(),
00562         0,
00563         TransportDeviceName->MaximumLength);
00564 
00565     if (!TransportDeviceName->Buffer)
00566         return WSAENOBUFS;
00567 
00568     /* Append the transport device name */
00569     RtlAppendUnicodeStringToString(TransportDeviceName, &String);
00570 
00571     if (*SocketType == SOCK_RAW) {
00572         /* Append a separator */
00573         TransportDeviceName->Buffer[TransportDeviceName->Length / sizeof(WCHAR)] = OBJ_NAME_PATH_SEPARATOR;
00574         TransportDeviceName->Length += sizeof(WCHAR);
00575         TransportDeviceName->Buffer[TransportDeviceName->Length / sizeof(WCHAR)] = UNICODE_NULL;
00576 
00577         /* Append the protocol number */
00578         String.Buffer = TransportDeviceName->Buffer + (TransportDeviceName->Length / sizeof(WCHAR));
00579         String.Length = 0;
00580         String.MaximumLength = TransportDeviceName->MaximumLength - TransportDeviceName->Length;
00581 
00582         RtlIntegerToUnicodeString((ULONG)*Protocol, 10, &String);
00583 
00584         TransportDeviceName->Length += String.Length;
00585     }
00586 
00587     /* Setup a socket context area */
00588 
00589     Context = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SOCKET_CONTEXT));
00590     if (!Context) {
00591         RtlFreeUnicodeString(TransportDeviceName);
00592         return WSAENOBUFS;
00593     }
00594 
00595     Context->AddressFamily = *AddressFamily;
00596     Context->SocketType    = *SocketType;
00597     Context->Protocol      = *Protocol;
00598     Context->Flags         = Flags;
00599     Context->SocketState   = SocketStateCreated;
00600 
00601     *HelperDllSocketContext = Context;
00602     *NotificationEvents = WSH_NOTIFY_CLOSE | WSH_NOTIFY_BIND;
00603 
00604     return NO_ERROR;
00605 }
00606 
00607 INT
00608 EXPORT
00609 WSHSetSocketInformation(
00610     IN  PVOID HelperDllSocketContext,
00611     IN  SOCKET SocketHandle,
00612     IN  HANDLE TdiAddressObjectHandle,
00613     IN  HANDLE TdiConnectionObjectHandle,
00614     IN  INT Level,
00615     IN  INT OptionName,
00616     IN  PCHAR OptionValue,
00617     IN  INT OptionLength)
00618 {
00619     PSOCKET_CONTEXT Context = HelperDllSocketContext;
00620     UINT RealOptionName;
00621     INT Status;
00622     PTCP_REQUEST_SET_INFORMATION_EX Info;
00623     PQUEUED_REQUEST Queued, NextQueued;
00624 
00625     DPRINT("WSHSetSocketInformation\n");
00626 
00627     /* FIXME: We only handle address file object here */
00628 
00629     RealOptionName = GetAddressOption(Level, OptionName);
00630 
00631     /* FIXME: Support all options */
00632     if (!RealOptionName)
00633         return 0; /* return WSAEINVAL; */
00634 
00635     Info = HeapAlloc(GetProcessHeap(), 0, sizeof(*Info) + OptionLength);
00636     if (!Info)
00637         return WSAENOBUFS;
00638 
00639     Info->ID.toi_entity.tei_entity = Context->AddrFileEntityType;
00640     Info->ID.toi_entity.tei_instance = Context->AddrFileInstance;
00641     Info->ID.toi_class = INFO_CLASS_PROTOCOL;
00642     Info->ID.toi_type = INFO_TYPE_ADDRESS_OBJECT;
00643     Info->ID.toi_id = RealOptionName;
00644     Info->BufferSize = OptionLength;
00645     memcpy(Info->Buffer, OptionValue, OptionLength);
00646 
00647     if (Context->SocketState == SocketStateCreated)
00648     {
00649         if (Context->RequestQueue)
00650         {
00651             Queued = Context->RequestQueue;
00652             while ((NextQueued = Queued->Next))
00653             {
00654                Queued = NextQueued;
00655             }
00656 
00657             Queued->Next = HeapAlloc(GetProcessHeap(), 0, sizeof(QUEUED_REQUEST));
00658             if (!Queued->Next)
00659             {
00660                 HeapFree(GetProcessHeap(), 0, Info);
00661                 return WSAENOBUFS;
00662             }
00663 
00664             NextQueued = Queued->Next;
00665             NextQueued->Next = NULL;
00666             NextQueued->Info = Info;
00667         }
00668         else
00669         {
00670             Context->RequestQueue = HeapAlloc(GetProcessHeap(), 0, sizeof(QUEUED_REQUEST));
00671             if (!Context->RequestQueue)
00672             {
00673                 HeapFree(GetProcessHeap(), 0, Info);
00674                 return WSAENOBUFS;
00675             }
00676 
00677             Context->RequestQueue->Next = NULL;
00678             Context->RequestQueue->Info = Info;
00679         }
00680 
00681         return 0;
00682     }
00683 
00684     Status = SendRequest(Info, sizeof(*Info) + Info->BufferSize, IOCTL_TCP_SET_INFORMATION_EX);
00685 
00686     HeapFree(GetProcessHeap(), 0, Info);
00687 
00688     return Status;
00689 }
00690 
00691 
00692 INT
00693 EXPORT
00694 WSHStringToAddress(
00695     IN      LPWSTR AddressString,
00696     IN      DWORD AddressFamily,
00697     IN      LPWSAPROTOCOL_INFOW ProtocolInfo    OPTIONAL,
00698     OUT     LPSOCKADDR Address,
00699     IN OUT  LPDWORD AddressStringLength)
00700 {
00701     UNIMPLEMENTED
00702 
00703     return NO_ERROR;
00704 }
00705 
00706 /* EOF */

Generated on Thu May 24 2012 04:27:40 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.