#ifndef _NTIOAPI_H
/**
* The NtSetIoCompletion routine queues an I/O completion packet to an I/O completion port.
*
* \param[in] IoCompletionHandle Handle to the I/O completion port.
* \param[in, optional] KeyContext The value specified when the port was associated with a file handle.
* \param[in, optional] ApcContext The value specified when the I/O operation was issued.
* \param[in] IoStatus The completion status for the I/O operation.
* \param[in] IoStatusInformation The number of bytes transferred or other information.
* \return NTSTATUS Successful or errant status.
* \sa https://learn.microsoft.com/en-us/windows/win32/api/ioapiset/nf-ioapiet-postqueuedcompletionstatus
*/
NTSYSCALLAPI
NTSTATUS
NTAPI
NtSetIoCompletion(
_In_ HANDLE IoCompletionHandle,
_In_opt_ PVOID KeyContext,
_In_opt_ PVOID ApcContext,
_In_ NTSTATUS IoStatus,
_In_ ULONG_PTR IoStatusInformation
);
View code on GitHub#ifndef _NTZWAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwSetIoCompletion(
_In_ HANDLE IoCompletionHandle,
_In_opt_ PVOID KeyContext,
_In_opt_ PVOID ApcContext,
_In_ NTSTATUS IoStatus,
_In_ ULONG_PTR IoStatusInformation
);
View code on GitHubNo description available.
Function NtSetIoCompletion increments pending IO counter in IO Completion Object. It can be used to manual finish IO operation.
HANDLE to IO Completion Object opened with IO_COMPLETION_MODIFY_STATE access.
User's defined key received by NtRemoveIoCompletion function.
IO result of call.
IO operation status.
Number of bytes transferred in manually finished IO operation.