ReactOS 0.4.15-dev-8422-g6219a1a
chkdsk.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: File Management IFS Utility functions
4 * FILE: reactos/dll/win32/fmifs/chkdsk.c
5 * PURPOSE: Disk Checker
6 *
7 * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca@sfr.fr)
8 */
9
10#include "precomp.h"
11
12#define NDEBUG
13#include <debug.h>
14
15/* FMIFS.1 */
16VOID
19 IN PWCHAR DriveRoot,
21 IN BOOLEAN CorrectErrors,
23 IN BOOLEAN CheckOnlyIfDirty,
24 IN BOOLEAN ScanDrive,
25 IN PVOID Unused2,
26 IN PVOID Unused3,
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}
80
81/* EOF */
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
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: chkdsk.c:18
#define swprintf
Definition: precomp.h:40
@ Success
Definition: eventcreate.c:712
_Must_inspect_result_ _Inout_opt_ PUNICODE_STRING VolumeName
Definition: fltkernel.h:1117
BOOLEAN(NTAPI * PFMIFSCALLBACK)(IN CALLBACKCOMMAND Command, IN ULONG SubAction, IN PVOID ActionInfo)
Definition: fmifs.h:89
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:73
#define towupper(c)
Definition: wctype.h:99
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint16_t * PWCHAR
Definition: typedefs.h:56
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:458
__wchar_t WCHAR
Definition: xmlstorage.h:180