I am not sure if "device interface symbolic link" is correct.
This is the string that I mean..
\\?\ACPI#10250759#4&2f80d4b8&0#{884b96c3-56ef-11d1-bc8c-00a0c91405dd
This is for a built in keyboard.
Other devices work, but this one doesn't. For example, for a built in touchpad with device interface class
GUID_DEVINTERFACE_MOUSE
this string is..
\\?\HID#VID_06CB&PID_2970&Col01#6&4e814c3&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd}
For each of these devices, I used
CreateFileA
with
OPEN_EXISTING
.
Then the
HANDLE
from
CreateFileA
is passed to..
..
HidD_GetAttributes
..
HidD_GetProductString
..
HidD_GetManufacturerString
..
HidD_GetSerialnumberString
For all devices for which the "device interface symbolic link" starts with HID, the functions work (all except
HidD_GetSerialnumberString
, which causes
ERROR_INVALID_PARAMETER
(i.e. "The parameter is incorrect.").
For the ACPI one, all of these functions fail and
GetLastError
is set to
ERROR_INVALID_FUNCTION
(i.e. "Incorrect function.").
As
HidD_GetAttributes
doesn't mention in the documentation ever setting the "last error", I call
SetLastError(ERROR_SUCCESS)
before. It turns out HidD_GetAttributes does set the "last error".
The
raw input overview page[
^] has this sentence "The raw input API provides a stable and robust way for applications to accept raw input from any HID, including the keyboard and mouse.". Thus I assume that raw input is ONLY for HID devices, what is up then with this ACPI device?
I found
this page[
^] that mentions the format of both these ACPI and HID paths, but I don't know much about this topic.
What I have tried:
I've tried both using MinGW-w64 (from chocolatey) and Visual Studio 2022. The results were the same.