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)
20 IN FMIFS_MEDIA_FLAG MediaFlag
,
23 IN BOOLEAN QuickFormat
,
24 IN PFMIFSCALLBACK Callback
)
40 IN FMIFS_MEDIA_FLAG MediaFlag
,
43 IN BOOLEAN QuickFormat
,
45 IN PFMIFSCALLBACK Callback
)
47 PIFS_PROVIDER Provider
;
48 UNICODE_STRING usDriveRoot
;
49 UNICODE_STRING usLabel
;
50 BOOLEAN Argument
= FALSE
;
51 WCHAR VolumeName
[MAX_PATH
];
54 Provider
= GetProvider(Format
);
57 /* Unknown file system */
58 Callback(DONE
, 0, &Argument
);
63 DPRINT1("Warning: use GetVolumeNameForVolumeMountPointW() instead!\n");
64 swprintf(VolumeName
, L
"\\??\\%c:", towupper(DriveRoot
[0]));
65 RtlCreateUnicodeString(&usDriveRoot
, VolumeName
);
66 /* Code disabled as long as our storage stack doesn't understand IOCTL_MOUNTDEV_QUERY_DEVICE_NAME */
68 if (!GetVolumeNameForVolumeMountPointW(DriveRoot
, VolumeName
, MAX_PATH
) ||
69 !RtlDosPathNameToNtPathName_U(VolumeName
, &usDriveRoot
, NULL
, &CurDir
))
71 /* Report an error. */
72 Callback(DONE
, 0, &Argument
);
77 RtlInitUnicodeString(&usLabel
, Label
);
79 DPRINT("FormatEx - %S\n", Format
);
80 Provider
->FormatEx(&usDriveRoot
,
87 RtlFreeUnicodeString(&usDriveRoot
);