21#if (_WIN32_WINNT < 0x0600)
22#define FILE_SKIP_COMPLETION_PORT_ON_SUCCESS 0x1
23#define FILE_SKIP_SET_EVENT_ON_HANDLE 0x2
68 IN DWORD NumberOfConcurrentThreads)
76 NewPort = ExistingCompletionPort;
77 if (!ExistingCompletionPort)
83 NumberOfConcurrentThreads);
96 if (ExistingCompletionPort)
106 CompletionInformation.
Port = NewPort;
107 CompletionInformation.
Key = (
PVOID)CompletionKey;
110 &CompletionInformation,
117 if (!ExistingCompletionPort)
NtClose(NewPort);
146 (
PVOID*)&CompletionKey,
172 *lpCompletionKey = CompletionKey;
173 *lpNumberOfBytesTransferred =
IoStatus.Information;
193 IN DWORD dwNumberOfBytesTransferred,
201 (
PVOID)dwCompletionKey,
204 dwNumberOfBytesTransferred);
254 if (WaitStatus)
return FALSE;
258 *lpNumberOfBytesTransferred =
lpOverlapped->InternalHigh;
_In_ CDROM_SCAN_FOR_SPECIAL_INFO _In_ PCDROM_SCAN_FOR_SPECIAL_HANDLER Function
#define NT_SUCCESS(StatCode)
#define ERROR_INVALID_PARAMETER
#define INVALID_HANDLE_VALUE
PLARGE_INTEGER WINAPI BaseFormatTimeOut(OUT PLARGE_INTEGER Timeout, IN DWORD dwMilliseconds)
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
@ FileIoCompletionNotificationInformation
@ FileCompletionInformation
NTSTATUS NTAPI NtSetIoCompletion(IN HANDLE IoCompletionPortHandle, IN PVOID CompletionKey, IN PVOID CompletionContext, IN NTSTATUS CompletionStatus, IN ULONG CompletionInformation)
NTSTATUS NTAPI NtRemoveIoCompletion(IN HANDLE IoCompletionHandle, OUT PVOID *KeyContext, OUT PVOID *ApcContext, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER Timeout OPTIONAL)
NTSTATUS NTAPI NtCreateIoCompletion(OUT PHANDLE IoCompletionHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN ULONG NumberOfConcurrentThreads)
BOOL WINAPI PostQueuedCompletionStatus(IN HANDLE CompletionHandle, IN DWORD dwNumberOfBytesTransferred, IN ULONG_PTR dwCompletionKey, IN LPOVERLAPPED lpOverlapped)
HANDLE WINAPI CreateIoCompletionPort(IN HANDLE FileHandle, IN HANDLE ExistingCompletionPort, IN ULONG_PTR CompletionKey, IN DWORD NumberOfConcurrentThreads)
#define FILE_SKIP_SET_EVENT_ON_HANDLE
BOOL WINAPI SetFileCompletionNotificationModes(IN HANDLE FileHandle, IN UCHAR Flags)
#define FILE_SKIP_COMPLETION_PORT_ON_SUCCESS
BOOL WINAPI BindIoCompletionCallback(IN HANDLE FileHandle, IN LPOVERLAPPED_COMPLETION_ROUTINE Function, IN ULONG Flags)
BOOL WINAPI GetOverlappedResult(IN HANDLE hFile, IN LPOVERLAPPED lpOverlapped, OUT LPDWORD lpNumberOfBytesTransferred, IN BOOL bWait)
BOOL WINAPI GetQueuedCompletionStatus(IN HANDLE CompletionHandle, IN LPDWORD lpNumberOfBytesTransferred, OUT PULONG_PTR lpCompletionKey, OUT LPOVERLAPPED *lpOverlapped, IN DWORD dwMilliseconds)
#define IO_COMPLETION_ALL_ACCESS
static OUT PIO_STATUS_BLOCK IoStatusBlock
static OUT PIO_STATUS_BLOCK OUT PVOID FileInformation
static PLARGE_INTEGER Time
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
NTSYSAPI NTSTATUS NTAPI RtlSetIoCompletionCallback(_In_ HANDLE FileHandle, _In_ PIO_APC_ROUTINE Callback, _In_ ULONG Flags)
NTSYSAPI NTSTATUS NTAPI NtSetInformationFile(IN HANDLE hFile, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN PVOID FileInformationBuffer, IN ULONG FileInformationBufferLength, IN FILE_INFORMATION_CLASS FileInfoClass)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
VOID(* PIO_APC_ROUTINE)(IN PVOID ApcContext, IN PIO_STATUS_BLOCK IoStatusBlock, IN ULONG Reserved)
DWORD BaseSetLastNTError(IN NTSTATUS Status)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
#define STATUS_INVALID_PARAMETER
void(CALLBACK * LPOVERLAPPED_COMPLETION_ROUTINE)(DWORD, DWORD, LPOVERLAPPED)
#define ERROR_IO_INCOMPLETE
_Must_inspect_result_ _In_ ULONG Flags