[PATCH 3/4] kernelbase: Save the DLL module handle.

Gijs Vermeulen gijsvrm at gmail.com
Wed Mar 10 08:25:11 CST 2021


From: Aaro Altonen <a.altonen at hotmail.com>

Signed-off-by: Aaro Altonen <a.altonen at hotmail.com>
Signed-off-by: Gijs Vermeulen <gijsvrm at gmail.com>
---
 dlls/kernelbase/kernelbase.h | 1 +
 dlls/kernelbase/main.c       | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/dlls/kernelbase/kernelbase.h b/dlls/kernelbase/kernelbase.h
index e813950891d..023705d4996 100644
--- a/dlls/kernelbase/kernelbase.h
+++ b/dlls/kernelbase/kernelbase.h
@@ -42,6 +42,7 @@ extern const WCHAR system_dir[] DECLSPEC_HIDDEN;
 
 static const BOOL is_win64 = (sizeof(void *) > sizeof(int));
 extern BOOL is_wow64 DECLSPEC_HIDDEN;
+extern HMODULE KERNELBASE_hModule DECLSPEC_HIDDEN;
 
 static inline BOOL set_ntstatus( NTSTATUS status )
 {
diff --git a/dlls/kernelbase/main.c b/dlls/kernelbase/main.c
index b90ee1cba2c..158961ce70b 100644
--- a/dlls/kernelbase/main.c
+++ b/dlls/kernelbase/main.c
@@ -35,6 +35,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(kernelbase);
 
 
 BOOL is_wow64 = FALSE;
+HMODULE KERNELBASE_hModule = 0;
 
 /***********************************************************************
  *           DllMain
@@ -43,6 +44,7 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
 {
     if (reason == DLL_PROCESS_ATTACH)
     {
+        KERNELBASE_hModule = hinst;
         DisableThreadLibraryCalls( hinst );
         IsWow64Process( GetCurrentProcess(), &is_wow64 );
         init_locale();
-- 
2.30.2




More information about the wine-devel mailing list