NtSetIoCompletionEx - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTIOAPI_H

/**
 * Posts a packet using a reusable MemoryReserveIoCompletion object allocated by
 * NtAllocateReserveObject. This is not a wait-completion packet handle from
 * NtCreateWaitCompletionPacket; the two object types are not interchangeable.
 *
 * \param[in] IoCompletionHandle Port handle with IO_COMPLETION_MODIFY_STATE (0x2).
 * \param[in] IoCompletionPacketHandle MemoryReserveIoCompletion reserve handle
 * with access bit 0x2. The reserve can back only one outstanding packet at a time.
 * \param[in, optional] KeyContext Opaque pointer-sized value returned to the consumer.
 * \param[in, optional] ApcContext Opaque pointer-sized value, not a callback address.
 * \param[in] IoStatus Status stored in the packet, independent of posting status.
 * \param[in] IoStatusInformation Pointer-sized information stored in the packet.
 * \return STATUS_SUCCESS when posted. An in-use reserve returns
 * STATUS_INVALID_PARAMETER_2; a UserApc reserve or wait-completion packet is the
 * wrong object type and returns STATUS_OBJECT_TYPE_MISMATCH.
 * \remarks The queued packet holds a reference to the reserve. Dequeuing releases
 * its in-use state and permits reuse. Closing the caller's reserve handle after
 * posting does not invalidate the queued packet, but forfeits that handle for reuse.
 */
_Kernel_entry_
NTSYSCALLAPI
NTSTATUS
NTAPI
NtSetIoCompletionEx(
    _In_ HANDLE IoCompletionHandle,
    _In_ HANDLE IoCompletionPacketHandle,
    _In_opt_ PVOID KeyContext,
    _In_opt_ PVOID ApcContext,
    _In_ NTSTATUS IoStatus,
    _In_ ULONG_PTR IoStatusInformation
    );

#endif

View code on GitHub
#ifndef _NTZWAPI_H

_Kernel_entry_
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwSetIoCompletionEx(
    _In_ HANDLE IoCompletionHandle,
    _In_ HANDLE IoCompletionPacketHandle,
    _In_opt_ PVOID KeyContext,
    _In_opt_ PVOID ApcContext,
    _In_ NTSTATUS IoStatus,
    _In_ ULONG_PTR IoStatusInformation
    );

#endif

View code on GitHub

NtDoc

No description available.