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)
28 IN FMIFS_MEDIA_FLAG MediaFlag
,
31 IN BOOLEAN QuickFormat
,
33 IN PFMIFSCALLBACK Callback
)
35 PIFS_PROVIDER Provider
;
36 UNICODE_STRING usDriveRoot
;
37 UNICODE_STRING usLabel
;
38 BOOLEAN Argument
= FALSE
;
39 WCHAR VolumeName
[MAX_PATH
];
42 Provider
= GetProvider(Format
);
45 /* Unknown file system */
46 Callback(DONE
, /* Command */
47 0, /* DWORD Modifier */
48 &Argument
); /* Argument */
53 DPRINT1("Warning: use GetVolumeNameForVolumeMountPointW() instead!\n");
54 swprintf(VolumeName
, L
"\\??\\%c:", towupper(DriveRoot
[0]));
55 RtlCreateUnicodeString(&usDriveRoot
, VolumeName
);
56 /* Code disabled as long as our storage stack doesn't understand IOCTL_MOUNTDEV_QUERY_DEVICE_NAME */
58 if (!GetVolumeNameForVolumeMountPointW(DriveRoot
, VolumeName
, MAX_PATH
) ||
59 !RtlDosPathNameToNtPathName_U(VolumeName
, &usDriveRoot
, NULL
, &CurDir
))
61 /* Report an error. */
62 Callback(DONE
, /* Command */
63 0, /* DWORD Modifier */
64 &Argument
); /* Argument */
69 RtlInitUnicodeString(&usLabel
, Label
);
71 DPRINT("FormatEx - %S\n", Format
);
72 Provider
->FormatEx(&usDriveRoot
,
79 RtlFreeUnicodeString(&usDriveRoot
);