Dinput8 initialize fix

Roderick Colenbrander thunderbird2k at gmx.net
Sat May 13 14:09:44 CDT 2006


Hi,

In order to correctly fix dinput8's DirectInput8Create, dinput needs to
correctly support the Initialize method. On windows DirectInput8Create
creates a dinput8 object using CoCreateInstance and after this it calls
Initialize (in case no aggregation is used).

Initialize is used to initialize the object and it also sets the version
number. According to MSDN dinput8 emulates the specified dinput version if
the version number is different than 0x800 (dinput8). If you read this on
msdn you can think that this option can be used to emulate lets say version
7 or older but this doesn't appear to be the case.

Someone on irc mentioned that the version number is used for correcting
'bugs' in certain directx 8.0x/8.1x versions. I have attached a test app
which checks the behaviour of the Initialize call. I tried to set version
numbers between 0 and 0x1000 and only 0x800 (dinput8) was accepted. For all
other version numbers This DIERR_BETADIRECTINPUTVERSION was returned. (In
the attached version of the patch only a few known version numbers are
tested.)
I tried to find more info about the dwVersion parameter but couldn't find
more, so the behaviour is based on my observations with native dinput8.

Further the attached test tries to create dinput8 objects using both
CoCreateInstance and DirectInput8Create. After creation it calls Initialize
and tests its behaviour for different version numbers. The object creation
tests should only pass for directinput8 interfaces. Right now it passes for
directinput7 too. This behaviour will be fixed by the patch which fixes
DirectInput8Create.

Regards,
Roderick Colenbrander

-- 
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dinput8_initialize.patch
Type: text/x-patch
Size: 3724 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20060513/ad51989c/dinput8_initialize.patch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dinput8.c
Type: text/x-csrc
Size: 4515 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20060513/ad51989c/dinput8.c


More information about the wine-patches mailing list