ReactOS  0.4.15-dev-439-g292f67a
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 */
16 VOID
17 NTAPI
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;
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 }
68 
69 /* EOF */
#define IN
Definition: typedefs.h:39
BOOL Verbose
Definition: chkdsk.c:72
uint16_t * PWCHAR
Definition: typedefs.h:55
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
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
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
BOOLEAN(NTAPI * PFMIFSCALLBACK)(IN CALLBACKCOMMAND Command, IN ULONG SubAction, IN PVOID ActionInfo)
Definition: fmifs.h:89
#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:112
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