OSDN Git Service

* dtable.cc (handle_to_fn): Detect failing NtQueryObject.
authorcgf <cgf>
Mon, 6 Jul 2009 15:11:29 +0000 (15:11 +0000)
committercgf <cgf>
Mon, 6 Jul 2009 15:11:29 +0000 (15:11 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/dtable.cc

index 3c6296e..1f824a3 100644 (file)
@@ -1,3 +1,7 @@
+2009-07-06  Christopher Faylor  <me+cygwin@cgf.cx>
+
+       * dtable.cc (handle_to_fn): Detect failing NtQueryObject.
+
 2009-07-06  Corinna Vinschen  <corinna@vinschen.de>
 
        * autoload.cc: Delete stray CR.
index 08b04f0..22303df 100644 (file)
@@ -891,8 +891,9 @@ handle_to_fn (HANDLE h, char *posix_fn)
   WCHAR *maxmatchdos = NULL;
   int maxmatchlen = 0;
 
-  NtQueryObject (h, ObjectNameInformation, &dummy_oni, sizeof (dummy_oni), &len);
-  if (!len)
+  NTSTATUS status = NtQueryObject (h, ObjectNameInformation, &dummy_oni,
+                                  sizeof (dummy_oni), &len);
+  if (!NT_SUCCESS (status) || !len)
     debug_printf ("NtQueryObject failed 1");
   else
     {