[ros-diffs] [navaraf] 20156: Fix the path translation in FormatEx
(depends on unimplemented GetVolumeNameForVolumeMountPointW
function).
navaraf at svn.reactos.com
navaraf at svn.reactos.com
Wed Dec 14 00:10:45 CET 2005
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 */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20051214/1956a10e/attachment.html
More information about the Ros-diffs
mailing list