ReactOS 0.4.15-dev-7953-g1f49173
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]));
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,
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}
unsigned char BOOLEAN
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
BOOL Verbose
Definition: chkdsk.c:72
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define MAX_PATH
Definition: compat.h:34
#define swprintf
Definition: precomp.h:40
@ Success
Definition: eventcreate.c:712
_Must_inspect_result_ _Inout_opt_ PUNICODE_STRING VolumeName
Definition: fltkernel.h:1117
return pInstance GetProvider() -> GetHandle()
Status
Definition: gdiplustypes.h:25
BOOL WINAPI GetVolumeNameForVolumeMountPointW(IN LPCWSTR VolumeMountPoint, OUT LPWSTR VolumeName, IN DWORD VolumeNameLength)
Definition: mntpoint.c:496
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)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define L(x)
Definition: ntvdm.h:50
#define DONE
Definition: rnr20lib.h:14
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:71
#define towupper(c)
Definition: wctype.h:99
uint32_t * PULONG
Definition: typedefs.h:59
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:458
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by ChkDskNow(), and wmain().