302{
305 PWSTR FullHelperDllName;
310
311
313
314
315 if (HelperData ==
NULL) {
316 ERR(
"Buffer allocation failed\n");
318 }
319
320
322
323
324 if (HelperKey ==
NULL) {
325 ERR(
"Buffer allocation failed\n");
328 }
329
330
331 wcscpy(HelperKey,
L"System\\CurrentControlSet\\Services\\");
332 wcscat(HelperKey, TransportName);
333 wcscat(HelperKey,
L"\\Parameters\\Winsock");
334
335
337
339
340
342 ERR(
"Error reading helper DLL parameters\n");
345 }
346
347
351 L"MinSockaddrLength",
359 L"MaxSockaddrLength",
364
365
368
369
373 L"UseDelayedAcceptance",
378
379
381
382
383 if (HelperDllName ==
NULL) {
384 ERR(
"Buffer allocation failed\n");
387 }
388
390
391
392 if (FullHelperDllName ==
NULL) {
393 ERR(
"Buffer allocation failed\n");
397 }
398
399
407
408
410 ERR(
"Error reading helper DLL parameters\n");
415 }
416
417
419 FullHelperDllName,
420 256);
421
422
424
427
429 ERR(
"Error loading helper DLL\n");
432 }
433
434
436
437
440 "WSHOpenSocket");
443 "WSHOpenSocket2");
446 "WSHJoinLeaf");
451 "WSHGetSocketInformation");
454 "WSHSetSocketInformation");
457 "WSHGetSockaddrType");
460 "WSHGetWildcardSockaddr");
463 "WSHGetBroadcastSockaddr");
466 "WSHAddressToString");
469 "WSHStringToAddress");
472 "WSHIoctl");
473
474
477
478
480
481
483
484
485 *HelperDllData = HelperData;
486 return 0;
487}
#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)
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
#define InsertHeadList(ListHead, Entry)
_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
_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_SET_SOCKET_INFORMATION WSHSetSocketInformation
PWSH_GET_BROADCAST_SOCKADDR WSHGetBroadcastSockaddr
PWSH_GET_WILDCARD_SOCKADDR WSHGetWildcardSockaddr
#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)