NtRemoveIoCompletion - NtDoc

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

NTSYSCALLAPI
NTSTATUS
NTAPI
NtRemoveIoCompletion(
    _In_ HANDLE IoCompletionHandle,
    _Out_ PVOID *KeyContext,
    _Out_ PVOID *ApcContext,
    _Out_ PIO_STATUS_BLOCK IoStatusBlock,
    _In_opt_ PLARGE_INTEGER Timeout
    );

#endif

View code on GitHub
#ifndef _NTZWAPI_H

NTSYSCALLAPI
NTSTATUS
NTAPI
ZwRemoveIoCompletion(
    _In_ HANDLE IoCompletionHandle,
    _Out_ PVOID *KeyContext,
    _Out_ PVOID *ApcContext,
    _Out_ PIO_STATUS_BLOCK IoStatusBlock,
    _In_opt_ PLARGE_INTEGER Timeout
    );

#endif

View code on GitHub

This function is documented in Windows SDK.


Function NtRemoveIoCompletion is one of waiting calls and it's finished when at least one completion record will be available in specified Io Completion object. Records are added when I/O operation is finished, but previously File object have to been associated with Io Completion object.
Association between File and Io Completion objects is added by call to NtSetInformationFile
with FileCompletionInformation information class. Additionally every association have to have unique Key defined. This functionality allows to use one Io Completion object with different File objects.
Every one File object can have only one Io Completion associated with it.

I/O operations won't be appended to Io Completion object except file operations will be called with non-zero value in ApcContext parameters.

IoCompletionHandle

HANDLE to previously created or opened Io Completion object.

CompletionKey

Receives completion Key informing about File object who finishes I/O.

CompletionValue

Value of ApcContext file operation parameter. CompletionValue informs about operation finished.

IoStatusBlock

Io status of finished operation.

Timeout

Optionally pointer to time out value.

Documented by

See also