29 PVOID *HelperDllContext,
40 TRACE(
"AddressFamily %p, SocketType %p, Protocol %p, Group %u, Flags %lx, TransportName %p, HelperDllContext %p, HelperDllData %p, Events %p\n",
46 Helpers = Helpers->
Flink ) {
80 *HelperDllData = HelperData;
90 WARN(
"Can't get transport list\n");
95 for (Transport = Transports;
97 Transport +=
wcslen(Transport) + 1) {
98 TRACE(
"Transport: %S\n", Transports);
105 ERR(
"Can't get mapping for %S\n", Transports);
118 ERR(
"Can't load helper DLL for Transport %S.\n", Transport);
147 *HelperDllData = HelperData;
170 TRACE(
"TransportName %ws\n", TransportName);
176 if (TransportKey ==
NULL) {
177 ERR(
"Buffer allocation failed\n");
182 wcscpy(TransportKey,
L"System\\CurrentControlSet\\Services\\");
183 wcscat(TransportKey, TransportName);
184 wcscat(TransportKey,
L"\\Parameters\\Winsock");
194 ERR(
"Error reading transport mapping registry\n");
203 ERR(
"Error reading transport mapping registry\n");
212 ERR(
"Buffer allocation failed\n");
221 ERR(
"Error reading transport mapping registry\n");
233 PWSTR *TransportList)
235 ULONG TransportListSize;
243 L"SYSTEM\\CurrentControlSet\\Services\\Winsock\\Parameters",
250 ERR(
"Error reading transport list registry\n");
264 ERR(
"Error reading transport list registry\n");
272 if (*TransportList ==
NULL) {
273 ERR(
"Buffer allocation failed\n");
287 ERR(
"Error reading transport list registry\n");
305 PWSTR FullHelperDllName;
315 if (HelperData ==
NULL) {
316 ERR(
"Buffer allocation failed\n");
324 if (HelperKey ==
NULL) {
325 ERR(
"Buffer allocation failed\n");
331 wcscpy(HelperKey,
L"System\\CurrentControlSet\\Services\\");
332 wcscat(HelperKey, TransportName);
333 wcscat(HelperKey,
L"\\Parameters\\Winsock");
342 ERR(
"Error reading helper DLL parameters\n");
351 L"MinSockaddrLength",
359 L"MaxSockaddrLength",
373 L"UseDelayedAcceptance",
383 if (HelperDllName ==
NULL) {
384 ERR(
"Buffer allocation failed\n");
392 if (FullHelperDllName ==
NULL) {
393 ERR(
"Buffer allocation failed\n");
410 ERR(
"Error reading helper DLL parameters\n");
429 ERR(
"Error loading helper DLL\n");
451 "WSHGetSocketInformation");
454 "WSHSetSocketInformation");
457 "WSHGetSockaddrType");
460 "WSHGetWildcardSockaddr");
463 "WSHGetBroadcastSockaddr");
466 "WSHAddressToString");
469 "WSHStringToAddress");
485 *HelperDllData = HelperData;
502 for (Row = 0; Row <
Mapping->Rows; Row++) {
503 TRACE(
"Examining: row %d: AF %d type %d proto %d\n",
#define RegCloseKey(hKey)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
#define GetProcAddress(x, y)
#define HeapFree(x, y, z)
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
LIST_ENTRY SockHelpersListHead
CRITICAL_SECTION HelperDLLDatabaseLock
LIST_ENTRY HelperDLLDatabaseListHead
INT SockLoadTransportMapping(PWSTR TransportName, PWINSOCK_MAPPING *Mapping)
INT SockLoadHelperDll(PWSTR TransportName, PWINSOCK_MAPPING Mapping, PHELPER_DATA *HelperDllData)
INT SockGetTdiName(PINT AddressFamily, PINT SocketType, PINT Protocol, GROUP Group, DWORD Flags, PUNICODE_STRING TransportName, PVOID *HelperDllContext, PHELPER_DATA *HelperDllData, PDWORD Events)
BOOL SockIsTripleInMapping(PWINSOCK_MAPPING Mapping, INT AddressFamily, INT SocketType, INT Protocol)
INT SockLoadTransportList(PWSTR *TransportList)
static PVOID Mapping[EMS_PHYSICAL_PAGES]
#define InsertHeadList(ListHead, Entry)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
IN PCO_ADDRESS_FAMILY AddressFamily
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
BOOLEAN UseDelayedAcceptance
PWSH_GET_SOCKADDR_TYPE WSHGetSockaddrType
PWSH_JOIN_LEAF WSHJoinLeaf
PWSH_GET_SOCKET_INFORMATION WSHGetSocketInformation
PWSH_STRING_TO_ADDRESS WSHStringToAddress
PWSH_ADDRESS_TO_STRING WSHAddressToString
PWSH_OPEN_SOCKET WSHOpenSocket
PWSH_SET_SOCKET_INFORMATION WSHSetSocketInformation
PWSH_GET_BROADCAST_SOCKADDR WSHGetBroadcastSockaddr
PWSH_OPEN_SOCKET2 WSHOpenSocket2
PWSH_GET_WILDCARD_SOCKADDR WSHGetWildcardSockaddr
struct _LIST_ENTRY * Flink
#define CONTAINING_RECORD(address, type, field)
#define HKEY_LOCAL_MACHINE
INT(WINAPI * PWSH_GET_BROADCAST_SOCKADDR)(PVOID, PSOCKADDR, PINT)
INT(WINAPI * PWSH_GET_WILDCARD_SOCKADDR)(PVOID, PSOCKADDR, PINT)
INT(WINAPI * PWSH_SET_SOCKET_INFORMATION)(PVOID, SOCKET, HANDLE, HANDLE, INT, INT, PCHAR, INT)
INT(WINAPI * PWSH_GET_SOCKADDR_TYPE)(PSOCKADDR, DWORD, PSOCKADDR_INFO)
INT(WINAPI * PWSH_OPEN_SOCKET2)(PINT, PINT, PINT, GROUP, DWORD, PUNICODE_STRING, PVOID *, PDWORD)
INT(WINAPI * PWSH_NOTIFY)(PVOID, SOCKET, HANDLE, HANDLE, DWORD)
INT(WINAPI * PWSH_JOIN_LEAF)(PVOID, SOCKET, HANDLE, HANDLE, PVOID, SOCKET, PSOCKADDR, DWORD, LPWSABUF, LPWSABUF, LPQOS, LPQOS, DWORD)
INT(WINAPI * PWSH_STRING_TO_ADDRESS)(LPWSTR, DWORD, LPWSAPROTOCOL_INFOW, LPSOCKADDR, LPDWORD)
INT(WINAPI * PWSH_OPEN_SOCKET)(PINT, PINT, PINT, PUNICODE_STRING, PVOID, PDWORD)
INT(WINAPI * PWSH_IOCTL)(PVOID, SOCKET, HANDLE, HANDLE, DWORD, LPVOID, DWORD, LPVOID, DWORD, LPDWORD, LPWSAOVERLAPPED, LPWSAOVERLAPPED_COMPLETION_ROUTINE, LPBOOL)
INT(WINAPI * PWSH_ADDRESS_TO_STRING)(LPSOCKADDR, INT, LPWSAPROTOCOL_INFOW, LPWSTR, LPDWORD)
INT(WINAPI * PWSH_GET_SOCKET_INFORMATION)(PVOID, SOCKET, HANDLE, HANDLE, INT, INT, PCHAR, LPINT)
_Must_inspect_result_ _In_ ULONG Flags