ReactOS  0.4.14-dev-77-gd9e7c48
format.c File Reference
#include "precomp.h"
#include <debug.h>
Include dependency graph for format.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID NTAPI Format (IN PWCHAR DriveRoot, IN FMIFS_MEDIA_FLAG MediaFlag, IN PWCHAR Format, IN PWCHAR Label, IN BOOLEAN QuickFormat, IN PFMIFSCALLBACK Callback)
 
VOID NTAPI FormatEx (IN PWCHAR DriveRoot, IN FMIFS_MEDIA_FLAG MediaFlag, IN PWCHAR Format, IN PWCHAR Label, IN BOOLEAN QuickFormat, IN ULONG ClusterSize, IN PFMIFSCALLBACK Callback)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file format.c.

Function Documentation

◆ Format()

VOID NTAPI Format ( IN PWCHAR  DriveRoot,
IN FMIFS_MEDIA_FLAG  MediaFlag,
IN PWCHAR  Format,
IN PWCHAR  Label,
IN BOOLEAN  QuickFormat,
IN PFMIFSCALLBACK  Callback 
)

Definition at line 18 of file format.c.

25 {
26  FormatEx(DriveRoot,
27  MediaFlag,
28  Format,
29  Label,
31  0,
32  Callback);
33 }
BOOL QuickFormat
Definition: format.c:66
VOID NTAPI FormatEx(IN PWCHAR DriveRoot, IN FMIFS_MEDIA_FLAG MediaFlag, IN PWCHAR Format, IN PWCHAR Label, IN BOOLEAN QuickFormat, IN ULONG ClusterSize, IN PFMIFSCALLBACK Callback)
Definition: format.c:38
PWCHAR Label
Definition: format.c:70
LPFNPSPCALLBACK Callback
Definition: desk.c:111

◆ FormatEx()

VOID NTAPI FormatEx ( IN PWCHAR  DriveRoot,
IN FMIFS_MEDIA_FLAG  MediaFlag,
IN PWCHAR  Format,
IN PWCHAR  Label,
IN BOOLEAN  QuickFormat,
IN ULONG  ClusterSize,
IN PFMIFSCALLBACK  Callback 
)

Definition at line 38 of file format.c.

46 {
48  UNICODE_STRING usDriveRoot;
49  UNICODE_STRING usLabel;
50  BOOLEAN Argument = FALSE;
52  //CURDIR CurDir;
53 
55  if (!Provider)
56  {
57  /* Unknown file system */
58  Callback(DONE, 0, &Argument);
59  return;
60  }
61 
62 #if 1
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 */
67 #else
69  !RtlDosPathNameToNtPathName_U(VolumeName, &usDriveRoot, NULL, &CurDir))
70  {
71  /* Report an error. */
72  Callback(DONE, 0, &Argument);
73  return;
74  }
75 #endif
76 
77  RtlInitUnicodeString(&usLabel, Label);
78 
79  DPRINT("FormatEx - %S\n", Format);
80  Provider->FormatEx(&usDriveRoot,
81  MediaFlag,
82  &usLabel,
85  Callback);
86 
87  RtlFreeUnicodeString(&usDriveRoot);
88 }
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
BOOL QuickFormat
Definition: format.c:66
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
#define swprintf(buf, format,...)
Definition: sprintf.c:56
DWORD ClusterSize
Definition: format.c:67
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
static const WCHAR L[]
Definition: oid.c:1250
#define DPRINT1
Definition: precomp.h:8
_Must_inspect_result_ _Inout_opt_ PUNICODE_STRING VolumeName
Definition: fltkernel.h:1117
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
PWCHAR Label
Definition: format.c:70
#define DONE
Definition: rnr20lib.h:14
#define towupper(c)
Definition: wctype.h:99
BOOL WINAPI GetVolumeNameForVolumeMountPointW(IN LPCWSTR VolumeMountPoint, OUT LPWSTR VolumeName, IN DWORD VolumeNameLength)
Definition: mntpoint.c:496
LPFNPSPCALLBACK Callback
Definition: desk.c:111
NTSYSAPI BOOLEAN NTAPI RtlDosPathNameToNtPathName_U(_In_opt_z_ PCWSTR DosPathName, _Out_ PUNICODE_STRING NtPathName, _Out_opt_ PCWSTR *NtFileNamePart, _Out_opt_ PRTL_RELATIVE_NAME_U DirectoryInfo)
PIFS_PROVIDER GetProvider(IN PWCHAR FileSystem)
Definition: init.c:23

Referenced by Format(), FormatDrive(), and wmain().