Remove workarounds for handles passed into Ke* functions.

This commit is contained in:
Dr. Chat 2015-10-31 10:31:35 -05:00
parent 4d22c21688
commit cee0e582c2
1 changed files with 4 additions and 23 deletions

View File

@ -269,18 +269,8 @@ SHIM_CALL KeSetBasePriorityThread_shim(PPCContext* ppc_context,
XELOGD("KeSetBasePriorityThread(%.8X, %.8X)", thread_ptr, increment);
int32_t prev_priority = 0;
object_ref<XThread> thread;
if (thread_ptr < 0x1000) {
// They passed in a handle (for some reason)
thread = kernel_state->object_table()->LookupObject<XThread>(thread_ptr);
// Log it in case this is the source of any problems in the future
XELOGD("KeSetBasePriorityThread - Interpreting thread ptr as handle!");
} else {
thread = XObject::GetNativeObject<XThread>(kernel_state,
SHIM_MEM_ADDR(thread_ptr));
}
auto thread = XObject::GetNativeObject<XThread>(kernel_state,
SHIM_MEM_ADDR(thread_ptr));
if (thread) {
prev_priority = thread->QueryPriority();
@ -856,17 +846,8 @@ SHIM_CALL KeWaitForSingleObject_shim(PPCContext* ppc_context,
XELOGD("KeWaitForSingleObject(%.8X, %.8X, %.8X, %.1X, %.8X)", object_ptr,
wait_reason, processor_mode, alertable, timeout_ptr);
object_ref<XObject> object;
if (object_ptr < 0x1000) {
// They passed in a handle (for some reason)
object = kernel_state->object_table()->LookupObject<XObject>(object_ptr);
// Log it in case this is the source of any problems in the future
XELOGD("KeWaitForSingleObject - Interpreting object ptr as handle!");
} else {
object = XObject::GetNativeObject<XObject>(kernel_state,
SHIM_MEM_ADDR(object_ptr));
}
auto object = XObject::GetNativeObject<XObject>(kernel_state,
SHIM_MEM_ADDR(object_ptr));
if (!object) {
// The only kind-of failure code.