Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
cffe655
refactoring
assorted Feb 2, 2026
a3305a9
UDFInsertPrefix
assorted Feb 14, 2026
991f517
Merge branch 'udf-dev' of https://github.com/zero3k20/reactos into ud…
Zero3K20 Apr 27, 2026
bb810f0
Initial plan
Copilot Mar 6, 2026
f6f605d
[UDFS] Convert C++ to C for MinGW compatibility
Copilot Mar 6, 2026
9f38e09
Add udfs-for-write-branch.patch targeting the write branch directly
Copilot Mar 6, 2026
880986e
Fix C++ constructs in struct.h, udf_rel.h, ecma_167.h, osta_misc.h, p…
Copilot Mar 6, 2026
ff8baff
Regenerate write-branch patch with only C++->C syntax fixes, no udf-d…
Copilot Mar 6, 2026
fb5b873
Fix C++ default parameter values and DbgPrint declaration for MSVC C …
Copilot Mar 6, 2026
f30e8cc
Fix C4047: uint32 assigned void* (NULL) in mount.c line 2738
Copilot Mar 6, 2026
52a2c59
Fix patch: remove udf-dev content, base on write branch only with C++…
Copilot Mar 6, 2026
31d4a41
Fix MSVC C compilation errors: empty structs, enum typedefs, extern C…
Copilot Mar 6, 2026
3995e05
Apply remaining C++ to C compilation fixes from PR #105
Copilot Mar 6, 2026
b2f742e
Fix MinGW/GCC build errors: remove C++-only flags, fix inline placeme…
Copilot Mar 6, 2026
90a1c7e
Fix static/inline conflict in mem_tools.h and __inline forward decl w…
Copilot Mar 6, 2026
1242147
Fix stale .cpp include references after files were renamed to .c
Copilot Mar 7, 2026
b2878b9
Remove udfs-for-write-branch.patch
Copilot Mar 7, 2026
a5e5219
Fix mixed SEH macro nesting in UDFGetVolumeBitmap (fscntrl.c)
Copilot Mar 7, 2026
960ca67
Fix multiple definition of MyAllocInit (and other inline funcs) in me…
Copilot Mar 7, 2026
1de154a
[UDFS] Fix multiple definition / static-vs-non-static conflict for My…
Copilot Mar 7, 2026
ad59893
[UDFS] Fix compiler warnings in filesystem driver
Copilot Mar 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 37 additions & 39 deletions drivers/filesystems/udfs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,49 @@
include_directories(Include)

list(APPEND SOURCE
udf_info/alloc.cpp
udf_info/dirtree.cpp
udf_info/extent.cpp
udf_info/mount.cpp
udf_info/phys_eject.cpp
udf_info/physical.cpp
udf_info/remap.cpp
udf_info/udf_info.cpp
cleanup.cpp
close.cpp
create.cpp
devcntrl.cpp
dircntrl.cpp
env_spec.cpp
fastio.cpp
fileinfo.cpp
flush.cpp
fscntrl.cpp
lockctrl.cpp
mem.cpp
misc.cpp
namesup.cpp
prefxsup.cpp
pnp.cpp
read.cpp
secursup.cpp
shutdown.cpp
sys_spec.cpp
udf_dbg.cpp
udfinit.cpp
unload.cpp
verfysup.cpp
volinfo.cpp
write.cpp
strucsup.cpp
filobsup.cpp
udfdata.cpp
udf_info/alloc.c
udf_info/dirtree.c
udf_info/extent.c
udf_info/mount.c
udf_info/phys_eject.c
udf_info/physical.c
udf_info/remap.c
udf_info/udf_info.c
cleanup.c
close.c
create.c
devcntrl.c
dircntrl.c
env_spec.c
fastio.c
fileinfo.c
flush.c
fscntrl.c
lockctrl.c
mem.c
misc.c
namesup.c
pnp.c
read.c
secursup.c
shutdown.c
sys_spec.c
udf_dbg.c
udfinit.c
unload.c
verfysup.c
volinfo.c
write.c
strucsup.c
filobsup.c
udfdata.c
udffs.h)

add_library(udfs MODULE ${SOURCE} udffs.rc)

if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_compile_options(udfs PRIVATE -Wno-unused-but-set-variable)
target_compile_options(udfs PRIVATE -Wno-invalid-offsetof)
target_compile_options(udfs PRIVATE -Wno-error -fpermissive)
target_compile_options(udfs PRIVATE -Wno-error)
endif()

if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
Expand Down
2 changes: 1 addition & 1 deletion drivers/filesystems/udfs/Include/Sys_spec_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ __inline LARGE_INTEGER UDFMakeLargeInteger(LONGLONG value) {

#define UDFGetNTFileId(Vcb, fi) \
UDFMakeLargeInteger((((fi)->Dloc->FELoc.Mapping[0].extLocation - UDFPartStart(Vcb, -2)) + \
((LONGLONG)Vcb<<32)))
((LONGLONG)(ULONG_PTR)Vcb<<32)))

#define UnicodeIsPrint(a) RtlIsValidOemCharacter(&(a))

Expand Down
10 changes: 6 additions & 4 deletions drivers/filesystems/udfs/Include/mem_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ extern ULONG MemTotalAllocated;
#define MY_HEAP_MAX_FRAMES 512
#define MY_HEAP_MAX_BLOCKS 4*1024 // blocks per frame

#ifdef MY_USE_INTERNAL_MEMMANAGER
// Mem
BOOLEAN MyAllocInit(VOID);
VOID MyAllocRelease(VOID);
Expand All @@ -65,6 +66,7 @@ PCHAR __fastcall MyAllocatePool(ULONG Type, ULONG size
ULONG __fastcall MyReallocPool( PCHAR addr, ULONG OldLength, PCHAR* NewBuff, ULONG NewLength);
#endif
VOID __fastcall MyFreePool(PCHAR addr);
#endif // MY_USE_INTERNAL_MEMMANAGER

#ifdef MY_HEAP_CHECK_BOUNDS
#define MY_HEAP_ALIGN 63
Expand Down Expand Up @@ -130,7 +132,7 @@ MyFindMemBaseByAddr(
#define MyAlignSize__(size) (size)
#endif

BOOLEAN inline MyAllocInit(VOID) {return TRUE;}
static inline BOOLEAN MyAllocInit(VOID) {return TRUE;}
#define MyAllocRelease()

#ifndef MY_MEM_BOUNDS_CHECK
Expand Down Expand Up @@ -176,7 +178,7 @@ PVOID inline MyAllocatePool__(ULONG type, ULONG len) {
}
*/

PVOID inline MyAllocatePoolTag__(ULONG type, ULONG len, /*PCHAR*/ULONG tag) {
static inline PVOID MyAllocatePoolTag__(ULONG type, ULONG len, /*PCHAR*/ULONG tag) {
PCHAR newaddr;
ULONG i;
// newaddr = (PCHAR)MyAllocatePoolTag_(type, len+MY_HEAP_ALIGN+1, tag);
Expand All @@ -193,7 +195,7 @@ PVOID inline MyAllocatePoolTag__(ULONG type, ULONG len, /*PCHAR*/ULONG tag) {
return newaddr;
}

VOID inline MyFreePool__(PVOID addr) {
static inline VOID MyFreePool__(PVOID addr) {
PCHAR newaddr;
// ULONG i;
newaddr = (PCHAR)addr;
Expand All @@ -220,7 +222,7 @@ VOID inline MyFreePool__(PVOID addr) {
#pragma GCC diagnostic ignored "-Wstringop-overflow"
#endif

ULONG inline MyReallocPool__(PCHAR addr, ULONG len, PCHAR *pnewaddr, ULONG newlen) {
static inline ULONG MyReallocPool__(PCHAR addr, ULONG len, PCHAR *pnewaddr, ULONG newlen) {
ULONG _len, _newlen;
_newlen = MyAlignSize__(newlen);
_len = MyAlignSize__(len);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -796,14 +796,14 @@ UDFGetBlockSize(
if (UDFGetDevType(DeviceObject) == FILE_DEVICE_DISK) {
UDFPrint(("UDFGetBlockSize: HDD\n"));
RC = UDFPhSendIOCTL(IOCTL_DISK_GET_DRIVE_GEOMETRY_EX,DeviceObject,
0,NULL,
NULL,0,
&DiskGeometryEx,sizeof(DISK_GEOMETRY_EX),
TRUE,NULL );

if (!NT_SUCCESS(RC))
try_return(RC);
RC = UDFPhSendIOCTL(IOCTL_DISK_GET_PARTITION_INFO,DeviceObject,
0,NULL,
NULL,0,
&PartitionInfo,sizeof(PARTITION_INFORMATION),
TRUE,NULL );
if (!NT_SUCCESS(RC)) {
Expand Down Expand Up @@ -1002,7 +1002,6 @@ UDFPrepareForReadOperation(
Vcb->VcbState &= ~UDF_VCB_LAST_WRITE;
return STATUS_SUCCESS;
}
uint32 i = Vcb->LastReadTrack;

#ifdef _UDF_STRUCTURES_H_
if (Vcb->BSBM_Bitmap) {
Expand Down Expand Up @@ -1036,7 +1035,7 @@ UDFReadSectors(
OUT PULONG ReadBytes
)
{
return UDFTRead(IrpContext, Vcb, Buffer, BCount*Vcb->SectorSize, Lba, ReadBytes);
return UDFTRead(IrpContext, Vcb, Buffer, BCount*Vcb->SectorSize, Lba, ReadBytes, 0);
} // end UDFReadSectors()

/*
Expand Down Expand Up @@ -1167,7 +1166,7 @@ UDFWriteSectors(
Vcb->LastLBA = Lba+BCount-1;
}

status = UDFTWrite(IrpContext, Vcb, Buffer, BCount<<Vcb->SectorShift, Lba, WrittenBytes);
status = UDFTWrite(IrpContext, Vcb, Buffer, BCount<<Vcb->SectorShift, Lba, WrittenBytes, 0);
ASSERT(NT_SUCCESS(status));

return status;
Expand Down
4 changes: 2 additions & 2 deletions drivers/filesystems/udfs/Include/phys_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ UDFTRead(
SIZE_T Length,
ULONG LBA,
PULONG ReadBytes,
ULONG Flags = 0
ULONG Flags
);

NTSTATUS
Expand All @@ -26,7 +26,7 @@ UDFTWrite(
IN SIZE_T Length,
IN ULONG LBA,
OUT PSIZE_T WrittenBytes,
IN ULONG Flags = 0
IN ULONG Flags
);

#define PH_TMP_BUFFER 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// This file was released under the GPLv2 on June 2015.
////////////////////////////////////////////////////////////////////

extern "C"
ULONG
MyRtlCompareMemory(
PVOID s1,
Expand All @@ -26,7 +25,6 @@ MyRtlCompareMemory(

#ifndef NT_NATIVE_MODE

extern "C"
ULONG
RtlCompareUnicodeString(
PUNICODE_STRING s1,
Expand All @@ -41,7 +39,6 @@ RtlCompareUnicodeString(
return i;
}

extern "C"
NTSTATUS
RtlUpcaseUnicodeString(
PUNICODE_STRING dst,
Expand All @@ -57,7 +54,6 @@ RtlUpcaseUnicodeString(
return STATUS_SUCCESS;
}

extern "C"
NTSTATUS
RtlAppendUnicodeToString(
IN PUNICODE_STRING Str1,
Expand Down
Loading