summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/init.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/init.cc')
-rw-r--r--winsup/cygwin/init.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/winsup/cygwin/init.cc b/winsup/cygwin/init.cc
index d3e41b6a4..3d7a91c50 100644
--- a/winsup/cygwin/init.cc
+++ b/winsup/cygwin/init.cc
@@ -108,6 +108,8 @@ respawn_wow64_process ()
extern void __stdcall dll_crt0_0 ();
+HMODULE NO_COPY cygwin_hmodule;
+
extern "C" int WINAPI
dll_entry (HANDLE h, DWORD reason, void *static_load)
{
@@ -116,6 +118,7 @@ dll_entry (HANDLE h, DWORD reason, void *static_load)
switch (reason)
{
case DLL_PROCESS_ATTACH:
+ cygwin_hmodule = (HMODULE) h;
/* Is the stack at an unusual high address? Check if we're running on
a 64 bit machine. If so, respawn. */
if (&is_64bit_machine >= (PBOOL) 0x400000