https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8d3e80e43725828f00533…
commit 8d3e80e43725828f0053347536f1df28ad089b7f
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Nov 22 05:35:37 2020 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Nov 22 21:57:07 2020 +0100
[FSLIB][FMIFS][AUTOCHK][SETUPLIB] Use more Windows-compatible (but not fully
compatible yet) Format() and Chkdsk() ULIB functions.
[AUTOCHK] Add also support for scanning FATX volumes.
The Format(), FormatEx(), Chkdsk(), ChkdskEx() functions exposed by the
U*.DLL user-mode FS library dlls are different (and have different
prototypes) than the similarly-named functions exported by FMIFS.DLL .
In particular, what we used to call "xxxChkdskEx()" and
"xxxFormatEx()"
in our U*.DLL libraries actually correspond more, from their arguments,
to the "Chkdsk()" and "Format()" functions in Windows' U*.DLL
. Their
*Ex() counterparts instead take most of the parameters through a
structure passed by pointer.
On FMIFS.DLL side, while FMIFS!Chkdsk() calls U*.DLL!Chkdsk() and
FMIFS!ChkdskEx() calls U*.DLL!ChkdskEx() (and we do not implement these
*Ex() functions at the moment), both FMIFS!Format() and FMIFS!FormatEx()
call U*.DLL!Format() instead, while FMIFS!FormatEx2() calls
U*.DLL!FormatEx() (that we do not implement yet either) !!
To improve that, refactor the calls to these U*.DLL functions so as to
respect the more compatible prototypes: They contain the correct number
of parameters in a compatible order. However, some of the parameters do
not have the same types yet: the strings are kept here in PUNICODE_STRINGS,
while on Windows they are passed via an undocumented DSTRING struct, and
the FMIFS callback is instead a MESSAGE struct/class on Windows.
Finally, the MEDIA_TYPE parameter in U*.DLL!Format() is equivalent, yet
not fully 100% in 1-to-1 correspondence, with the FMIFS_MEDIA_FLAG used
in the corresponding FMIFS.DLL functions.
One thing to notice is that the U*.DLL!Format() (and the Ex) functions
support a BOOLEAN (a flag resp.) for telling that a backwards-compatible
FS version should be used instead of the (default) latest FS version.
This is used e.g. by the FAT FS, where by default FAT32 is selected
(depending also on other constraints like, the disk and the partition
sizes), unless that bit is set in which case, FAT16 (or 12) is used.
---
base/setup/lib/fsutil.c | 90 +++++++++++++++++++++-------
base/setup/lib/fsutil.h | 2 +-
base/setup/usetup/format.c | 15 +++--
base/system/autochk/CMakeLists.txt | 2 +-
base/system/autochk/autochk.c | 55 ++++++++++-------
dll/win32/fmifs/chkdsk.c | 36 +++++++----
dll/win32/fmifs/format.c | 62 +++++++++++++++----
dll/win32/fmifs/init.c | 8 ++-
dll/win32/fmifs/precomp.h | 6 +-
dll/win32/ubtrfs/ubtrfs.spec | 4 +-
dll/win32/ucdfs/ucdfs.spec | 4 +-
dll/win32/uext2/uext2.spec | 4 +-
dll/win32/ufat/ufat.spec | 4 +-
dll/win32/ufatx/ufatx.spec | 4 +-
dll/win32/uffs/uffs.spec | 4 +-
dll/win32/untfs/untfs.spec | 4 +-
dll/win32/ureiserfs/ureiserfs.spec | 4 +-
sdk/include/reactos/libs/fmifs/fmifs.h | 37 ++++++++----
sdk/include/reactos/libs/fslib/btrfslib.h | 43 +++++++------
sdk/include/reactos/libs/fslib/cdfslib.h | 39 +++++++-----
sdk/include/reactos/libs/fslib/ext2lib.h | 39 +++++++-----
sdk/include/reactos/libs/fslib/ffslib.h | 39 +++++++-----
sdk/include/reactos/libs/fslib/ntfslib.h | 39 +++++++-----
sdk/include/reactos/libs/fslib/reiserfslib.h | 39 +++++++-----
sdk/include/reactos/libs/fslib/vfatlib.h | 39 +++++++-----
sdk/include/reactos/libs/fslib/vfatxlib.h | 35 ++++++++---
sdk/lib/fslib/btrfslib/btrfslib.c | 70 ++++++++++++++++++----
sdk/lib/fslib/cdfslib/cdfslib.c | 43 ++++++++-----
sdk/lib/fslib/ext2lib/Mke2fs.c | 56 +++++++++--------
sdk/lib/fslib/ffslib/ffslib.c | 49 +++++++++------
sdk/lib/fslib/ffslib/ffslib.h | 8 ---
sdk/lib/fslib/ntfslib/ntfslib.c | 49 +++++++++------
sdk/lib/fslib/ntfslib/ntfslib.h | 8 ---
sdk/lib/fslib/reiserfslib/reiserfslib.c | 49 +++++++++------
sdk/lib/fslib/reiserfslib/reiserfslib.h | 8 ---
sdk/lib/fslib/vfatlib/vfatlib.c | 84 +++++++++++++++-----------
sdk/lib/fslib/vfatxlib/vfatxlib.c | 73 ++++++++++++----------
37 files changed, 741 insertions(+), 413 deletions(-)
diff --git a/base/setup/lib/fsutil.c b/base/setup/lib/fsutil.c
index fec1aa7283a..3d49be888d7 100644
--- a/base/setup/lib/fsutil.c
+++ b/base/setup/lib/fsutil.c
@@ -1,7 +1,7 @@
/*
* PROJECT: ReactOS Setup Library
* LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+)
- * PURPOSE: Filesystem support functions
+ * PURPOSE: Filesystem Format and ChkDsk support functions.
* COPYRIGHT: Copyright 2003-2019 Casper S. Hornstrup (chorns(a)users.sourceforge.net)
* Copyright 2017-2020 Hermes Belusca-Maito
*/
@@ -122,8 +122,8 @@ C_ASSERT(sizeof(BTRFS_BOOTSECTOR) == BTRFS_BOOTSECTOR_SIZE);
typedef struct _FILE_SYSTEM
{
PCWSTR FileSystemName;
- FORMATEX FormatFunc;
- CHKDSKEX ChkdskFunc;
+ PULIB_FORMAT FormatFunc;
+ PULIB_CHKDSK ChkdskFunc;
} FILE_SYSTEM, *PFILE_SYSTEM;
/* The list of file systems on which we can install ReactOS */
@@ -137,7 +137,7 @@ static FILE_SYSTEM RegisteredFileSystems[] =
{ L"FATX" , VfatxFormat, VfatxChkdsk },
{ L"NTFS" , NtfsFormat, NtfsChkdsk },
#endif
- { L"BTRFS", BtrfsFormatEx, BtrfsChkdskEx },
+ { L"BTRFS", BtrfsFormat, BtrfsChkdsk },
#if 0
{ L"EXT2" , Ext2Format, Ext2Chkdsk },
{ L"EXT3" , Ext2Format, Ext2Chkdsk },
@@ -224,22 +224,36 @@ ChkdskFileSystem_UStr(
IN PFMIFSCALLBACK Callback)
{
PFILE_SYSTEM FileSystem;
+ NTSTATUS Status;
+ BOOLEAN Success;
FileSystem = GetFileSystemByName(FileSystemName);
if (!FileSystem || !FileSystem->ChkdskFunc)
{
- // BOOLEAN Argument = FALSE;
- // Callback(DONE, 0, &Argument);
+ // Success = FALSE;
+ // Callback(DONE, 0, &Success);
return STATUS_NOT_SUPPORTED;
}
- return FileSystem->ChkdskFunc(DriveRoot,
- FixErrors,
- Verbose,
- CheckOnlyIfDirty,
- ScanDrive,
- Callback);
+ Status = STATUS_SUCCESS;
+ Success = FileSystem->ChkdskFunc(DriveRoot,
+ Callback,
+ FixErrors,
+ Verbose,
+ CheckOnlyIfDirty,
+ ScanDrive,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ (PULONG)&Status);
+ if (!Success)
+ DPRINT1("ChkdskFunc() failed with Status 0x%lx\n", Status);
+
+ // Callback(DONE, 0, &Success);
+
+ return Status;
}
NTSTATUS
@@ -277,22 +291,58 @@ FormatFileSystem_UStr(
IN PFMIFSCALLBACK Callback)
{
PFILE_SYSTEM FileSystem;
+ BOOLEAN Success;
+ BOOLEAN BackwardCompatible = FALSE; // Default to latest FS versions.
+ MEDIA_TYPE MediaType;
FileSystem = GetFileSystemByName(FileSystemName);
if (!FileSystem || !FileSystem->FormatFunc)
{
- // BOOLEAN Argument = FALSE;
- // Callback(DONE, 0, &Argument);
+ // Success = FALSE;
+ // Callback(DONE, 0, &Success);
return STATUS_NOT_SUPPORTED;
}
- return FileSystem->FormatFunc(DriveRoot,
- MediaFlag,
- Label,
- QuickFormat,
- ClusterSize,
- Callback);
+ /* Set the BackwardCompatible flag in case we format with older FAT12/16 */
+ if (wcsicmp(FileSystemName, L"FAT") == 0)
+ BackwardCompatible = TRUE;
+ // else if (wcsicmp(FileSystemName, L"FAT32") == 0)
+ // BackwardCompatible = FALSE;
+
+ /* Convert the FMIFS MediaFlag to a NT MediaType */
+ // FIXME: Actually covert all the possible flags.
+ switch (MediaFlag)
+ {
+ case FMIFS_FLOPPY:
+ MediaType = F5_320_1024; // FIXME: This is hardfixed!
+ break;
+ case FMIFS_REMOVABLE:
+ MediaType = RemovableMedia;
+ break;
+ case FMIFS_HARDDISK:
+ MediaType = FixedMedia;
+ break;
+ default:
+ DPRINT1("Unknown FMIFS MediaFlag %d, converting 1-to-1 to NT
MediaType\n",
+ MediaFlag);
+ MediaType = (MEDIA_TYPE)MediaFlag;
+ break;
+ }
+
+ Success = FileSystem->FormatFunc(DriveRoot,
+ Callback,
+ QuickFormat,
+ BackwardCompatible,
+ MediaType,
+ Label,
+ ClusterSize);
+ if (!Success)
+ DPRINT1("FormatFunc() failed\n");
+
+ // Callback(DONE, 0, &Success);
+
+ return (Success ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL);
}
NTSTATUS
diff --git a/base/setup/lib/fsutil.h b/base/setup/lib/fsutil.h
index ef5e6a3ccd8..7696be6dec8 100644
--- a/base/setup/lib/fsutil.h
+++ b/base/setup/lib/fsutil.h
@@ -1,7 +1,7 @@
/*
* PROJECT: ReactOS Setup Library
* LICENSE: GPL-2.0+ (
https://spdx.org/licenses/GPL-2.0+)
- * PURPOSE: Filesystem support functions
+ * PURPOSE: Filesystem Format and ChkDsk support functions.
* COPYRIGHT: Copyright 2003-2019 Casper S. Hornstrup (chorns(a)users.sourceforge.net)
* Copyright 2017-2020 Hermes Belusca-Maito
*/
diff --git a/base/setup/usetup/format.c b/base/setup/usetup/format.c
index 08e029ce543..4abb464ba3e 100644
--- a/base/setup/usetup/format.c
+++ b/base/setup/usetup/format.c
@@ -55,24 +55,27 @@ FormatCallback(
break;
}
- /*case OUTPUT:
+#if 0
+ case OUTPUT:
{
PTEXTOUTPUT Output;
output = (PTEXTOUTPUT) Argument;
DPRINT("%s\n", output->Output);
break;
- }*/
+ }
+#endif
case DONE:
{
- /*PBOOLEAN Success;*/
+ // PBOOLEAN Success;
DPRINT("Done\n");
-
- /*Success = (PBOOLEAN)Argument;
+#if 0
+ Success = (PBOOLEAN)Argument;
if (*Success == FALSE)
{
DPRINT("FormatEx was unable to complete successfully.\n\n");
- }*/
+ }
+#endif
break;
}
diff --git a/base/system/autochk/CMakeLists.txt b/base/system/autochk/CMakeLists.txt
index e7a9fb1f388..d2c03339285 100644
--- a/base/system/autochk/CMakeLists.txt
+++ b/base/system/autochk/CMakeLists.txt
@@ -1,6 +1,6 @@
add_executable(autochk WIN32 autochk.c autochk.rc)
set_module_type(autochk nativecui)
-target_link_libraries(autochk nt ext2lib vfatlib ntfslib cdfslib ffslib reiserfslib
btrfslib)
+target_link_libraries(autochk nt vfatlib vfatxlib ntfslib btrfslib ext2lib ffslib
reiserfslib cdfslib)
add_importlibs(autochk ntdll)
add_cd_file(TARGET autochk DESTINATION reactos/system32 FOR all)
diff --git a/base/system/autochk/autochk.c b/base/system/autochk/autochk.c
index 72b010f8d85..33d3593d776 100644
--- a/base/system/autochk/autochk.c
+++ b/base/system/autochk/autochk.c
@@ -27,11 +27,12 @@
#include <fmifs/fmifs.h>
#include <fslib/vfatlib.h>
+#include <fslib/vfatxlib.h>
#include <fslib/ntfslib.h>
-#include <fslib/ext2lib.h>
#include <fslib/btrfslib.h>
-#include <fslib/reiserfslib.h>
+#include <fslib/ext2lib.h>
#include <fslib/ffslib.h>
+#include <fslib/reiserfslib.h>
#include <fslib/cdfslib.h>
#define NDEBUG
@@ -42,20 +43,21 @@
typedef struct _FILESYSTEM_CHKDSK
{
WCHAR Name[10];
- CHKDSKEX ChkdskFunc;
+ PULIB_CHKDSK ChkdskFunc;
} FILESYSTEM_CHKDSK, *PFILESYSTEM_CHKDSK;
-FILESYSTEM_CHKDSK FileSystems[10] =
+FILESYSTEM_CHKDSK FileSystems[] =
{
{ L"FAT", VfatChkdsk },
{ L"FAT32", VfatChkdsk },
+ { L"FATX" , VfatxChkdsk },
{ L"NTFS", NtfsChkdsk },
+ { L"BTRFS", BtrfsChkdsk },
{ L"EXT2", Ext2Chkdsk },
{ L"EXT3", Ext2Chkdsk },
{ L"EXT4", Ext2Chkdsk },
- { L"Btrfs", BtrfsChkdskEx },
- { L"RFSD", ReiserfsChkdsk },
{ L"FFS", FfsChkdsk },
+ { L"RFSD", ReiserfsChkdsk },
{ L"CDFS", CdfsChkdsk },
};
@@ -379,7 +381,7 @@ ChkdskCallback(
case DONE:
Status = (PBOOLEAN)Argument;
- if (*Status != FALSE)
+ if (*Status == FALSE)
{
PrintString("The file system check was unable to complete
successfully.\r\n\r\n");
// Error = TRUE;
@@ -396,6 +398,7 @@ CheckVolume(
IN BOOLEAN CheckOnlyIfDirty)
{
NTSTATUS Status;
+ BOOLEAN Success;
PCWSTR DisplayName;
UNICODE_STRING VolumePathU;
ULONG Count;
@@ -450,15 +453,21 @@ CheckVolume(
}
/* Check whether the volume is dirty */
- Status = FileSystems[Count].ChkdskFunc(&VolumePathU,
- FALSE, // FixErrors
- TRUE, // Verbose
- TRUE, // CheckOnlyIfDirty
- FALSE, // ScanDrive
- ChkdskCallback);
+ Status = STATUS_SUCCESS;
+ Success = FileSystems[Count].ChkdskFunc(&VolumePathU,
+ ChkdskCallback,
+ FALSE, // FixErrors
+ TRUE, // Verbose
+ TRUE, // CheckOnlyIfDirty
+ FALSE, // ScanDrive
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ (PULONG)&Status);
/* Perform the check either when the volume is dirty or a check is forced */
- if ((Status == STATUS_DISK_CORRUPT_ERROR) || !CheckOnlyIfDirty)
+ if (Success && ((Status == STATUS_DISK_CORRUPT_ERROR) || !CheckOnlyIfDirty))
{
/* Let the user decide whether to repair */
if (Status == STATUS_DISK_CORRUPT_ERROR)
@@ -474,12 +483,18 @@ CheckVolume(
if (!KeyboardHandle || WaitForKeyboard(KeyboardHandle, TimeOut) ==
STATUS_TIMEOUT)
{
PrintString("The system will now check the file system.\r\n\r\n");
- Status = FileSystems[Count].ChkdskFunc(&VolumePathU,
- TRUE, // FixErrors
- TRUE, // Verbose
- CheckOnlyIfDirty,
- FALSE, // ScanDrive
- ChkdskCallback);
+ Status = STATUS_SUCCESS;
+ Success = FileSystems[Count].ChkdskFunc(&VolumePathU,
+ ChkdskCallback,
+ TRUE, // FixErrors
+ TRUE, // Verbose
+ CheckOnlyIfDirty,
+ FALSE, // ScanDrive
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ (PULONG)&Status);
}
else
{
diff --git a/dll/win32/fmifs/chkdsk.c b/dll/win32/fmifs/chkdsk.c
index ba6839ff181..c3be682eeea 100644
--- a/dll/win32/fmifs/chkdsk.c
+++ b/dll/win32/fmifs/chkdsk.c
@@ -28,7 +28,8 @@ Chkdsk(
{
PIFS_PROVIDER Provider;
UNICODE_STRING usDriveRoot;
- BOOLEAN Argument = FALSE;
+ NTSTATUS Status;
+ BOOLEAN Success = FALSE;
WCHAR VolumeName[MAX_PATH];
//CURDIR CurDir;
@@ -36,7 +37,7 @@ Chkdsk(
if (!Provider)
{
/* Unknown file system */
- Callback(DONE, 0, &Argument);
+ Callback(DONE, 0, &Success);
return;
}
@@ -46,22 +47,33 @@ Chkdsk(
RtlCreateUnicodeString(&usDriveRoot, VolumeName);
/* Code disabled as long as our storage stack doesn't understand
IOCTL_MOUNTDEV_QUERY_DEVICE_NAME */
#else
- if (!GetVolumeNameForVolumeMountPointW(DriveRoot, VolumeName, MAX_PATH) ||
+ if (!GetVolumeNameForVolumeMountPointW(DriveRoot, VolumeName,
RTL_NUMBER_OF(VolumeName)) ||
!RtlDosPathNameToNtPathName_U(VolumeName, &usDriveRoot, NULL, &CurDir))
{
- /* Report an error. */
- Callback(DONE, 0, &Argument);
+ /* Report an error */
+ Callback(DONE, 0, &Success);
return;
}
#endif
- DPRINT("ChkdskEx - %S\n", Format);
- Provider->ChkdskEx(&usDriveRoot,
- CorrectErrors,
- Verbose,
- CheckOnlyIfDirty,
- ScanDrive,
- Callback);
+ DPRINT("Chkdsk() - %S\n", Format);
+ Status = STATUS_SUCCESS;
+ Success = Provider->Chkdsk(&usDriveRoot,
+ Callback,
+ CorrectErrors,
+ Verbose,
+ CheckOnlyIfDirty,
+ ScanDrive,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ (PULONG)&Status);
+ if (!Success)
+ DPRINT1("Chkdsk() failed with Status 0x%lx\n", Status);
+
+ /* Report success */
+ Callback(DONE, 0, &Success);
RtlFreeUnicodeString(&usDriveRoot);
}
diff --git a/dll/win32/fmifs/format.c b/dll/win32/fmifs/format.c
index 266002e08a3..82fa203b1e4 100644
--- a/dll/win32/fmifs/format.c
+++ b/dll/win32/fmifs/format.c
@@ -47,15 +47,21 @@ FormatEx(
PIFS_PROVIDER Provider;
UNICODE_STRING usDriveRoot;
UNICODE_STRING usLabel;
- BOOLEAN Argument = FALSE;
+ BOOLEAN Success = FALSE;
+ BOOLEAN BackwardCompatible = FALSE; // Default to latest FS versions.
+ MEDIA_TYPE MediaType;
WCHAR VolumeName[MAX_PATH];
//CURDIR CurDir;
+//
+// TODO: Convert filesystem Format into ULIB format string.
+//
+
Provider = GetProvider(Format);
if (!Provider)
{
/* Unknown file system */
- Callback(DONE, 0, &Argument);
+ Callback(DONE, 0, &Success);
return;
}
@@ -65,24 +71,56 @@ FormatEx(
RtlCreateUnicodeString(&usDriveRoot, VolumeName);
/* Code disabled as long as our storage stack doesn't understand
IOCTL_MOUNTDEV_QUERY_DEVICE_NAME */
#else
- if (!GetVolumeNameForVolumeMountPointW(DriveRoot, VolumeName, MAX_PATH) ||
+ if (!GetVolumeNameForVolumeMountPointW(DriveRoot, VolumeName,
RTL_NUMBER_OF(VolumeName)) ||
!RtlDosPathNameToNtPathName_U(VolumeName, &usDriveRoot, NULL, &CurDir))
{
- /* Report an error. */
- Callback(DONE, 0, &Argument);
+ /* Report an error */
+ Callback(DONE, 0, &Success);
return;
}
#endif
RtlInitUnicodeString(&usLabel, Label);
- DPRINT("FormatEx - %S\n", Format);
- Provider->FormatEx(&usDriveRoot,
- MediaFlag,
- &usLabel,
- QuickFormat,
- ClusterSize,
- Callback);
+ /* Set the BackwardCompatible flag in case we format with older FAT12/16 */
+ if (wcsicmp(Format, L"FAT") == 0)
+ BackwardCompatible = TRUE;
+ // else if (wcsicmp(Format, L"FAT32") == 0)
+ // BackwardCompatible = FALSE;
+
+ /* Convert the FMIFS MediaFlag to a NT MediaType */
+ // FIXME: Actually covert all the possible flags.
+ switch (MediaFlag)
+ {
+ case FMIFS_FLOPPY:
+ MediaType = F5_320_1024; // FIXME: This is hardfixed!
+ break;
+ case FMIFS_REMOVABLE:
+ MediaType = RemovableMedia;
+ break;
+ case FMIFS_HARDDISK:
+ MediaType = FixedMedia;
+ break;
+ default:
+ DPRINT1("Unknown FMIFS MediaFlag %d, converting 1-to-1 to NT
MediaType\n",
+ MediaFlag);
+ MediaType = (MEDIA_TYPE)MediaFlag;
+ break;
+ }
+
+ DPRINT("Format() - %S\n", Format);
+ Success = Provider->Format(&usDriveRoot,
+ Callback,
+ QuickFormat,
+ BackwardCompatible,
+ MediaType,
+ &usLabel,
+ ClusterSize);
+ if (!Success)
+ DPRINT1("Format() failed\n");
+
+ /* Report success */
+ Callback(DONE, 0, &Success);
RtlFreeUnicodeString(&usDriveRoot);
}
diff --git a/dll/win32/fmifs/init.c b/dll/win32/fmifs/init.c
index e895f5ef9ca..b03e83a6775 100644
--- a/dll/win32/fmifs/init.c
+++ b/dll/win32/fmifs/init.c
@@ -66,9 +66,11 @@ AddProvider(
RtlZeroMemory(Provider, RequiredSize);
/* Get function pointers */
- Provider->ChkdskEx = (CHKDSKEX)GetProcAddress(hMod, "ChkdskEx");
- //Provider->Extend = (EXTEND)GetProcAddress(hMod, "Extend");
- Provider->FormatEx = (FORMATEX)GetProcAddress(hMod, "FormatEx");
+ Provider->Chkdsk = (PULIB_CHKDSK)GetProcAddress(hMod, "Chkdsk");
+ //Provider->ChkdskEx = (PULIB_CHKDSKEX)GetProcAddress(hMod,
"ChkdskEx");
+ //Provider->Extend = (PULIB_EXTEND)GetProcAddress(hMod, "Extend");
+ Provider->Format = (PULIB_FORMAT)GetProcAddress(hMod, "Format");
+ //Provider->FormatEx = (PULIB_FORMATEX)GetProcAddress(hMod,
"FormatEx");
RtlCopyMemory(Provider->Name, FileSystem->Buffer, FileSystem->Length);
diff --git a/dll/win32/fmifs/precomp.h b/dll/win32/fmifs/precomp.h
index 0d2218f47f8..1a31415b696 100644
--- a/dll/win32/fmifs/precomp.h
+++ b/dll/win32/fmifs/precomp.h
@@ -33,9 +33,11 @@ typedef struct _IFS_PROVIDER
{
LIST_ENTRY ListEntry;
- CHKDSKEX ChkdskEx;
+ PULIB_CHKDSK Chkdsk;
+ PVOID ChkdskEx;
PVOID Extend;
- FORMATEX FormatEx;
+ PULIB_FORMAT Format;
+ PVOID FormatEx;
WCHAR Name[1];
} IFS_PROVIDER, *PIFS_PROVIDER;
diff --git a/dll/win32/ubtrfs/ubtrfs.spec b/dll/win32/ubtrfs/ubtrfs.spec
index b797157b4c2..ddf1db7f8e6 100644
--- a/dll/win32/ubtrfs/ubtrfs.spec
+++ b/dll/win32/ubtrfs/ubtrfs.spec
@@ -1,5 +1,5 @@
-@ stdcall ChkdskEx(ptr long long long long ptr) BtrfsChkdskEx
-@ stdcall FormatEx(ptr long ptr long long ptr) BtrfsFormatEx
+@ stdcall Chkdsk(ptr ptr long long long long ptr ptr ptr ptr ptr) BtrfsChkdsk
+@ stdcall Format(ptr ptr long long long ptr long) BtrfsFormat
@ stdcall GetFilesystemInformation(long long ptr)
@ stdcall SetIncompatFlags(int64)
diff --git a/dll/win32/ucdfs/ucdfs.spec b/dll/win32/ucdfs/ucdfs.spec
index 5ad590f9a7c..b425670db98 100644
--- a/dll/win32/ucdfs/ucdfs.spec
+++ b/dll/win32/ucdfs/ucdfs.spec
@@ -1,2 +1,2 @@
-@ stdcall ChkdskEx(ptr long long long long ptr) CdfsChkdsk
-@ stdcall FormatEx(ptr long ptr long long ptr) CdfsFormat
+@ stdcall Chkdsk(ptr ptr long long long long ptr ptr ptr ptr ptr) CdfsChkdsk
+@ stdcall Format(ptr ptr long long long ptr long) CdfsFormat
diff --git a/dll/win32/uext2/uext2.spec b/dll/win32/uext2/uext2.spec
index fb2d99b0981..cd8682132e5 100644
--- a/dll/win32/uext2/uext2.spec
+++ b/dll/win32/uext2/uext2.spec
@@ -1,2 +1,2 @@
-@ stdcall ChkdskEx(ptr long long long long ptr) Ext2Chkdsk
-@ stdcall FormatEx(ptr long ptr long long ptr) Ext2Format
+@ stdcall Chkdsk(ptr ptr long long long long ptr ptr ptr ptr ptr) Ext2Chkdsk
+@ stdcall Format(ptr ptr long long long ptr long) Ext2Format
diff --git a/dll/win32/ufat/ufat.spec b/dll/win32/ufat/ufat.spec
index cc7532f0712..19cd54669cf 100644
--- a/dll/win32/ufat/ufat.spec
+++ b/dll/win32/ufat/ufat.spec
@@ -1,2 +1,2 @@
-@ stdcall ChkdskEx(ptr long long long long ptr) VfatChkdsk
-@ stdcall FormatEx(ptr long ptr long long ptr) VfatFormat
+@ stdcall Chkdsk(ptr ptr long long long long ptr ptr ptr ptr ptr) VfatChkdsk
+@ stdcall Format(ptr ptr long long long ptr long) VfatFormat
diff --git a/dll/win32/ufatx/ufatx.spec b/dll/win32/ufatx/ufatx.spec
index 40ab9e02736..aff06f9c8c6 100644
--- a/dll/win32/ufatx/ufatx.spec
+++ b/dll/win32/ufatx/ufatx.spec
@@ -1,2 +1,2 @@
-@ stdcall ChkdskEx(ptr long long long long ptr) VfatxChkdsk
-@ stdcall FormatEx(ptr long ptr long long ptr) VfatxFormat
+@ stdcall Chkdsk(ptr ptr long long long long ptr ptr ptr ptr ptr) VfatxChkdsk
+@ stdcall Format(ptr ptr long long long ptr long) VfatxFormat
diff --git a/dll/win32/uffs/uffs.spec b/dll/win32/uffs/uffs.spec
index 8c5627af99a..f06e34356a9 100644
--- a/dll/win32/uffs/uffs.spec
+++ b/dll/win32/uffs/uffs.spec
@@ -1,2 +1,2 @@
-@ stdcall ChkdskEx(ptr long long long long ptr) FfsChkdsk
-@ stdcall FormatEx(ptr long ptr long long ptr) FfsFormat
+@ stdcall Chkdsk(ptr ptr long long long long ptr ptr ptr ptr ptr) FfsChkdsk
+@ stdcall Format(ptr ptr long long long ptr long) FfsFormat
diff --git a/dll/win32/untfs/untfs.spec b/dll/win32/untfs/untfs.spec
index 29c777772eb..bcdeca48e95 100644
--- a/dll/win32/untfs/untfs.spec
+++ b/dll/win32/untfs/untfs.spec
@@ -1,2 +1,2 @@
-@ stdcall ChkdskEx(ptr long long long long ptr) NtfsChkdsk
-@ stdcall FormatEx(ptr long ptr long long ptr) NtfsFormat
+@ stdcall Chkdsk(ptr ptr long long long long ptr ptr ptr ptr ptr) NtfsChkdsk
+@ stdcall Format(ptr ptr long long long ptr long) NtfsFormat
diff --git a/dll/win32/ureiserfs/ureiserfs.spec b/dll/win32/ureiserfs/ureiserfs.spec
index 5a86418e1fd..496546ae682 100644
--- a/dll/win32/ureiserfs/ureiserfs.spec
+++ b/dll/win32/ureiserfs/ureiserfs.spec
@@ -1,2 +1,2 @@
-@ stdcall ChkdskEx(ptr long long long long ptr) ReiserfsChkdsk
-@ stdcall FormatEx(ptr long ptr long long ptr) ReiserfsFormat
+@ stdcall Chkdsk(ptr ptr long long long long ptr ptr ptr ptr ptr) ReiserfsChkdsk
+@ stdcall Format(ptr ptr long long long ptr long) ReiserfsFormat
diff --git a/sdk/include/reactos/libs/fmifs/fmifs.h
b/sdk/include/reactos/libs/fmifs/fmifs.h
index c2c8b80e7cc..482b3b02457 100644
--- a/sdk/include/reactos/libs/fmifs/fmifs.h
+++ b/sdk/include/reactos/libs/fmifs/fmifs.h
@@ -152,6 +152,9 @@ FormatEx(
IN ULONG ClusterSize,
IN PFMIFSCALLBACK Callback);
+/* FormatEx2 command in FMIFS */
+// FIXME!
+
BOOLEAN NTAPI
QueryAvailableFileSystemFormat(
IN DWORD Index,
@@ -194,23 +197,33 @@ SetLabel(
/* Functions provided by u*.dll */
-typedef NTSTATUS
-(NTAPI *FORMATEX)(
- IN PUNICODE_STRING DriveRoot,
- IN FMIFS_MEDIA_FLAG MediaFlag,
- IN PUNICODE_STRING Label,
- IN BOOLEAN QuickFormat,
- IN ULONG ClusterSize,
- IN PFMIFSCALLBACK Callback);
-
-typedef NTSTATUS
-(NTAPI *CHKDSKEX)(
+typedef BOOLEAN
+(NTAPI *PULIB_CHKDSK)(
IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
IN BOOLEAN FixErrors,
IN BOOLEAN Verbose,
IN BOOLEAN CheckOnlyIfDirty,
IN BOOLEAN ScanDrive,
- IN PFMIFSCALLBACK Callback);
+ IN PVOID pUnknown1,
+ IN PVOID pUnknown2,
+ IN PVOID pUnknown3,
+ IN PVOID pUnknown4,
+ IN PULONG ExitStatus);
+
+// FIXME: PULIB_CHKDSKEX of u*.dll works with ChkdskEx() of FMIFS.DLL
+
+typedef BOOLEAN
+(NTAPI *PULIB_FORMAT)(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN QuickFormat,
+ IN BOOLEAN BackwardCompatible,
+ IN MEDIA_TYPE MediaType,
+ IN PUNICODE_STRING Label,
+ IN ULONG ClusterSize);
+
+// FIXME: PULIB_FORMATEX of u*.dll works with FormatEx2() of FMIFS.DLL
#ifdef __cplusplus
}
diff --git a/sdk/include/reactos/libs/fslib/btrfslib.h
b/sdk/include/reactos/libs/fslib/btrfslib.h
index e97f7ca9cc9..53ec74538d4 100644
--- a/sdk/include/reactos/libs/fslib/btrfslib.h
+++ b/sdk/include/reactos/libs/fslib/btrfslib.h
@@ -4,27 +4,36 @@
* FILE: include/reactos/libs/fslib/btrfslib.h
* PURPOSE: Public definitions for BtrFS filesystem library
*/
+
#ifndef __BTRFSLIB_H
#define __BTRFSLIB_H
#include <fmifs/fmifs.h>
-NTSTATUS NTAPI
-BtrfsChkdskEx(
- IN PUNICODE_STRING DriveRoot,
- IN BOOLEAN FixErrors,
- IN BOOLEAN Verbose,
- IN BOOLEAN CheckOnlyIfDirty,
- IN BOOLEAN ScanDrive,
- IN PFMIFSCALLBACK Callback);
+BOOLEAN
+NTAPI
+BtrfsChkdsk(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN FixErrors,
+ IN BOOLEAN Verbose,
+ IN BOOLEAN CheckOnlyIfDirty,
+ IN BOOLEAN ScanDrive,
+ IN PVOID pUnknown1,
+ IN PVOID pUnknown2,
+ IN PVOID pUnknown3,
+ IN PVOID pUnknown4,
+ IN PULONG ExitStatus);
-NTSTATUS NTAPI
-BtrfsFormatEx(
- IN PUNICODE_STRING DriveRoot,
- IN FMIFS_MEDIA_FLAG MediaFlag,
- IN PUNICODE_STRING Label,
- IN BOOLEAN QuickFormat,
- IN ULONG ClusterSize,
- IN PFMIFSCALLBACK Callback);
+BOOLEAN
+NTAPI
+BtrfsFormat(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN QuickFormat,
+ IN BOOLEAN BackwardCompatible,
+ IN MEDIA_TYPE MediaType,
+ IN PUNICODE_STRING Label,
+ IN ULONG ClusterSize);
-#endif /*__BTRFSLIB_H */
+#endif /* __BTRFSLIB_H */
diff --git a/sdk/include/reactos/libs/fslib/cdfslib.h
b/sdk/include/reactos/libs/fslib/cdfslib.h
index a49cabf0bbf..60023b65d30 100644
--- a/sdk/include/reactos/libs/fslib/cdfslib.h
+++ b/sdk/include/reactos/libs/fslib/cdfslib.h
@@ -4,27 +4,36 @@
* FILE: include/reactos/libs/fslib/cdfslib.h
* PURPOSE: Public definitions for CDFS filesystem library
*/
+
#ifndef __CDFSLIB_H
#define __CDFSLIB_H
#include <fmifs/fmifs.h>
-NTSTATUS NTAPI
+BOOLEAN
+NTAPI
CdfsChkdsk(
- IN PUNICODE_STRING DriveRoot,
- IN BOOLEAN FixErrors,
- IN BOOLEAN Verbose,
- IN BOOLEAN CheckOnlyIfDirty,
- IN BOOLEAN ScanDrive,
- IN PFMIFSCALLBACK Callback);
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN FixErrors,
+ IN BOOLEAN Verbose,
+ IN BOOLEAN CheckOnlyIfDirty,
+ IN BOOLEAN ScanDrive,
+ IN PVOID pUnknown1,
+ IN PVOID pUnknown2,
+ IN PVOID pUnknown3,
+ IN PVOID pUnknown4,
+ IN PULONG ExitStatus);
-NTSTATUS NTAPI
+BOOLEAN
+NTAPI
CdfsFormat(
- IN PUNICODE_STRING DriveRoot,
- IN FMIFS_MEDIA_FLAG MediaFlag,
- IN PUNICODE_STRING Label,
- IN BOOLEAN QuickFormat,
- IN ULONG ClusterSize,
- IN PFMIFSCALLBACK Callback);
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN QuickFormat,
+ IN BOOLEAN BackwardCompatible,
+ IN MEDIA_TYPE MediaType,
+ IN PUNICODE_STRING Label,
+ IN ULONG ClusterSize);
-#endif /*__CDFSLIB_H */
+#endif /* __CDFSLIB_H */
diff --git a/sdk/include/reactos/libs/fslib/ext2lib.h
b/sdk/include/reactos/libs/fslib/ext2lib.h
index 596bbcbf9e8..b368aa3323c 100644
--- a/sdk/include/reactos/libs/fslib/ext2lib.h
+++ b/sdk/include/reactos/libs/fslib/ext2lib.h
@@ -4,27 +4,36 @@
* FILE: include/reactos/libs/fslib/ext2lib.h
* PURPOSE: Public definitions for ext2 filesystem library
*/
+
#ifndef __EXT2LIB_H
#define __EXT2LIB_H
#include <fmifs/fmifs.h>
-NTSTATUS NTAPI
+BOOLEAN
+NTAPI
Ext2Chkdsk(
- IN PUNICODE_STRING DriveRoot,
- IN BOOLEAN FixErrors,
- IN BOOLEAN Verbose,
- IN BOOLEAN CheckOnlyIfDirty,
- IN BOOLEAN ScanDrive,
- IN PFMIFSCALLBACK Callback);
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN FixErrors,
+ IN BOOLEAN Verbose,
+ IN BOOLEAN CheckOnlyIfDirty,
+ IN BOOLEAN ScanDrive,
+ IN PVOID pUnknown1,
+ IN PVOID pUnknown2,
+ IN PVOID pUnknown3,
+ IN PVOID pUnknown4,
+ IN PULONG ExitStatus);
-NTSTATUS NTAPI
+BOOLEAN
+NTAPI
Ext2Format(
- IN PUNICODE_STRING DriveRoot,
- IN FMIFS_MEDIA_FLAG MediaFlag,
- IN PUNICODE_STRING Label,
- IN BOOLEAN QuickFormat,
- IN ULONG ClusterSize,
- IN PFMIFSCALLBACK Callback);
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN QuickFormat,
+ IN BOOLEAN BackwardCompatible,
+ IN MEDIA_TYPE MediaType,
+ IN PUNICODE_STRING Label,
+ IN ULONG ClusterSize);
-#endif /*__EXT2LIB_H */
+#endif /* __EXT2LIB_H */
diff --git a/sdk/include/reactos/libs/fslib/ffslib.h
b/sdk/include/reactos/libs/fslib/ffslib.h
index 31e3f257364..4703c06ee9b 100644
--- a/sdk/include/reactos/libs/fslib/ffslib.h
+++ b/sdk/include/reactos/libs/fslib/ffslib.h
@@ -4,27 +4,36 @@
* FILE: include/reactos/libs/fslib/ffslib.h
* PURPOSE: Public definitions for FFS filesystem library
*/
+
#ifndef __FFSLIB_H
#define __FFSLIB_H
#include <fmifs/fmifs.h>
-NTSTATUS NTAPI
+BOOLEAN
+NTAPI
FfsChkdsk(
- IN PUNICODE_STRING DriveRoot,
- IN BOOLEAN FixErrors,
- IN BOOLEAN Verbose,
- IN BOOLEAN CheckOnlyIfDirty,
- IN BOOLEAN ScanDrive,
- IN PFMIFSCALLBACK Callback);
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN FixErrors,
+ IN BOOLEAN Verbose,
+ IN BOOLEAN CheckOnlyIfDirty,
+ IN BOOLEAN ScanDrive,
+ IN PVOID pUnknown1,
+ IN PVOID pUnknown2,
+ IN PVOID pUnknown3,
+ IN PVOID pUnknown4,
+ IN PULONG ExitStatus);
-NTSTATUS NTAPI
+BOOLEAN
+NTAPI
FfsFormat(
- IN PUNICODE_STRING DriveRoot,
- IN FMIFS_MEDIA_FLAG MediaFlag,
- IN PUNICODE_STRING Label,
- IN BOOLEAN QuickFormat,
- IN ULONG ClusterSize,
- IN PFMIFSCALLBACK Callback);
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN QuickFormat,
+ IN BOOLEAN BackwardCompatible,
+ IN MEDIA_TYPE MediaType,
+ IN PUNICODE_STRING Label,
+ IN ULONG ClusterSize);
-#endif /*__FFSLIB_H */
+#endif /* __FFSLIB_H */
diff --git a/sdk/include/reactos/libs/fslib/ntfslib.h
b/sdk/include/reactos/libs/fslib/ntfslib.h
index d4647d4cb05..f1677a40597 100644
--- a/sdk/include/reactos/libs/fslib/ntfslib.h
+++ b/sdk/include/reactos/libs/fslib/ntfslib.h
@@ -4,27 +4,36 @@
* FILE: include/reactos/libs/fslib/ntfslib.h
* PURPOSE: Public definitions for NTFS filesystem library
*/
+
#ifndef __NTFSLIB_H
#define __NTFSLIB_H
#include <fmifs/fmifs.h>
-NTSTATUS NTAPI
+BOOLEAN
+NTAPI
NtfsChkdsk(
- IN PUNICODE_STRING DriveRoot,
- IN BOOLEAN FixErrors,
- IN BOOLEAN Verbose,
- IN BOOLEAN CheckOnlyIfDirty,
- IN BOOLEAN ScanDrive,
- IN PFMIFSCALLBACK Callback);
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN FixErrors,
+ IN BOOLEAN Verbose,
+ IN BOOLEAN CheckOnlyIfDirty,
+ IN BOOLEAN ScanDrive,
+ IN PVOID pUnknown1,
+ IN PVOID pUnknown2,
+ IN PVOID pUnknown3,
+ IN PVOID pUnknown4,
+ IN PULONG ExitStatus);
-NTSTATUS NTAPI
+BOOLEAN
+NTAPI
NtfsFormat(
- IN PUNICODE_STRING DriveRoot,
- IN FMIFS_MEDIA_FLAG MediaFlag,
- IN PUNICODE_STRING Label,
- IN BOOLEAN QuickFormat,
- IN ULONG ClusterSize,
- IN PFMIFSCALLBACK Callback);
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN QuickFormat,
+ IN BOOLEAN BackwardCompatible,
+ IN MEDIA_TYPE MediaType,
+ IN PUNICODE_STRING Label,
+ IN ULONG ClusterSize);
-#endif /*__NTFSLIB_H */
+#endif /* __NTFSLIB_H */
diff --git a/sdk/include/reactos/libs/fslib/reiserfslib.h
b/sdk/include/reactos/libs/fslib/reiserfslib.h
index ed7bd2f79a0..519abe0495e 100644
--- a/sdk/include/reactos/libs/fslib/reiserfslib.h
+++ b/sdk/include/reactos/libs/fslib/reiserfslib.h
@@ -4,27 +4,36 @@
* FILE: include/reactos/libs/fslib/reiserfslib.h
* PURPOSE: Public definitions for ReiserFS filesystem library
*/
+
#ifndef __REISERFSLIB_H
#define __REISERFSLIB_H
#include <fmifs/fmifs.h>
-NTSTATUS NTAPI
+BOOLEAN
+NTAPI
ReiserfsChkdsk(
- IN PUNICODE_STRING DriveRoot,
- IN BOOLEAN FixErrors,
- IN BOOLEAN Verbose,
- IN BOOLEAN CheckOnlyIfDirty,
- IN BOOLEAN ScanDrive,
- IN PFMIFSCALLBACK Callback);
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN FixErrors,
+ IN BOOLEAN Verbose,
+ IN BOOLEAN CheckOnlyIfDirty,
+ IN BOOLEAN ScanDrive,
+ IN PVOID pUnknown1,
+ IN PVOID pUnknown2,
+ IN PVOID pUnknown3,
+ IN PVOID pUnknown4,
+ IN PULONG ExitStatus);
-NTSTATUS NTAPI
+BOOLEAN
+NTAPI
ReiserfsFormat(
- IN PUNICODE_STRING DriveRoot,
- IN FMIFS_MEDIA_FLAG MediaFlag,
- IN PUNICODE_STRING Label,
- IN BOOLEAN QuickFormat,
- IN ULONG ClusterSize,
- IN PFMIFSCALLBACK Callback);
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN QuickFormat,
+ IN BOOLEAN BackwardCompatible,
+ IN MEDIA_TYPE MediaType,
+ IN PUNICODE_STRING Label,
+ IN ULONG ClusterSize);
-#endif /*__REISERFSLIB_H */
+#endif /* __REISERFSLIB_H */
diff --git a/sdk/include/reactos/libs/fslib/vfatlib.h
b/sdk/include/reactos/libs/fslib/vfatlib.h
index 9e635cd086d..cceebe6e70b 100644
--- a/sdk/include/reactos/libs/fslib/vfatlib.h
+++ b/sdk/include/reactos/libs/fslib/vfatlib.h
@@ -4,27 +4,36 @@
* FILE: include/reactos/libs/fslib/vfatlib.h
* PURPOSE: Public definitions for vfat filesystem library
*/
+
#ifndef __VFATLIB_H
#define __VFATLIB_H
#include <fmifs/fmifs.h>
-NTSTATUS NTAPI
+BOOLEAN
+NTAPI
VfatChkdsk(
- IN PUNICODE_STRING DriveRoot,
- IN BOOLEAN FixErrors,
- IN BOOLEAN Verbose,
- IN BOOLEAN CheckOnlyIfDirty,
- IN BOOLEAN ScanDrive,
- IN PFMIFSCALLBACK Callback);
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN FixErrors,
+ IN BOOLEAN Verbose,
+ IN BOOLEAN CheckOnlyIfDirty,
+ IN BOOLEAN ScanDrive,
+ IN PVOID pUnknown1,
+ IN PVOID pUnknown2,
+ IN PVOID pUnknown3,
+ IN PVOID pUnknown4,
+ IN PULONG ExitStatus);
-NTSTATUS NTAPI
+BOOLEAN
+NTAPI
VfatFormat(
- IN PUNICODE_STRING DriveRoot,
- IN FMIFS_MEDIA_FLAG MediaFlag,
- IN PUNICODE_STRING Label,
- IN BOOLEAN QuickFormat,
- IN ULONG ClusterSize,
- IN PFMIFSCALLBACK Callback);
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN QuickFormat,
+ IN BOOLEAN BackwardCompatible,
+ IN MEDIA_TYPE MediaType,
+ IN PUNICODE_STRING Label,
+ IN ULONG ClusterSize);
-#endif /*__VFATLIB_H */
+#endif /* __VFATLIB_H */
diff --git a/sdk/include/reactos/libs/fslib/vfatxlib.h
b/sdk/include/reactos/libs/fslib/vfatxlib.h
index 767ec58a2b1..57960c1ae06 100644
--- a/sdk/include/reactos/libs/fslib/vfatxlib.h
+++ b/sdk/include/reactos/libs/fslib/vfatxlib.h
@@ -4,17 +4,36 @@
* FILE: include/reactos/libs/fslib/vfatxlib.h
* PURPOSE: Public definitions for vfat filesystem library
*/
+
#ifndef __VFATXLIB_H
#define __VFATXLIB_H
#include <fmifs/fmifs.h>
-NTSTATUS NTAPI
-VfatxFormat (PUNICODE_STRING DriveRoot,
- FMIFS_MEDIA_FLAG MediaFlag,
- PUNICODE_STRING Label,
- BOOLEAN QuickFormat,
- ULONG ClusterSize,
- PFMIFSCALLBACK Callback);
+BOOLEAN
+NTAPI
+VfatxChkdsk(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN FixErrors,
+ IN BOOLEAN Verbose,
+ IN BOOLEAN CheckOnlyIfDirty,
+ IN BOOLEAN ScanDrive,
+ IN PVOID pUnknown1,
+ IN PVOID pUnknown2,
+ IN PVOID pUnknown3,
+ IN PVOID pUnknown4,
+ IN PULONG ExitStatus);
+
+BOOLEAN
+NTAPI
+VfatxFormat(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN QuickFormat,
+ IN BOOLEAN BackwardCompatible,
+ IN MEDIA_TYPE MediaType,
+ IN PUNICODE_STRING Label,
+ IN ULONG ClusterSize);
-#endif /*__VFATLIB_H */
+#endif /* __VFATXLIB_H */
diff --git a/sdk/lib/fslib/btrfslib/btrfslib.c b/sdk/lib/fslib/btrfslib/btrfslib.c
index b5222e57551..d176204b2a2 100644
--- a/sdk/lib/fslib/btrfslib/btrfslib.c
+++ b/sdk/lib/fslib/btrfslib/btrfslib.c
@@ -181,6 +181,7 @@ ULONG def_sector_size = 0, def_node_size = 0;
uint64_t def_incompat_flags = BTRFS_INCOMPAT_FLAGS_EXTENDED_IREF |
BTRFS_INCOMPAT_FLAGS_SKINNY_METADATA;
uint16_t def_csum_type = CSUM_TYPE_CRC32C;
+#ifndef __REACTOS__
// the following definitions come from fmifs.h in ReactOS
typedef struct {
@@ -237,12 +238,32 @@ typedef enum {
typedef BOOLEAN (NTAPI* PFMIFSCALLBACK)(CALLBACKCOMMAND Command, ULONG SubAction, PVOID
ActionInfo);
+#else
+
+#include <fmifs/fmifs.h>
+
+#endif // __REACTOS__
+
#ifndef __REACTOS__
NTSTATUS WINAPI ChkdskEx(PUNICODE_STRING DriveRoot, BOOLEAN FixErrors, BOOLEAN Verbose,
BOOLEAN CheckOnlyIfDirty,
+ BOOLEAN ScanDrive, PFMIFSCALLBACK Callback) {
#else
-NTSTATUS NTAPI BtrfsChkdskEx(PUNICODE_STRING DriveRoot, BOOLEAN FixErrors, BOOLEAN
Verbose, BOOLEAN CheckOnlyIfDirty,
+BOOLEAN
+NTAPI
+BtrfsChkdsk(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN FixErrors,
+ IN BOOLEAN Verbose,
+ IN BOOLEAN CheckOnlyIfDirty,
+ IN BOOLEAN ScanDrive,
+ IN PVOID pUnknown1,
+ IN PVOID pUnknown2,
+ IN PVOID pUnknown3,
+ IN PVOID pUnknown4,
+ IN PULONG ExitStatus)
+{
#endif
- BOOLEAN ScanDrive, PFMIFSCALLBACK Callback) {
// STUB
if (Callback) {
@@ -254,7 +275,12 @@ NTSTATUS NTAPI BtrfsChkdskEx(PUNICODE_STRING DriveRoot, BOOLEAN
FixErrors, BOOLE
Callback(OUTPUT, 0, &TextOut);
}
+#ifndef __REACTOS__
return STATUS_SUCCESS;
+#else
+ *ExitStatus = (ULONG)STATUS_SUCCESS;
+ return TRUE;
+#endif
}
static btrfs_root* add_root(LIST_ENTRY* roots, uint64_t id) {
@@ -1316,11 +1342,7 @@ static void check_cpu() {
}
#endif
-#ifndef __REACTOS__
static NTSTATUS NTAPI FormatEx2(PUNICODE_STRING DriveRoot, FMIFS_MEDIA_FLAG MediaFlag,
PUNICODE_STRING Label,
-#else
-NTSTATUS NTAPI BtrfsFormatEx(PUNICODE_STRING DriveRoot, FMIFS_MEDIA_FLAG MediaFlag,
PUNICODE_STRING Label,
-#endif // __REACTOS__
BOOLEAN QuickFormat, ULONG ClusterSize, PFMIFSCALLBACK
Callback)
{
NTSTATUS Status;
@@ -1479,14 +1501,44 @@ end:
Status = STATUS_SUCCESS;
}
+#ifndef __REACTOS__
if (Callback) {
bool success = NT_SUCCESS(Status);
Callback(DONE, 0, (PVOID)&success);
}
+#endif
return Status;
}
+#ifdef __REACTOS__
+
+BOOLEAN
+NTAPI
+BtrfsFormat(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN QuickFormat,
+ IN BOOLEAN BackwardCompatible,
+ IN MEDIA_TYPE MediaType,
+ IN PUNICODE_STRING Label,
+ IN ULONG ClusterSize)
+{
+ NTSTATUS Status;
+
+ if (BackwardCompatible)
+ {
+ // DPRINT1("BackwardCompatible == TRUE is unsupported!\n");
+ return FALSE;
+ }
+
+ Status = FormatEx2(DriveRoot, (FMIFS_MEDIA_FLAG)MediaType, Label, QuickFormat,
ClusterSize, Callback);
+
+ return NT_SUCCESS(Status);
+}
+
+#else
+
BOOL __stdcall FormatEx(DSTRING* root, STREAM_MESSAGE* message, options* opts, uint32_t
unk1) {
UNICODE_STRING DriveRoot, Label;
NTSTATUS Status;
@@ -1505,15 +1557,13 @@ BOOL __stdcall FormatEx(DSTRING* root, STREAM_MESSAGE* message,
options* opts, u
Label.Buffer = NULL;
}
-#ifndef __REACTOS__
Status = FormatEx2(&DriveRoot, FMIFS_HARDDISK, &Label, opts &&
opts->flags & FORMAT_FLAG_QUICK_FORMAT, 0, NULL);
-#else
- Status = BtrfsFormatEx(&DriveRoot, FMIFS_HARDDISK, &Label, opts &&
opts->flags & FORMAT_FLAG_QUICK_FORMAT, 0, NULL);
-#endif
return NT_SUCCESS(Status);
}
+#endif // __REACTOS__
+
void __stdcall SetSizes(ULONG sector, ULONG node) {
if (sector != 0)
def_sector_size = sector;
diff --git a/sdk/lib/fslib/cdfslib/cdfslib.c b/sdk/lib/fslib/cdfslib/cdfslib.c
index 296ac6650dc..7052de2870a 100644
--- a/sdk/lib/fslib/cdfslib/cdfslib.c
+++ b/sdk/lib/fslib/cdfslib/cdfslib.c
@@ -12,26 +12,37 @@
#define NDEBUG
#include <debug.h>
-NTSTATUS NTAPI
-CdfsChkdsk(IN PUNICODE_STRING DriveRoot,
+BOOLEAN
+NTAPI
+CdfsFormat(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN QuickFormat,
+ IN BOOLEAN BackwardCompatible,
+ IN MEDIA_TYPE MediaType,
+ IN PUNICODE_STRING Label,
+ IN ULONG ClusterSize)
+{
+ // Not possible for CDFS (ISO-9660).
+ return FALSE;
+}
+
+BOOLEAN
+NTAPI
+CdfsChkdsk(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
IN BOOLEAN FixErrors,
IN BOOLEAN Verbose,
IN BOOLEAN CheckOnlyIfDirty,
IN BOOLEAN ScanDrive,
- IN PFMIFSCALLBACK Callback)
+ IN PVOID pUnknown1,
+ IN PVOID pUnknown2,
+ IN PVOID pUnknown3,
+ IN PVOID pUnknown4,
+ IN PULONG ExitStatus)
{
UNIMPLEMENTED;
- return STATUS_SUCCESS;
-}
-
-NTSTATUS NTAPI
-CdfsFormat(IN PUNICODE_STRING DriveRoot,
- IN FMIFS_MEDIA_FLAG MediaFlag,
- IN PUNICODE_STRING Label,
- IN BOOLEAN QuickFormat,
- IN ULONG ClusterSize,
- IN PFMIFSCALLBACK Callback)
-{
- // Not possible for CDFS (ISO-9660).
- return STATUS_NOT_SUPPORTED;
+ *ExitStatus = (ULONG)STATUS_SUCCESS;
+ return TRUE;
}
diff --git a/sdk/lib/fslib/ext2lib/Mke2fs.c b/sdk/lib/fslib/ext2lib/Mke2fs.c
index 91506ad7d69..b3dc5e14c8d 100644
--- a/sdk/lib/fslib/ext2lib/Mke2fs.c
+++ b/sdk/lib/fslib/ext2lib/Mke2fs.c
@@ -798,16 +798,18 @@ Ext2TotalBlocks(PEXT2_FILESYS Ext2Sys, ULONG DataBlocks)
}
-NTSTATUS
+BOOLEAN
NTAPI
-Ext2Format(IN PUNICODE_STRING DriveRoot,
- IN FMIFS_MEDIA_FLAG MediaFlag,
- IN PUNICODE_STRING Label,
- IN BOOLEAN QuickFormat,
- IN ULONG ClusterSize,
- IN PFMIFSCALLBACK Callback)
+Ext2Format(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN QuickFormat,
+ IN BOOLEAN BackwardCompatible,
+ IN MEDIA_TYPE MediaType,
+ IN PUNICODE_STRING Label,
+ IN ULONG ClusterSize)
{
- BOOLEAN bRet = FALSE;
+ BOOLEAN bRet;
NTSTATUS Status = STATUS_UNSUCCESSFUL;
/* Super Block: 1024 bytes long */
EXT2_SUPER_BLOCK Ext2Sb;
@@ -819,6 +821,9 @@ Ext2Format(IN PUNICODE_STRING DriveRoot,
ULONG start;
ULONG ret_blk;
+ // FIXME:
+ UNREFERENCED_PARAMETER(BackwardCompatible);
+ UNREFERENCED_PARAMETER(MediaType);
if (Callback != NULL)
{
@@ -868,6 +873,7 @@ Ext2Format(IN PUNICODE_STRING DriveRoot,
bLocked = TRUE;
}
+ Status = STATUS_UNSUCCESSFUL;
// Initialize
if (!ext2_initialize_sb(&FileSys))
@@ -917,7 +923,6 @@ Ext2Format(IN PUNICODE_STRING DriveRoot,
ext2_print_super(&Ext2Sb);
bRet = ext2_allocate_tables(&FileSys);
-
if (!bRet)
{
goto clean_up;
@@ -942,6 +947,7 @@ Ext2Format(IN PUNICODE_STRING DriveRoot,
if (start > rsv)
start -= rsv;
+ bRet = TRUE;
if (start > 0)
bRet = zero_blocks(&FileSys, start, blocks - start, &ret_blk, NULL);
@@ -969,14 +975,12 @@ Ext2Format(IN PUNICODE_STRING DriveRoot,
if (!ext2_flush(&FileSys))
{
- bRet = false;
DPRINT1("Mke2fs: Warning, had trouble writing out superblocks.\n");
goto clean_up;
}
DPRINT("Mke2fs: Writing superblocks and filesystem accounting information
done!\n");
- bRet = true;
Status = STATUS_SUCCESS;
clean_up:
@@ -995,23 +999,25 @@ clean_up:
Ext2CloseDevice(&FileSys);
- if (Callback != NULL)
- {
- Callback(DONE, 0, (PVOID)&bRet);
- }
-
- return Status;
+ return NT_SUCCESS(Status);
}
-NTSTATUS
+BOOLEAN
NTAPI
-Ext2Chkdsk(IN PUNICODE_STRING DriveRoot,
- IN BOOLEAN FixErrors,
- IN BOOLEAN Verbose,
- IN BOOLEAN CheckOnlyIfDirty,
- IN BOOLEAN ScanDrive,
- IN PFMIFSCALLBACK Callback)
+Ext2Chkdsk(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN FixErrors,
+ IN BOOLEAN Verbose,
+ IN BOOLEAN CheckOnlyIfDirty,
+ IN BOOLEAN ScanDrive,
+ IN PVOID pUnknown1,
+ IN PVOID pUnknown2,
+ IN PVOID pUnknown3,
+ IN PVOID pUnknown4,
+ IN PULONG ExitStatus)
{
UNIMPLEMENTED;
- return STATUS_SUCCESS;
+ *ExitStatus = (ULONG)STATUS_SUCCESS;
+ return TRUE;
}
diff --git a/sdk/lib/fslib/ffslib/ffslib.c b/sdk/lib/fslib/ffslib/ffslib.c
index 2c7f3ed4ba5..75e361f17e2 100644
--- a/sdk/lib/fslib/ffslib/ffslib.c
+++ b/sdk/lib/fslib/ffslib/ffslib.c
@@ -5,32 +5,45 @@
* PURPOSE: FFS lib
* PROGRAMMERS: Pierre Schweitzer
*/
-#include "ffslib.h"
+
+#define NTOS_MODE_USER
+#include <ndk/umtypes.h>
+#include <fmifs/fmifs.h>
#define NDEBUG
#include <debug.h>
-NTSTATUS NTAPI
-FfsFormat(IN PUNICODE_STRING DriveRoot,
- IN FMIFS_MEDIA_FLAG MediaFlag,
- IN PUNICODE_STRING Label,
- IN BOOLEAN QuickFormat,
- IN ULONG ClusterSize,
- IN PFMIFSCALLBACK Callback)
+BOOLEAN
+NTAPI
+FfsFormat(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN QuickFormat,
+ IN BOOLEAN BackwardCompatible,
+ IN MEDIA_TYPE MediaType,
+ IN PUNICODE_STRING Label,
+ IN ULONG ClusterSize)
{
UNIMPLEMENTED;
- return STATUS_SUCCESS;
+ return TRUE;
}
-
-NTSTATUS NTAPI
-FfsChkdsk(IN PUNICODE_STRING DriveRoot,
- IN BOOLEAN FixErrors,
- IN BOOLEAN Verbose,
- IN BOOLEAN CheckOnlyIfDirty,
- IN BOOLEAN ScanDrive,
- IN PFMIFSCALLBACK Callback)
+BOOLEAN
+NTAPI
+FfsChkdsk(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN FixErrors,
+ IN BOOLEAN Verbose,
+ IN BOOLEAN CheckOnlyIfDirty,
+ IN BOOLEAN ScanDrive,
+ IN PVOID pUnknown1,
+ IN PVOID pUnknown2,
+ IN PVOID pUnknown3,
+ IN PVOID pUnknown4,
+ IN PULONG ExitStatus)
{
UNIMPLEMENTED;
- return STATUS_SUCCESS;
+ *ExitStatus = (ULONG)STATUS_SUCCESS;
+ return TRUE;
}
diff --git a/sdk/lib/fslib/ffslib/ffslib.h b/sdk/lib/fslib/ffslib/ffslib.h
deleted file mode 100644
index 1ee1a87b2e4..00000000000
--- a/sdk/lib/fslib/ffslib/ffslib.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS FFS library
- * FILE: lib/fslib/ffslib/ffslib.h
- */
-#define NTOS_MODE_USER
-#include <ndk/umtypes.h>
-#include <fmifs/fmifs.h>
diff --git a/sdk/lib/fslib/ntfslib/ntfslib.c b/sdk/lib/fslib/ntfslib/ntfslib.c
index d99f63e8703..b3f4433e4d9 100644
--- a/sdk/lib/fslib/ntfslib/ntfslib.c
+++ b/sdk/lib/fslib/ntfslib/ntfslib.c
@@ -5,32 +5,45 @@
* PURPOSE: NTFS lib
* PROGRAMMERS: Pierre Schweitzer
*/
-#include "ntfslib.h"
+
+#define NTOS_MODE_USER
+#include <ndk/umtypes.h>
+#include <fmifs/fmifs.h>
#define NDEBUG
#include <debug.h>
-NTSTATUS NTAPI
-NtfsFormat(IN PUNICODE_STRING DriveRoot,
- IN FMIFS_MEDIA_FLAG MediaFlag,
- IN PUNICODE_STRING Label,
- IN BOOLEAN QuickFormat,
- IN ULONG ClusterSize,
- IN PFMIFSCALLBACK Callback)
+BOOLEAN
+NTAPI
+NtfsFormat(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN QuickFormat,
+ IN BOOLEAN BackwardCompatible,
+ IN MEDIA_TYPE MediaType,
+ IN PUNICODE_STRING Label,
+ IN ULONG ClusterSize)
{
UNIMPLEMENTED;
- return STATUS_SUCCESS;
+ return TRUE;
}
-
-NTSTATUS NTAPI
-NtfsChkdsk(IN PUNICODE_STRING DriveRoot,
- IN BOOLEAN FixErrors,
- IN BOOLEAN Verbose,
- IN BOOLEAN CheckOnlyIfDirty,
- IN BOOLEAN ScanDrive,
- IN PFMIFSCALLBACK Callback)
+BOOLEAN
+NTAPI
+NtfsChkdsk(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN FixErrors,
+ IN BOOLEAN Verbose,
+ IN BOOLEAN CheckOnlyIfDirty,
+ IN BOOLEAN ScanDrive,
+ IN PVOID pUnknown1,
+ IN PVOID pUnknown2,
+ IN PVOID pUnknown3,
+ IN PVOID pUnknown4,
+ IN PULONG ExitStatus)
{
UNIMPLEMENTED;
- return STATUS_SUCCESS;
+ *ExitStatus = (ULONG)STATUS_SUCCESS;
+ return TRUE;
}
diff --git a/sdk/lib/fslib/ntfslib/ntfslib.h b/sdk/lib/fslib/ntfslib/ntfslib.h
deleted file mode 100644
index 200dfeeba6b..00000000000
--- a/sdk/lib/fslib/ntfslib/ntfslib.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS NTFS FS library
- * FILE: lib/fslib/ntfslib/ntfslib.h
- */
-#define NTOS_MODE_USER
-#include <ndk/umtypes.h>
-#include <fmifs/fmifs.h>
diff --git a/sdk/lib/fslib/reiserfslib/reiserfslib.c
b/sdk/lib/fslib/reiserfslib/reiserfslib.c
index 7356e143326..1f68f0200a8 100644
--- a/sdk/lib/fslib/reiserfslib/reiserfslib.c
+++ b/sdk/lib/fslib/reiserfslib/reiserfslib.c
@@ -5,32 +5,45 @@
* PURPOSE: ReiserFS lib
* PROGRAMMERS: Pierre Schweitzer
*/
-#include "reiserfslib.h"
+
+#define NTOS_MODE_USER
+#include <ndk/umtypes.h>
+#include <fmifs/fmifs.h>
#define NDEBUG
#include <debug.h>
-NTSTATUS NTAPI
-ReiserfsFormat(IN PUNICODE_STRING DriveRoot,
- IN FMIFS_MEDIA_FLAG MediaFlag,
- IN PUNICODE_STRING Label,
- IN BOOLEAN QuickFormat,
- IN ULONG ClusterSize,
- IN PFMIFSCALLBACK Callback)
+BOOLEAN
+NTAPI
+ReiserfsFormat(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN QuickFormat,
+ IN BOOLEAN BackwardCompatible,
+ IN MEDIA_TYPE MediaType,
+ IN PUNICODE_STRING Label,
+ IN ULONG ClusterSize)
{
UNIMPLEMENTED;
- return STATUS_SUCCESS;
+ return TRUE;
}
-
-NTSTATUS NTAPI
-ReiserfsChkdsk(IN PUNICODE_STRING DriveRoot,
- IN BOOLEAN FixErrors,
- IN BOOLEAN Verbose,
- IN BOOLEAN CheckOnlyIfDirty,
- IN BOOLEAN ScanDrive,
- IN PFMIFSCALLBACK Callback)
+BOOLEAN
+NTAPI
+ReiserfsChkdsk(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN FixErrors,
+ IN BOOLEAN Verbose,
+ IN BOOLEAN CheckOnlyIfDirty,
+ IN BOOLEAN ScanDrive,
+ IN PVOID pUnknown1,
+ IN PVOID pUnknown2,
+ IN PVOID pUnknown3,
+ IN PVOID pUnknown4,
+ IN PULONG ExitStatus)
{
UNIMPLEMENTED;
- return STATUS_SUCCESS;
+ *ExitStatus = (ULONG)STATUS_SUCCESS;
+ return TRUE;
}
diff --git a/sdk/lib/fslib/reiserfslib/reiserfslib.h
b/sdk/lib/fslib/reiserfslib/reiserfslib.h
deleted file mode 100644
index 147c97e8a1d..00000000000
--- a/sdk/lib/fslib/reiserfslib/reiserfslib.h
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS ReiserFS library
- * FILE: lib/fslib/reiserfslib/reiserfslib.h
- */
-#define NTOS_MODE_USER
-#include <ndk/umtypes.h>
-#include <fmifs/fmifs.h>
diff --git a/sdk/lib/fslib/vfatlib/vfatlib.c b/sdk/lib/fslib/vfatlib/vfatlib.c
index 82c1282fbf0..fec1f736c20 100644
--- a/sdk/lib/fslib/vfatlib/vfatlib.c
+++ b/sdk/lib/fslib/vfatlib/vfatlib.c
@@ -45,14 +45,16 @@ ULONG FsCheckFlags;
PVOID FsCheckMemQueue;
ULONG FsCheckTotalFiles;
-NTSTATUS
+BOOLEAN
NTAPI
-VfatFormat(IN PUNICODE_STRING DriveRoot,
- IN FMIFS_MEDIA_FLAG MediaFlag,
- IN PUNICODE_STRING Label,
- IN BOOLEAN QuickFormat,
- IN ULONG ClusterSize,
- IN PFMIFSCALLBACK Callback)
+VfatFormat(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN QuickFormat,
+ IN BOOLEAN BackwardCompatible,
+ IN MEDIA_TYPE MediaType,
+ IN PUNICODE_STRING Label,
+ IN ULONG ClusterSize)
{
OBJECT_ATTRIBUTES ObjectAttributes;
DISK_GEOMETRY DiskGeometry;
@@ -64,6 +66,10 @@ VfatFormat(IN PUNICODE_STRING DriveRoot,
DPRINT("VfatFormat(DriveRoot '%wZ')\n", DriveRoot);
+ // FIXME:
+ UNREFERENCED_PARAMETER(BackwardCompatible);
+ UNREFERENCED_PARAMETER(MediaType);
+
Context.TotalSectorCount = 0;
Context.CurrentSectorCount = 0;
Context.Callback = Callback;
@@ -84,8 +90,8 @@ VfatFormat(IN PUNICODE_STRING DriveRoot,
FILE_SYNCHRONOUS_IO_ALERT);
if (!NT_SUCCESS(Status))
{
- DPRINT1("NtOpenFile() failed with status 0x%.08x\n", Status);
- return Status;
+ DPRINT1("NtOpenFile() failed with status 0x%08x\n", Status);
+ return FALSE;
}
Status = NtDeviceIoControlFile(FileHandle,
@@ -100,9 +106,9 @@ VfatFormat(IN PUNICODE_STRING DriveRoot,
sizeof(DISK_GEOMETRY));
if (!NT_SUCCESS(Status))
{
- DPRINT("IOCTL_DISK_GET_DRIVE_GEOMETRY failed with status 0x%.08x\n",
Status);
+ DPRINT("IOCTL_DISK_GET_DRIVE_GEOMETRY failed with status 0x%08x\n",
Status);
NtClose(FileHandle);
- return Status;
+ return FALSE;
}
if (DiskGeometry.MediaType == FixedMedia)
@@ -129,9 +135,9 @@ VfatFormat(IN PUNICODE_STRING DriveRoot,
sizeof(PARTITION_INFORMATION));
if (!NT_SUCCESS(Status))
{
- DPRINT("IOCTL_DISK_GET_PARTITION_INFO failed with status
0x%.08x\n", Status);
+ DPRINT("IOCTL_DISK_GET_PARTITION_INFO failed with status 0x%08x\n",
Status);
NtClose(FileHandle);
- return Status;
+ return FALSE;
}
}
else
@@ -214,7 +220,7 @@ VfatFormat(IN PUNICODE_STRING DriveRoot,
if (Callback != NULL)
{
Context.Percent = 0;
- Callback (PROGRESS, 0, (PVOID)&Context.Percent);
+ Callback(PROGRESS, 0, (PVOID)&Context.Percent);
}
LockStatus = NtFsControlFile(FileHandle,
@@ -306,15 +312,8 @@ VfatFormat(IN PUNICODE_STRING DriveRoot,
NtClose(FileHandle);
- if (Callback != NULL)
- {
- Context.Success = (BOOLEAN)(NT_SUCCESS(Status));
- Callback(DONE, 0, (PVOID)&Context.Success);
- }
-
- DPRINT("VfatFormat() done. Status 0x%.08x\n", Status);
-
- return Status;
+ DPRINT("VfatFormat() done. Status 0x%08x\n", Status);
+ return NT_SUCCESS(Status);
}
@@ -370,14 +369,20 @@ VfatPrint(PCHAR Format, ...)
}
-NTSTATUS
+BOOLEAN
NTAPI
-VfatChkdsk(IN PUNICODE_STRING DriveRoot,
- IN BOOLEAN FixErrors,
- IN BOOLEAN Verbose,
- IN BOOLEAN CheckOnlyIfDirty,
- IN BOOLEAN ScanDrive,
- IN PFMIFSCALLBACK Callback)
+VfatChkdsk(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN FixErrors,
+ IN BOOLEAN Verbose,
+ IN BOOLEAN CheckOnlyIfDirty,
+ IN BOOLEAN ScanDrive,
+ IN PVOID pUnknown1,
+ IN PVOID pUnknown2,
+ IN PVOID pUnknown3,
+ IN PVOID pUnknown4,
+ IN PULONG ExitStatus)
{
BOOLEAN verify;
BOOLEAN salvage_files;
@@ -385,6 +390,11 @@ VfatChkdsk(IN PUNICODE_STRING DriveRoot,
DOS_FS fs;
NTSTATUS Status;
+ UNREFERENCED_PARAMETER(pUnknown1);
+ UNREFERENCED_PARAMETER(pUnknown2);
+ UNREFERENCED_PARAMETER(pUnknown3);
+ UNREFERENCED_PARAMETER(pUnknown4);
+
RtlZeroMemory(&fs, sizeof(fs));
/* Store callback pointer */
@@ -416,7 +426,8 @@ VfatChkdsk(IN PUNICODE_STRING DriveRoot,
if (!NT_SUCCESS(Status))
{
fs_close(FALSE);
- return STATUS_DISK_CORRUPT_ERROR;
+ *ExitStatus = (ULONG)STATUS_DISK_CORRUPT_ERROR;
+ return FALSE;
}
if (CheckOnlyIfDirty && !fs_isdirty())
@@ -426,14 +437,17 @@ VfatChkdsk(IN PUNICODE_STRING DriveRoot,
fs_lock(FALSE);
/* No need to check FS */
- return (fs_close(FALSE) == 0 ? STATUS_SUCCESS : STATUS_DISK_CORRUPT_ERROR);
+ Status = (fs_close(FALSE) == 0 ? STATUS_SUCCESS : STATUS_DISK_CORRUPT_ERROR);
+ *ExitStatus = (ULONG)Status;
+ return (Status == STATUS_SUCCESS);
}
else if (CheckOnlyIfDirty && fs_isdirty())
{
if (!(FsCheckFlags & FSCHECK_READ_WRITE) && !(FsCheckFlags &
FSCHECK_INTERACTIVE))
{
fs_close(FALSE);
- return STATUS_DISK_CORRUPT_ERROR;
+ *ExitStatus = (ULONG)STATUS_DISK_CORRUPT_ERROR;
+ return FALSE;
}
}
@@ -503,7 +517,9 @@ VfatChkdsk(IN PUNICODE_STRING DriveRoot,
//
https://support.microsoft.com/en-us/kb/265533
/* Close the volume */
- return (fs_close(FsCheckFlags & FSCHECK_READ_WRITE) == 0 ? STATUS_SUCCESS :
STATUS_DISK_CORRUPT_ERROR);
+ Status = (fs_close(FsCheckFlags & FSCHECK_READ_WRITE) == 0 ? STATUS_SUCCESS :
STATUS_DISK_CORRUPT_ERROR);
+ *ExitStatus = (ULONG)Status;
+ return (Status == STATUS_SUCCESS);
}
/* EOF */
diff --git a/sdk/lib/fslib/vfatxlib/vfatxlib.c b/sdk/lib/fslib/vfatxlib/vfatxlib.c
index 4f40cad7593..d5b73e37f12 100644
--- a/sdk/lib/fslib/vfatxlib/vfatxlib.c
+++ b/sdk/lib/fslib/vfatxlib/vfatxlib.c
@@ -15,13 +15,16 @@
#define NDEBUG
#include <debug.h>
-NTSTATUS NTAPI
-VfatxFormat(IN PUNICODE_STRING DriveRoot,
- IN FMIFS_MEDIA_FLAG MediaFlag,
- IN PUNICODE_STRING Label,
- IN BOOLEAN QuickFormat,
- IN ULONG ClusterSize,
- IN PFMIFSCALLBACK Callback)
+BOOLEAN
+NTAPI
+VfatxFormat(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN QuickFormat,
+ IN BOOLEAN BackwardCompatible,
+ IN MEDIA_TYPE MediaType,
+ IN PUNICODE_STRING Label,
+ IN ULONG ClusterSize)
{
OBJECT_ATTRIBUTES ObjectAttributes;
DISK_GEOMETRY DiskGeometry;
@@ -33,6 +36,15 @@ VfatxFormat(IN PUNICODE_STRING DriveRoot,
DPRINT("VfatxFormat(DriveRoot '%wZ')\n", DriveRoot);
+ // FIXME:
+ UNREFERENCED_PARAMETER(MediaType);
+
+ if (BackwardCompatible)
+ {
+ DPRINT1("BackwardCompatible == TRUE is unsupported!\n");
+ return FALSE;
+ }
+
Context.TotalSectorCount = 0;
Context.CurrentSectorCount = 0;
Context.Callback = Callback;
@@ -53,8 +65,8 @@ VfatxFormat(IN PUNICODE_STRING DriveRoot,
FILE_SYNCHRONOUS_IO_ALERT);
if (!NT_SUCCESS(Status))
{
- DPRINT("NtOpenFile() failed with status 0x%.08x\n", Status);
- return Status;
+ DPRINT("NtOpenFile() failed with status 0x%08x\n", Status);
+ return FALSE;
}
Status = NtDeviceIoControlFile(FileHandle,
@@ -69,9 +81,9 @@ VfatxFormat(IN PUNICODE_STRING DriveRoot,
sizeof(DISK_GEOMETRY));
if (!NT_SUCCESS(Status))
{
- DPRINT("IOCTL_DISK_GET_DRIVE_GEOMETRY failed with status 0x%.08x\n",
Status);
+ DPRINT("IOCTL_DISK_GET_DRIVE_GEOMETRY failed with status 0x%08x\n",
Status);
NtClose(FileHandle);
- return Status;
+ return FALSE;
}
if (DiskGeometry.MediaType == FixedMedia)
@@ -98,9 +110,9 @@ VfatxFormat(IN PUNICODE_STRING DriveRoot,
sizeof(PARTITION_INFORMATION));
if (!NT_SUCCESS(Status))
{
- DPRINT("IOCTL_DISK_GET_PARTITION_INFO failed with status
0x%.08x\n", Status);
+ DPRINT("IOCTL_DISK_GET_PARTITION_INFO failed with status 0x%08x\n",
Status);
NtClose(FileHandle);
- return Status;
+ return FALSE;
}
}
else
@@ -141,27 +153,28 @@ VfatxFormat(IN PUNICODE_STRING DriveRoot,
&Context);
NtClose(FileHandle);
- if (Callback != NULL)
- {
- Context.Success = (BOOLEAN)(NT_SUCCESS(Status));
- Callback(DONE, 0, (PVOID)&Context.Success);
- }
-
- DPRINT("VfatxFormat() done. Status 0x%.08x\n", Status);
-
- return Status;
+ DPRINT("VfatxFormat() done. Status 0x%08x\n", Status);
+ return NT_SUCCESS(Status);
}
-NTSTATUS NTAPI
-VfatxChkdsk(IN PUNICODE_STRING DriveRoot,
- IN BOOLEAN FixErrors,
- IN BOOLEAN Verbose,
- IN BOOLEAN CheckOnlyIfDirty,
- IN BOOLEAN ScanDrive,
- IN PFMIFSCALLBACK Callback)
+BOOLEAN
+NTAPI
+VfatxChkdsk(
+ IN PUNICODE_STRING DriveRoot,
+ IN PFMIFSCALLBACK Callback,
+ IN BOOLEAN FixErrors,
+ IN BOOLEAN Verbose,
+ IN BOOLEAN CheckOnlyIfDirty,
+ IN BOOLEAN ScanDrive,
+ IN PVOID pUnknown1,
+ IN PVOID pUnknown2,
+ IN PVOID pUnknown3,
+ IN PVOID pUnknown4,
+ IN PULONG ExitStatus)
{
UNIMPLEMENTED;
- return STATUS_SUCCESS;
+ *ExitStatus = (ULONG)STATUS_SUCCESS;
+ return TRUE;
}
VOID