#ifndef _NTIOAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
NtDeviceIoControlFile(
_In_ HANDLE FileHandle,
_In_opt_ HANDLE Event,
_In_opt_ PIO_APC_ROUTINE ApcRoutine,
_In_opt_ PVOID ApcContext,
_Out_ PIO_STATUS_BLOCK IoStatusBlock,
_In_ ULONG IoControlCode,
_In_reads_bytes_opt_(InputBufferLength) PVOID InputBuffer,
_In_ ULONG InputBufferLength,
_Out_writes_bytes_opt_(OutputBufferLength) PVOID OutputBuffer,
_In_ ULONG OutputBufferLength
);
View code on GitHub
#ifndef _NTZWAPI_H
NTSYSCALLAPI
NTSTATUS
NTAPI
ZwDeviceIoControlFile(
_In_ HANDLE FileHandle,
_In_opt_ HANDLE Event,
_In_opt_ PIO_APC_ROUTINE ApcRoutine,
_In_opt_ PVOID ApcContext,
_Out_ PIO_STATUS_BLOCK IoStatusBlock,
_In_ ULONG IoControlCode,
_In_reads_bytes_opt_(InputBufferLength) PVOID InputBuffer,
_In_ ULONG InputBufferLength,
_Out_writes_bytes_opt_(OutputBufferLength) PVOID OutputBuffer,
_In_ ULONG OutputBufferLength
);
View code on GitHub
This function is documented in Windows Driver Kit here, here, and here.
Function NtDeviceIoControlFile
sends IOCTL_*
control code to Device Driver. It is primary (but not the best) solution to communicate between application and Device Driver.
HANDLE
to Device Object opened as a file.
Optional HANDLE
to Event Object signalled on the end of processing request.
Optional pointer to user's APC Routine called on the end of processing request.
User's parameter to ApcRoutine
.
IO result of call.
IO Control code [IOCTL_*
].
User's allocated buffer with input data.
Length of InputBuffer
, in bytes.
User's allocated buffer for result data.
Length of OutputBuffer
, in bytes.
See also NtFsControlFile
.