Temporary fix to trying to put a pointer in a DWORD

Shachar Shemesh wine-devel at shemesh.biz
Sun Oct 17 00:24:53 CDT 2004


Vincent Béron wrote:

>Le sam 16/10/2004 à 23:54, Dmitry Timoshkov a écrit :
>  
>
>>"Vincent Béron" <vberon at mecano.gme.usherb.ca> wrote:
>>
>>    
>>
>>>We try to put a pointer in a DWORD in a static initialization of
>>>CRITICAL_SECTION_DEBUGs. Of course it doesn't work on Win64. We'll have
>>>to find a better solution though.
>>>      
>>>
>>Another way to fix it is to use full 'DWORD Spare[2]' to store a pointer
>>on Win64 and leave it as it is now for Win32.
>>    
>>
>
>I tried, but since it's a static initialization you don't have access to
>& (addessof), so you can't put the high part in one and the low part in
>the other. Maybe with a union, but then we'd extend a MS type.
>
>Vincent
>  
>
How about this, then?

-- 
Shachar Shemesh
Lingnu Open Source Consulting ltd.
http://www.lingnu.com/

-------------- next part --------------
Index: dlls/dinput/keyboard.c
===================================================================
RCS file: /home/sun/sources/cvs/wine/dlls/dinput/keyboard.c,v
retrieving revision 1.9
diff -u -r1.9 keyboard.c
--- dlls/dinput/keyboard.c	21 Sep 2004 20:04:37 -0000	1.9
+++ dlls/dinput/keyboard.c	17 Oct 2004 05:23:04 -0000
@@ -75,11 +75,12 @@
 static BYTE DInputKeyState[256]; /* array for 'GetDeviceState' */
 
 static CRITICAL_SECTION keyboard_crit;
+static const char * const critsect_debug_strid = __FILE__ ": keyboard_crit";
 static CRITICAL_SECTION_DEBUG critsect_debug =
 {
     0, 0, &keyboard_crit,
     { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
-      0, 0, { 0, (DWORD)(__FILE__ ": keyboard_crit") }
+      0, 0, { HIDWORD(critsect_debug_strid), LODDWORD(critsect_debug_strid) }
 };
 static CRITICAL_SECTION keyboard_crit = { &critsect_debug, -1, 0, 0, 0, 0 };
 


More information about the wine-devel mailing list