Skip to content

Commit 947c03e

Browse files
committed
[WS2_32][WS2HELP] On Vista+ forward all ws2help to ws2_32
1 parent 8df62f2 commit 947c03e

File tree

6 files changed

+105
-51
lines changed

6 files changed

+105
-51
lines changed

dll/win32/ws2_32/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ add_library(ws2_32 MODULE
5353

5454
set_module_type(ws2_32 win32dll)
5555
target_link_libraries(ws2_32 ${PSEH_LIB})
56+
if(DLL_EXPORT_VERSION GREATER_EQUAL 0x600)
57+
target_link_libraries(ws2_32 ws2help_static)
58+
endif()
5659
add_importlibs(ws2_32 user32 advapi32 ws2help msvcrt kernel32 ntdll)
5760
add_pch(ws2_32 inc/ws2_32.h SOURCE)
5861
add_cd_file(TARGET ws2_32 DESTINATION reactos/system32 FOR all)

dll/win32/ws2_32/src/dllmain.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ DWORD GlobalTlsIndex = TLS_OUT_OF_INDEXES;
2424

2525
/* FUNCTIONS *****************************************************************/
2626

27+
#if (DLL_EXPORT_VERSION >= _WIN32_WINNT_VISTA)
28+
BOOL
29+
APIENTRY
30+
Ws2HelpDllMain(
31+
HANDLE hModule,
32+
DWORD dwReason,
33+
LPVOID lpReserved);
34+
#endif
35+
2736
BOOL
2837
APIENTRY
2938
DllMain(HANDLE hModule,
@@ -32,6 +41,16 @@ DllMain(HANDLE hModule,
3241
{
3342
PWSPROCESS WsProcess;
3443

44+
#if (DLL_EXPORT_VERSION >= _WIN32_WINNT_VISTA)
45+
/* Initialize ws2help */
46+
if (!Ws2HelpDllMain(hModule, dwReason, lpReserved))
47+
{
48+
/* Should never happen */
49+
ASSERT(FALSE);
50+
return FALSE;
51+
}
52+
#endif
53+
3554
/* Main Entrypoint */
3655
switch (dwReason)
3756
{

dll/win32/ws2_32/ws2_32.spec

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -156,30 +156,30 @@
156156
@ stdcall -stub -arch=win64 WSCWriteNameSpaceOrder32(ptr long)
157157
@ stdcall WSCWriteProviderOrder(ptr long)
158158
@ stdcall -stub -arch=win64 WSCWriteProviderOrder32(ptr long)
159-
@ stdcall -stub -version=0x600+ WahCloseApcHelper(long)
160-
@ stdcall -stub -version=0x600+ WahCloseHandleHelper(long)
161-
@ stdcall -stub -version=0x600+ WahCloseNotificationHandleHelper(long)
162-
@ stdcall -stub -version=0x600+ WahCloseSocketHandle(long ptr)
163-
@ stdcall -stub -version=0x600+ WahCloseThread(long ptr)
164-
@ stdcall -stub -version=0x600+ WahCompleteRequest(long ptr ptr long long)
165-
@ stdcall -stub -version=0x600+ WahCreateHandleContextTable(ptr)
166-
@ stdcall -stub -version=0x600+ WahCreateNotificationHandle(long ptr)
167-
@ stdcall -stub -version=0x600+ WahCreateSocketHandle(long ptr)
168-
@ stdcall -stub -version=0x600+ WahDestroyHandleContextTable(ptr)
169-
@ stdcall -stub -version=0x600+ WahDisableNonIFSHandleSupport()
170-
@ stdcall -stub -version=0x600+ WahEnableNonIFSHandleSupport()
171-
@ stdcall -stub -version=0x600+ WahEnumerateHandleContexts(ptr ptr ptr)
172-
@ stdcall -stub -version=0x600+ WahInsertHandleContext(ptr ptr)
173-
@ stdcall -stub -version=0x600+ WahNotifyAllProcesses(long)
174-
@ stdcall -stub -version=0x600+ WahOpenApcHelper(ptr)
175-
@ stdcall -stub -version=0x600+ WahOpenCurrentThread(long ptr)
176-
@ stdcall -stub -version=0x600+ WahOpenHandleHelper(ptr)
177-
@ stdcall -stub -version=0x600+ WahOpenNotificationHandleHelper(ptr)
178-
@ stdcall -stub -version=0x600+ WahQueueUserApc(long ptr ptr ptr)
179-
@ stdcall -stub -version=0x600+ WahReferenceContextByHandle(ptr long)
180-
@ stdcall -stub -version=0x600+ WahRemoveHandleContext(ptr ptr)
181-
@ stdcall -stub -version=0x600+ WahWaitForNotification(long long ptr ptr)
182-
@ stub -version=0x600+ WahWriteLSPEvent
159+
@ stdcall -version=0x600+ WahCloseApcHelper(long)
160+
@ stdcall -version=0x600+ WahCloseHandleHelper(long)
161+
@ stdcall -version=0x600+ WahCloseNotificationHandleHelper(long)
162+
@ stdcall -version=0x600+ WahCloseSocketHandle(long ptr)
163+
@ stdcall -version=0x600+ WahCloseThread(long ptr)
164+
@ stdcall -version=0x600+ WahCompleteRequest(long ptr ptr long long)
165+
@ stdcall -version=0x600+ WahCreateHandleContextTable(ptr)
166+
@ stdcall -version=0x600+ WahCreateNotificationHandle(long ptr)
167+
@ stdcall -version=0x600+ WahCreateSocketHandle(long ptr)
168+
@ stdcall -version=0x600+ WahDestroyHandleContextTable(ptr)
169+
@ stdcall -version=0x600+ WahDisableNonIFSHandleSupport()
170+
@ stdcall -version=0x600+ WahEnableNonIFSHandleSupport()
171+
@ stdcall -version=0x600+ WahEnumerateHandleContexts(ptr ptr ptr)
172+
@ stdcall -version=0x600+ WahInsertHandleContext(ptr ptr)
173+
@ stdcall -version=0x600+ WahNotifyAllProcesses(long)
174+
@ stdcall -version=0x600+ WahOpenApcHelper(ptr)
175+
@ stdcall -version=0x600+ WahOpenCurrentThread(long ptr)
176+
@ stdcall -version=0x600+ WahOpenHandleHelper(ptr)
177+
@ stdcall -version=0x600+ WahOpenNotificationHandleHelper(ptr)
178+
@ stdcall -version=0x600+ WahQueueUserApc(long ptr ptr ptr)
179+
@ stdcall -version=0x600+ WahReferenceContextByHandle(ptr long)
180+
@ stdcall -version=0x600+ WahRemoveHandleContext(ptr ptr)
181+
@ stdcall -version=0x600+ WahWaitForNotification(long long ptr ptr)
182+
@ stdcall -stub -version=0x600+ WahWriteLSPEvent(ptr ptr)
183183
@ stdcall freeaddrinfo(ptr)
184184
@ stdcall getaddrinfo(str str ptr ptr)
185185
@ stdcall getnameinfo(ptr long ptr long ptr long long)

dll/win32/ws2help/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@ list(APPEND SOURCE
1010
notify.c
1111
precomp.h)
1212

13+
add_library(ws2help_static ${SOURCE})
14+
add_dependencies(ws2help_static xdk)
15+
1316
add_library(ws2help MODULE
14-
${SOURCE}
1517
ws2help.rc
1618
${CMAKE_CURRENT_BINARY_DIR}/ws2help.def)
1719

1820
set_module_type(ws2help win32dll)
21+
if(DLL_EXPORT_VERSION LESS 0x600)
22+
target_link_libraries(ws2help ws2help_static)
23+
set_entrypoint(ws2help Ws2HelpDllMain 12)
24+
endif()
1925
add_importlibs(ws2help advapi32 ws2_32 msvcrt kernel32 ntdll)
2026
add_pch(ws2help precomp.h SOURCE)
2127
add_cd_file(TARGET ws2help DESTINATION reactos/system32 FOR all)

dll/win32/ws2help/dllmain.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,10 @@ Ws2helpInitialize(VOID)
120120

121121
BOOL
122122
APIENTRY
123-
DllMain(HANDLE hModule,
124-
DWORD dwReason,
125-
LPVOID lpReserved)
123+
Ws2HelpDllMain(
124+
HANDLE hModule,
125+
DWORD dwReason,
126+
LPVOID lpReserved)
126127
{
127128
switch (dwReason)
128129
{

dll/win32/ws2help/ws2help.spec

Lines changed: 48 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,48 @@
1-
@ stdcall WahCloseApcHelper(long)
2-
@ stdcall WahCloseHandleHelper(long)
3-
@ stdcall WahCloseNotificationHandleHelper(long)
4-
@ stdcall WahCloseSocketHandle(long ptr)
5-
@ stdcall WahCloseThread(long ptr)
6-
@ stdcall WahCompleteRequest(long ptr ptr long long)
7-
@ stdcall WahCreateHandleContextTable(ptr)
8-
@ stdcall WahCreateNotificationHandle(long ptr)
9-
@ stdcall WahCreateSocketHandle(long ptr)
10-
@ stdcall WahDestroyHandleContextTable(ptr)
11-
@ stdcall WahDisableNonIFSHandleSupport()
12-
@ stdcall WahEnableNonIFSHandleSupport()
13-
@ stdcall WahEnumerateHandleContexts(ptr ptr ptr)
14-
@ stdcall WahInsertHandleContext(ptr ptr)
15-
@ stdcall WahNotifyAllProcesses(long)
16-
@ stdcall WahOpenApcHelper(ptr)
17-
@ stdcall WahOpenCurrentThread(long ptr)
18-
@ stdcall WahOpenHandleHelper(ptr)
19-
@ stdcall WahOpenNotificationHandleHelper(ptr)
20-
@ stdcall WahQueueUserApc(long ptr ptr ptr)
21-
@ stdcall WahReferenceContextByHandle(ptr long)
22-
@ stdcall WahRemoveHandleContext(ptr ptr)
23-
@ stdcall WahWaitForNotification(long long ptr ptr)
1+
@ stdcall -version=0x400-0x503 WahCloseApcHelper(long)
2+
@ stdcall -version=0x400-0x503 WahCloseHandleHelper(long)
3+
@ stdcall -version=0x400-0x503 WahCloseNotificationHandleHelper(long)
4+
@ stdcall -version=0x400-0x503 WahCloseSocketHandle(long ptr)
5+
@ stdcall -version=0x400-0x503 WahCloseThread(long ptr)
6+
@ stdcall -version=0x400-0x503 WahCompleteRequest(long ptr ptr long long)
7+
@ stdcall -version=0x400-0x503 WahCreateHandleContextTable(ptr)
8+
@ stdcall -version=0x400-0x503 WahCreateNotificationHandle(long ptr)
9+
@ stdcall -version=0x400-0x503 WahCreateSocketHandle(long ptr)
10+
@ stdcall -version=0x400-0x503 WahDestroyHandleContextTable(ptr)
11+
@ stdcall -version=0x400-0x503 WahDisableNonIFSHandleSupport()
12+
@ stdcall -version=0x400-0x503 WahEnableNonIFSHandleSupport()
13+
@ stdcall -version=0x400-0x503 WahEnumerateHandleContexts(ptr ptr ptr)
14+
@ stdcall -version=0x400-0x503 WahInsertHandleContext(ptr ptr)
15+
@ stdcall -version=0x400-0x503 WahNotifyAllProcesses(long)
16+
@ stdcall -version=0x400-0x503 WahOpenApcHelper(ptr)
17+
@ stdcall -version=0x400-0x503 WahOpenCurrentThread(long ptr)
18+
@ stdcall -version=0x400-0x503 WahOpenHandleHelper(ptr)
19+
@ stdcall -version=0x400-0x503 WahOpenNotificationHandleHelper(ptr)
20+
@ stdcall -version=0x400-0x503 WahQueueUserApc(long ptr ptr ptr)
21+
@ stdcall -version=0x400-0x503 WahReferenceContextByHandle(ptr long)
22+
@ stdcall -version=0x400-0x503 WahRemoveHandleContext(ptr ptr)
23+
@ stdcall -version=0x400-0x503 WahWaitForNotification(long long ptr ptr)
24+
25+
@ stdcall -version=0x600+ WahCloseApcHelper(long) ws2_32.WahCloseApcHelper
26+
@ stdcall -version=0x600+ WahCloseHandleHelper(long) ws2_32.WahCloseHandleHelper
27+
@ stdcall -version=0x600+ WahCloseNotificationHandleHelper(long) ws2_32.WahCloseNotificationHandleHelper
28+
@ stdcall -version=0x600+ WahCloseSocketHandle(long ptr) ws2_32.WahCloseSocketHandle
29+
@ stdcall -version=0x600+ WahCloseThread(long ptr) ws2_32.WahCloseThread
30+
@ stdcall -version=0x600+ WahCompleteRequest(long ptr ptr long long) ws2_32.WahCompleteRequest
31+
@ stdcall -version=0x600+ WahCreateHandleContextTable(ptr) ws2_32.WahCreateHandleContextTable
32+
@ stdcall -version=0x600+ WahCreateNotificationHandle(long ptr) ws2_32.WahCreateNotificationHandle
33+
@ stdcall -version=0x600+ WahCreateSocketHandle(long ptr) ws2_32.WahCreateSocketHandle
34+
@ stdcall -version=0x600+ WahDestroyHandleContextTable(ptr) ws2_32.WahDestroyHandleContextTable
35+
@ stdcall -version=0x600+ WahDisableNonIFSHandleSupport() ws2_32.WahDisableNonIFSHandleSupport
36+
@ stdcall -version=0x600+ WahEnableNonIFSHandleSupport() ws2_32.WahEnableNonIFSHandleSupport
37+
@ stdcall -version=0x600+ WahEnumerateHandleContexts(ptr ptr ptr) ws2_32.WahEnumerateHandleContexts
38+
@ stdcall -version=0x600+ WahInsertHandleContext(ptr ptr) ws2_32.WahInsertHandleContext
39+
@ stdcall -version=0x600+ WahNotifyAllProcesses(long) ws2_32.WahNotifyAllProcesses
40+
@ stdcall -version=0x600+ WahOpenApcHelper(ptr) ws2_32.WahOpenApcHelper
41+
@ stdcall -version=0x600+ WahOpenCurrentThread(long ptr) ws2_32.WahOpenCurrentThread
42+
@ stdcall -version=0x600+ WahOpenHandleHelper(ptr) ws2_32.WahOpenHandleHelper
43+
@ stdcall -version=0x600+ WahOpenNotificationHandleHelper(ptr) ws2_32.WahOpenNotificationHandleHelper
44+
@ stdcall -version=0x600+ WahQueueUserApc(long ptr ptr ptr) ws2_32.WahQueueUserApc
45+
@ stdcall -version=0x600+ WahReferenceContextByHandle(ptr long) ws2_32.WahReferenceContextByHandle
46+
@ stdcall -version=0x600+ WahRemoveHandleContext(ptr ptr) ws2_32.WahRemoveHandleContext
47+
@ stdcall -version=0x600+ WahWaitForNotification(long long ptr ptr) ws2_32.WahWaitForNotification
48+
#@ stdcall -version=0x600+ WahWriteLSPEvent(ptr ptr) ws2_32.WahWriteLSPEvent

0 commit comments

Comments
 (0)