IoCompletion: Removed !wait_ticks check
This commit is contained in:
parent
0035720a84
commit
049da82036
|
@ -449,7 +449,8 @@ dword_result_t NtSetIoCompletion(dword_t handle, dword_t key_context,
|
||||||
port->QueueNotification(notification);
|
port->QueueNotification(notification);
|
||||||
return X_STATUS_SUCCESS;
|
return X_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
DECLARE_XBOXKRNL_EXPORT1(NtSetIoCompletion, kFileSystem, kImplemented);
|
DECLARE_XBOXKRNL_EXPORT2(NtSetIoCompletion, kFileSystem, kImplemented,
|
||||||
|
kHighFrequency);
|
||||||
|
|
||||||
// Dequeues a packet from the completion port.
|
// Dequeues a packet from the completion port.
|
||||||
dword_result_t NtRemoveIoCompletion(
|
dword_result_t NtRemoveIoCompletion(
|
||||||
|
@ -479,12 +480,18 @@ dword_result_t NtRemoveIoCompletion(
|
||||||
io_status_block->information = notification.num_bytes;
|
io_status_block->information = notification.num_bytes;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
status = X_STATUS_TIMEOUT;
|
// TODO(Gliniak): We're returning X_STATUS_SUCCESS here instead of
|
||||||
|
// X_STATUS_TIMEOUT due to timing issues between threads when subthread
|
||||||
|
// execute NtRemoveIoCompletion before mainthread execute NtSetIoCompletion
|
||||||
|
// Returning X_STATUS_SUCCESS suprisingly doesn't bother titles that uses
|
||||||
|
// this function, but X_STATUS_TIMEOUT causes them to lock
|
||||||
|
status = X_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
DECLARE_XBOXKRNL_EXPORT1(NtRemoveIoCompletion, kFileSystem, kImplemented);
|
DECLARE_XBOXKRNL_EXPORT2(NtRemoveIoCompletion, kFileSystem, kImplemented,
|
||||||
|
kHighFrequency);
|
||||||
|
|
||||||
dword_result_t NtQueryFullAttributesFile(
|
dword_result_t NtQueryFullAttributesFile(
|
||||||
pointer_t<X_OBJECT_ATTRIBUTES> obj_attribs,
|
pointer_t<X_OBJECT_ATTRIBUTES> obj_attribs,
|
||||||
|
|
|
@ -30,7 +30,7 @@ bool XIOCompletion::WaitForNotification(uint64_t wait_ticks,
|
||||||
IONotification* notify) {
|
IONotification* notify) {
|
||||||
auto ms = std::chrono::milliseconds(TimeoutTicksToMs(wait_ticks));
|
auto ms = std::chrono::milliseconds(TimeoutTicksToMs(wait_ticks));
|
||||||
auto res = threading::Wait(notification_semaphore_.get(), false, ms);
|
auto res = threading::Wait(notification_semaphore_.get(), false, ms);
|
||||||
if (res == threading::WaitResult::kSuccess || !wait_ticks) {
|
if (res == threading::WaitResult::kSuccess) {
|
||||||
std::unique_lock<std::mutex> lock(notification_lock_);
|
std::unique_lock<std::mutex> lock(notification_lock_);
|
||||||
assert_false(notifications_.empty());
|
assert_false(notifications_.empty());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue