54 lines
1.5 KiB
C
54 lines
1.5 KiB
C
// Public nt-lite DDK asynchronous request declarations.
|
|
|
|
#pragma once
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include <ntlite/status.h>
|
|
#include <ntlite/ddk/list.h>
|
|
#include <ntlite/ddk/object.h>
|
|
|
|
struct EVENT;
|
|
struct KAPC;
|
|
struct IRP;
|
|
typedef struct MM_LOCKED_USER_BUFFER MM_LOCKED_USER_BUFFER;
|
|
|
|
typedef struct IO_STATUS_BLOCK {
|
|
volatile KSTATUS Status;
|
|
volatile size_t Information;
|
|
} IO_STATUS_BLOCK;
|
|
|
|
typedef enum IO_ASYNC_REQUEST_STATE {
|
|
IoAsyncRequestQueued = 0,
|
|
IoAsyncRequestRunning = 1,
|
|
IoAsyncRequestCompleted = 2,
|
|
IoAsyncRequestCancelled = 3,
|
|
} IO_ASYNC_REQUEST_STATE;
|
|
|
|
typedef struct IO_ASYNC_REQUEST_OBJECT IO_ASYNC_REQUEST_OBJECT;
|
|
|
|
typedef void (*IO_ASYNC_REQUEST_CLEANUP_ROUTINE)(IO_ASYNC_REQUEST_OBJECT* request,
|
|
void* context);
|
|
typedef KSTATUS (*IO_ASYNC_REQUEST_CANCEL_ROUTINE)(IO_ASYNC_REQUEST_OBJECT* request,
|
|
void* context);
|
|
|
|
struct IO_ASYNC_REQUEST_OBJECT {
|
|
OBJECT Header;
|
|
LIST_ENTRY Link;
|
|
IO_ASYNC_REQUEST_STATE State;
|
|
bool CancelRequested;
|
|
struct EVENT* WaitEvent;
|
|
struct EVENT* CompletionEvent;
|
|
struct KAPC* CompletionApc;
|
|
IO_STATUS_BLOCK* Iosb;
|
|
IO_STATUS_BLOCK IosbSnapshot;
|
|
MM_LOCKED_USER_BUFFER* LockedBuffer;
|
|
MM_LOCKED_USER_BUFFER* LockedIosb;
|
|
struct IRP* Irp;
|
|
IO_ASYNC_REQUEST_CLEANUP_ROUTINE CleanupRoutine;
|
|
void* CleanupContext;
|
|
IO_ASYNC_REQUEST_CANCEL_ROUTINE CancelRoutine;
|
|
void* CancelContext;
|
|
};
|