micetools/src/micetools/dll/drivers/mxhwreset.c

23 lines
746 B
C

#include "mx.h"
BOOL mxhwreset_DeviceIoControl(void* file, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize,
LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned,
LPOVERLAPPED lpOverlapped) {
switch (dwIoControlCode) {
case IOCTL_MXHWRESET_RESET:
if (lpBytesReturned) *lpBytesReturned = 0;
break;
default:
log_warning("mxhwreset", "unhandled 0x%08x", dwIoControlCode);
return FALSE;
}
return TRUE;
}
void setup_mxhwreset() {
file_hook_t* mxhwreset = new_file_hook(L"\\\\.\\mxhwreset");
mxhwreset->DeviceIoControl = &mxhwreset_DeviceIoControl;
hook_file(mxhwreset);
}