How do I convert this to autoit? I've seen people here post examples (Manko) of communicating with device drivers, but this is ridiculously complex!
#define CODEMSG(_digitval) CTL_CODE(FILE_DEVICE_UNKNOWN,_digitval , METHOD_BUFFERED,\
FILE_READ_DATA | FILE_WRITE_DATA)
#define CODE_VALUE 4094
//handle to driver
HANDLE device = 0;
char ret[1024];
WCHAR SendValue[512];
DWORD codeval, bytes;
if( !strcmp(argv[i],"-p") ) {
codeval = CODE_VALUE;
i++; continue;
}
MultiByteToWideChar(CP_ACP, 0, argv[i], -1, SendValue, sizeof(SendValue));
DeviceIoControl(device, CODEMSG(codeval), SendValue, (wcslen(SendValue)+1)*2,
&ret, sizeof(ret),&bytes,NULL);
The farthest I've got is~
#Include <WinAPI.au3>
$Handle = _LoadDriver()
$Struc = DllStructCreate("char[1024];WCHAR[512];DWORD")
DllStructSetData($Struc, 3, _WinAPI_MultiByteToWideChar("I have no idea what I'm doing" , 0, $MB_PRECOMPOSED , true))
MsgBox(0,"",DllStructGetPtr($Struc))
$ret = DllCall("kernel32.dll", "int", "DeviceIoControl", _
"dword", $Handle, _
"dword", DllStructGetPtr($Struc,3), _
"ptr", DllStructGetPtr($Struc), _
"dword", 12, _
"ptr", DllStructGetPtr($Struc), _
"dword", 12, _
"dword*", 0, _
"ptr", 0)
Until I slowly started to realize I have absolutely no idea what I'm doing.