Debugging Xfire: need help

Stefan Dösinger stefandoesinger at gmx.at
Sun Oct 18 08:32:25 CDT 2009


Am 18.10.2009 um 15:02 schrieb Warren Dumortier:

> Xfire was working until version 1.104, but since then it crashed on  
> every Wine version, so the Xfire update broke it under Wine.
>
> Here's the problem:
> Xfire crashes every time you interact with it's GUI, well most of  
> the time...
> When using the keyboard it crashes sometimes, but when using the  
> mouse it crashes every time...
>
> I used winedbg to find the possible cause, but i can't figure it out  
> myself, however here is the output: http://pastebin.be/21435
>
> As you can see, it crashes in user32/button.c, because i clicked on  
> a button.
xfire_toucan_39439 is its hooking DLL that is injected into every  
process(even non-games ones, and Xfire itself). It could be a hook  
going bad. I doubt it, because as far as I can see Xfire only tries to  
hook D3D's EndScene calls, but on the other hand Xfire worked for me  
in my hooking-enabled tree.

My hooking patches are in Wine git by now - but you need binutils and  
gcc from SVN to enable that code. A short summary:

1) Install GNU binutils from cvs. You don't have to install it system- 
wide. You can install it somewhere else, e.g. with ./configure -- 
prefix=/home/myUser/wine-build. Then, set PATH accordingly, so gcc  
uses the new as binary.

2) Install gcc from svn. The gcc configure scripts check if the  
assembler supports the swap suffix. This has to be available at  
compile time, gcc doesn't have runtime checks for that. Early during  
the compile process you should see a line like

checking assembler for swap suffix... yes

3) Compile wine with the new gcc. Again, make sure that the configure  
script sees the right gcc and as binaries.  In the Wine ./configure  
output you should see a line like:

checking for ms_hook_prologue attribute... yes

4) If Xfire still doesn't run(very likely), you can try to make *all*  
functions hookable, not just the selected ones I patched so far. To do  
so, edit include/windef.h, and make __attribute__ 
((__ms_hook_prologue__)) part of the WINAPI (or even __stdcall)  
definitions. Then make clean, and recompile.

5) If (4) makes Xfire work, try to figure out which function(s) it  
tries to hook, and send a patch to add DECLSPEC_HOTPATCH to those  
functions(look at dlls/kernel32/module.c, LoadLibraryA for an example)




More information about the wine-devel mailing list