All pastes #32692 Raw Edit

Mine

public text v1 · immutable
#32692 ·published 2005-12-06 19:10 UTC
rendered paste body
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 660ba1b..531f6e7 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -196,11 +199,11 @@ NTSTATUS WINAPI NtCreateFile( PHANDLE ha
     if (attr->RootDirectory)
     {
         FIXME( "RootDirectory %p not supported\n", attr->RootDirectory );
-        return STATUS_OBJECT_NAME_NOT_FOUND;
+        io->u.Status = STATUS_OBJECT_NAME_NOT_FOUND;
     }
-
-    io->u.Status = wine_nt_to_unix_file_name( attr->ObjectName, &unix_name, disposition,
-                                              !(attr->Attributes & OBJ_CASE_INSENSITIVE) );
+    else
+        io->u.Status = wine_nt_to_unix_file_name( attr->ObjectName, &unix_name, disposition,
+                                                  !(attr->Attributes & OBJ_CASE_INSENSITIVE) );
 
     if (io->u.Status == STATUS_NO_SUCH_FILE &&
         disposition != FILE_OPEN && disposition != FILE_OVERWRITE)
@@ -226,7 +229,20 @@ NTSTATUS WINAPI NtCreateFile( PHANDLE ha
         SERVER_END_REQ;
         RtlFreeAnsiString( &unix_name );
     }
-    else WARN("%s not found (%lx)\n", debugstr_us(attr->ObjectName), io->u.Status );
+    else
+    {
+        /* Check for Nt device */
+        SERVER_START_REQ( open_device )
+        {
+            req->access     = access;
+            req->attributes = attr ? attr->Attributes : 0;
+            req->rootdir    = attr ? attr->RootDirectory : 0;
+            wine_server_add_data(req, attr->ObjectName->Buffer, attr->ObjectName->Length);
+            io->u.Status = wine_server_call(req);
+            *handle = reply->handle;
+        }
+        SERVER_END_REQ;
+    }
 
     if (io->u.Status == STATUS_SUCCESS)
     {
@@ -249,6 +265,7 @@ NTSTATUS WINAPI NtCreateFile( PHANDLE ha
             break;
         }
     }
+    else WARN("%s not found (%lx)\n", debugstr_us(attr->ObjectName), io->u.Status );
 
     return io->u.Status;
 }