From 369176ea9d3e1f087caa0260e2afb80a8c124403 Mon Sep 17 00:00:00 2001 From: Ged Murphy Date: Thu, 17 Aug 2006 16:48:36 +0000 Subject: [PATCH] Don't allow ws2_32 access to apps with bad setup data (commit correct version this time) svn path=/trunk/; revision=23596 --- reactos/dll/win32/ws2_32/include/ws2_32.h | 1 + reactos/dll/win32/ws2_32/misc/dllmain.c | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/reactos/dll/win32/ws2_32/include/ws2_32.h b/reactos/dll/win32/ws2_32/include/ws2_32.h index c7f8c96d885..8b0e9a2f41c 100644 --- a/reactos/dll/win32/ws2_32/include/ws2_32.h +++ b/reactos/dll/win32/ws2_32/include/ws2_32.h @@ -28,6 +28,7 @@ unsigned long strtoul(const char *nptr, char **endptr, int base); #define EXPORT STDCALL +extern HINSTANCE g_hInstDll; extern HANDLE GlobalHeap; extern BOOL WsaInitialized; /* TRUE if WSAStartup() has been successfully called */ extern WSPUPCALLTABLE UpcallTable; diff --git a/reactos/dll/win32/ws2_32/misc/dllmain.c b/reactos/dll/win32/ws2_32/misc/dllmain.c index 74eed23e3c3..bddf23beddd 100644 --- a/reactos/dll/win32/ws2_32/misc/dllmain.c +++ b/reactos/dll/win32/ws2_32/misc/dllmain.c @@ -27,7 +27,7 @@ DWORD DebugTraceLevel = 0; /* To make the linker happy */ VOID STDCALL KeBugCheck (ULONG BugCheckCode) {} - +HINSTANCE g_hInstDll; HANDLE GlobalHeap; BOOL WsaInitialized = FALSE; /* TRUE if WSAStartup() has been successfully called */ WSPUPCALLTABLE UpcallTable; @@ -86,8 +86,8 @@ WSAStartup(IN WORD wVersionRequested, if (lpWSAData == NULL) return WSAEFAULT; - Low = LOWBYTE(wVersionRequested); - High = HIGHBYTE(wVersionRequested); + Low = LOBYTE(wVersionRequested); + High = HIBYTE(wVersionRequested); if (Low < 1) { @@ -841,6 +841,8 @@ DllMain(HANDLE hInstDll, { GlobalHeap = GetProcessHeap(); + g_hInstDll = hInstDll; + CreateCatalog(); InitProviderHandleTable();