ReactOS  0.4.15-dev-2091-gc14c9ca
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;
34  //CURDIR CurDir;
35 
37  if (!Provider)
38  {
39  /* Unknown file system */
40  Callback(DONE, 0, &Success);
41  return;
42  }
43 
44 #if 1
45  DPRINT1("Warning: use GetVolumeNameForVolumeMountPointW() instead!\n");
46  swprintf(VolumeName, L"\\??\\%c:", towupper(DriveRoot[0]));
47  RtlCreateUnicodeString(&usDriveRoot, VolumeName);
48  /* Code disabled as long as our storage stack doesn't understand IOCTL_MOUNTDEV_QUERY_DEVICE_NAME */
49 #else
51  !RtlDosPathNameToNtPathName_U(VolumeName, &usDriveRoot, NULL, &CurDir))
52  {
53  /* Report an error */
54  Callback(DONE, 0, &Success);
55  return;
56  }
57 #endif
58 
59  DPRINT("Chkdsk() - %S\n", Format);
61  Success = Provider->Chkdsk(&usDriveRoot,
62  Callback,
63  CorrectErrors,
64  Verbose,
65  CheckOnlyIfDirty,
66  ScanDrive,
67  NULL,
68  NULL,
69  NULL,
70  NULL,
71  (PULONG)&Status);
72  if (!Success)
73  DPRINT1("Chkdsk() failed with Status 0x%lx\n", Status);
74 
75  /* Report success */
76  Callback(DONE, 0, &Success);
77 
78  RtlFreeUnicodeString(&usDriveRoot);
79 }
BOOL Verbose
Definition: chkdsk.c:72
LONG NTSTATUS
Definition: precomp.h:26
#define swprintf
Definition: precomp.h:40
#define FALSE
Definition: types.h:117
unsigned char BOOLEAN
Status
Definition: gdiplustypes.h:24
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
static const WCHAR L[]
Definition: oid.c:1250
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:456
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
unsigned int * PULONG
Definition: retypes.h:1
#define NULL
Definition: types.h:112
#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 STATUS_SUCCESS
Definition: shellext.h:65
#define towupper(c)
Definition: wctype.h:99
BOOL WINAPI GetVolumeNameForVolumeMountPointW(IN LPCWSTR VolumeMountPoint, OUT LPWSTR VolumeName, IN DWORD VolumeNameLength)
Definition: mntpoint.c:496
#define DPRINT
Definition: sndvol32.h:71
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().