2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: File Management IFS Utility functions
4 * FILE: reactos/dll/win32/fmifs/format.c
5 * PURPOSE: Volume format
7 * PROGRAMMERS: Emanuele Aliberti
8 * Hervé Poussineau (hpoussin@reactos.org)
26 IN FMIFS_MEDIA_FLAG MediaFlag
,
29 IN BOOLEAN QuickFormat
,
31 IN PFMIFSCALLBACK Callback
)
33 PIFS_PROVIDER Provider
;
34 UNICODE_STRING usDriveRoot
;
35 UNICODE_STRING usLabel
;
36 BOOLEAN Argument
= FALSE
;
37 WCHAR VolumeName
[MAX_PATH
];
40 Provider
= GetProvider(Format
);
43 /* Unknown file system */
46 0, /* DWORD Modifier */
47 &Argument
); /* Argument */
52 DPRINT1("Warning: use GetVolumeNameForVolumeMountPointW() instead!\n");
53 swprintf(VolumeName
, L
"\\??\\%c:", towupper(DriveRoot
[0]));
54 RtlCreateUnicodeString(&usDriveRoot
, VolumeName
);
55 /* Code disabled as long as our storage stack doesn't understand IOCTL_MOUNTDEV_QUERY_DEVICE_NAME */
57 if (!GetVolumeNameForVolumeMountPointW(DriveRoot
, VolumeName
, MAX_PATH
)
58 || !RtlDosPathNameToNtPathName_U(VolumeName
, &usDriveRoot
, NULL
, &CurDir
))
60 /* Report an error. */
63 0, /* DWORD Modifier */
64 &Argument
); /* Argument */
69 RtlInitUnicodeString(&usLabel
, Label
);
71 DPRINT("FormatEx - %S\n", Format
);
79 RtlFreeUnicodeString(&usDriveRoot
);