Threading Issues with DInput/Joysticks

Robert Reif reif at earthlink.net
Fri Apr 15 20:28:26 CDT 2005


Dylan Taft wrote:

>http://veracity.ath.cx/~diefool/failure.gz  Log is
>about 100 megs unzipped.
>
>This is pretty bizzare.  I gzipped a +all log.  When a
>joystick is plugged
>into my machine, many dinput apps crash with
>meaningless backtraces
>unrelated to dinput.
>
>It affects a fair amount of apps
>http://www.blockland.us/blockland/index.asp is an easy
>one to work on since
>it crashes as soon as the program starts.  It also
>only crashes when my
>joystick is plugged in and wine can see /dev/js0.
>
>0047:trace:dinput:create_DataFormat Matching : 
>0047:trace:dinput:create_DataFormat    - Asked (5) :
>0047:trace:dinput:create_DataFormat        * GUID:
>{a36d02e3-c9f3-11cf-bfc7-444553540000} ('GUID_RzAxis')
>0047:trace:dinput:create_DataFormat        * Offset: 
>20
>0047:trace:dinput:create_DataFormat        * dwType:
>00000603
>0047:trace:dinput:create_DataFormat          Type:
>DIDFT_RELAXIS
>DIDFT_ABSAXIS / Instance:   6
>0047:trace:dinput:create_DataFormat    - Wine  (5) :
>0047:trace:dinput:create_DataFormat        * GUID:
>{a36d02e3-c9f3-11cf-bfc7-444553540000} ('GUID_RzAxis')
>0047:trace:dinput:create_DataFormat        * Offset: 
>20
>0047:trace:dinput:create_DataFormat        * dwType:
>80ffff03
>0047:trace:dinput:create_DataFormat          Type:
>DIDFT_RELAXIS
>DIDFT_ABSAXIS (unhandled: 80000000) / Instance:
>DIDFT_ANYINSTANCE
>0047:trace:seh:EXC_RtlRaiseException code=c0000005
>flags=0 addr=0x7e98f3a8
>0047:trace:seh:EXC_RtlRaiseException  info[0]=00000000
>0047:trace:seh:EXC_RtlRaiseException  info[1]=00000000
>0047:trace:seh:EXC_RtlRaiseException  eax=00000010
>ebx=7e9aa5d8 ecx=00000010
>edx=77c5bd50 esi=00000000 edi=7eda3bcc
>0047:trace:seh:EXC_RtlRaiseException  ebp=77aefad4
>esp=77aefa3c cs=0073
>ds=007b es=007b fs=003b gs=0033 flags=00010216
>0047:trace:seh:EXC_CallHandler calling handler at
>0x6437c8 code=c0000005
>flags=0
>0047:Call kernel32.UnhandledExceptionFilter(77aef5e8)
>ret=00649b15
>
>I think this is where it gives up in the log. ^^
>
>I'd like to debug this, anyone know where to start?
>
>
>
>		
>__________________________________ 
>Do you Yahoo!? 
>Yahoo! Small Business - Try our new resources site!
>http://smallbusiness.yahoo.com/resources/
>
>
>  
>
Could you try this patch?
-------------- next part --------------
Index: dlls/dinput/device.c
===================================================================
RCS file: /home/wine/wine/dlls/dinput/device.c,v
retrieving revision 1.25
diff -u -p -r1.25 device.c
--- dlls/dinput/device.c	24 Mar 2005 21:01:39 -0000	1.25
+++ dlls/dinput/device.c	16 Apr 2005 01:25:51 -0000
@@ -289,34 +289,35 @@ DataFormat *create_DataFormat(const DIDA
     int *done;
     int index = 0;
     DWORD next = 0;
-    
+
     ret = HeapAlloc(GetProcessHeap(), 0, sizeof(DataFormat));
-    
+
     done = HeapAlloc(GetProcessHeap(), 0, sizeof(int) * asked_format->dwNumObjs);
     memset(done, 0, sizeof(int) * asked_format->dwNumObjs);
-    
+
     dt = HeapAlloc(GetProcessHeap(), 0, asked_format->dwNumObjs * sizeof(DataTransform));
-    
+
     TRACE("Creating DataTransform : \n");
     
     for (i = 0; i < wine_format->dwNumObjs; i++) {
 	offset[i] = -1;
-	
+
 	for (j = 0; j < asked_format->dwNumObjs; j++) {
 	    if (done[j] == 1)
 		continue;
-	    
+
 	    if (/* Check if the application either requests any GUID and if not, it if matches
 		 * the GUID of the Wine object.
 		 */
 		((asked_format->rgodf[j].pguid == NULL) ||
+		 (wine_format->rgodf[i].pguid == NULL) ||
 		 (IsEqualGUID(wine_format->rgodf[i].pguid, asked_format->rgodf[j].pguid)))
 		&&
 		(/* 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))) {
+		 ((wine_format->rgodf[i].dwType & asked_format->rgodf[j].dwType)) & 0x00FFFF00)) {
 		
 		done[j] = 1;
 		
@@ -329,19 +330,19 @@ DataFormat *create_DataFormat(const DIDA
 		TRACE("       * dwType: %08lx\n", asked_format->rgodf[j].dwType);
 		TRACE("         "); _dump_EnumObjects_flags(asked_format->rgodf[j].dwType); TRACE("\n");
 		
-		TRACE("   - Wine  (%d) :\n", j);
+		TRACE("   - Wine  (%d) :\n", i);
 		TRACE("       * GUID: %s ('%s')\n",
-		      debugstr_guid(wine_format->rgodf[j].pguid),
-		      _dump_dinput_GUID(wine_format->rgodf[j].pguid));
-		TRACE("       * Offset: %3ld\n", wine_format->rgodf[j].dwOfs);
-		TRACE("       * dwType: %08lx\n", wine_format->rgodf[j].dwType);
-		TRACE("         "); _dump_EnumObjects_flags(wine_format->rgodf[j].dwType); TRACE("\n");
+		      debugstr_guid(wine_format->rgodf[i].pguid),
+		      _dump_dinput_GUID(wine_format->rgodf[i].pguid));
+		TRACE("       * Offset: %3ld\n", wine_format->rgodf[i].dwOfs);
+		TRACE("       * dwType: %08lx\n", wine_format->rgodf[i].dwType);
+		TRACE("         "); _dump_EnumObjects_flags(wine_format->rgodf[i].dwType); TRACE("\n");
 		
 		if (wine_format->rgodf[i].dwType & DIDFT_BUTTON)
 		    dt[index].size = sizeof(BYTE);
 		else
 		    dt[index].size = sizeof(DWORD);
-		dt[index].offset_in  = wine_format ->rgodf[i].dwOfs;
+		dt[index].offset_in  = wine_format->rgodf[i].dwOfs;
                 if (asked_format->rgodf[j].dwOfs < next) {
                     WARN("bad format: dwOfs=%ld, changing to %ld\n", asked_format->rgodf[j].dwOfs, next);
 		    dt[index].offset_out = next;


More information about the wine-devel mailing list