diff options
author | Christopher Faylor <me@cgf.cx> | 2006-02-23 22:21:21 +0300 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2006-02-23 22:21:21 +0300 |
commit | 7fbfec2b642a0f2560cd4840bab76285b17c3fd0 (patch) | |
tree | 16067604f6876513595616ee2e1897e2ed140b64 /winsup/cygwin/exceptions.cc | |
parent | 7db9cdd24e884d70f3444fcd3abdf87b0df24479 (diff) |
* winsup.h (cygwin_hmodule): Declare.
* exceptions.cc (inside_kernel): Reverse return values to reflect function
name. Return true if we're in cygwin1.dll or if we're executing in dll_entry.
(_cygtls::interrupt_now): Reflect reversal of inside_kernel return value.
* hookapi.cc (cygwin_hmodule): Remove declaration.
* init.cc (dll_entry): Use in_dllentry global to record that we are executing
in dllentry.
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r-- | winsup/cygwin/exceptions.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 33ba9f02d..5e6a217a0 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -293,6 +293,10 @@ inside_kernel (CONTEXT *cx) { int res; MEMORY_BASIC_INFORMATION m; + extern bool in_dllentry; + + if (in_dllentry) + return true; memset (&m, 0, sizeof m); if (!VirtualQuery ((LPCVOID) cx->Eip, &m, sizeof m)) @@ -305,16 +309,16 @@ inside_kernel (CONTEXT *cx) /* Apparently Windows 95 can sometimes return bogus addresses from GetThreadContext. These resolve to a strange allocation base. These should *never* be treated as interruptible. */ - if (!h || m.State != MEM_COMMIT) - res = false; - else if (h == user_data->hmodule) + if (!h || m.State != MEM_COMMIT || h == cygwin_hmodule) res = true; + else if (h == user_data->hmodule) + res = false; else if (!GetModuleFileName (h, checkdir, windows_system_directory_length + 2)) - res = true; + res = false; else - res = !strncasematch (windows_system_directory, checkdir, - windows_system_directory_length); - sigproc_printf ("pc %p, h %p, interruptible %d", cx->Eip, h, res); + res = strncasematch (windows_system_directory, checkdir, + windows_system_directory_length); + sigproc_printf ("pc %p, h %p, inside_kernel %d", cx->Eip, h, res); # undef h return res; } @@ -726,7 +730,7 @@ _cygtls::interrupt_now (CONTEXT *cx, int sig, void *handler, { bool interrupted; - if (incyg || spinning || locked () || !inside_kernel (cx)) + if (incyg || spinning || locked () || inside_kernel (cx)) interrupted = false; else { |