[XAM] - Replacing Unk

- Replacing unk parameters
- Naming unk xmp calls
- Added missing xmp structs
- Added missing messenger structs
- Added missing XamProfileCreate related structs
This commit is contained in:
The-Little-Wolf
2025-06-18 08:27:00 -07:00
committed by Radosław Gliński
parent fd82727be6
commit 6314388c51
13 changed files with 198 additions and 55 deletions

View File

@@ -58,7 +58,7 @@ namespace xam {
// https://github.com/tpn/winsdk-10/blob/master/Include/10.0.14393.0/km/wdm.h#L15539
typedef enum _MODE { KernelMode, UserMode, MaximumMode } MODE;
dword_result_t XamFeatureEnabled_entry(dword_t unk) { return 0; }
dword_result_t XamFeatureEnabled_entry(dword_t app_id) { return 0; }
DECLARE_XAM_EXPORT1(XamFeatureEnabled, kNone, kStub);
dword_result_t XamGetStagingMode_entry() { return cvars::staging_mode; }
@@ -107,7 +107,7 @@ void XamFormatDateString_entry(dword_t locale_format, qword_t filetime,
}
DECLARE_XAM_EXPORT1(XamFormatDateString, kNone, kImplemented);
void XamFormatTimeString_entry(dword_t unk, qword_t filetime,
void XamFormatTimeString_entry(dword_t user_index, qword_t filetime,
lpvoid_t output_buffer, dword_t output_count) {
output_buffer.Zero(output_count * sizeof(char16_t));
@@ -530,22 +530,20 @@ dword_result_t GetModuleHandleA_entry(lpstring_t module_name) {
}
DECLARE_XAM_EXPORT1(GetModuleHandleA, kNone, kImplemented);
dword_result_t XapipCreateThread_entry(lpdword_t lpThreadAttributes,
dword_t dwStackSize,
lpvoid_t lpStartAddress,
lpvoid_t lpParameter,
dword_t dwCreationFlags, dword_t unkn,
lpdword_t lpThreadId) {
uint32_t flags = (dwCreationFlags >> 2) & 1;
dword_result_t XapipCreateThread_entry(
lpdword_t thread_attributes, dword_t stack_size, lpvoid_t start_address,
lpvoid_t parameter, dword_t creation_flags, dword_t thread_processor,
lpdword_t thread_id) {
uint32_t flags = (creation_flags >> 2) & 1;
if (unkn != -1) {
flags |= 1 << unkn << 24;
if (thread_processor != -1) {
flags |= 1 << thread_processor << 24;
}
xe::be<uint32_t> result = 0;
const X_STATUS error_code = xe::kernel::xboxkrnl::ExCreateThread(
&result, dwStackSize, lpThreadId, lpStartAddress, lpParameter, 0, flags);
&result, stack_size, thread_id, start_address, parameter, 0, flags);
if (XFAILED(error_code)) {
RtlSetLastNTError_entry(error_code);