DInput.h Wine source

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
cyberluke
Newbie
Newbie
Posts: 1
Joined: Wed Aug 24, 2022 4:52 am

DInput.h Wine source

Post by cyberluke »

Hi, where to find a source to this header file? https://doxygen.reactos.org/d8/df4/dinp ... ource.html

I want to see implementation of SendDeviceData.

I am currently implementing a virtual joystick driver that will encapsulate multiple joystick devices into one because older games can see only one and only the first joystick device. If you have flight stick, rudder, throttle for example, you need to combine them into one device. This part is already working.

Now I'm messing with Force Feedback (FFB) in Direct Input.

I can use CreateEffect and such. But as I'm working only on a simple routing of joystick direct input data, I want to use SendDeviceData to directly send FFB packet I already have received from Direct Input app (ie. game or FFB testing software).

Example of FFB packet:

Code: Select all

DataSize: 30, CMD: IOCTL_HID_WRITE_REPORT
1A010101FFFFFF00000000FFFF04FF5F0000000000000000000000000000
BlockIdx: 1
Device ID: 1
Packet type: Effect
	EffectType: ConstantForce
	Duration: -1
	TriggerRepeatInterval: -1
	SamplePeriod: 0
	Gain: 0
	TriggerBtn (?): 0
	Polar: True
	Angle: 360
See these remarks in original doc: https://docs.microsoft.com/en-us/previo ... 7(v=vs.85)

They mention applications should not use this method directly. Which means it is possible, just not recommended. But for routing scenario, it is more that recommended to simply reroute the packet. Currently I have a complex async packet mapper + parser + then reconstructing individual CreateEffect / Start / Stop calls. But I'm running into issues with latency and also there is a lot of unnecessary reprocessing of effect parameters.

For the sake of simplicity, I am currently testing it on Windows 10 (I have Windows XP as well).
User avatar
DarkShadow44
Level 8
Level 8
Posts: 1207
Joined: Tue Nov 22, 2016 5:39 pm

Re: DInput.h Wine source

Post by DarkShadow44 »

You realize you linked to a ReactOS header, not a Wine header?
The Wine header is here here: https://gitlab.winehq.org/wine/wine/-/b ... e/dinput.h
The source seems to be at https://gitlab.winehq.org/wine/wine/-/b ... ce.c#L1861

Sorry, this won't be of much use.
Locked