[DInput] 'Proper' fix for the Fallout problem

Lionel Ulmer lionel.ulmer at free.fr
Wed May 4 10:53:08 CDT 2005


While continuing to clean my wine-devel mailbox with old problems, I looked
again at the Fallout mouse problem.

Attached to this file is the proper fix. Basically, the bug was that Windows
accepts both 0xFFFF ('ANYINSTANCE') but also 0xFF (no define anywhere) to
mean 'any instance' for a field.

This has been verified on a Windows XP box and fixes Fallout.

Note that the interim patch was still better than what was before (I had
forgotten to test if the type matched).

Changelog:
 - more pretty print for the types flag
 - more Windows-aligned check for object instances

-- 
		 Lionel Ulmer - http://www.bbrox.org/
-------------- next part --------------
Index: dlls/dinput/device.c
===================================================================
RCS file: /home/wine/wine/dlls/dinput/device.c,v
retrieving revision 1.26
diff -u -r1.26 device.c
--- dlls/dinput/device.c	25 Apr 2005 10:48:38 -0000	1.26
+++ dlls/dinput/device.c	4 May 2005 15:47:39 -0000
@@ -80,7 +80,10 @@
 	    FE(DIDFT_NODATA),	    
 	    FE(DIDFT_FFACTUATOR),
 	    FE(DIDFT_FFEFFECTTRIGGER),
-	    FE(DIDFT_OUTPUT)
+	    FE(DIDFT_OUTPUT),
+	    FE(DIDFT_VENDORDEFINED),
+	    FE(DIDFT_ALIAS),
+	    FE(DIDFT_OPTIONAL)
 #undef FE
 	};
 	type = (dwFlags & 0xFF0000FF);
@@ -315,8 +318,12 @@
 		(/* Then check if it accepts any instance id, and if not, if it matches Wine's
 		  * instance id.
 		  */
-		 ((asked_format->rgodf[j].dwType & 0x00FFFF00) == DIDFT_ANYINSTANCE) ||
-		 (wine_format->rgodf[i].dwType & asked_format->rgodf[j].dwType))) {
+		 (DIDFT_GETINSTANCE(asked_format->rgodf[j].dwType) == DIDFT_ANYINSTANCE) ||
+		 (DIDFT_GETINSTANCE(asked_format->rgodf[j].dwType) == 0xFF) || /* This is mentionned in no DX docs, but it works fine - tested on WinXP */
+		 (DIDFT_GETINSTANCE(asked_format->rgodf[j].dwType) == DIDFT_GETINSTANCE(wine_format->rgodf[i].dwType)))
+		&&
+		( /* Then if the asked type matches the one Wine provides */
+		 wine_format->rgodf[i].dwType & asked_format->rgodf[j].dwType)) {
 		
 		done[j] = 1;
 		


More information about the wine-patches mailing list