Enumerating HID devices on Windows->wine and cmd.exe input

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
epigramx
Newbie
Newbie
Posts: 4
Joined: Tue Jan 02, 2018 4:49 am

Enumerating HID devices on Windows->wine and cmd.exe input

Post by epigramx »

I have a C# application that enumerates HID devices on Windows using SetupDiEnumDeviceInterfaces(), SetupDiGetDeviceInterfaceDetail(), HidD_GetAttributes() etc. methods.

Can I use that directly on Linux with the same hardware as it works on Windows, and if yes, do I need to look for specific settings or caveats?

Another related issue to that console application is that if I run it on Linux (latest staging), it does send it any input to as it does to cmd.exe.
User avatar
DarkShadow44
Level 8
Level 8
Posts: 1207
Joined: Tue Nov 22, 2016 5:39 pm

Re: Enumerating HID devices on Windows->wine and cmd.exe inp

Post by DarkShadow44 »

epigramx wrote:Can I use that directly on Linux with the same hardware as it works on Windows, and if yes, do I need to look for specific settings or caveats?
Possibly, why don't you just try it?
epigramx wrote:Another related issue to that console application is that if I run it on Linux (latest staging), it does send it any input to as it does to cmd.exe.
What do you mean?
epigramx
Newbie
Newbie
Posts: 4
Joined: Tue Jan 02, 2018 4:49 am

Re: Enumerating HID devices on Windows->wine and cmd.exe inp

Post by epigramx »

DarkShadow44 wrote:
epigramx wrote:Can I use that directly on Linux with the same hardware as it works on Windows, and if yes, do I need to look for specific settings or caveats?
Possibly, why don't you just try it?
epigramx wrote:Another related issue to that console application is that if I run it on Linux (latest staging), it does send it any input to as it does to cmd.exe.
What do you mean?
Apparently if I run hclient.exe (which enumerates devices with their VID and PID properly on windows), on wine I get erroneous VID and PID (e.g. 2516:0014 on hid6) when clearly with "cat /sys/class/hidraw/hidraw6/device/uevent" I get the proper VID and PID as I see it on Windows (057E:0330 in that example). I suspect that's part of the true cause that doesn't let my .exe enumerate HIDs and find the right one.

Regarding cmd.exe input, Console.ReadKey() is used on windows to get input from a console application but on wine it appears to not receive input (even if a "wine cmd" is run before execution).
User avatar
DarkShadow44
Level 8
Level 8
Posts: 1207
Joined: Tue Nov 22, 2016 5:39 pm

Re: Enumerating HID devices on Windows->wine and cmd.exe inp

Post by DarkShadow44 »

Can you provide an example application?
epigramx
Newbie
Newbie
Posts: 4
Joined: Tue Jan 02, 2018 4:49 am

Re: Enumerating HID devices on Windows->wine and cmd.exe inp

Post by epigramx »

It's now a bug report here: https://bugs.winehq.org/show_bug.cgi?id=44279

A compiled hclient.exe is here: http://www.mediafire.com/file/yaoi44c24 ... client.exe
(source is in the bug report)

I have a suspicion there's something wrong when the HID device is provided by Bluetooth or at least when the device is a Wii Remote
epigramx
Newbie
Newbie
Posts: 4
Joined: Tue Jan 02, 2018 4:49 am

Re: Enumerating HID devices on Windows->wine and cmd.exe inp

Post by epigramx »

I have now pretty much concluded that Wine needs a fix to a bug that doesn't let it enumerate the device at all. This is proven by the fact the bug report includes native software that works with that device fine, even in a generic way with a HID library.
Locked