* 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.
This commit is contained in:
parent
7db9cdd24e
commit
7fbfec2b64
@ -1,3 +1,15 @@
|
|||||||
|
2006-02-23 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2006-02-22 Corinna Vinschen <corinna@vinschen.de>
|
2006-02-22 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* exceptions.cc (_cygtls::interrupt_now): Reorder conditional
|
* exceptions.cc (_cygtls::interrupt_now): Reorder conditional
|
||||||
|
@ -293,6 +293,10 @@ inside_kernel (CONTEXT *cx)
|
|||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
MEMORY_BASIC_INFORMATION m;
|
MEMORY_BASIC_INFORMATION m;
|
||||||
|
extern bool in_dllentry;
|
||||||
|
|
||||||
|
if (in_dllentry)
|
||||||
|
return true;
|
||||||
|
|
||||||
memset (&m, 0, sizeof m);
|
memset (&m, 0, sizeof m);
|
||||||
if (!VirtualQuery ((LPCVOID) cx->Eip, &m, 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
|
/* Apparently Windows 95 can sometimes return bogus addresses from
|
||||||
GetThreadContext. These resolve to a strange allocation base.
|
GetThreadContext. These resolve to a strange allocation base.
|
||||||
These should *never* be treated as interruptible. */
|
These should *never* be treated as interruptible. */
|
||||||
if (!h || m.State != MEM_COMMIT)
|
if (!h || m.State != MEM_COMMIT || h == cygwin_hmodule)
|
||||||
res = false;
|
res = true;
|
||||||
else if (h == user_data->hmodule)
|
else if (h == user_data->hmodule)
|
||||||
res = true;
|
res = false;
|
||||||
else if (!GetModuleFileName (h, checkdir, windows_system_directory_length + 2))
|
else if (!GetModuleFileName (h, checkdir, windows_system_directory_length + 2))
|
||||||
res = true;
|
res = false;
|
||||||
else
|
else
|
||||||
res = !strncasematch (windows_system_directory, checkdir,
|
res = strncasematch (windows_system_directory, checkdir,
|
||||||
windows_system_directory_length);
|
windows_system_directory_length);
|
||||||
sigproc_printf ("pc %p, h %p, interruptible %d", cx->Eip, h, res);
|
sigproc_printf ("pc %p, h %p, inside_kernel %d", cx->Eip, h, res);
|
||||||
# undef h
|
# undef h
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -726,7 +730,7 @@ _cygtls::interrupt_now (CONTEXT *cx, int sig, void *handler,
|
|||||||
{
|
{
|
||||||
bool interrupted;
|
bool interrupted;
|
||||||
|
|
||||||
if (incyg || spinning || locked () || !inside_kernel (cx))
|
if (incyg || spinning || locked () || inside_kernel (cx))
|
||||||
interrupted = false;
|
interrupted = false;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -111,7 +111,6 @@ RedirectIAT (function_hook& fh, PIMAGE_IMPORT_DESCRIPTOR pImportDesc,
|
|||||||
void
|
void
|
||||||
get_export (function_hook& fh)
|
get_export (function_hook& fh)
|
||||||
{
|
{
|
||||||
extern HMODULE cygwin_hmodule;
|
|
||||||
PIMAGE_DOS_HEADER pdh = (PIMAGE_DOS_HEADER) cygwin_hmodule;
|
PIMAGE_DOS_HEADER pdh = (PIMAGE_DOS_HEADER) cygwin_hmodule;
|
||||||
if (pdh->e_magic != IMAGE_DOS_SIGNATURE)
|
if (pdh->e_magic != IMAGE_DOS_SIGNATURE)
|
||||||
return;
|
return;
|
||||||
|
@ -142,12 +142,14 @@ respawn_wow64_process ()
|
|||||||
extern void __stdcall dll_crt0_0 ();
|
extern void __stdcall dll_crt0_0 ();
|
||||||
|
|
||||||
HMODULE NO_COPY cygwin_hmodule;
|
HMODULE NO_COPY cygwin_hmodule;
|
||||||
|
bool in_dllentry;
|
||||||
|
|
||||||
extern "C" BOOL WINAPI
|
extern "C" BOOL WINAPI
|
||||||
dll_entry (HANDLE h, DWORD reason, void *static_load)
|
dll_entry (HANDLE h, DWORD reason, void *static_load)
|
||||||
{
|
{
|
||||||
BOOL wow64_test_stack_marker;
|
BOOL wow64_test_stack_marker;
|
||||||
// _STRACE_ON;
|
|
||||||
|
in_dllentry = true;
|
||||||
|
|
||||||
switch (reason)
|
switch (reason)
|
||||||
{
|
{
|
||||||
@ -182,5 +184,6 @@ dll_entry (HANDLE h, DWORD reason, void *static_load)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
in_dllentry = false;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -354,6 +354,7 @@ extern HANDLE hMainProc;
|
|||||||
extern HANDLE hProcToken;
|
extern HANDLE hProcToken;
|
||||||
extern HANDLE hProcImpToken;
|
extern HANDLE hProcImpToken;
|
||||||
extern HANDLE hExeced;
|
extern HANDLE hExeced;
|
||||||
|
extern HMODULE cygwin_hmodule;
|
||||||
|
|
||||||
extern bool cygwin_testing;
|
extern bool cygwin_testing;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user