<?xml version="1.0" ?>
<kc>

<title>Wine Traffic</title>

<author contact="http://www.theshell.com/~vinn">Brian Vincent</author>
<issue num="288" date="19 Aug 2005 00:00:00 -0800" />
<intro> <p>This is the 288th issue of the Wine Weekly News publication.
Its main goal is to sleep in the car. It also serves to inform you of what's going on around Wine. Wine is an open source implementation of the Windows API on top of X and Unix.  Think of it as a Windows compatibility layer.  Wine does not require Microsoft Windows, as it is a completely alternative implementation consisting of 100% Microsoft-free code, but it can optionally use native system DLLs if they are available.   You can find more info at <a href="http://www.winehq.org">www.winehq.org</a></p> </intro>
<stats posts="130" size="519" contrib="47" multiples="29" lastweek="24">

<person posts="9" size="32" who="Saulius Krasuckas" />
<person posts="7" size="22" who="Mike McCormack" />
<person posts="7" size="21" who="Tom Wickline" />
<person posts="8" size="23" who="Stefan D&#246;singer" />
<person posts="7" size="16" who="Alexandre Julliard" />
<person posts="5" size="50" who="Jacek Caban" />
<person posts="5" size="14" who="Evil" />
<person posts="5" size="13" who="Andreas Mohr" />
<person posts="4" size="13" who="Felix Nawothnig" />
<person posts="4" size="11" who="James Liggett" />
<person posts="4" size="10" who="Phil Krylov" />
<person posts="4" size="9" who="Fabio Duarte Vilas Boas" />
<person posts="4" size="8" who="Lionel Ulmer" />
<person posts="3" size="11" who="Francois Gouget" />
<person posts="3" size="10" who="Jonathan Ernst" />
<person posts="3" size="9" who="Detlef Riekenberg" />
<person posts="5" size="16" who="Marcus Meissner" />
<person posts="3" size="9" who="Vijay Kiran Kamuju" />
<person posts="3" size="8" who="Kevin DeKorte" />
<person posts="3" size="7" who="Vitaliy Margolen" />
<person posts="3" size="6" who="Paul Vriens" />
<person posts="2" size="68" who="=?ISO-8859-1?Q?Alex_Villac=ED=ADs_Lasso?=" />
<person posts="2" size="15" who="Troy Rollo" />
<person posts="2" size="13" who="Michael Jung" />
<person posts="2" size="11" who="Robert Reif" />
<person posts="2" size="5" who="Ge van Geldorp" />
<person posts="2" size="5" who="Ivan Leo Puoti" />
<person posts="2" size="4" who="Christian Britz" />
<person posts="1" size="11" who="Robbert Xerox" />
<person posts="1" size="7" who="Michael Kaufmann" />
<person posts="1" size="4" who="Shachar Shemesh" />
<person posts="1" size="4" who="Yuri Kozlov" />
<person posts="1" size="3" who="Daniel Remenak" />
<person posts="1" size="3" who="Christian Schmitz" />
<person posts="1" size="3" who="Tony Lambregts" />
<person posts="1" size="3" who="Duane Clark" />
<person posts="1" size="3" who="Huw D M Davies" />
<person posts="1" size="3" who="Jacob Emcken" />
<person posts="1" size="3" who="Dmitry Timoshkov" />
<person posts="1" size="2" who="Brian Vincent" />
<person posts="1" size="2" who="Vitaly Lipatov" />
<person posts="1" size="2" who="Scott Edwards" />
<person posts="1" size="2" who="Dripple" />
<person posts="1" size="2" who="gslink" />

</stats>
<section 
	title="Heap Corruption"
	subject="Help with debugging needed"
	archive="http://www.winehq.com/hypermail/wine-devel/2005/08/0253.html"
	posts="9"
	startdate="11 Aug 2005 00:00:00 -0800"
	enddate="13 Aug 2005 00:00:00 -0800"
>
<topic>Memory Management</topic>
<p>Stefan D&#246;singer wrote to the list late last week with an odd
problem:</p>
<quote who="Stefan Dosinger"><p>
I am trying(once again) to get Empire Earth running with wine. After 
solving a few problems, I've run into a strange access violation crash. It 
looks like a buffer overrun, followed by a return to an invalid adress.
</p><p>

The crash messages look a little bit different every time, with illegal 
instructions / access violations or even a Segmentation Fault without 
starting winedbg at various addreses(Attached file crashes). On very rare 
occasions, this crash doesn't occur, and the game continues to load and 
crashes later in some ddraw function. Instead of crashing it complains about 
a corrupted heap:
<ul><code>
 err:heap:HEAP_ValidateInUseArena Heap 0x7fd80000: prev arena 0x7fe01640 is 
not prev for in-use 0x7fe01cb0</code></ul></p><p>
I've looked at a +heap trace, but I couldn't find anything usefull.
(See ee-nocrash for a log). I've also attached a normal log without any 
special debug flags set(ee-normal.log.gz). I've added a few ERR statements 
for testing in some functions.
</p>
<p>So my questions are:
<ul><li>
Am I right with my suspection that the problems are caused by a incorrect 
return?</li>
<li>How can I get a disassembly of Low-Level 
Engine.?Deactivate_at_GERasterizer@@UAEJXZ or simmilar functions. I didn't find 
this symbol.</li></ul></p></quote>

<p>James Liggett recognized the problem,
<quote who="James Liggett">
I've also seen similar problems with related heap functions in WinMM.
I'm told that there's something wrong with the heap manager library Wine
uses. 
</quote></p>

<p>Stefan did more detective work and found what seemed to be the source
of the problem:</p>
<quote who="Stefan Dosinger"><p>
I was lucky with setting a breakpoint in the wine code. The crash happens in 
the DDraw implementation. The return from 
Main_DirectDraw_Release(ddraw_main.c:154) leads to a random adress. The call 
which leads to this is "HeapFree(GetProcessHeap(), 0, This);" in 
Main_DirectDrawSurface_Destroy, surface_main.c:154. If I comment out this 
call, Empire Earth continues loading and crashes more or less randomly at 
some later points.
</p><p>
I've edited the IDirectDrawSurfaceImpl structure and added a 2048 byte block 
at the beginning and the end. This makes the crashes reliable: With the 
HeapFree call, the ret jumps to NULL, and without the call Empire Earth 
crashes little later.
</p><p>
This looks like a really nasty heap corruption to me, and I'm afraid it's 
beyond my knowledge. Can anyone of the ddraw/d3d people help me?</p></quote>

<p>Lionel Ulmer suggested some debug channels to look at,
<quote who="Lionel Ulmer">

I think best would a +ddraw,+heap,+relay,+tid,+seh trace to be able to see
where the corruption may occur. And it's not because it crashes into DDraw
code that it's DDraw responsible for it :-)</quote></p>

<p>Stefan then had an interesting insight,
<quote who="Stefan Dosinger">
BTW, Empire Earth crashes in exactly the same way in Cedega, where I expect 
the DirectX implementation to be quite different.
</quote></p>

<p>James thought this bug could be hidden deeply in the heap code, such
as a buffer overrun.  If so, it's likely been there for a long time if
Cedega also suffers from it - they branched from Wine over three years 
ago.  More work showed a way to reproduce a problem, though perhaps 
not the same problem:</p>
<quote who="Stefan Dosinger"><p>
This is interesting: Setting the +heap trace flag sets the bad address 
realiably to 0xaaaaaaaa (without my changes to DDraw). Does this say anything?
</p></quote>

<p>Andreas Mohr grepped through the code and pointed out a potentional
culprit:</p>
<quote who="Andreas Mohr"><p>
<code>dlls/ntdll/heap.c:#define ARENA_FREE_FILLER      0xaa</code></p><p>

I'd guess this is an address in an area that's actually gotten freed.
</p></quote>

<p>James thought it was more likely to be an uninitialized value.  Stefan
poked around more and discovered something that pointed to it being contained 
within DirectDraw.  Lionel Ulmer asked for a +ddraw trace since he thought it 
could be a reference counting issue.  Thus far there's no solution.</p>


</section>
<section 
	title="Disappearing Cursors"
	subject="[Bug 3165] Patch available"
	archive="http://www.winehq.com/hypermail/wine-devel/2005/08/0380.html"
	posts="7"
	startdate="17 Aug 2005 00:00:00 -0800"
	enddate="18 Aug 2005 00:00:00 -0800"
>
<topic>Fixes</topic>
<mention>Eric Pouech</mention>

<p>Kevin DeKorte reported a problem with Lotus Notes that appeared to
be a regression:</p>
<quote who="Kevin DeKorte"><p>
Using Wine 20050725 and Lotus Notes 6.51 when I move my mouse to the database 
tabs or over the replication window the mouse disappears while I move over 
the tab or replicated databases and then reappears when I leave the list. The 
databases are highlighted, but having the mouse completely disappear is a 
little annoying. I don't remember it doing this with 20041202.</p><p>
I checked this on my XP machine and on that machine the cursor 
changes from an arrow to a hand pointer. So maybe the cursor just did not 
load correctly. So can a patch be done that if the cursor being selected is 
bogus that it stays the arrow pointer.</p></quote>
<p>Apparently it's a known regression filed in Bugzilla under bug
<a href="http://bugs.winehq.org/show_bug.cgi?id=3165">#3165</a>

Someone then reported the patch listed with that bug fixed the problem.
That touches on something Eric Pouech mentioned at WineConf.  Bugzilla
contains some bugs with known fixes that haven't made their way into Wine.
Kevin wondered about it though,
<quote who="Kevin DeKorte">
Well the patch does improve the cursor. I can now see it. Although it is only 
grey. It there any reason why the best cursor selection method always checks 
for bits == 1. What about color cursors?</quote>
</p><p>
Duane Clark also reported success,
<quote who="Duane Clark">

I don't really understand how the patch fixed things, but...
Riven uses a bunch of color cursors (hands pointing various directions). 
Without the patch, only the standard pointer cursor was generated. This 
cursor appeared and disappeared normally (the cursor is supposed to 
disappear while some Quicktime clips are playing, and then reappear).
With the patch, the color cursors reappeared and all are correct.
</quote></p>

<p>Mike McCormack explained a little behind the patch:</p>
<quote who="Mike McCormack"><p>
It should improve things over the original code that was there in 
cursoricon.c revision 1.9.  That code first checked if there was only 
one cursor, then returned it, but if there was more than on cursor, it 
would choose one a 1bpp cursor.  That scheme would miss out picking a 
cursor at all if there was two coloured cursors.
</p><p>
The new scheme makes sure that we always start with one cursor and 
improve over that.
</p><p>
I think the problem is that standard X cannot support coloured cursors. 
The Xcursor extension appears to, but we don't support that.  Any 
volunteers?

</p></quote>
</section>
<section 
	title="Comctl32 Fixes"
	subject="Re: commctrl: dialog theming"
	archive="http://www.winehq.com/hypermail/wine-devel/2005/08/0373.html"
	posts="9"
	startdate="17 Aug 2005 00:00:00 -0800"
	enddate="19 Aug 2005 00:00:00 -0800"
>
<topic>Controls</topic>
<mention>Vitaliy Margolen</mention>
<mention>WineHQ</mention>

<p>Jesse Litton ran into a problem using a native commctrl.dll and 
comctl32.dll:</p>
<quote who="Jesse Litton"><p>
I'm no longer able to run programs that require the native comctl32 and 
commctrl DLLs, since updating to today's CVS.  Could it be related to 
these theme patches?
</p><p>
It seems that now, if you override comctl32 for any app (or globally), 
even WineCfg itself will error out with the error.
<ul><code>
    err:thunk:_loadthunk (commctrl.dll, Cctl1632_ThunkData16,
    comctl32.dll): Unable to load 'commctrl.dll', error 2<br />
    err:module:LdrInitializeThunk "comctl32.dll" failed to initialize,
    aborting<br />
    err:module:LdrInitializeThunk Main exe initialization for
    L"c:\\windows\\system32\\winecfg.exe" failed, status c0000142
</code></ul></p><p>
The native commctrl.dll and comctl32.dll both exist in my windows/system 
directory - the same versions that always worked before.  Overriding 
commctrl doesn't have any effect on this error.
</p></quote>

<p>Andi Mohr wanted to know if Jesse was running either both of the
DLL's as native or both as builtin.  These DLL's can't be mixed and
matched between native and builtin.  Jesse replied that both of them
were in fact native.  Mike McCormack didn't think there was a reason
to still use native DLL's:</p>
<quote who="Mike McCormack"><p>

You shouldn't need to use the native comctl32 any longer.  Please update 
your dll overrides to "comctl32" = "builtin".
</p><p>
Wine's comctl32 implementation is almost complete.  If there's bugs with 
the builtin comctl32 then please help us by reporting them rather than 
sweeping the problem under the carpet and using the native dll.

</p></quote>

<p>Jesse described the specific problem he was running into with 
DreamWeaver.  Mike supplied a patch:</p>
<quote who="Mike McCormack"><p>

OK, there is a patch that is in CrossOver that has not yet been 
committed to WineHQ for some reason, that fixes this problem.

</p><p>
Could you please try the 
<a href="http://www.winehq.com/hypermail/wine-devel/2005/08/att-0390/01-comctl32-tab-dw.diff">attached</a> patch?
</p><p>
I fear that Wine doesn't go forward as much as it should for lack of 
testing :/</p></quote>
<p>Jesse reported success:</p>
<quote who="Jesse Litton"><p>
The patch worked great!  At least, it appears to work a lot better than 
before.
</p><p>
There are still some graphical glitches, for example:  If you switch 
server technology between yes and no when defining a site, the combo box 
doesn't completely reappear... but it's actually useable now!

</p></quote>
<p>Vitaliy Margolen jumped in to mention that all Delphi programs are
currently broken with themed controls.  Frank Richter then posted a
patch on Friday with the following ChangeLog,
<quote who="Frank Richter">
Merge subclass stubs and subclass proc. Having the stub set the window
proc to the subclass proc was not a good idea since that breaks
subclasses of themed standard controls (e.g. what Delphi does a lot).</quote>
</p>

</section>
<section 
	title="Exluding Call in Relay Traces"
	subject="excluding kernel32.9[78] from a relay log"
	archive="http://www.winehq.com/hypermail/wine-devel/2005/08/0401.html"
	posts="3"
	startdate="20 Aug 2005 00:00:00 -0800"
>
<topic>Debugging</topic>
<p>Saulius Krasuckas wanted to know how to exclude some calls from relay
traces:</p>
<quote who="Saulius Krasuckas"><p>
Using CVS version I get following calls in the output very frequently:
<ul><code>
000b:Call kernel32.97(408b8880) ret=40891d49<br />
000b:Ret  kernel32.97() retval=40428f60 ret=40891d49<br />
000b:Call kernel32.98(408b8880) ret=40891e27<br />
000b:Ret  kernel32.98() retval=00000000 ret=40891e27
</code></ul></p><p>
I want to exclude this stuff.  
Adding "97;98" to <tt>HKEY_CURRENT_USER/Software/Wine/debug/RelayExclude</tt>
string value doesn't help me.
<ul><code>
$ grep -Ir [^0-9]9[78][^0-9] dlls/kernel/*.spec
| dlls/kernel/kernel32.spec: 97 stdcall -noname _EnterSysLevel(ptr)
| dlls/kernel/kernel32.spec: 98 stdcall -noname _LeaveSysLevel(ptr)
</code></ul></p><p>

Adding "_EnterSysLevel;_LeaveSysLevel;97;98" does not help either.  
Suggestions?
</p></quote>

<p>Felix Nawothnig suggested:</p>

<quote who="Felix Nawothnig"><p>
Try "kernel32.97;kernel32.98".</p></quote>

<p>Saulius reported that worked.</p>
</section>
<section 
	title="Pending Website Updates"
	subject="Future Acknowledgement &amp; Who's Who updates"
	archive="http://www.winehq.com/hypermail/wine-devel/2005/08/0359.html"
	posts="1"
	startdate="16 Aug 2005 00:00:00 -0800"
>
<topic>WineHQ</topic>
<mention>Phil Krylov</mention>
<mention>James Hawkins</mention>
<mention>Michael Jung</mention>
<mention>Mike Hearn</mention>
<mention>Gerald Pfeifer</mention>
<mention>Vitaliy Margolen</mention>
<mention>Krzysztof Foltman</mention>
<mention>WineHQ</mention>

<p>Tom Wickline is currently updating some web pages on WineHQ:</p>
<quote who="Tom Wickline"><p>

I am in the process of updating our  "Acknowledgement" &amp; "Who's Who"
pages and if anyone here wants to be included and your currently not
just send me a mail and ask for inclusion.
</p><p>
If you want inclusion on the "Acknowledgement" page let me know what
areas you have worked on and you will be added in on my next patch.
</p><p>
If you believe you will be around for some time to come (a year) and
want to be included to the "Who's Who" page let me know this as well.
For the "Who's Who" I will need a short description of who you are,
where you're from, when you started working on wine, and what areas
you work on.
</p><p>
You can look at other entries for a good example..
<ul>
<li><a href="http://www.winehq.org/site/who">
http://www.winehq.org/site/who</a></li>
<li><a href="http://www.winehq.org/site/acknowledgement">
http://www.winehq.org/site/acknowledgement</a></li></ul></p>

<p>This is what I have thus far for my next update:
<ul>
<li>ADD -  Jonathan Ernst  (Acknowledgement page)</li>
<li>ADD -  Krzysztof Foltman  (Acknowledgement page)</li>
<li>ADD -  Phil Krylov  (Acknowledgement page)</li>


<li>Update -  Gerald Pfeifer to (2005)</li>
<li>Update -  Michael Jung to (2005)</li>
<li>Update -  James Hawkins to (2005)</li>
<li>Update -  Vitaliy Margolen to (2005)</li>
<li>Update -  Mike Hearn to (2005)</li></ul>
</p></quote>
</section></kc>
