This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
[PATCH] fix for GetModuleFileName() hang when address is in ntdll.dll(NT4 SP5)
- From: Joe Buehler <jbuehler at hekimian dot com>
- To: Cygwin Patches <cygwin-patches at cygwin dot com>
- Date: Wed, 02 Apr 2003 10:17:38 -0500
- Subject: [PATCH] fix for GetModuleFileName() hang when address is in ntdll.dll(NT4 SP5)
- Organization: Spirent Communications, Inc.
- Reply-to: jbuehler at hekimian dot com
2003-04-02 Joe Buehler <jhpb at hekimian dot com>
* exceptions.cc (interruptible): avoid calling GetModuleFileName() on system DLL
Index: exceptions.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/exceptions.cc,v
retrieving revision 1.144
diff -u -r1.144 exceptions.cc
--- exceptions.cc 31 Mar 2003 21:27:06 -0000 1.144
+++ exceptions.cc 2 Apr 2003 15:15:58 -0000
@@ -651,6 +652,11 @@
res = 1;
else if (h == cygwin_hmodule)
res = 0;
+ else if (((int)h & 0xf0000000) == 0x70000000)
+ /* GetModuleFileName() has been observed to hang when handed an address
+ in ntdll.dll (NT4 SP5), so test before calling, to see whether the
+ address looks like it is in a Windows system DLL. */
+ res = 0;
else if (!GetModuleFileName (h, checkdir, windows_system_directory_length + 2))
res = 0;
else
--
Joe Buehler