Correct Windows API to search CurrentControlSet \ Control \ MediaProperties?

I am looking for user joystick support, and due to project requirements, I can no longer use the DirectInput API. I switched to using the "classic" Windows multimedia API (like joyGetDevCaps and the family), and all this works with one exception.

There were two fields in DirectInput DeviceInstance : InstanceName and ProductName , which returned the correct "custom" device name.

The corresponding joyGetDevCaps name field , szPname, returns the generic "Microsoft PC Joystick Driver".

When searching the registry on a system with a device installed, I found that in this node there is a REG_SZ OEMName entry in which there is a line:

HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ MediaProperties \ PrivateProperties \ Joystick \ OEM \ VID_07C0 & PID_1128

In JOYCAPS, wMid (manufacturer identifier) ​​and wPid (product identifier) ​​there are two fields that map to two hexadecimal values ​​in the key name: wMid = 0x07c0, wPid = 0x1128.

In addition, I can use the SetupDiEnumDeviceInfo API by GUID_DEVINTERFACE_HID and find the appropriate controller (although this step may not be necessary):

HID \ VID_07C0 & PID_1128 & REV_1032, HID compatible game controller

: API MediaProperties\PrivateProperties, , "" ? API, / ! .

+3
1

szRegName, : ( szRegName - "DINPUT.DLL" ):

HKCU\System\CurrentControlSet\Control\MediaResources\Joystick\DINPUT.DLL\CurrentJoystickSettings

, "Joystick1OEMName", , "VID_07C0 & PID_1128", PrivateProperties.

: https://github.com/google/liquidfun/blob/master/freeglut/src/mswin/fg_joystick_mswin.c

0

All Articles