Skip to content

Commit

Permalink
Allow raw read request in xiso driver
Browse files Browse the repository at this point in the history
  • Loading branch information
ergo720 committed Aug 13, 2024
1 parent 82bf3f3 commit f56690f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nboxkrnl/io/cdrom/xiso.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,10 @@ static NTSTATUS XBOXAPI XisoIrpRead(PDEVICE_OBJECT DeviceObject, PIRP Irp)
}

if (FileInfo->Flags & XISO_VOLUME_FILE) {
// We can't support the volume itself, because there's no dvd image on the host side

return XisoCompleteRequest(Irp, STATUS_IO_DEVICE_ERROR, VolumeExtension);
// We can only support the volume itself if the user booted an xiso image
if (IoDvdInputType == 0) {
return XisoCompleteRequest(Irp, STATUS_IO_DEVICE_ERROR, VolumeExtension);
}
}
else {
// Cannot read past the end of the file
Expand Down
1 change: 1 addition & 0 deletions nboxkrnl/io/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ BOOLEAN IoInitSystem()
}

XboxFactoryGameRegion = CachedEeprom.EncryptedSettings.GameRegion;
IoDvdInputType = inl(DVD_MEDIA_TYPE);

if (!HddInitDriver()) {
return FALSE;
Expand Down
3 changes: 3 additions & 0 deletions nboxkrnl/kernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#define IO_RETRY 0x207
// Request the I/O request with the specified id
#define IO_QUERY 0x208
// Request the dvd type the user has booted
#define DVD_MEDIA_TYPE 0x209
// Check if a I/O request was submitted successfully
#define IO_CHECK_ENQUEUE 0x20A
// Request the path's length of the XBE to launch when no reboot occured
Expand Down Expand Up @@ -141,6 +143,7 @@ struct XBOX_HARDWARE_INFO {
};

inline SystemType XboxType;
inline ULONG IoDvdInputType; // 0: xbe, 1: xiso
inline ULONGLONG IoRequestId = 0;
inline ULONGLONG IoHostFileHandle = FIRST_FREE_HANDLE;

Expand Down

0 comments on commit f56690f

Please sign in to comment.