Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-01-10 21:11:32 +0300
committerCorinna Vinschen <corinna@vinschen.de>2006-01-10 21:11:32 +0300
commitb773a592d3dfea4525c852a1d98540aa86bc0e43 (patch)
tree10f26be64fbe4b3dfa4384928e8c9b72267ce323 /winsup/cygwin/init.cc
parentdea958bc0612f79a603e4a8a915c8beeafc464e1 (diff)
* dcrt0.cc (dll_crt0_0): Remove call to wincap.init.
* init.cc (dll_entry): Rename is_wow64_proc to wow64_test_stack_marker. Call wincap.init here before doing anything else. Use wincap.is_wow64 to determine if we're running in a WOW64 emulator. * mmap.cc (MapViewNT): Don't use AT_ROUND_TO_PAGE in WOW64, it's apparently not supported. (mmap64): Don't create mappings beyond EOF, which would need to use AT_ROUND_TO_PAGE, on WOW64. * wincap.cc (wincap): Throw into the .cygwin_dll_common section. (wincapc::init): Determine if running in WOW64 and set wow_64 flag. * wincap.h (class wincapc): Add wow64 member. (wincapc::is_wow64): New method.
Diffstat (limited to 'winsup/cygwin/init.cc')
-rw-r--r--winsup/cygwin/init.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/winsup/cygwin/init.cc b/winsup/cygwin/init.cc
index 037b6c795..57faa073c 100644
--- a/winsup/cygwin/init.cc
+++ b/winsup/cygwin/init.cc
@@ -143,7 +143,7 @@ HMODULE NO_COPY cygwin_hmodule;
extern "C" BOOL WINAPI
dll_entry (HANDLE h, DWORD reason, void *static_load)
{
- BOOL is_wow64_proc = FALSE;
+ BOOL wow64_test_stack_marker;
// _STRACE_ON;
switch (reason)
@@ -152,15 +152,16 @@ dll_entry (HANDLE h, DWORD reason, void *static_load)
cygwin_hmodule = (HMODULE) h;
dynamically_loaded = (static_load == NULL);
+ wincap.init ();
+
/* Is the stack at an unusual address? This is, an address which
is in the usual space occupied by the process image, but below
the auto load address of DLLs?
Check if we're running in WOW64 on a 64 bit machine *and* are
spawned by a genuine 64 bit process. If so, respawn. */
- if (&is_wow64_proc >= (PBOOL) 0x400000
- && &is_wow64_proc <= (PBOOL) 0x10000000
- && IsWow64Process (GetCurrentProcess (), &is_wow64_proc)
- && is_wow64_proc)
+ if (wincap.is_wow64 ()
+ && &wow64_test_stack_marker >= (PBOOL) 0x400000
+ && &wow64_test_stack_marker <= (PBOOL) 0x10000000)
respawn_wow64_process ();
dll_crt0_0 ();