diff --git a/file.go b/file.go index a8384fc..6925d00 100644 --- a/file.go +++ b/file.go @@ -20,6 +20,22 @@ NTSTATUS NtCreateFile( ); */ +/* +func: +NTSTATUS NtDeviceIoControlFile( + _In_ HANDLE FileHandle, + _In_ HANDLE Event, + _In_ PIO_APC_ROUTINE ApcRoutine, + _In_ PVOID ApcContext, + _Out_ PIO_STATUS_BLOCK IoStatusBlock, + _In_ ULONG IoControlCode, + _In_ PVOID InputBuffer, + _In_ ULONG InputBufferLength, + _Out_ PVOID OutputBuffer, + _In_ ULONG OutputBufferLength +); +*/ + /* func: NTSTATUS NtOpenFile( diff --git a/file_generated.go b/file_generated.go index eeec189..39a7ede 100644 --- a/file_generated.go +++ b/file_generated.go @@ -77,6 +77,7 @@ const ( var ( procNtCreateFile = modntdll.NewProc("NtCreateFile") + procNtDeviceIoControlFile = modntdll.NewProc("NtDeviceIoControlFile") procNtOpenFile = modntdll.NewProc("NtOpenFile") procNtQueryInformationFile = modntdll.NewProc("NtQueryInformationFile") procNtReadFile = modntdll.NewProc("NtReadFile") @@ -461,6 +462,32 @@ func NtCreateFile( return NtStatus(r0) } +// OUT-parameter: IoStatusBlock, OutputBuffer. +func NtDeviceIoControlFile( + FileHandle Handle, + Event Handle, + ApcRoutine *IoApcRoutine, + ApcContext *byte, + IoStatusBlock *IoStatusBlock, + IoControlCode uint32, + InputBuffer *byte, + InputBufferLength uint32, + OutputBuffer *byte, + OutputBufferLength uint32, +) NtStatus { + r0, _, _ := procNtDeviceIoControlFile.Call(uintptr(FileHandle), + uintptr(Event), + uintptr(unsafe.Pointer(ApcRoutine)), + uintptr(unsafe.Pointer(ApcContext)), + uintptr(unsafe.Pointer(IoStatusBlock)), + uintptr(IoControlCode), + uintptr(unsafe.Pointer(InputBuffer)), + uintptr(InputBufferLength), + uintptr(unsafe.Pointer(OutputBuffer)), + uintptr(OutputBufferLength)) + return NtStatus(r0) +} + // OUT-parameter: FileHandle, IoStatusBlock. func NtOpenFile( FileHandle *Handle,