#ifndef _NTIOAPI_H
/**
* Creates an empty I/O completion port. This native call neither accepts nor
* associates a file handle; file association is a separate operation. It can also
* be used as a packet queue without issuing file I/O.
*
* \param[out] IoCompletionHandle Receives a caller-owned handle; close with NtClose.
* \param[in] DesiredAccess Requested access. IO_COMPLETION_QUERY_STATE (0x1)
* permits depth queries; IO_COMPLETION_MODIFY_STATE (0x2) permits posting/removing.
* \param[in, optional] ObjectAttributes Optional name, root directory and security attributes.
* \param[in] NumberOfConcurrentThreads Concurrency limit for active queue consumers,
* not a packet-capacity limit. Zero selects the active processor count; on x64
* KeInitializeQueue queries all processor groups (0xFFFF).
* \return STATUS_SUCCESS for a new port. OBJ_OPENIF can return
* STATUS_OBJECT_NAME_EXISTS for an existing named port without clearing its queue
* or replacing its concurrency setting.
* \sa https://learn.microsoft.com/en-us/windows/win32/fileio/createiocompletionport
*/
_Kernel_entry_
NTSYSCALLAPI
NTSTATUS
NTAPI
NtCreateIoCompletion(
_Out_ PHANDLE IoCompletionHandle,
_In_ ACCESS_MASK DesiredAccess,
_In_opt_ PCOBJECT_ATTRIBUTES ObjectAttributes,
_In_opt_ ULONG NumberOfConcurrentThreads
);
View code on GitHub#ifndef _NTZWAPI_H
_Kernel_entry_
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwCreateIoCompletion(
_Out_ PHANDLE IoCompletionHandle,
_In_ ACCESS_MASK DesiredAccess,
_In_opt_ PCOBJECT_ATTRIBUTES ObjectAttributes,
_In_opt_ ULONG NumberOfConcurrentThreads
);
View code on GitHubNo description available.
Function NtCreateIoCompletion creates IO Completion Object. IO Completion Object is used for waiting on pending IO operation (reading or writing) in multi-process file access. It contains more information about IO operation than synchronization event or APC Routine.
Result of call - HANDLE to newly created IO Completion Object.
Access mask for created HANDLE. Can be combination of:
Optionally contains object name, in Objects Namespace.
Number of threads accessing File Object associated with IO Completion. If Zero, system reserves memory for number of threads equal to current number of processes.