NtQueryIoCompletion - NtDoc

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

/**
 * Retrieves a snapshot of the number of packets queued on an I/O completion port. Querying does not remove a
 * packet; the result is not a reservation for a later dequeue.
 *
 * \param[in] IoCompletionHandle Handle with IO_COMPLETION_QUERY_STATE (0x1).
 * \param[in] IoCompletionInformationClass IoCompletionBasicInformation (0).
 * \param[out] IoCompletionInformation Writable IO_COMPLETION_BASIC_INFORMATION. User-mode output must be
 * 4-byte aligned on native x64 and WoW64.
 * \param[in] IoCompletionInformationLength Exactly 4 bytes.
 * \param[out, optional] ReturnLength Receives 4 on success; invalid class, size, alignment and access checks
 * leave it unchanged.
 * \return STATUS_INVALID_INFO_CLASS for unsupported classes, STATUS_INFO_LENGTH_MISMATCH for incorrect size,
 * or the query's NTSTATUS. A NULL/zero-size call is not a supported size-discovery protocol.
 */
_Kernel_entry_
NTSYSCALLAPI
NTSTATUS
NTAPI
NtQueryIoCompletion(
    _In_ HANDLE IoCompletionHandle,
    _In_ IO_COMPLETION_INFORMATION_CLASS IoCompletionInformationClass,
    _Out_writes_bytes_(IoCompletionInformationLength) PVOID IoCompletionInformation,
    _In_ ULONG IoCompletionInformationLength,
    _Out_opt_ PULONG ReturnLength
    );

#endif

View code on GitHub
#ifndef _NTZWAPI_H

_Kernel_entry_
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwQueryIoCompletion(
    _In_ HANDLE IoCompletionHandle,
    _In_ IO_COMPLETION_INFORMATION_CLASS IoCompletionInformationClass,
    _Out_writes_bytes_(IoCompletionInformationLength) PVOID IoCompletionInformation,
    _In_ ULONG IoCompletionInformationLength,
    _Out_opt_ PULONG ReturnLength
    );

#endif

View code on GitHub

NtDoc

No description available.

NTinternals.net (undocumented.ntinternals.net)

Function NtQueryIoCompletion receives number of file operations pending on specified IO Completion Object.

IoCompletionHandle

HANDLE to IO Completion Object opened with IO_COMPLETION_QUERY_STATE access.

InformationClass

See IO_COMPLETION_INFORMATION_CLASS for possible values.

IoCompletionInformation

User's allocated buffer for result data.

InformationBufferLength

Length of IoCompletionInformation buffer, in bytes.

RequiredLength

Optionally receives required length of buffer.

Documented by

See also