This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] fix for GetModuleFileName() hang when address is in ntdll.dll(NT4 SP5)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]