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
)
33 IN FMIFS_MEDIA_FLAG MediaFlag
,
36 IN BOOLEAN QuickFormat
,
38 IN PFMIFSCALLBACK Callback
)
40 PIFS_PROVIDER Provider
;
41 UNICODE_STRING usDriveRoot
;
42 UNICODE_STRING usLabel
;
43 BOOLEAN Argument
= FALSE
;
44 WCHAR VolumeName
[MAX_PATH
];
47 Provider
= GetProvider(Format
);
50 /* Unknown file system */
51 Callback(DONE
, /* Command */
52 0, /* DWORD Modifier */
53 &Argument
); /* Argument */
58 DPRINT1("Warning: use GetVolumeNameForVolumeMountPointW() instead!\n");
59 swprintf(VolumeName
, L
"\\??\\%c:", towupper(DriveRoot
[0]));
60 RtlCreateUnicodeString(&usDriveRoot
, VolumeName
);
61 /* Code disabled as long as our storage stack doesn't understand IOCTL_MOUNTDEV_QUERY_DEVICE_NAME */
63 if (!GetVolumeNameForVolumeMountPointW(DriveRoot
, VolumeName
, MAX_PATH
) ||
64 !RtlDosPathNameToNtPathName_U(VolumeName
, &usDriveRoot
, NULL
, &CurDir
))
66 /* Report an error. */
67 Callback(DONE
, /* Command */
68 0, /* DWORD Modifier */
69 &Argument
); /* Argument */
74 RtlInitUnicodeString(&usLabel
, Label
);
76 DPRINT("FormatEx - %S\n", Format
);
77 Provider
->FormatEx(&usDriveRoot
,
84 RtlFreeUnicodeString(&usDriveRoot
);