ReactOS  0.4.14-dev-317-g96040ec
chkdsk.c File Reference
#include "precomp.h"
#include <debug.h>
Include dependency graph for chkdsk.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID NTAPI Chkdsk (IN PWCHAR DriveRoot, IN PWCHAR Format, IN BOOLEAN CorrectErrors, IN BOOLEAN Verbose, IN BOOLEAN CheckOnlyIfDirty, IN BOOLEAN ScanDrive, IN PVOID Unused2, IN PVOID Unused3, IN PFMIFSCALLBACK Callback)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file chkdsk.c.

Function Documentation

◆ Chkdsk()

VOID NTAPI Chkdsk ( IN PWCHAR  DriveRoot,
IN PWCHAR  Format,
IN BOOLEAN  CorrectErrors,
IN BOOLEAN  Verbose,
IN BOOLEAN  CheckOnlyIfDirty,
IN BOOLEAN  ScanDrive,
IN PVOID  Unused2,
IN PVOID  Unused3,
IN PFMIFSCALLBACK  Callback 
)

Definition at line 18 of file chkdsk.c.

28 {
30  UNICODE_STRING usDriveRoot;
31  BOOLEAN Argument = FALSE;
33  //CURDIR CurDir;
34 
36  if (!Provider)
37  {
38  /* Unknown file system */
39  Callback(DONE, 0, &Argument);
40  return;
41  }
42 
43 #if 1
44  DPRINT1("Warning: use GetVolumeNameForVolumeMountPointW() instead!\n");
45  swprintf(VolumeName, L"\\??\\%c:", towupper(DriveRoot[0]));
46  RtlCreateUnicodeString(&usDriveRoot, VolumeName);
47  /* Code disabled as long as our storage stack doesn't understand IOCTL_MOUNTDEV_QUERY_DEVICE_NAME */
48 #else
50  !RtlDosPathNameToNtPathName_U(VolumeName, &usDriveRoot, NULL, &CurDir))
51  {
52  /* Report an error. */
53  Callback(DONE, 0, &Argument);
54  return;
55  }
56 #endif
57 
58  DPRINT("ChkdskEx - %S\n", Format);
59  Provider->ChkdskEx(&usDriveRoot,
60  CorrectErrors,
61  Verbose,
62  CheckOnlyIfDirty,
63  ScanDrive,
64  Callback);
65 
66  RtlFreeUnicodeString(&usDriveRoot);
67 }
BOOL Verbose
Definition: chkdsk.c:72
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
#define swprintf(buf, format,...)
Definition: sprintf.c:56
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
#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 ChkDskNow(), and wmain().