Fix the path translation in FormatEx (depends on unimplemented GetVolumeNameForVolumeMountPointW function).
Modified: trunk/reactos/lib/fmifs/fmifs.xml
Modified: trunk/reactos/lib/fmifs/format.c

Modified: trunk/reactos/lib/fmifs/fmifs.xml
--- trunk/reactos/lib/fmifs/fmifs.xml	2005-12-13 23:06:37 UTC (rev 20155)
+++ trunk/reactos/lib/fmifs/fmifs.xml	2005-12-13 23:10:34 UTC (rev 20156)
@@ -3,6 +3,7 @@
 	<include base="fmifs">.</include>
 	<define name="_DISABLE_TIDENTS" />
 	<define name="__USE_W32API" />
+	<define name="_WIN32_WINNT">0x0600</define>
 	<library>vfatlib</library>
 	<library>ntdll</library>
 	<library>kernel32</library>

Modified: trunk/reactos/lib/fmifs/format.c
--- trunk/reactos/lib/fmifs/format.c	2005-12-13 23:06:37 UTC (rev 20155)
+++ trunk/reactos/lib/fmifs/format.c	2005-12-13 23:10:34 UTC (rev 20156)
@@ -35,8 +35,28 @@
   UNICODE_STRING usDriveRoot;
   UNICODE_STRING usLabel;
   BOOLEAN Argument = FALSE;
+  WCHAR VolumeName[MAX_PATH];
+  CURDIR CurDir;
 
-  RtlInitUnicodeString(&usDriveRoot, DriveRoot);
+  if (_wcsnicmp(Format, L"FAT", 3) != 0)
+    {
+      /* Unknown file system */
+      Callback (DONE,        /* Command */
+		0,           /* DWORD Modifier */
+		&Argument);  /* Argument */
+    }
+
+  if (!GetVolumeNameForVolumeMountPointW(DriveRoot, VolumeName, MAX_PATH) ||
+      !RtlDosPathNameToNtPathName_U(VolumeName, &usDriveRoot, NULL, &CurDir))
+    {
+      /* Report an error. */
+      Callback (DONE,        /* Command */
+		0,           /* DWORD Modifier */
+		&Argument);  /* Argument */
+
+      return;
+    }
+
   RtlInitUnicodeString(&usLabel, Label);
 
   if (_wcsnicmp(Format, L"FAT", 3) == 0)
@@ -51,14 +71,8 @@
 		  ClusterSize,
 		  Callback);
       VfatCleanup ();
+      RtlFreeUnicodeString(&usDriveRoot);
     }
-  else
-    {
-      /* Unknown file system */
-      Callback (DONE,        /* Command */
-		0,           /* DWORD Modifier */
-		&Argument);  /* Argument */
-    }
 }
 
 /* EOF */