- Add a basic CDFS filesystem library "cdfslib" for checking and formatting a CDFS volume. Checking is unimplemented and formatting not supported anyway :)
- Use this library in the new "ucdfs" DLL and that DLL in "autochk". Fixes the "Unable to verify a CDFS volume" message at boot.
- Return the right device type (FILE_DEVICE_CD_ROM or FILE_DEVICE_DISK) in when querying volume information in cdfs.sys to get the proper icon in Explorer.

svn path=/trunk/; revision=75591
This commit is contained in:
Colin Finck 2017-08-17 12:21:27 +00:00
parent d31e5d598c
commit fb160be266
10 changed files with 92 additions and 2 deletions

View file

@ -283,7 +283,11 @@ LoadProvider(
{
RtlInitUnicodeString(&ProviderDll, L"uffs.dll");
}
else
else if (wcscmp(FileSystem, L"CDFS") == 0)
{
RtlInitUnicodeString(&ProviderDll, L"ucdfs.dll");
}
else
{
return NULL;
}

View file

@ -206,6 +206,7 @@ add_subdirectory(themeui)
add_subdirectory(traffic)
add_subdirectory(twain_32)
add_subdirectory(ubtrfs)
add_subdirectory(ucdfs)
add_subdirectory(uext2)
add_subdirectory(ufat)
add_subdirectory(ufatx)

View file

@ -0,0 +1,13 @@
spec2def(ucdfs.dll ucdfs.spec)
list(APPEND SOURCE
ucdfs.c
ucdfs.rc
${CMAKE_CURRENT_BINARY_DIR}/ucdfs.def)
add_library(ucdfs SHARED ${SOURCE})
set_module_type(ucdfs nativedll)
target_link_libraries(ucdfs cdfslib)
add_importlibs(ucdfs ntdll)
add_cd_file(TARGET ucdfs DESTINATION reactos/system32 FOR all)

View file

@ -0,0 +1,20 @@
/*
* PROJECT: CDFS File System Management
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
* PURPOSE: DLL Initialization
* COPYRIGHT: Copyright 2017 Colin Finck <colin@reactos.org>
*/
#include <windef.h>
INT WINAPI
DllMain(IN HINSTANCE hinstDLL,
IN DWORD dwReason,
IN LPVOID lpvReserved)
{
UNREFERENCED_PARAMETER(hinstDLL);
UNREFERENCED_PARAMETER(dwReason);
UNREFERENCED_PARAMETER(lpvReserved);
return TRUE;
}

View file

@ -0,0 +1,5 @@
#define REACTOS_VERSION_DLL
#define REACTOS_STR_FILE_DESCRIPTION "CDFS File System Management"
#define REACTOS_STR_INTERNAL_NAME "ucdfs"
#define REACTOS_STR_ORIGINAL_FILENAME "ucdfs.dll"
#include <reactos/version.rc>

View file

@ -0,0 +1,2 @@
@ stdcall ChkdskEx(ptr long long long long ptr) CdfsChkdsk
@ stdcall FormatEx(ptr long ptr long long ptr) CdfsFormat

View file

@ -159,7 +159,11 @@ CdfsGetFsDeviceInformation(
if (*BufferLength < sizeof(FILE_FS_DEVICE_INFORMATION))
return STATUS_BUFFER_OVERFLOW;
FsDeviceInfo->DeviceType = FILE_DEVICE_CD_ROM;
if (DeviceObject->DeviceType == FILE_DEVICE_CD_ROM_FILE_SYSTEM)
FsDeviceInfo->DeviceType = FILE_DEVICE_CD_ROM;
else
FsDeviceInfo->DeviceType = FILE_DEVICE_DISK;
FsDeviceInfo->Characteristics = DeviceObject->Characteristics;
DPRINT("FsdGetFsDeviceInformation() finished.\n");

View file

@ -1,5 +1,6 @@
add_subdirectory(btrfslib)
add_subdirectory(cdfslib)
add_subdirectory(ext2lib)
add_subdirectory(ffslib)
add_subdirectory(ntfslib)

View file

@ -0,0 +1,3 @@
add_library(cdfslib cdfslib.c)
add_dependencies(cdfslib psdk)

View file

@ -0,0 +1,37 @@
/*
* PROJECT: ReactOS CDFS library
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
* PURPOSE: Checking and Formatting CDFS volumes
* COPYRIGHT: Copyright 2017 Colin Finck <colin@reactos.org>
*/
#define NTOS_MODE_USER
#include <ndk/umtypes.h>
#include <fmifs/fmifs.h>
#define NDEBUG
#include <debug.h>
NTSTATUS NTAPI
CdfsChkdsk(IN PUNICODE_STRING DriveRoot,
IN BOOLEAN FixErrors,
IN BOOLEAN Verbose,
IN BOOLEAN CheckOnlyIfDirty,
IN BOOLEAN ScanDrive,
IN PFMIFSCALLBACK Callback)
{
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;
}