From ea6969f37820ba55b19717233bee88a2e04e369e Mon Sep 17 00:00:00 2001 From: Gliniak Date: Fri, 25 Dec 2020 20:31:51 +0100 Subject: [PATCH] [Kernel] Implemented NtSetIoCompletion --- src/xenia/kernel/xboxkrnl/xboxkrnl_io.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_io.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_io.cc index 5f19d7ca2..fc5d6ef16 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_io.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_io.cc @@ -353,6 +353,26 @@ dword_result_t NtCreateIoCompletion(lpdword_t out_handle, } DECLARE_XBOXKRNL_EXPORT1(NtCreateIoCompletion, kFileSystem, kImplemented); +dword_result_t NtSetIoCompletion(dword_t handle, dword_t key_context, + dword_t apc_context, dword_t completion_status, + dword_t num_bytes) { + auto port = + kernel_state()->object_table()->LookupObject(handle); + if (!port) { + return X_STATUS_INVALID_HANDLE; + } + + XIOCompletion::IONotification notification; + notification.key_context = key_context; + notification.apc_context = apc_context; + notification.num_bytes = num_bytes; + notification.status = completion_status; + + port->QueueNotification(notification); + return X_STATUS_SUCCESS; +} +DECLARE_XBOXKRNL_EXPORT1(NtSetIoCompletion, kFileSystem, kImplemented); + // Dequeues a packet from the completion port. dword_result_t NtRemoveIoCompletion( dword_t handle, lpdword_t key_context, lpdword_t apc_context,