[Kernel] NtReadFile: Add APC call only for successful executions

This commit is contained in:
Gliniak
2025-05-27 12:31:42 +02:00
committed by Radosław Gliński
parent 97be6ebf51
commit 96c2fb13f7

View File

@@ -160,7 +160,7 @@ dword_result_t NtReadFile_entry(dword_t file_handle, dword_t event_handle,
// though were are completing immediately.
// Low bit probably means do not queue to IO ports.
if ((uint32_t)apc_routine_ptr & ~1) {
if (apc_context) {
if (apc_context && result == X_STATUS_SUCCESS) {
auto thread = XThread::GetCurrentThread();
thread->EnqueueApc(static_cast<uint32_t>(apc_routine_ptr) & ~1u,
apc_context, io_status_block, 0);