[KERNEL32]: w2k3ify GetDriveTypeA()
authorPierre Schweitzer <pierre@reactos.org>
Thu, 5 Oct 2017 21:43:10 +0000 (23:43 +0200)
committerPierre Schweitzer <pierre@reactos.org>
Thu, 5 Oct 2017 21:43:10 +0000 (23:43 +0200)
dll/win32/kernel32/client/file/disk.c

index e784306..041f4b1 100644 (file)
@@ -463,15 +463,26 @@ UINT
 WINAPI
 GetDriveTypeA(IN LPCSTR lpRootPathName)
 {
-    PWCHAR RootPathNameW;
+    PWSTR RootPathU;
 
-    if (!lpRootPathName)
-        return GetDriveTypeW(NULL);
+    if (lpRootPathName != NULL)
+    {
+        PUNICODE_STRING RootPathUStr;
 
-    if (!(RootPathNameW = FilenameA2W(lpRootPathName, FALSE)))
-        return DRIVE_UNKNOWN;
+        RootPathUStr = Basep8BitStringToStaticUnicodeString(lpRootPathName);
+        if (RootPathUStr == NULL)
+        {
+            return DRIVE_NO_ROOT_DIR;
+        }
+
+        RootPathU = RootPathUStr->Buffer;
+    }
+    else
+    {
+        RootPathU = NULL;
+    }
 
-    return GetDriveTypeW(RootPathNameW);
+    return GetDriveTypeW(RootPathU);
 }
 
 /*