Fixing some misc bugs.
This commit is contained in:
@@ -60,7 +60,7 @@ class XThread : public XObject {
|
||||
void SetPriority(int32_t increment);
|
||||
void SetAffinity(uint32_t affinity);
|
||||
|
||||
X_STATUS Resume(uint32_t* out_suspend_count);
|
||||
X_STATUS Resume(uint32_t* out_suspend_count = nullptr);
|
||||
X_STATUS Suspend(uint32_t* out_suspend_count);
|
||||
X_STATUS Delay(uint32_t processor_mode, uint32_t alertable,
|
||||
uint64_t interval);
|
||||
|
||||
@@ -539,6 +539,7 @@ int xe_xex2_read_image_uncompressed(const xe_xex2_header_t *header,
|
||||
return 2;
|
||||
}
|
||||
uint8_t *buffer = memory->Translate(header->exe_address);
|
||||
std::memset(buffer, 0, uncompressed_size);
|
||||
|
||||
const uint8_t *p = (const uint8_t *)xex_addr + header->exe_offset;
|
||||
|
||||
@@ -589,6 +590,7 @@ int xe_xex2_read_image_basic_compressed(const xe_xex2_header_t *header,
|
||||
}
|
||||
uint8_t *buffer = memory->Translate(header->exe_address);
|
||||
uint8_t *d = buffer;
|
||||
std::memset(buffer, 0, uncompressed_size);
|
||||
|
||||
uint32_t rk[4 * (MAXNR + 1)];
|
||||
uint8_t ivec[16] = {0};
|
||||
@@ -725,6 +727,7 @@ int xe_xex2_read_image_compressed(const xe_xex2_header_t *header,
|
||||
goto XECLEANUP;
|
||||
}
|
||||
uint8_t *buffer = memory->Translate(header->exe_address);
|
||||
std::memset(buffer, 0, uncompressed_size);
|
||||
|
||||
// Setup decompressor and decompress.
|
||||
sys = mspack_memory_sys_create();
|
||||
|
||||
@@ -159,21 +159,14 @@ SHIM_CALL NtResumeThread_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
|
||||
SHIM_CALL KeResumeThread_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
uint32_t thread_ptr = SHIM_GET_ARG_32(0);
|
||||
uint32_t suspend_count_ptr = SHIM_GET_ARG_32(1);
|
||||
|
||||
XELOGD("KeResumeThread(%.8X, %.8X)", thread_ptr, suspend_count_ptr);
|
||||
XELOGD("KeResumeThread(%.8X)", thread_ptr);
|
||||
|
||||
X_STATUS result;
|
||||
XThread* thread =
|
||||
(XThread*)XObject::GetObject(state, SHIM_MEM_ADDR(thread_ptr));
|
||||
uint32_t suspend_count;
|
||||
if (thread) {
|
||||
result = thread->Resume(&suspend_count);
|
||||
}
|
||||
if (XSUCCEEDED(result)) {
|
||||
if (suspend_count_ptr) {
|
||||
SHIM_SET_MEM_32(suspend_count_ptr, suspend_count);
|
||||
}
|
||||
result = thread->Resume();
|
||||
}
|
||||
|
||||
SHIM_SET_RETURN_32(result);
|
||||
@@ -447,7 +440,9 @@ SHIM_CALL NtCreateEvent_shim(PPCContext* ppc_state, KernelState* state) {
|
||||
|
||||
// TODO(benvanik): check for name collision. May return existing object if
|
||||
// type matches.
|
||||
AssertNoNameCollision(state, obj_attributes_ptr);
|
||||
if (obj_attributes_ptr) {
|
||||
AssertNoNameCollision(state, obj_attributes_ptr);
|
||||
}
|
||||
|
||||
XEvent* ev = new XEvent(state);
|
||||
ev->Initialize(!event_type, !!initial_state);
|
||||
|
||||
Reference in New Issue
Block a user