Check for null string passed to Win32Thread::set_name

Move impl of XamAlloc into XamAllocImpl
Implement XamAllocEx
Implement XamIsCurrentTitleDash
Implement XamGetLocaleDateFormat
Implement "stub" of XFileFsDeviceInformation, XFileSectorInformation (log warnings when they're executed so this doesnt get mistaken for an actual implementation)
Added xboxkrnl_memory file
Moved meat of MmAllocatePhysicalMemoryEx into xeMmAllocatePhysicalMemoryEx, exposed its definition via xboxkrnl_memory.

Moved impl of RtlImageHeaderNt into a helper function
Implement RtlImageDirectoryEntryToData
Implement KeSuspendThread
Check for bad handles passed in XOVERLAPPED, fixes crash in 415608D8
This commit is contained in:
chss95cs@gmail.com
2023-04-30 13:22:49 -04:00
parent 37051afcaf
commit b270c59d0c
10 changed files with 241 additions and 30 deletions

View File

@@ -92,10 +92,15 @@ dword_result_t NtQueryInformationFile_entry(
break;
}
case XFileSectorInformation: {
// TODO(benvanik): return sector this file's on.
XELOGE("NtQueryInformationFile(XFileSectorInformation) unimplemented");
status = X_STATUS_INVALID_PARAMETER;
out_length = 0;
// SW that uses this seems to use the output as a way of uniquely
// identifying a file for sorting/lookup so we can just give it an
// arbitrary 4 byte integer most of the time
XELOGW("Stub XFileSectorInformation!");
auto info = info_ptr.as<uint32_t*>();
//low 32 bits of ptr. todo: maybe hash name?
*info = static_cast<uint32_t>(
reinterpret_cast<uintptr_t>(file->file()->entry()));
out_length = 4;
break;
}
case XFileXctdCompressionInformation: {
@@ -338,9 +343,17 @@ dword_result_t NtQueryVolumeInformationFile_entry(
}
break;
}
case XFileFsDeviceInformation:
case XFileFsDeviceInformation: {
auto info = info_ptr.as<X_FILE_FS_DEVICE_INFORMATION*>();
auto file_device = file->device();
XELOGW("Stub XFileFsDeviceInformation!");
//FILE_DEVICE_UNKNOWN
info->device_type = 0x22; // 415608D8 checks for 0x46;
info->characteristics = 0;
out_length = 8;
break;
}
default: {
// Unsupported, for now.
assert_always();
out_length = 0;
break;