ReactOS 0.4.15-dev-8127-g6338913
wshtcpip.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS WinSock Helper DLL for TCP/IP
4 * FILE: wshtcpip.c
5 * PURPOSE: DLL entry
6 * PROGRAMMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
7 * REVISIONS:
8 * CSH 01/09-2000 Created
9 */
10#include "wshtcpip.h"
11#define NDEBUG
12#include <debug.h>
13
14BOOL
16DllMain(HANDLE hInstDll,
19{
20 DPRINT("DllMain of wshtcpip.dll\n");
21
22 switch (dwReason) {
24 /* Don't need thread attach notifications
25 so disable them to improve performance */
27 break;
28
30 break;
31
33 break;
34
36 break;
37 }
38 return TRUE;
39}
40
41
42INT
46 IN INT AddressLength,
47 IN LPWSAPROTOCOL_INFOW ProtocolInfo OPTIONAL,
48 OUT LPWSTR AddressString,
49 IN OUT LPDWORD AddressStringLength)
50{
52
53 return NO_ERROR;
54}
55
56
57INT
60 IN LPINT lpiProtocols OPTIONAL,
61 IN LPWSTR lpTransportKeyName,
62 IN OUT LPVOID lpProtocolBuffer,
64{
66
67 return NO_ERROR;
68}
69
70
71INT
74 IN PVOID HelperDllSocketContext,
75 OUT PSOCKADDR Sockaddr,
76 OUT PINT SockaddrLength)
77{
78 INT Size = 2 * sizeof(UINT);
79
80 if (*SockaddrLength < Size)
81 {
82 DPRINT1("Socket address length too small: %d\n", *SockaddrLength);
83 return WSAEFAULT;
84 }
85
86 RtlZeroMemory(Sockaddr, *SockaddrLength);
87
88 Sockaddr->sa_family = AF_INET;
89 *((PUINT)Sockaddr->sa_data) = INADDR_BROADCAST;
90
91 /* *SockaddrLength = Size; */
92
93 return NO_ERROR;
94}
95
96
97INT
100 IN LPWSTR ProviderName,
101 OUT LPGUID ProviderGuid)
102{
104
105 return NO_ERROR;
106}
107
108
109/*
110Document from OSR how WSHGetSockaddrType works
111http://www.osronline.com/ddkx/network/37wshfun_5lyq.htm
112*/
113
114INT
115EXPORT
117 IN PSOCKADDR Sockaddr,
118 IN DWORD SockaddrLength,
119 OUT PSOCKADDR_INFO SockaddrInfo)
120{
121 PSOCKADDR_IN ipv4 = (PSOCKADDR_IN)Sockaddr;
122
123 if (!ipv4 || !SockaddrInfo || SockaddrLength < sizeof(SOCKADDR_IN) ||
124 ipv4->sin_family != AF_INET)
125 {
126 DPRINT1("Invalid parameter: %x %x %d %u\n", ipv4, SockaddrInfo, SockaddrLength, (ipv4 ? ipv4->sin_family : 0));
127 return WSAEINVAL;
128 }
129
130 switch (ntohl(ipv4->sin_addr.s_addr))
131 {
132 case INADDR_ANY:
133 SockaddrInfo->AddressInfo = SockaddrAddressInfoWildcard;
134 break;
135
136 case INADDR_BROADCAST:
137 SockaddrInfo->AddressInfo = SockaddrAddressInfoBroadcast;
138 break;
139
140 case INADDR_LOOPBACK:
141 SockaddrInfo->AddressInfo = SockaddrAddressInfoLoopback;
142 break;
143
144 default:
145 SockaddrInfo->AddressInfo = SockaddrAddressInfoNormal;
146 break;
147 }
148
149 if (ntohs(ipv4->sin_port) == 0)
150 SockaddrInfo->EndpointInfo = SockaddrEndpointInfoWildcard;
151 else if (ntohs(ipv4->sin_port) < IPPORT_RESERVED)
152 SockaddrInfo->EndpointInfo = SockaddrEndpointInfoReserved;
153 else
154 SockaddrInfo->EndpointInfo = SockaddrEndpointInfoNormal;
155
156 return NO_ERROR;
157}
158
159static
160void
162 _In_ INT Level,
163 _In_ INT OptionName,
164 _Out_ PULONG TdiType,
165 _Out_ PULONG TdiId)
166{
167 switch (Level)
168 {
169 case SOL_SOCKET:
170 *TdiType = INFO_TYPE_ADDRESS_OBJECT;
171 switch (OptionName)
172 {
173 case SO_KEEPALIVE:
174 /* FIXME: Return proper option */
175 ASSERT(FALSE);
176 break;
177 default:
178 break;
179 }
180 break;
181
182 case IPPROTO_IP:
183 *TdiType = INFO_TYPE_ADDRESS_OBJECT;
184 switch (OptionName)
185 {
186 case IP_TTL:
187 *TdiId = AO_OPTION_TTL;
188 return;
189
190 case IP_DONTFRAGMENT:
192 return;
193
194#if 0
196 *TdiId = AO_OPTION_BROADCAST;
197 return;
198#endif
199
200 case IP_HDRINCL:
201 *TdiId = AO_OPTION_IP_HDRINCL;
202 return;
203
204 default:
205 break;
206 }
207 break;
208
209 case IPPROTO_TCP:
210 *TdiType = INFO_TYPE_CONNECTION;
211 switch (OptionName)
212 {
213 case TCP_NODELAY:
214 *TdiId = TCP_SOCKET_NODELAY;
215 return;
216 default:
217 break;
218 }
219
220 default:
221 break;
222 }
223
224 DPRINT1("Unknown level/option name: %d %d\n", Level, OptionName);
225 *TdiType = 0;
226 *TdiId = 0;
227}
228
229INT
230EXPORT
232 IN PVOID HelperDllSocketContext,
233 IN SOCKET SocketHandle,
234 IN HANDLE TdiAddressObjectHandle,
235 IN HANDLE TdiConnectionObjectHandle,
236 IN INT Level,
237 IN INT OptionName,
238 OUT PCHAR OptionValue,
239 OUT LPINT OptionLength)
240{
242
243 DPRINT1("Get: Unknown level/option name: %d %d\n", Level, OptionName);
244
245 *OptionLength = 0;
246
247 return NO_ERROR;
248}
249
250
251INT
252EXPORT
254 IN PVOID HelperDllSocketContext,
255 OUT PSOCKADDR Sockaddr,
256 OUT PINT SockaddrLength)
257{
258 INT Size = 2 * sizeof(UINT);
259
260 if (*SockaddrLength < Size)
261 {
262 DPRINT1("Socket address length too small: %d\n", *SockaddrLength);
263 return WSAEFAULT;
264 }
265
266 RtlZeroMemory(Sockaddr, *SockaddrLength);
267
268 Sockaddr->sa_family = AF_INET;
269 *((PUINT)Sockaddr->sa_data) = INADDR_ANY;
270
271 /* *SockaddrLength = Size; */
272
273 return NO_ERROR;
274}
275
276
277DWORD
278EXPORT
281 IN DWORD MappingLength)
282{
283 DWORD Rows = 6;
284 DWORD Columns = 3;
285 DWORD Size = 2 * sizeof(DWORD) + Columns * Rows * sizeof(DWORD);
286
287 if (MappingLength < Size)
288 {
289 DPRINT1("Mapping length too small: %d\n", MappingLength);
290 return Size;
291 }
292
293 Mapping->Rows = Rows;
294 Mapping->Columns = Columns;
295
296 Mapping->Mapping[0].AddressFamily = AF_INET;
297 Mapping->Mapping[0].SocketType = SOCK_STREAM;
298 Mapping->Mapping[0].Protocol = 0;
299
300 Mapping->Mapping[1].AddressFamily = AF_INET;
301 Mapping->Mapping[1].SocketType = SOCK_STREAM;
302 Mapping->Mapping[1].Protocol = IPPROTO_TCP;
303
304 Mapping->Mapping[2].AddressFamily = AF_INET;
305 Mapping->Mapping[2].SocketType = SOCK_DGRAM;
306 Mapping->Mapping[2].Protocol = 0;
307
308 Mapping->Mapping[3].AddressFamily = AF_INET;
309 Mapping->Mapping[3].SocketType = SOCK_DGRAM;
310 Mapping->Mapping[3].Protocol = IPPROTO_UDP;
311
312 Mapping->Mapping[4].AddressFamily = AF_INET;
313 Mapping->Mapping[4].SocketType = SOCK_RAW;
314 Mapping->Mapping[4].Protocol = 0;
315
316 Mapping->Mapping[5].AddressFamily = AF_INET;
317 Mapping->Mapping[5].SocketType = SOCK_RAW;
318 Mapping->Mapping[5].Protocol = IPPROTO_ICMP;
319
320 return NO_ERROR;
321}
322
323
324INT
325EXPORT
327 IN LPWSTR ProviderName,
328 OUT LPWSAPROTOCOL_INFOW *ProtocolInfo,
329 OUT LPDWORD ProtocolInfoEntries)
330{
332
333 return NO_ERROR;
334}
335
336
337INT
338EXPORT
340 IN PVOID HelperDllSocketContext,
341 IN SOCKET SocketHandle,
342 IN HANDLE TdiAddressObjectHandle,
343 IN HANDLE TdiConnectionObjectHandle,
349 OUT LPDWORD NumberOfBytesReturned,
350 IN LPWSAOVERLAPPED Overlapped,
352 OUT LPBOOL NeedsCompletion)
353{
354 INT res;
355
357 {
361 NumberOfBytesReturned,
362 NeedsCompletion);
363 return res;
364 }
365
367
368 DPRINT1("Ioctl: Unknown IOCTL code: %x\n", IoControlCode);
369
370 return WSAEINVAL;
371}
372
373
374INT
375EXPORT
377 IN PVOID HelperDllSocketContext,
378 IN SOCKET SocketHandle,
379 IN HANDLE TdiAddressObjectHandle,
380 IN HANDLE TdiConnectionObjectHandle,
381 IN PVOID LeafHelperDllSocketContext,
382 IN SOCKET LeafSocketHandle,
383 IN PSOCKADDR Sockaddr,
384 IN DWORD SockaddrLength,
385 IN LPWSABUF CallerData,
386 IN LPWSABUF CalleeData,
387 IN LPQOS SocketQOS,
388 IN LPQOS GroupQOS,
389 IN DWORD Flags)
390{
392
393 return NO_ERROR;
394}
395
396INT
400 IN DWORD IOCTL)
401{
403 HANDLE TcpCC;
405
407 return WSAEINVAL;
408
409 Success = DeviceIoControl(TcpCC,
410 IOCTL,
411 Request,
413 NULL,
414 0,
416 NULL);
417
418 closeTcpFile(TcpCC);
419
420 DPRINT("DeviceIoControl: %ld\n", (Success ? NO_ERROR : GetLastError()));
421
422 if (!Success)
423 return WSAEINVAL;
424
425 return NO_ERROR;
426}
427
428INT
429EXPORT
431 IN PVOID HelperDllSocketContext,
432 IN SOCKET SocketHandle,
433 IN HANDLE TdiAddressObjectHandle,
434 IN HANDLE TdiConnectionObjectHandle,
435 IN DWORD NotifyEvent)
436{
437 PSOCKET_CONTEXT Context = HelperDllSocketContext;
439 HANDLE TcpCC;
440 TDIEntityID *EntityIDs;
442 PQUEUED_REQUEST QueuedRequest, NextQueuedRequest;
443
444 switch (NotifyEvent)
445 {
446 case WSH_NOTIFY_CLOSE:
447 DPRINT("WSHNotify: WSH_NOTIFY_CLOSE\n");
448 QueuedRequest = Context->RequestQueue;
449 while (QueuedRequest)
450 {
451 NextQueuedRequest = QueuedRequest->Next;
452
453 HeapFree(GetProcessHeap(), 0, QueuedRequest->Info);
454 HeapFree(GetProcessHeap(), 0, QueuedRequest);
455
456 QueuedRequest = NextQueuedRequest;
457 }
458 HeapFree(GetProcessHeap(), 0, HelperDllSocketContext);
459 break;
460
461
462 case WSH_NOTIFY_BIND:
463 DPRINT("WSHNotify: WSH_NOTIFY_BIND\n");
465 if (Status != STATUS_SUCCESS)
466 return WSAEINVAL;
467
469 &EntityIDs,
470 &EntityCount);
471
472 closeTcpFile(TcpCC);
473
474 if (Status != STATUS_SUCCESS)
475 return WSAEINVAL;
476
477 for (i = 0; i < EntityCount; i++)
478 {
479 if (EntityIDs[i].tei_entity == CO_TL_ENTITY ||
480 EntityIDs[i].tei_entity == CL_TL_ENTITY ||
481 EntityIDs[i].tei_entity == ER_ENTITY)
482 {
483 Context->AddrFileInstance = EntityIDs[i].tei_instance;
484 Context->AddrFileEntityType = EntityIDs[i].tei_entity;
485 }
486 }
487
488 DPRINT("Instance: %lx Type: %lx\n", Context->AddrFileInstance, Context->AddrFileEntityType);
489
490 tdiFreeThingSet(EntityIDs);
491
492 Context->SocketState = SocketStateBound;
493
494 QueuedRequest = Context->RequestQueue;
495 while (QueuedRequest)
496 {
497 QueuedRequest->Info->ID.toi_entity.tei_entity = Context->AddrFileEntityType;
498 QueuedRequest->Info->ID.toi_entity.tei_instance = Context->AddrFileInstance;
499
500 SendRequest(QueuedRequest->Info,
501 sizeof(*QueuedRequest->Info) + QueuedRequest->Info->BufferSize,
503
504 NextQueuedRequest = QueuedRequest->Next;
505
506 HeapFree(GetProcessHeap(), 0, QueuedRequest->Info);
507 HeapFree(GetProcessHeap(), 0, QueuedRequest);
508
509 QueuedRequest = NextQueuedRequest;
510 }
511 Context->RequestQueue = NULL;
512 break;
513
514 default:
515 DPRINT1("Unwanted notification received! (%ld)\n", NotifyEvent);
516 break;
517 }
518
519 return NO_ERROR;
520}
521
522
523INT
524EXPORT
529 OUT PUNICODE_STRING TransportDeviceName,
530 OUT PVOID HelperDllSocketContext,
531 OUT PDWORD NotificationEvents)
532/*
533 * FUNCTION: Opens a socket
534 */
535{
538 Protocol,
539 0,
540 0,
541 TransportDeviceName,
542 HelperDllSocketContext,
543 NotificationEvents);
544}
545
546
547INT
548EXPORT
553 IN GROUP Group,
554 IN DWORD Flags,
555 OUT PUNICODE_STRING TransportDeviceName,
556 OUT PVOID *HelperDllSocketContext,
557 OUT PDWORD NotificationEvents)
558/*
559 * FUNCTION: Opens a socket
560 * ARGUMENTS:
561 * AddressFamily = Address of buffer with address family (updated)
562 * SocketType = Address of buffer with type of socket (updated)
563 * Protocol = Address of buffer with protocol number (updated)
564 * Group = Socket group
565 * Flags = Socket flags
566 * TransportDeviceName = Address of buffer to place name of transport device
567 * HelperDllSocketContext = Address of buffer to place socket context pointer
568 * NotificationEvents = Address of buffer to place flags for event notification
569 * RETURNS:
570 * Status of operation
571 * NOTES:
572 * Mapping tripple is returned in an canonicalized form
573 */
574{
580
581 DPRINT("WSHOpenSocket2 called\n");
582
583 switch (*SocketType) {
584 case SOCK_STREAM:
585 String = TcpDeviceName;
586 break;
587
588 case SOCK_DGRAM:
589 String = UdpDeviceName;
590 break;
591
592 case SOCK_RAW:
593 if ((*Protocol < 0) || (*Protocol > 255))
594 return WSAEINVAL;
595
596 String = RawDeviceName;
597 break;
598
599 default:
600 return WSAEINVAL;
601 }
602
603 RtlInitUnicodeString(TransportDeviceName, NULL);
604
605 TransportDeviceName->MaximumLength = String.Length + /* Transport device name */
606 (4 * sizeof(WCHAR) + /* Separator and protocol */
607 sizeof(UNICODE_NULL)); /* Terminating null */
608
609 TransportDeviceName->Buffer = HeapAlloc(
611 0,
612 TransportDeviceName->MaximumLength);
613
614 if (!TransportDeviceName->Buffer)
615 return WSAENOBUFS;
616
617 /* Append the transport device name */
618 RtlAppendUnicodeStringToString(TransportDeviceName, &String);
619
620 if (*SocketType == SOCK_RAW) {
621 /* Append a separator */
622 TransportDeviceName->Buffer[TransportDeviceName->Length / sizeof(WCHAR)] = OBJ_NAME_PATH_SEPARATOR;
623 TransportDeviceName->Length += sizeof(WCHAR);
624 TransportDeviceName->Buffer[TransportDeviceName->Length / sizeof(WCHAR)] = UNICODE_NULL;
625
626 /* Append the protocol number */
627 String.Buffer = TransportDeviceName->Buffer + (TransportDeviceName->Length / sizeof(WCHAR));
628 String.Length = 0;
629 String.MaximumLength = TransportDeviceName->MaximumLength - TransportDeviceName->Length;
630
632
633 TransportDeviceName->Length += String.Length;
634 }
635
636 /* Setup a socket context area */
637
639 if (!Context) {
640 RtlFreeUnicodeString(TransportDeviceName);
641 return WSAENOBUFS;
642 }
643
644 Context->AddressFamily = *AddressFamily;
645 Context->SocketType = *SocketType;
646 Context->Protocol = *Protocol;
647 Context->Flags = Flags;
648 Context->SocketState = SocketStateCreated;
649
650 *HelperDllSocketContext = Context;
651 *NotificationEvents = WSH_NOTIFY_CLOSE | WSH_NOTIFY_BIND;
652
653 return NO_ERROR;
654}
655
656INT
657EXPORT
659 IN PVOID HelperDllSocketContext,
660 IN SOCKET SocketHandle,
661 IN HANDLE TdiAddressObjectHandle,
662 IN HANDLE TdiConnectionObjectHandle,
663 IN INT Level,
664 IN INT OptionName,
665 IN PCHAR OptionValue,
666 IN INT OptionLength)
667{
668 PSOCKET_CONTEXT Context = HelperDllSocketContext;
669 ULONG TdiType, TdiId;
670 INT Status;
672 PQUEUED_REQUEST Queued, NextQueued;
673
674 DPRINT("WSHSetSocketInformation\n");
675
676 /* FIXME: We only handle address file object here */
677
678 switch (Level)
679 {
680 case SOL_SOCKET:
681 switch (OptionName)
682 {
683 case SO_DONTROUTE:
684 if (OptionLength < sizeof(BOOL))
685 {
686 return WSAEFAULT;
687 }
688 Context->DontRoute = *(BOOL*)OptionValue;
689 /* This is silently ignored on Windows */
690 return 0;
691
692 case SO_KEEPALIVE:
693 /* FIXME -- We'll send this to TCPIP */
694 DPRINT1("Set: SO_KEEPALIVE not yet supported\n");
695 return 0;
696
697 default:
698 /* Invalid option */
699 DPRINT1("Set: Received unexpected SOL_SOCKET option %d\n", OptionName);
700 return WSAENOPROTOOPT;
701 }
702 break;
703
704 case IPPROTO_IP:
705 switch (OptionName)
706 {
707 case IP_TTL:
708 case IP_DONTFRAGMENT:
709 case IP_HDRINCL:
710 /* Send these to TCPIP */
711 break;
712
713 default:
714 /* Invalid option -- FIXME */
715 DPRINT1("Set: Received unsupported IPPROTO_IP option %d\n", OptionName);
716 return 0;
717 }
718 break;
719
720 case IPPROTO_TCP:
721 switch (OptionName)
722 {
723 case TCP_NODELAY:
724 if (OptionLength < sizeof(CHAR))
725 {
726 return WSAEFAULT;
727 }
728 break;
729
730 default:
731 /* Invalid option */
732 DPRINT1("Set: Received unexpected IPPROTO_TCP option %d\n", OptionName);
733 return 0;
734 }
735 break;
736
737 default:
738 DPRINT1("Set: Received unexpected %d option %d\n", Level, OptionName);
739 return 0;
740 }
741
742 /* If we get here, GetAddressOption must return something valid */
743 GetTdiTypeId(Level, OptionName, &TdiType, &TdiId);
744 ASSERT((TdiId != 0) && (TdiType != 0));
745
746 Info = HeapAlloc(GetProcessHeap(), 0, sizeof(*Info) + OptionLength);
747 if (!Info)
748 return WSAENOBUFS;
749
750 Info->ID.toi_entity.tei_entity = Context->AddrFileEntityType;
751 Info->ID.toi_entity.tei_instance = Context->AddrFileInstance;
752 Info->ID.toi_class = INFO_CLASS_PROTOCOL;
753 Info->ID.toi_type = TdiType;
754 Info->ID.toi_id = TdiId;
755 Info->BufferSize = OptionLength;
756 memcpy(Info->Buffer, OptionValue, OptionLength);
757
758 if (Context->SocketState == SocketStateCreated)
759 {
760 if (Context->RequestQueue)
761 {
762 Queued = Context->RequestQueue;
763 while ((NextQueued = Queued->Next))
764 {
765 Queued = NextQueued;
766 }
767
768 Queued->Next = HeapAlloc(GetProcessHeap(), 0, sizeof(QUEUED_REQUEST));
769 if (!Queued->Next)
770 {
772 return WSAENOBUFS;
773 }
774
775 NextQueued = Queued->Next;
776 NextQueued->Next = NULL;
777 NextQueued->Info = Info;
778 }
779 else
780 {
781 Context->RequestQueue = HeapAlloc(GetProcessHeap(), 0, sizeof(QUEUED_REQUEST));
782 if (!Context->RequestQueue)
783 {
785 return WSAENOBUFS;
786 }
787
788 Context->RequestQueue->Next = NULL;
789 Context->RequestQueue->Info = Info;
790 }
791
792 return 0;
793 }
794
795 Status = SendRequest(Info, sizeof(*Info) + Info->BufferSize, IOCTL_TCP_SET_INFORMATION_EX);
796
798
799 return Status;
800}
801
802
803INT
804EXPORT
806 IN LPWSTR AddressString,
808 IN LPWSAPROTOCOL_INFOW ProtocolInfo OPTIONAL,
810 IN OUT LPDWORD AddressStringLength)
811{
813
814 return NO_ERROR;
815}
816
817/* EOF */
unsigned char BOOLEAN
#define OBJ_NAME_PATH_SEPARATOR
Definition: arcname_tests.c:25
LONG NTSTATUS
Definition: precomp.h:26
static const COLUMN_LIST Columns[]
Definition: listview.c:19
#define DPRINT1
Definition: precomp.h:8
DWORD dwReason
Definition: misc.cpp:154
#define UNIMPLEMENTED
Definition: debug.h:118
#define NO_ERROR
Definition: dderror.h:5
BOOL WINAPI DeviceIoControl(IN HANDLE hDevice, IN DWORD dwIoControlCode, IN LPVOID lpInBuffer OPTIONAL, IN DWORD nInBufferSize OPTIONAL, OUT LPVOID lpOutBuffer OPTIONAL, IN DWORD nOutBufferSize OPTIONAL, OUT LPDWORD lpBytesReturned OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: deviceio.c:136
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcessHeap()
Definition: compat.h:736
#define DLL_THREAD_DETACH
Definition: compat.h:133
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define DLL_THREAD_ATTACH
Definition: compat.h:132
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define IPPROTO_TCP
Definition: ip.h:196
#define IPPROTO_ICMP
Definition: ip.h:194
#define IPPROTO_UDP
Definition: ip.h:197
#define SOCK_STREAM
Definition: tcpip.h:118
#define AF_INET
Definition: tcpip.h:117
ULONG EntityCount
Definition: main.c:28
#define IP_HDRINCL
Definition: ip.h:64
static PVOID Mapping[EMS_PHYSICAL_PAGES]
Definition: emsdrv.c:41
@ Success
Definition: eventcreate.c:712
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
Status
Definition: gdiplustypes.h:25
GLuint res
Definition: glext.h:9613
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
INT WSHIoctl_GetInterfaceList(IN LPVOID OutputBuffer, IN DWORD OutputBufferLength, OUT LPDWORD NumberOfBytesReturned, OUT LPBOOL NeedsCompletion)
Definition: iflist.c:215
#define INADDR_BROADCAST
Definition: inet.h:55
#define INADDR_ANY
Definition: inet.h:53
#define INADDR_LOOPBACK
Definition: inet.h:51
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ASSERT(a)
Definition: mode.c:44
#define ntohl(x)
Definition: module.h:205
#define ntohs(x)
Definition: module.h:210
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
unsigned int * PUINT
Definition: ndis.h:50
unsigned int UINT
Definition: ndis.h:50
IN PCO_ADDRESS_FAMILY AddressFamily
Definition: ndis.h:1906
_In_opt_ PSID Group
Definition: rtlfuncs.h:1646
#define FILE_WRITE_DATA
Definition: nt_native.h:631
#define FILE_READ_DATA
Definition: nt_native.h:628
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI NTSTATUS NTAPI RtlIntegerToUnicodeString(ULONG Value, ULONG Base, PUNICODE_STRING String)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define DWORD
Definition: nt_native.h:44
#define UNICODE_NULL
DWORD * PDWORD
Definition: pedump.c:68
static WCHAR Address[46]
Definition: ping.c:68
static ULONG RequestSize
Definition: ping.c:63
VOID tdiFreeThingSet(PVOID things)
Definition: enum.c:118
NTSTATUS tdiGetEntityIDSet(HANDLE tcpFile, TDIEntityID **entitySet, PDWORD numEntities)
Definition: enum.c:122
NTSTATUS openTcpFile(PHANDLE tcpFile, ACCESS_MASK DesiredAccess)
Definition: handle.c:12
VOID closeTcpFile(HANDLE h)
Definition: handle.c:43
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
PTCP_REQUEST_SET_INFORMATION_EX Info
Definition: wshtcpip.h:39
ULONG tei_entity
Definition: tdiinfo.h:31
ULONG tei_instance
Definition: tdiinfo.h:32
TDIEntityID toi_entity
Definition: tdiinfo.h:74
struct in_addr sin_addr
Definition: winsock.h:512
short sin_family
Definition: winsock.h:510
u_short sin_port
Definition: winsock.h:511
#define TCP_NODELAY
Definition: tcpdef.h:117
#define AO_OPTION_BROADCAST
Definition: tcpioctl.h:74
#define AO_OPTION_IP_DONTFRAGMENT
Definition: tcpioctl.h:72
#define TCP_SOCKET_NODELAY
Definition: tcpioctl.h:104
#define AO_OPTION_TTL
Definition: tcpioctl.h:64
#define AO_OPTION_IP_HDRINCL
Definition: tcpioctl.h:75
#define INFO_TYPE_ADDRESS_OBJECT
Definition: tdiinfo.h:70
#define ER_ENTITY
Definition: tdiinfo.h:46
#define CL_TL_ENTITY
Definition: tdiinfo.h:43
#define INFO_CLASS_PROTOCOL
Definition: tdiinfo.h:65
#define CO_TL_ENTITY
Definition: tdiinfo.h:45
#define INFO_TYPE_CONNECTION
Definition: tdiinfo.h:71
#define IOCTL_TCP_SET_INFORMATION_EX
Definition: tditest.h:112
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14
uint32_t * PULONG
Definition: typedefs.h:59
uint32_t * LPDWORD
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
_In_ WDFREQUEST _In_ size_t _In_ size_t _In_ ULONG IoControlCode
Definition: wdfio.h:325
_In_ WDFREQUEST _In_ size_t OutputBufferLength
Definition: wdfio.h:320
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
Definition: wdfio.h:322
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_ ULONG _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesReturned
Definition: wdfiotarget.h:1052
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
Definition: wdfiotarget.h:863
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
Definition: wdfiotarget.h:953
_In_ WDFREQUEST _In_opt_ PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine
Definition: wdfrequest.h:895
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
BOOL * LPBOOL
Definition: windef.h:162
int * LPINT
Definition: windef.h:178
int * PINT
Definition: windef.h:177
#define WSAEINVAL
Definition: winerror.h:1946
#define WSAENOBUFS
Definition: winerror.h:1968
#define WSAENOPROTOOPT
Definition: winerror.h:1955
#define WSAEFAULT
Definition: winerror.h:1945
_In_ _In_opt_ _Out_writes_bytes_to_opt_ lpdwBufferLength _Inout_ LPDWORD lpdwBufferLength
Definition: winhttp.h:675
unsigned int GROUP
Definition: winsock2.h:640
void(CALLBACK * LPWSAOVERLAPPED_COMPLETION_ROUTINE)(IN DWORD dwError, IN DWORD cbTransferred, IN LPWSAOVERLAPPED lpOverlapped, IN DWORD dwFlags)
Definition: winsock2.h:722
#define IPPORT_RESERVED
Definition: winsock.h:290
#define SO_KEEPALIVE
Definition: winsock.h:181
#define IP_DONTFRAGMENT
Definition: winsock.h:326
#define SOCK_RAW
Definition: winsock.h:337
struct sockaddr_in * PSOCKADDR_IN
Definition: winsock.h:488
#define SO_DONTROUTE
Definition: winsock.h:182
#define SOCK_DGRAM
Definition: winsock.h:336
#define IP_TTL
Definition: winsock.h:324
UINT_PTR SOCKET
Definition: winsock.h:47
#define SOL_SOCKET
Definition: winsock.h:398
#define IPPROTO_IP
Definition: winsock.h:255
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:56
#define SIO_GET_INTERFACE_LIST
Definition: ws2ipdef.h:62
#define IP_RECEIVE_BROADCAST
Definition: ws2ipdef.h:43
#define WSH_NOTIFY_CLOSE
Definition: wsahelp.h:17
@ SockaddrEndpointInfoReserved
Definition: wsahelp.h:32
@ SockaddrEndpointInfoNormal
Definition: wsahelp.h:30
@ SockaddrEndpointInfoWildcard
Definition: wsahelp.h:31
@ SockaddrAddressInfoNormal
Definition: wsahelp.h:24
@ SockaddrAddressInfoLoopback
Definition: wsahelp.h:27
@ SockaddrAddressInfoWildcard
Definition: wsahelp.h:25
@ SockaddrAddressInfoBroadcast
Definition: wsahelp.h:26
#define WSH_NOTIFY_BIND
Definition: wsahelp.h:10
INT EXPORT WSHGetProviderGuid(IN LPWSTR ProviderName, OUT LPGUID ProviderGuid)
Definition: wshtcpip.c:99
INT EXPORT WSHGetWSAProtocolInfo(IN LPWSTR ProviderName, OUT LPWSAPROTOCOL_INFOW *ProtocolInfo, OUT LPDWORD ProtocolInfoEntries)
Definition: wshtcpip.c:326
INT EXPORT WSHGetSockaddrType(IN PSOCKADDR Sockaddr, IN DWORD SockaddrLength, OUT PSOCKADDR_INFO SockaddrInfo)
Definition: wshtcpip.c:116
INT EXPORT WSHSetSocketInformation(IN PVOID HelperDllSocketContext, IN SOCKET SocketHandle, IN HANDLE TdiAddressObjectHandle, IN HANDLE TdiConnectionObjectHandle, IN INT Level, IN INT OptionName, IN PCHAR OptionValue, IN INT OptionLength)
Definition: wshtcpip.c:658
INT EXPORT WSHIoctl(IN PVOID HelperDllSocketContext, IN SOCKET SocketHandle, IN HANDLE TdiAddressObjectHandle, IN HANDLE TdiConnectionObjectHandle, IN DWORD IoControlCode, IN LPVOID InputBuffer, IN DWORD InputBufferLength, IN LPVOID OutputBuffer, IN DWORD OutputBufferLength, OUT LPDWORD NumberOfBytesReturned, IN LPWSAOVERLAPPED Overlapped, IN LPWSAOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine, OUT LPBOOL NeedsCompletion)
Definition: wshtcpip.c:339
INT EXPORT WSHGetBroadcastSockaddr(IN PVOID HelperDllSocketContext, OUT PSOCKADDR Sockaddr, OUT PINT SockaddrLength)
Definition: wshtcpip.c:73
BOOL EXPORT DllMain(HANDLE hInstDll, ULONG dwReason, PVOID Reserved)
Definition: wshtcpip.c:16
INT EXPORT WSHNotify(IN PVOID HelperDllSocketContext, IN SOCKET SocketHandle, IN HANDLE TdiAddressObjectHandle, IN HANDLE TdiConnectionObjectHandle, IN DWORD NotifyEvent)
Definition: wshtcpip.c:430
DWORD EXPORT WSHGetWinsockMapping(OUT PWINSOCK_MAPPING Mapping, IN DWORD MappingLength)
Definition: wshtcpip.c:279
INT EXPORT WSHStringToAddress(IN LPWSTR AddressString, IN DWORD AddressFamily, IN LPWSAPROTOCOL_INFOW ProtocolInfo OPTIONAL, OUT LPSOCKADDR Address, IN OUT LPDWORD AddressStringLength)
Definition: wshtcpip.c:805
INT EXPORT WSHOpenSocket(IN OUT PINT AddressFamily, IN OUT PINT SocketType, IN OUT PINT Protocol, OUT PUNICODE_STRING TransportDeviceName, OUT PVOID HelperDllSocketContext, OUT PDWORD NotificationEvents)
Definition: wshtcpip.c:525
INT EXPORT WSHAddressToString(IN LPSOCKADDR Address, IN INT AddressLength, IN LPWSAPROTOCOL_INFOW ProtocolInfo OPTIONAL, OUT LPWSTR AddressString, IN OUT LPDWORD AddressStringLength)
Definition: wshtcpip.c:44
INT EXPORT WSHGetSocketInformation(IN PVOID HelperDllSocketContext, IN SOCKET SocketHandle, IN HANDLE TdiAddressObjectHandle, IN HANDLE TdiConnectionObjectHandle, IN INT Level, IN INT OptionName, OUT PCHAR OptionValue, OUT LPINT OptionLength)
Definition: wshtcpip.c:231
INT EXPORT WSHJoinLeaf(IN PVOID HelperDllSocketContext, IN SOCKET SocketHandle, IN HANDLE TdiAddressObjectHandle, IN HANDLE TdiConnectionObjectHandle, IN PVOID LeafHelperDllSocketContext, IN SOCKET LeafSocketHandle, IN PSOCKADDR Sockaddr, IN DWORD SockaddrLength, IN LPWSABUF CallerData, IN LPWSABUF CalleeData, IN LPQOS SocketQOS, IN LPQOS GroupQOS, IN DWORD Flags)
Definition: wshtcpip.c:376
INT EXPORT WSHGetWildcardSockaddr(IN PVOID HelperDllSocketContext, OUT PSOCKADDR Sockaddr, OUT PINT SockaddrLength)
Definition: wshtcpip.c:253
INT SendRequest(IN PVOID Request, IN DWORD RequestSize, IN DWORD IOCTL)
Definition: wshtcpip.c:397
INT EXPORT WSHOpenSocket2(OUT PINT AddressFamily, IN OUT PINT SocketType, IN OUT PINT Protocol, IN GROUP Group, IN DWORD Flags, OUT PUNICODE_STRING TransportDeviceName, OUT PVOID *HelperDllSocketContext, OUT PDWORD NotificationEvents)
Definition: wshtcpip.c:549
INT EXPORT WSHEnumProtocols(IN LPINT lpiProtocols OPTIONAL, IN LPWSTR lpTransportKeyName, IN OUT LPVOID lpProtocolBuffer, IN OUT LPDWORD lpdwBufferLength)
Definition: wshtcpip.c:59
static void GetTdiTypeId(_In_ INT Level, _In_ INT OptionName, _Out_ PULONG TdiType, _Out_ PULONG TdiId)
Definition: wshtcpip.c:161
#define DD_RAW_IP_DEVICE_NAME
Definition: wshtcpip.h:29
#define DD_UDP_DEVICE_NAME
Definition: wshtcpip.h:28
@ SocketStateBound
Definition: wshtcpip.h:33
@ SocketStateCreated
Definition: wshtcpip.h:32
#define DD_TCP_DEVICE_NAME
Definition: wshtcpip.h:27
_In_ USHORT SocketType
Definition: wsk.h:182
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_In_ ULONG Rows
Definition: haltypes.h:7
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
char CHAR
Definition: xmlstorage.h:175