windows-pioctl-debug-20041130
authorJeffrey Altman <jaltman@mit.edu>
Tue, 30 Nov 2004 16:53:59 +0000 (16:53 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 30 Nov 2004 16:53:59 +0000 (16:53 +0000)
Output the error number and not just the text string when reporting
failures from CreateFile.

src/sys/pioctl_nt.c

index cd2ca48..17a64b3 100644 (file)
@@ -210,7 +210,8 @@ GetIoctlHandle(char *fileNamep, HANDLE * handlep)
                                (va_list *) NULL
                                ) )
             {
-                fprintf(stderr,"pioctl CreateFile(%s) failed: [%s]\r\n",tbuffer,buf);
+                fprintf(stderr,"pioctl CreateFile(%s) failed: 0x%8X\r\n\t[%s]\r\n",
+                        tbuffer,gle,buf);
             }
         }
         if (gle != ERROR_DOWNGRADE_DETECTED)
@@ -262,7 +263,8 @@ GetIoctlHandle(char *fileNamep, HANDLE * handlep)
                                     (va_list *) NULL
                                     ) )
                 {
-                    fprintf(stderr,"pioctl CreateFile(%s) failed: [%s]\r\n",tbuffer,buf);
+                    fprintf(stderr,"pioctl CreateFile(%s) failed: 0x%8X\r\n\t[%s]\r\n",
+                             tbuffer,gle,buf);
                 }
             }
             return -1;