#pragma once
#include <stdint.h>
/* Legacy identity/ping ABI stays unchanged; read extension has its own version. */
#define EASY_KERNEL_VERSION 1u
#define EASY_KERNEL_CAP_PING 1u
#define EASY_KERNEL_DEVICE L"\\\\.\\EasyUniversalBase"
/* FILE_DEVICE_UNKNOWN, vendor functions, METHOD_BUFFERED, FILE_READ_ACCESS. */
#define EASY_KERNEL_GET_INFO ((0x22u << 16) | (1u << 14) | (0x800u << 2))
#define EASY_KERNEL_PING ((0x22u << 16) | (1u << 14) | (0x801u << 2))
#define EASY_KERNEL_READ_INFO ((0x22u << 16) | (1u << 14) | (0x802u << 2))
#define EASY_KERNEL_READ ((0x22u << 16) | (1u << 14) | (0x803u << 2))
#define EASY_KERNEL_READ_VERSION 1u
#define EASY_KERNEL_READ_MAX 65536u
#define EASY_KERNEL_CAP_READ_HANDLE 2u
typedef struct EasyKernelReadInfo {
uint32_t size;
uint32_t version;
uint32_t capabilities;
uint32_t max_bytes;
} EasyKernelReadInfo;
/* Real caller-owned handle opened with PROCESS_VM_READ; never a pseudo handle. */
typedef struct EasyKernelRead {
uint32_t size;
uint32_t version;
uint64_t process_handle;
uint64_t address;
uint32_t bytes;
uint32_t reserved;
} EasyKernelRead;
/* Followed by exactly bytes_read bytes. Transport succeeds for a valid request;
status is the NTSTATUS of handle validation / memory copy, including partial. */
typedef struct EasyKernelReadReply {
uint32_t size;
uint32_t version;
int32_t status;
uint32_t bytes_read;
} EasyKernelReadReply;
typedef struct EasyKernelInfo {
uint32_t size;
uint32_t version;
uint32_t capabilities;
uint32_t reserved;
char name[32];
} EasyKernelInfo;
typedef struct EasyKernelPing {
uint32_t size;
uint32_t version;
uint64_t nonce;
} EasyKernelPing;
typedef struct EasyKernelPong {
uint32_t size;
uint32_t version;
uint64_t nonce;
uint32_t reserved[2];
} EasyKernelPong;
#if defined(__cplusplus)
static_assert(sizeof(EasyKernelReadInfo) == 16, "Read info ABI");
static_assert(sizeof(EasyKernelRead) == 32, "Read request ABI");
static_assert(sizeof(EasyKernelReadReply) == 16, "Read reply ABI");
static_assert(sizeof(EasyKernelInfo) == 48, "Info ABI");
static_assert(sizeof(EasyKernelPing) == 16, "Ping ABI");
static_assert(sizeof(EasyKernelPong) == 24, "Pong ABI");
#endif
Easy Universal / Примеры и шаблоны