NtOpenIoCompletion - NtDoc

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

/**
 * Opens an existing named I/O completion port without removing queued packets.
 *
 * \param[out] IoCompletionHandle Receives a caller-owned handle; close with NtClose.
 * \param[in] DesiredAccess Requested access: IO_COMPLETION_QUERY_STATE (0x1)
 * for depth queries and IO_COMPLETION_MODIFY_STATE (0x2) for posting/removing.
 * \param[in] ObjectAttributes Identifies the port by name and optional root directory.
 * \return NTSTATUS indicating whether a handle was opened.
 * \remarks Native name-lookup failure leaves the output handle
 * unchanged; WoW64 copies its zero-initialized local after the native call, including
 * on this failure. Do not depend on failure-output preservation across architectures.
 */
_Kernel_entry_
NTSYSCALLAPI
NTSTATUS
NTAPI
NtOpenIoCompletion(
    _Out_ PHANDLE IoCompletionHandle,
    _In_ ACCESS_MASK DesiredAccess,
    _In_ PCOBJECT_ATTRIBUTES ObjectAttributes
    );

#endif

View code on GitHub
#ifndef _NTZWAPI_H

_Kernel_entry_
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwOpenIoCompletion(
    _Out_ PHANDLE IoCompletionHandle,
    _In_ ACCESS_MASK DesiredAccess,
    _In_ PCOBJECT_ATTRIBUTES ObjectAttributes
    );

#endif

View code on GitHub

NtDoc

No description available.

NTinternals.net (undocumented.ntinternals.net)

Function NtOpenIoCompletion opens existing IO Completion Object. IO Completion must be created as named object.

IoCompletionHandle

Result of call - pointer to HANDLE value.

DesiredAccess

Can be one or combination of:

ObjectAttributes

Pointer to OBJECT_ATTRIBUTES structure containing valid IO Completion name.

Documented by

See also