20 DPRINT(
"DllMain of wshtcpip.dll\n");
74 IN PVOID HelperDllSocketContext,
80 if (*SockaddrLength <
Size)
82 DPRINT1(
"Socket address length too small: %d\n", *SockaddrLength);
123 if (!ipv4 || !SockaddrInfo || SockaddrLength <
sizeof(
SOCKADDR_IN) ||
126 DPRINT1(
"Invalid parameter: %x %x %d %u\n", ipv4, SockaddrInfo, SockaddrLength, (ipv4 ? ipv4->
sin_family : 0));
224 DPRINT1(
"Unknown level/option name: %d %d\n",
Level, OptionName);
232 IN PVOID HelperDllSocketContext,
235 IN HANDLE TdiConnectionObjectHandle,
243 DPRINT1(
"Get: Unknown level/option name: %d %d\n",
Level, OptionName);
254 IN PVOID HelperDllSocketContext,
260 if (*SockaddrLength <
Size)
262 DPRINT1(
"Socket address length too small: %d\n", *SockaddrLength);
287 if (MappingLength <
Size)
289 DPRINT1(
"Mapping length too small: %d\n", MappingLength);
298 Mapping->Mapping[0].Protocol = 0;
306 Mapping->Mapping[2].Protocol = 0;
314 Mapping->Mapping[4].Protocol = 0;
340 IN PVOID HelperDllSocketContext,
343 IN HANDLE TdiConnectionObjectHandle,
361 NumberOfBytesReturned,
377 IN PVOID HelperDllSocketContext,
380 IN HANDLE TdiConnectionObjectHandle,
381 IN PVOID LeafHelperDllSocketContext,
431 IN PVOID HelperDllSocketContext,
434 IN HANDLE TdiConnectionObjectHandle,
447 DPRINT(
"WSHNotify: WSH_NOTIFY_CLOSE\n");
448 QueuedRequest =
Context->RequestQueue;
449 while (QueuedRequest)
451 NextQueuedRequest = QueuedRequest->
Next;
456 QueuedRequest = NextQueuedRequest;
463 DPRINT(
"WSHNotify: WSH_NOTIFY_BIND\n");
494 QueuedRequest =
Context->RequestQueue;
495 while (QueuedRequest)
504 NextQueuedRequest = QueuedRequest->
Next;
509 QueuedRequest = NextQueuedRequest;
515 DPRINT1(
"Unwanted notification received! (%ld)\n", NotifyEvent);
542 HelperDllSocketContext,
581 DPRINT(
"WSHOpenSocket2 called\n");
605 TransportDeviceName->MaximumLength =
String.Length +
612 TransportDeviceName->MaximumLength);
614 if (!TransportDeviceName->Buffer)
623 TransportDeviceName->Length +=
sizeof(
WCHAR);
624 TransportDeviceName->Buffer[TransportDeviceName->Length /
sizeof(
WCHAR)] =
UNICODE_NULL;
627 String.Buffer = TransportDeviceName->Buffer + (TransportDeviceName->Length /
sizeof(
WCHAR));
629 String.MaximumLength = TransportDeviceName->MaximumLength - TransportDeviceName->Length;
633 TransportDeviceName->Length +=
String.Length;
650 *HelperDllSocketContext =
Context;
659 IN PVOID HelperDllSocketContext,
662 IN HANDLE TdiConnectionObjectHandle,
669 ULONG TdiType, TdiId;
674 DPRINT(
"WSHSetSocketInformation\n");
684 if (OptionLength <
sizeof(
BOOL))
694 DPRINT1(
"Set: SO_KEEPALIVE not yet supported\n");
699 DPRINT1(
"Set: Received unexpected SOL_SOCKET option %d\n", OptionName);
715 DPRINT1(
"Set: Received unsupported IPPROTO_IP option %d\n", OptionName);
724 if (OptionLength <
sizeof(
CHAR))
732 DPRINT1(
"Set: Received unexpected IPPROTO_TCP option %d\n", OptionName);
738 DPRINT1(
"Set: Received unexpected %d option %d\n",
Level, OptionName);
744 ASSERT((TdiId != 0) && (TdiType != 0));
750 Info->ID.toi_entity.tei_entity =
Context->AddrFileEntityType;
751 Info->ID.toi_entity.tei_instance =
Context->AddrFileInstance;
753 Info->ID.toi_type = TdiType;
754 Info->ID.toi_id = TdiId;
755 Info->BufferSize = OptionLength;
756 memcpy(
Info->Buffer, OptionValue, OptionLength);
762 Queued =
Context->RequestQueue;
763 while ((NextQueued = Queued->
Next))
775 NextQueued = Queued->
Next;
#define OBJ_NAME_PATH_SEPARATOR
static const COLUMN_LIST Columns[]
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)
#define DLL_THREAD_DETACH
#define DLL_PROCESS_ATTACH
#define DLL_PROCESS_DETACH
#define HeapFree(x, y, z)
#define DLL_THREAD_ATTACH
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
static PVOID Mapping[EMS_PHYSICAL_PAGES]
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
INT WSHIoctl_GetInterfaceList(IN LPVOID OutputBuffer, IN DWORD OutputBufferLength, OUT LPDWORD NumberOfBytesReturned, OUT LPBOOL NeedsCompletion)
#define memcpy(s1, s2, n)
IN PCO_ADDRESS_FAMILY AddressFamily
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)
VOID tdiFreeThingSet(PVOID things)
NTSTATUS tdiGetEntityIDSet(HANDLE tcpFile, TDIEntityID **entitySet, PDWORD numEntities)
NTSTATUS openTcpFile(PHANDLE tcpFile, ACCESS_MASK DesiredAccess)
VOID closeTcpFile(HANDLE h)
PULONG MinorVersion OPTIONAL
PTCP_REQUEST_SET_INFORMATION_EX Info
#define AO_OPTION_BROADCAST
#define AO_OPTION_IP_DONTFRAGMENT
#define TCP_SOCKET_NODELAY
#define AO_OPTION_IP_HDRINCL
#define INFO_TYPE_ADDRESS_OBJECT
#define INFO_CLASS_PROTOCOL
#define INFO_TYPE_CONNECTION
#define IOCTL_TCP_SET_INFORMATION_EX
#define RTL_CONSTANT_STRING(s)
#define RtlZeroMemory(Destination, Length)
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
_In_ WDFREQUEST _In_ size_t _In_ size_t _In_ ULONG IoControlCode
_In_ WDFREQUEST _In_ size_t OutputBufferLength
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
_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
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
_In_ WDFREQUEST _In_opt_ PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine
DWORD WINAPI GetLastError(void)
_Reserved_ PVOID Reserved
_In_ _In_opt_ _Out_writes_bytes_to_opt_ lpdwBufferLength _Inout_ LPDWORD lpdwBufferLength
void(CALLBACK * LPWSAOVERLAPPED_COMPLETION_ROUTINE)(IN DWORD dwError, IN DWORD cbTransferred, IN LPWSAOVERLAPPED lpOverlapped, IN DWORD dwFlags)
struct sockaddr_in * PSOCKADDR_IN
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
#define SIO_GET_INTERFACE_LIST
#define IP_RECEIVE_BROADCAST
@ SockaddrEndpointInfoReserved
@ SockaddrEndpointInfoNormal
@ SockaddrEndpointInfoWildcard
@ SockaddrAddressInfoNormal
@ SockaddrAddressInfoLoopback
@ SockaddrAddressInfoWildcard
@ SockaddrAddressInfoBroadcast
INT EXPORT WSHGetProviderGuid(IN LPWSTR ProviderName, OUT LPGUID ProviderGuid)
INT EXPORT WSHGetWSAProtocolInfo(IN LPWSTR ProviderName, OUT LPWSAPROTOCOL_INFOW *ProtocolInfo, OUT LPDWORD ProtocolInfoEntries)
INT EXPORT WSHGetSockaddrType(IN PSOCKADDR Sockaddr, IN DWORD SockaddrLength, OUT PSOCKADDR_INFO SockaddrInfo)
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)
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)
INT EXPORT WSHGetBroadcastSockaddr(IN PVOID HelperDllSocketContext, OUT PSOCKADDR Sockaddr, OUT PINT SockaddrLength)
BOOL EXPORT DllMain(HANDLE hInstDll, ULONG dwReason, PVOID Reserved)
INT EXPORT WSHNotify(IN PVOID HelperDllSocketContext, IN SOCKET SocketHandle, IN HANDLE TdiAddressObjectHandle, IN HANDLE TdiConnectionObjectHandle, IN DWORD NotifyEvent)
DWORD EXPORT WSHGetWinsockMapping(OUT PWINSOCK_MAPPING Mapping, IN DWORD MappingLength)
INT EXPORT WSHStringToAddress(IN LPWSTR AddressString, IN DWORD AddressFamily, IN LPWSAPROTOCOL_INFOW ProtocolInfo OPTIONAL, OUT LPSOCKADDR Address, IN OUT LPDWORD AddressStringLength)
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)
INT EXPORT WSHAddressToString(IN LPSOCKADDR Address, IN INT AddressLength, IN LPWSAPROTOCOL_INFOW ProtocolInfo OPTIONAL, OUT LPWSTR AddressString, IN OUT LPDWORD AddressStringLength)
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)
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)
INT EXPORT WSHGetWildcardSockaddr(IN PVOID HelperDllSocketContext, OUT PSOCKADDR Sockaddr, OUT PINT SockaddrLength)
INT SendRequest(IN PVOID Request, IN DWORD RequestSize, IN DWORD IOCTL)
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)
INT EXPORT WSHEnumProtocols(IN LPINT lpiProtocols OPTIONAL, IN LPWSTR lpTransportKeyName, IN OUT LPVOID lpProtocolBuffer, IN OUT LPDWORD lpdwBufferLength)
static void GetTdiTypeId(_In_ INT Level, _In_ INT OptionName, _Out_ PULONG TdiType, _Out_ PULONG TdiId)
#define DD_RAW_IP_DEVICE_NAME
#define DD_UDP_DEVICE_NAME
#define DD_TCP_DEVICE_NAME
_Must_inspect_result_ _In_ ULONG Flags