surely the function HID.HidP_GetCaps can return whatever I like?
HidP_GetCaps(ByRef PreparsedData, ByRef Capabilities){ /* https://msdn.microsoft.com/en-us/library/windows/hardware/ff539715%28v=vs.85%29.aspx NTSTATUS __stdcall HidP_GetCaps( _In_ PHIDP_PREPARSED_DATA PreparsedData, _Out_ PHIDP_CAPS Capabilities ); */ Capabilities := new _Struct("WinStructs.HIDP_CAPS") r := DllCall("Hid\HidP_GetCaps", "Ptr", &PreparsedData, "Ptr", Capabilities[]) if (r = this.HIDP_STATUS_SUCCESS){ r := 0 } else { MsgBox % r r := -1 } If (r = -1) Or ErrorLevel { soundbeep ErrorLevel = %A_ThisFunc% call failed.`nReturn value: %r%`nErrorLevel: %ErrorLevel%`nLine: %A_LineNumber%`nLast Error: %A_LastError% Return -1 } return r }
The Dll Call may return HIDP_STATUS_SUCCESS, but the function does not need to, surely?