From 2cfaba893e80d26ba348eaa30bcf420dc60de15c Mon Sep 17 00:00:00 2001 From: RadWolfie Date: Sun, 11 Aug 2024 12:51:46 -0500 Subject: [PATCH 1/2] kernel: fix Exhibition Demo discs problem for copy soundtracks onto hdd (require force santion) --- src/core/kernel/exports/EmuKrnlIo.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/kernel/exports/EmuKrnlIo.cpp b/src/core/kernel/exports/EmuKrnlIo.cpp index 4ffecf890..ce9911583 100644 --- a/src/core/kernel/exports/EmuKrnlIo.cpp +++ b/src/core/kernel/exports/EmuKrnlIo.cpp @@ -281,6 +281,11 @@ XBSYSAPI EXPORTNUM(66) xbox::ntstatus_xt NTAPI xbox::IoCreateFile // Force ShareAccess to all ShareAccess = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; + // Force sanitize before call to NtDll::NtCreateFile + // Testcase: + // * Exhibition Demo discs - Attempt to create music folder fail internally which then show unable to copy soundtrack dialog. + FileAttributes &= FILE_ATTRIBUTE_VALID_FLAGS; + if (SUCCEEDED(ret)) { // redirect to NtCreateFile From 77c63ceec3070377470278abc3e289e58da89d0a Mon Sep 17 00:00:00 2001 From: RadWolfie Date: Thu, 15 Aug 2024 08:45:43 -0500 Subject: [PATCH 2/2] kernel: fix dashupdate titles attempt delete new files NOTE: Partition2.bin needs to be emulated in order for copy files to partition and fatx metadata. --- src/core/kernel/exports/EmuKrnlIo.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/kernel/exports/EmuKrnlIo.cpp b/src/core/kernel/exports/EmuKrnlIo.cpp index ce9911583..d26e42e7d 100644 --- a/src/core/kernel/exports/EmuKrnlIo.cpp +++ b/src/core/kernel/exports/EmuKrnlIo.cpp @@ -281,6 +281,12 @@ XBSYSAPI EXPORTNUM(66) xbox::ntstatus_xt NTAPI xbox::IoCreateFile // Force ShareAccess to all ShareAccess = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; + // Force set DELETE permission flag if write attributes flag is set. + // Testcase: dashupdate.xbe (4928, untested with other versions but newer dashupdate did not call for deletion on fail). + if (DesiredAccess & FILE_WRITE_ATTRIBUTES) { + DesiredAccess |= DELETE; + } + // Force sanitize before call to NtDll::NtCreateFile // Testcase: // * Exhibition Demo discs - Attempt to create music folder fail internally which then show unable to copy soundtrack dialog.