#ifndef _NTIOAPI_H
/**
* The NtCreateIoCompletion routine creates an I/O completion port and associates it with a specified file handle,
* or creates an I/O completion port that is not yet associated with a file handle, allowing association at a later time.
*
* \param[out] IoCompletionHandle Pointer to a variable that receives a handle to the I/O completion port.
* \param[in] DesiredAccess The requested access to the object.
* \param[in] ObjectAttributes Pointer to an OBJECT_ATTRIBUTES structure that contains the name to an existing I/O completion port or NULL.
* \param[out] NumberOfConcurrentThreads The maximum number of threads that the operating system can allow to concurrently process
* I/O completion packets for the I/O completion port. This parameter is ignored if the ExistingCompletionPort parameter is not NULL.
* If this parameter is zero, the system allows as many concurrently running threads as there are processors in the system.
* \return NTSTATUS Successful or errant status.
* \sa https://learn.microsoft.com/en-us/windows/win32/fileio/createiocompletionport
*/
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
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.