* globals.cc (hntdll): Define/declare.
* exceptions.cc (inside_kernel): Don't call GetModuleFileName if we know we're in ntdll. * sigproc.cc (wait_sig): Initialize hntdll.
This commit is contained in:
parent
db0d50a67d
commit
ae8456bdf2
@ -1,3 +1,10 @@
|
||||
2013-12-09 Christopher Faylor <me.cygwin2013@cgf.cx>
|
||||
|
||||
* globals.cc (hntdll): Define/declare.
|
||||
* exceptions.cc (inside_kernel): Don't call GetModuleFileName if we
|
||||
know we're in ntdll.
|
||||
* sigproc.cc (wait_sig): Initialize hntdll.
|
||||
|
||||
2013-12-09 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* include/cygwin/stdlib.h (initstate, random, setstate, srandom):
|
||||
|
@ -394,6 +394,9 @@ _cygtls::inside_kernel (CONTEXT *cx)
|
||||
# define h ((HMODULE) m.AllocationBase)
|
||||
if (!h || m.State != MEM_COMMIT) /* Be defensive */
|
||||
res = true;
|
||||
else if (h == hntdll)
|
||||
res = true; /* Calling GetModuleFilename on ntdll.dll
|
||||
can hang */
|
||||
else if (h == user_data->hmodule)
|
||||
res = false;
|
||||
else if (!GetModuleFileNameW (h, checkdir, windows_system_directory_length + 6))
|
||||
|
@ -23,6 +23,7 @@ HANDLE NO_COPY hProcToken;
|
||||
HANDLE NO_COPY hProcImpToken;
|
||||
HANDLE my_wr_proc_pipe;
|
||||
HMODULE NO_COPY cygwin_hmodule;
|
||||
HMODULE NO_COPY hntdll;
|
||||
int NO_COPY sigExeced;
|
||||
WCHAR windows_system_directory[MAX_PATH];
|
||||
UINT windows_system_directory_length;
|
||||
|
@ -1205,6 +1205,8 @@ wait_sig (VOID *)
|
||||
sigproc_printf ("entering ReadFile loop, my_readsig %p, my_sendsig %p",
|
||||
my_readsig, my_sendsig);
|
||||
|
||||
hntdll = GetModuleHandle ("ntdll.dll");
|
||||
|
||||
for (;;)
|
||||
{
|
||||
DWORD nb;
|
||||
|
Loading…
Reference in New Issue
Block a user