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

<title>Wine Traffic</title>

<author contact="http://www.theshell.com/~vinn">Brian Vincent</author>
<issue num="329" date="04/16/2007" />
<intro> <p>This is the 329th issue of the Wine Weekly News publication.
Its main goal is to smile. 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="172" size="316" contrib="67" multiples="35" lastweek="35">

<person posts="10" size="10" who="dmitry at codeweavers.com (Dmitry Timoshkov)" />
<person posts="8" size="14" who="nlaw at nildram.co.uk (Nick Law)" />
<person posts="8" size="8" who="scott at open-vote.org (Scott Ritchie)" />
<person posts="8" size="8" who="twickline at gmail.com (Tom Wickline)" />
<person posts="8" size="7" who="dank at kegel.com (Dan Kegel)" />
<person posts="7" size="10" who="citizenr at gmail.com (RusH)" />
<person posts="6" size="31" who="speeddymon at gmail.com (Tom Spear)" />
<person posts="13" size="37" who="stefandoesinger at gmx.at (Stefan D&#246;singer)" />
<person posts="6" size="5" who="hverbeet at gmail.com (H. Verbeet)" />
<person posts="6" size="5" who="m.b.lankhorst at gmail.com (Maarten Lankhorst)" />
<person posts="4" size="9" who="flexo at holycrap.org (Felix Nawothnig)" />
<person posts="4" size="9" who="wine-devel at kievinfo.com (Vitaliy Margolen)" />
<person posts="4" size="6" who="rob at codeweavers.com (Robert Shearman)" />
<person posts="4" size="6" who="us at edmeades.me.uk (Ann &amp; Jason Edmeades)" />
<person posts="4" size="5" who="ivg231 at gmail.com (Ivan Gyurdiev)" />
<person posts="4" size="4" who="julliard at winehq.org (Alexandre Julliard)" />
<person posts="3" size="5" who="lich at math.spbu.ru (Kirill K. Smirnov)" />
<person posts="3" size="4" who="marshall at ece.ualberta.ca (Philip A. Marshall)" />
<person posts="3" size="3" who="h.figge at gmx.de (Hartmut Figge)" />
<person posts="2" size="13" who="eric.pouech at wanadoo.fr (Eric Pouech)" />
<person posts="2" size="6" who="kai.blin at gmail.com (Kai Blin)" />
<person posts="2" size="6" who="jwhite at winehq.org (Jeremy White)" />
<person posts="2" size="4" who="r.kalbermatter at hccnet.nl (Rolf Kalbermatter)" />
<person posts="2" size="3" who="paul.vriens.wine at gmail.com (Paul Vriens)" />
<person posts="3" size="3" who="marcus at jet.franken.de (Marcus Meissner)" />
<person posts="2" size="2" who="the3dfxdude at gmail.com (Jesse Allen)" />
<person posts="2" size="2" who="vit.hrachovy at sandbox.cz (Vit Hrachovy)" />
<person posts="2" size="2" who="truiken at gmail.com (James Hawkins)" />
<person posts="2" size="2" who="wine at martin.wrong.nu (Martin Traverse)" />
<person posts="2" size="2" who="Andrew.Talbot at talbotville.com (Andrew Talbot)" />
<person posts="2" size="1" who="jan.wine at zerebecki.de (Jan Zerebecki)" />
<person posts="2" size="1" who="ead1234 at hotmail.com (EA Durbin)" />
<person posts="2" size="1" who="wine.dev at web.de (Detlef Riekenberg)" />
<person posts="1" size="17" who="klaus.layer at gmx.de (Klaus Layer)" />
<person posts="1" size="5" who="dsh at linux.ucla.edu (Dan Hipschman)" />
<person posts="1" size="3" who="nemes.sorin at gmail.com (SorinN)" />
<person posts="1" size="2" who="pawel.rozanski at gmail.com (=?ISO-8859-2?Q?Pawe=B3_R=F3=BFa=F1ski?=)" />
<person posts="1" size="2" who="frick at sc-networks.de (Christoph Frick)" />
<person posts="1" size="2" who="alex at thehandofagony.com (Alexander Nicolaysen =?utf-8?q?S=C3=B8rnes?=)" />
<person posts="1" size="2" who="mahanuu at free.fr (Emmanuel Maillard)" />
<person posts="1" size="1" who="bgerst at didntduck.org (Brian Gerst)" />
<person posts="1" size="1" who="wes.parish at paradise.net.nz (Wesley Parish)" />
<person posts="1" size="1" who="jaka at kubje.org (=?UTF-8?B?SmFrYSBKYW7EjWFy?=)" />
<person posts="1" size="1" who="damjan.jov at gmail.com (Damjan Jovanovic)" />
<person posts="1" size="1" who="frusso at qpass.com (Frank Russo)" />
<person posts="1" size="1" who="mstefani at redhat.com (Michael Stefaniuc)" />
<person posts="1" size="1" who="hallo at michael-kaufmann.ch (Michael Kaufmann)" />
<person posts="1" size="1" who="thunder.m at czela.net (Mirek)" />
<person posts="1" size="1" who="tokul at users.sourceforge.net (Tomas Kuliavas)" />
<person posts="1" size="1" who="research at science.su (L. Rahyen)" />
<person posts="1" size="1" who="chris.kcat at gmail.com (Chris Robinson)" />
<person posts="1" size="1" who="fgouget at free.fr (Francois Gouget)" />
<person posts="1" size="0" who="Phil.Lodwick at EFI.COM (Phil Lodwick)" />
<person posts="1" size="0" who="dimi at lattica.com (Dimi Paun)" />
<person posts="1" size="0" who="laurent at vromman.org (Laurent Vromman)" />
<person posts="1" size="0" who="frank.richter at gmail.com (Frank Richter)" />
<person posts="1" size="0" who="anssi.hannula at gmail.com (Anssi Hannula)" />
<person posts="1" size="0" who="sol11x86 at comcast.net" />
<person posts="1" size="0" who="fpga at pacbell.net (Duane Clark)" />
<person posts="1" size="0" who="strooka_ace at yahoo.de (marcel busse)" />
<person posts="1" size="0" who="vbudovski at gmail.com (Vitaly Budovski)" />
<person posts="1" size="0" who="marco at mandrivaclub.nl (marco)" />

</stats>
<section 
	title="News: Summer of Code Projects"
	subject="News"
	archive="http://code.google.com/soc/wine/about.html"
	posts="1"
>
<topic>News</topic>
<p>The big news this week was the announcement of Google's Summer of Code
projects.  Ten projects were approved for Wine.  Even more exciting,
each of those 10 projects are really strong candidates.  If even half of
them get completed we'll have some wonderful new functionality in Wine.  
Google has continued to expand this program each year.  There were 
nearly 6,200 applicants this summer with over 900 being accepted. 
Here's the list of Wine projects:
<ul>
<li><i>Improve sound in wine</i>
by Maarten Lankhorst, mentored by Marcus Meissner</li>
<li><i>Improve Wine's rich edit implementation</i>
by Matthew Finnicum, mentored by Ulrich Czekalla</li>
<li><i>The DIB Engine</i>
by Jessie Laine Allen, mentored by Huw D M Davies</li>
<li><i>Implementing mscoree.dll and Mono-WINE bridge</i>
by Bryan DeGrendel, mentored by James Hawkins</li>
<li><i>Tablet PC support in Wine</i>
by Carl John Klehm, mentored by Daniel Richard Kegel</li>
<li><i>Beginning of Direct3D10 implementation</i>
by Andr&#225;s Kov&#225;cs, mentored by Stefan D&#246;singer</li>
<li><i>Improve Wine's built-in text editors</i>
by Alexander Nicolaysen S&#248;rnes, mentored by Eric Pouech</li>
<li><i>Windows Printing subsystem bridge (i.e. use WIN32 drivers to print from wine)</i>
by Marcel Partap, mentored by Detlef Riekenberg</li>
<li><i>CHM compiler</i>
by Miikka Viljanen, mentored by Jacek Caban</li>
<li><i>Improve Wine portability, make Solaris x86/amd64 a first-class supported platform</i>
by Albert Lee, mentored by Juan Lang</li>
</ul></p>

<p>Kai Blin, who's worked on authentication in Wine for the previous 2 summers,
was accepted for a Samba project this year to improve winbindd support.
What's interesting about that is Kai has enough experience with Wine to
understand what would be needed in Samba for improved support.  </p>

<p>A new Wine beta arrived last Friday.  Noted changes include:</p>
<quote who="Alexandre Julliard"><p>
<ul>
<li> Broken aRts sound driver now removed for good.</li>
<li> Many fixes to the Quartz DLL sound support.</li>
<li> File I/O performance improvements.</li>
<li> The usual assortment of Direct3D fixes.</li></ul>
</p></quote>

<p>The 'File I/O' mention lies in some work being done by Alexandre and
goes right to the heart of the wineserver.  I won't even pretend to understand
the changes being made there, but it seems interesting.</p>
</section>
<section 
	title="Cedega 6.0 &amp; Wine Benchmarks"
	subject="Wine vs. Cedega in Benchmarks"
	archive="http://www.winehq.com/pipermail/wine-devel/2007-April/055858.html"
	posts="12"
>
<topic>Testing</topic>
<p>There's a little topic that doesn't get covered much here.  In fact, it's
something that doesn't really get covered anywhere and it's probably time
to try to set the record straight.  We'll start with the Slashdot announcement
of TransGaming's Cedega 6.0 which read:</p>
<quote who="Slashdot"><p>
Today TransGaming introduced Cedega 6.0, which is the popular Linux game 
emulator based upon WINE.</p></quote>

<p>Here's the facts you need to know about Wine &amp; Cedega:
<ul>
<li>Cedega's core is based off the original Wine tree and was forked in 2002.
There are several core components that no longer share a similarity with
Wine as it exists today.</li>
<li>TransGaming has not actively contributed to Wine in about 5 years with
the exception of a few patches (less than 5 a year.) </li></ul></p><p>

So any time I hear Wine and Cedega in the same sentence I kind of cringe.
They're really two different codebases at this point.  Why is that?  Well,
it all goes back to Wine changing its licensing from X11 (BSD-style)  to
the LGPL about 5 years ago.  See WWN issues
<a href="http://www.winehq.com/wwn/115#Wine%20License%20Change,%20Round%202">#115</a>,
<a href="http://www.winehq.com/wwn/116#Wine%20Licensing%20(con't)">#116</a>,
and 
<a href="http://www.winehq.com/wwn/117#Wine%20Licensing%20(con't)">#117</a> 
for more info.  So Wine switched its license, TransGaming kept using the old
codebase, and now the two have diverged.  Except.. TransGaming has realized
that some of the stuff created by Wine is necessary and they've imported
specific DLLs into their codebase and kept them under the LGPL license.
Wine's modular DLL architecture allows that pretty easily.
</p><p>
Okay, so the code is different.  How about the relationship between the
two projects?  Despite rumblings that might appear here and there on the
mailing list, the relaionship isn't that bad.  Really it's more that there
isn't a relationship, however there doesn't seem to be animosity between the
two groups.  The last in-depth communications (public at least) seemed to
have been in 2004 when Gav State came to WineConf 2004.  At the time he
basically pitched a few technical changes for Wine and all of them were
shot down.  While the two projects were diverging before that, that was
probably the event that ensured the two projects would go their own ways.</p>
<p>
Okay, so now you know some of the background.  Saying that Cedega is based off
Wine technicallly isn't incorrect, but it does imply that Cedega has all the
new architecture of Wine that's happened in the past half decade.  </p><p>
A benchmark was done and linked from the Slashdot announcement.  It led Tom 
Wickline to comment:</p>
<quote who="Tom Wickline"><p>
I have been pondering the thoughts of running every benchmark that I
have on Wine, Cedega, XP, and CX to see where we stack up in the
performance game.
</p><p>
And while doing my daily reading of news sites I came across this posted on /.
<ul>
<a href="http://www.phoronix.com/scan.php?page=article&amp;item=681&amp;num=1">
http://www.phoronix.com/scan.php?page=article&amp;item=681&amp;num=1</a></ul>
</p><p>
Those guys ran 5 game tests and Wine's performance is clearly superior
to that of Cedega on benchmarks where Wine was run. They give no
details of the Wine configuration, so I can only presume it's a
default setup. And since they're *trying* to paint the best picture
possible for Cedega, they don't point out that Wine is superior!
<ul><i>"It is also important to note that there were minimal performance
differences between WINE 0.9.32 and Cedega 6.0. Granted there are only
five benchmarks in this Cedega 6.0 performance preview, but the level
of performance for Cedega does look extremely promising and we will
continue to look at Cedega 6.0 and report back in future articles."
</i></ul></p><p>
Should read : Cedega's performance is currently lagging that of Wine
0.9.32 and with each Wine release Wine's performance and feature set
is continuously improving!
</p><p>
I'm open for thoughts and suggestions....
</p></quote>

<p>Apparently what's not said in that benchmark though is that all of the
games are using OpenGL, not Direct3D, for rendering.  Really Direct3D 
is where Wine and Cedega have completely different codepaths.  So both
Henri Verbeet and Stefan D&#246;singer suggested a D3D comparison would
be much more useful.  On a slightly different note, Stefan mentioned some 
informal benchmarking he had recently performed himself using just Wine and
Linux vs. native Mac OS X:</p>
<quote who="Stefan Dosinger"><p>
Though the interesting thing is that I did my own native Linux vs native Mac OS X
vs Wine benchmarks with glExcess a few days ago. I got pretty much the
opposite result. Granted, my benchmarking code was very primitive, so read
the results as +/- 10 fps, and this was on fglrx. But I got remarkable
differences between wine and native, with native being up to 2 times faster.
</p><p>
Out of interest I did a quick check on nvidia. The difference is smaller, but
there too (990 vs 1100 fps in the first glExcess scene at 640x480). Still a
~10% difference.
</p><p>
I also tested winelib vs PE .exe (with msvc6) and found no difference (That was
990 (winelib) vs 980 (PE)). The small differences could be because of my shitty
benchmark code or because of compiler differences.
</p></quote>

</section>
<section 
	title="OpenGL Child Windows Revisited"
	subject="OpenGL child windows [RFC]"
	archive="http://www.winehq.com/pipermail/wine-devel/2007-April/055817.html"
	posts="2"
>
<topic>Graphics</topic>
<p>OpenGL child windows have been broken in Wine for quite a couple of
years now.  It was broken (some would say 'fixed') when the window management
rewrite occurred.  There's been some ideas floated about how to fix it, but 
nothing has really come of it.  For more background on this issue, see the 
<a href="http://wiki.winehq.org/OpenGL">OpenGL wiki</a> page.  Ulrich Czekalla
floated a <a href="http://www.winehq.org/pipermail/wine-patches/2006-October/031336.html">a patch</a>
last October, but it was never included in Wine.  Roderick Colenbrander sent a 
patch this week with a different approach and 
gave an excellent description of the challenges behind the problem:</p>
<quote who="Roderick Colenbrander"><p>
This is an updated version of the child window patch from Chris Robinson. I 
have added some fixes to it which were found by testing it with lots of 
programs.  
</p>
<p><u>Windowed OpenGL</u></p><p>
Several options have been discussed over the years for solving the windowed 
OpenGL issues. The lazy option was to use pixmaps but you would lose hardware 
acceleration. A better way but similar was the use of pbuffers but still they
are poorly supported by most drivers (only Nvidia has decent support).
</p><p>
One of the most attractive solutions is the use of glScissors/glViewport 
changes. This path works now if you apply Ulrich's latest patch which is in 
bugzilla (2398). Though for optimal performance you need specific OpenGL 
extensions. Second a number of standard OpenGL calls require changes and some 
aren't done yet (glReadPixels and friends) but right now it is one of the best 
solutions.
</p><p>
Another way of solving the windowed OpenGL problem is by using X child windows 
for the OpenGL window. In the end this results in the same as Ulrich's 
glScissor work but with the advantage that it should work fast on all OpenGL 
implementations as it doesn't require special extensions. Further it doesn't 
require the patching of OpenGL calls.
</p>
<p><u>OpenGL pixelformats</u></p>
<p>Next to the windowed OpenGL issues, there's the pixelformat limitation in Wine. 
Right now only one pixelformat can be used. Most programs use ChoosePixelFormat 
using which you can request a pixelformat but the call isn't guaranteed to give 
you back what you want. For this reason most programs aren't very critical.
</p><p>
These days more and more programs are more critical. They use 
wglChoosePixelFormatARB which does give you what you want or programs 
enumerate all pixelformats using DescribePixelFormat and choose what they want.
</p><p>
Anyway the issue is that the single pixelformat isn't enough anymore. A 
<a href="http://bugs.winehq.org/show_bug.cgi?id=7866">recent report</a>
from WoW on Intel drivers is a proof of this.  The game didn't like the single 
format exported by Wine. Another example is the IKEA kitchen planner tool which 
uses DescribePixelFormat to enumerate all formats. It expects to find a match 
in a format. Right now it doesn't find any match and calls SetPixelFormat with 
iPixelFormat=0 (which is invalid).
</p><p>
Like the above two programs there are many other programs with issues due to 
pixelformats. I believe that perhaps a few of them are fixable (by adding more 
hacks or by lying to programs). If we had more pixelformats, I think the 
issues could be fixed. OpenGL child windows would fix this issue as the child 
doesn't have to use the same pixelformat as its parent (!).
</p><p>
<u>Summary</u></p><p>
If we would use OpenGL child windows in Wine that would fix most windowed 
OpenGL issues and second it would allow us to use more pixelformats as a child 
window doesn't have to use the same pixelformat as its parent.
</p><p>

</p><p><u>Patch</u></p><p>
As mentioned before the patch was mainly made by Chris Robinson and I have 
added a few fixes to it to make it more compatible. Basically a child window is
allocated for a hdc during SetPixelFormat which needs to be called on every hdc 
before it can be used with OpenGL. That's basically the biggest change to the 
OpenGL code. For the rest some x11drv calls like SetWindowPos had to be 
patched in order to move the child window when needed.
</p><p>
Below you can find a list of tested programs and the results. As you can see it 
works correctly for most of the tested programs. Three of the tested programs 
don't work correctly of which two are not related to the use of child windows, 
so overall the result is good.
</p><p>
I'd like to know of more programs that work / don't work and I like feedback on 
the patch.
</p><p>
Properly working programs:
<ul><li> Blender</li>
<li> Google Earth</li>
<li> Google SketchUp</li>
<li> Lightwave 6 + 9</li>
<li> MilkShape3D</li>
<li> Terragen + Terragen2</li>
<li> VLC OpenGL plugin</li>
<li> Valve Hammer tool</li>
<li> Weatherscope</li>
<li> Q3Radiant</li></ul></p><p>

Unfixed programs:<ul>
<li> Truespace 6.5; The program uses OpenGL for its main window and uses some floating win32 toolbars. The child window obscures them, perhaps the SHAPE extension for X can be of help here to cut parts away.</li>
</ul></p><p>
Other broken apps not child window related:
<ul><li> NWN Model viewer; The program seems to do be using WGL in an illegal 
way but seems to get away with this without any failures on Windows. I don't 
know what's going on. It also never worked correctly before when there were X 
windows. It now behaves the same as before. Using Ulrich's patch it works 
but that's basically an 'accident'. It isn't because the code is fixed.</li>
<li> IKEA kitchen planner; The program uses multiple child windows one for a 3D 
preview which works fine and it uses one for drawing on a grid. When drawing 
things on the grid, the objects quickly disappear. There's some buffer 
swapping issue I guess. The same happens without the child window patch and 
using Ulrich's patch.  So the issue is not related to child windows.</li>
</ul></p></quote>

<p>With a little luck we'll see a solution soon.  This is one of those 
meta-bugs keeping an entire class of applications from working.</p>
</section>
<section 
	title="DIB Engine Ideas"
	subject="Patches / a proposal for the mystic DIB engine"
	archive="http://www.winehq.com/pipermail/wine-devel/2007-April/055859.html"
	posts="9"
>
<topic>Graphics</topic>
<p>Felix Nawothnig posted some ideas for how a DIB engine could get off
the ground:</p>
<quote who="Felix Nawothnig"><p>
Okay, I've spent the last days looking into this matter and I'd like to 
suggest a way to get it started. So. This is the plan:

<ol><li> In winex11.drv:
<ul><code>
-INT X11DRV_LockDIBSection(X11DRV_PDEVICE *physDev, INT req, BOOL lossy)<br />
+HBITMAP X11DRV_LockDIBSection(X11DRV_PDEVICE *physDev, INT req, BOOL force)
</code></ul>
    Lossy isn't used anywhere for LockDIBSection anyway. Force means that
    the function will only lock if the DIB is already in AppMod. The
    returned bitmap is of course physDev-&gt;bitmap-&gt;hbitmap.
<p>
    Rationale: If you lock the DIB to write on it, it makes sense that the
    function actually provides you with that DIB.</p>
</li>
<li> Export LockDIBSection/Unlock to gdi32.
<p>
    Adding more exports is not nice but there really is no way around
    that, right?</p>
</li>
<li> Move dc-&gt;funcs to dc-&gt;physDev-&gt;funcs. Many changes but mostly
    mechanical work.
<p>
    Rationale: This really belongs there. And I need it. :)</p>
</li>
<li> Now we write dibdrv.c for now just containing DIBDRV_Install
    and DIBDRV_Remove. That function will go through the physDev->funcs
    list and overwrite each function pointer which is actually
    implemented with DIBDRV_PutPixel(), whatever.
<p>
    DIBDRV_Install/DIBDRV_Remove will be called from
    BITMAP_SelectObject() when we switch from non-DIB to DIB and vice versa.
</p><p>
    Note that we can't use DRIVER_load_driver here because of the
    wanted "forward to original driver when not implemented".
</p><p>
    For this we will need to extend the "for DIB objects" part in
    BITMAPOBJ by
<ul><code>
     const DC_FUNCTIONS *orig_funcs;<br />
     DC_FUNCTIONS        local_funcs;
</code></ul>	
    where orig_funcs to the old physDev-&gt;funcs and the new physDev-&gt;funcs
    points to &amp;bmp-&gt;local_funcs.</p>
</li>
<li> In dibdrv.c we get us:
<ul><code>
  enum {
<ul><code>
     DIBDRV_MIXED,  /* Choose driver depending on current AppMod */<br />
     DIBDRV_ALWAYS, /* Always use DIBDRV (unless function not
                       implemented) */<br />
     DIBDRV_NEVER   /* Always use DC driver */<br />
</code></ul>
} DIB_Mode = DIBDRV_MIXED;
</code></ul>
    and DIB_Lock(PHYSDEV physDev) / DIB_Unlock(PHYSDEV).
    Now, here comes the reason we need the HBITMAP from
    LockDIBSection() and funcs inside PHYSDEV:
<p>
    Since we don't have the DC here we have no way of
    calling LockDIBSection(), forwarding to the original driver
    if NEVER/MIXED or writing to the actual DIB in case of
    MIXED/ALWAYS.</p>
</li>
<li> From this point we can start implementing one function at a time,
    touching nothing but dibdrv.c.</li>
</ol></p><p>
So far so good. I did all those steps (except 3., I hacked around that 
in my local tree) in a clean way and it works nice (for 6. I implemented 
SetPixel() and tried that with a test-app).
</p><p>
I attached patches for the steps 1 2 and 4 so you can see where this is 
going.
</p><p>
Comments?
</p></quote>

<p>Then Felix noticed someone had been accepted for Google's Summer of
Code to work on this very project.  That someone is Jesse Allen and he
replied:</p>
<quote who="Jesse Allen"><p>
Honestly there have been attempts before to start the DIB engine
and I've seen them already. I don't think it will affect what I do, as
nothing has really been accepted yet. But I suggest you find out who
my mentor is and show it to him first. See if what you have done can
somehow be worked into the mentoring process (hopefully it's good
enough :D). I think it's early enough to work it out.
</p></quote>

<p>Alexandre then replied and commented on some specific points that Felix
proposed:</p>
<quote who="Alexandre Julliard"><p>
<i>[regarding #2]</i></p><p>
No, LockDIBSection is a driver internal detail, gdi32 has no business
knowing about this.</p>
<p><i>[regarding #3]</i></p><p>

No it doesn't, physDev is an opaque structure as far as gdi32 is
concerned. Data needed by gdi32 belongs in the DC structure.

</p><p><i>[regarding #4]</i></p><p>

You certainly don't want to store the full function table in the
BITMAPOBJ, it will be the same for all bitmaps. All you need is one
function table for the DIB driver and one for the normal graphics
driver.  Forwarding to the graphics driver can be done privately in
the DIB driver, gdi32 doesn't need to know about it. And you probably
want a separate physDev pointer for it, you'll need to maintain state
for DIBs too.</p>

</quote>

<p>Felix then replied to Alexandre's points to clarify what he'd meant.</p>
<p>Rolf Kalbermatter replied regarding #1 above:</p>
<quote who="Rolf Kalbermatter"><p>
I had actually a bit of a different idea but didn't get around to trying it yet.
I was thinking about adding an extra value to the DIB section sync state
such
as DIB_Status_Conf. With this X11DRV_DIB_Coerce would decide based on a
configuration setting if it should do DIB_Status_GdiMod (DIBDRV_NEVER in
point 5.),
DIB_Status_AppMod (DIBDRV_ALWAYS), or DIB_Status_AppMod if the DIB is
already in
DIB_Status_AppMod (DIBDRV_MIXED).
The return value would someow indicate to that driver function if it should
just
simply return with a failure leaving the rest to GDI32 to deal with or do
for the
time being the actual work as it does now.
</p><p>
On driver failure (or nonexistent driver function) GDI32 would invoke the
corresponding
DIBDRV function for non-meta DCs. A nonexistent driver function would still
work
thanks to the exception handling for DIBs being accessed in application
mode, although
it is not the preferred way to deal with this until the DIB engine is fully
functional
(and the DIB handling could then be consequently removed from x11drv
entirely).
</p><p>
This would reduce the modifications to x11drv to a minimum and also GDI32
wouldn't
need much change at all. Adding a new DIBDRV function would be a change in
GDI32
to add the DIBDRV call on failure of the driver function and then switching
the
DIB_Status value in that driver function to DIB_Status_Conf instead of
DIB_Status_GdiMod.
</p></quote>

<p>Regardless of whether any of this is the appropriate plan of attack,
it's exciting to see that 3 different people are interested in this.</p>

</section>
<section 
	title="Removing Audio Drivers"
	subject="Removal of unused audio drivers"
	archive="http://www.winehq.com/pipermail/wine-devel/2007-April/055867.html"
	posts="10"
>
<topic>Multimedia</topic>
<p>Audio in Wine has been receiving more attention lately.  Maarten 
Lankhorst has plans to do a lot of work in this area and he's starting
by doing a bit of Spring cleaning.  First on the chopping block was
the winearts driver:</p>
<quote who="Maarten Lankhorst"><p>
As far as I can tell, it has been disabled for at least 4 months, and I didn't 
hear anyone about it, so it seems like a good idea to remove winearts, if 
anybody feels like reviving it, it would be easy to do so by reverting this 
commit, but KDE itself is moving away from arts, so I don't see a point in 
keeping this broken, disabled audio backend.</p></quote>

<p>That patch went through.  Next up he wanted to remove a few of the
other slightly obscure drivers:</p>
<quote who="Maarten Lankhorst"><p>
There are 5 different audio drivers for linux, I think this is a bit
overkill, so I propose to remove the esd and nas drivers, I don't think
anyone uses esd, especially that since for that task alsa can be used
now since dmix addon.
</p><p>
I'm not sure what nas is for, but it seems to be 'network audio system',
I haven't seen any use for it, except that it causes a 30 seconds
slowdown at showing 'audio' tab in winecfg. I don't think anyone uses it.
</p><p>
For esd I think it's best to remove it, for nas I'm also for removal, but
I'll settle for removing it from the winecfg list same way as winearts was
disabled for a while.
</p><p>
What are your thoughts about this?
</p></quote>

<p>Vit Hrachovy raised his hand to mention he was using esd.  Francois
Gouget raised a good point about NAS:</p>
<quote who="Francois Gouget"><p>
NAS is used to get sound on X terminals. It would be interesting to get
input from the LTSP and thin-client crowd before concluding it can be
removed.</p></quote>

<p>Other discussion seemed wary of removing working drivers.  With regards to
speeding up winecfg, Damjan Jovanovic supplied a patch to help with that:</p>
<quote who="Damjan Jovanovic"><p>
These changes reduce the time needed to load the Audio tab of winecfg
from 12 seconds down to 5.
</p><p>
Changelog:
<ul>
<li> Load audio drivers in multiple threads, so the length of time the
GUI is blocked for is the length of the longest driver load time,
rather than the sum of them all.</li>
<li> Keep audio drivers open until they need to be reloaded, because it
can take a very long time to load them multiple times.</li></ul>
</p></quote> 

</section>
<section 
	title="NT Named Pipes"
	subject="Named pipes to remote machines?"
	archive="http://www.winehq.com/pipermail/wine-devel/2007-April/055611.html"
	posts="2"
>
<topic>Integration</topic>
<p>
Dan Kegel forwarded a question from the c.e.m.w. (aka 
comp.emulators.ms-window.wine) newsgroup asking about NT named pipes support
(not the same as Unix named pipes):</p>
<quote who="Dan Kegel"><p>

A user asked in
<ul><a href="http://groups.google.com/group/comp.emulators.ms-windows.wine/msg/06fbfdfb53a28cbd">
http://groups.google.com/group/comp.emulators.ms-windows.wine/msg/06fbfdfb53a28cbd</a></ul>
whether Wine could communicate with remote
machines via named pipes yet (he needs it to
talk with an SQLServer box).
</p><p>
I know Alexandre's been poking around in that area, but
I think he's working on local networking, not remote.
I also know Kai Blin had looked at this, but I don't know where he left it.
</p><p>
Can someone summarize the current state and plan, if any?
</p><p>
Here are some past discussions on the topic:
<ul>
<li><a href="http://www.kerneltraffic.org/wine/wn20060428_312_print.html#3">
http://www.kerneltraffic.org/wine/wn20060428_312_print.html#3</a></li>
<li><a href="http://www.winehq.org/pipermail/wine-devel/2005-September/039680.html">
http://www.winehq.org/pipermail/wine-devel/2005-September/039680.html</a></li>
<li><a href="http://kerneltraffic.org/wine/wn20040109_204.html#3">
http://kerneltraffic.org/wine/wn20040109_204.html#3</a></li>
</ul></p></quote>

<p>Kai Blin, who's delved into this area, replied:</p>
<quote who="Kai Blin"><p>
I distinctly remember Juan asking me to poke Samba's Steve French about this 
for last year's SambaXP conference. Steve seemed happy to  add some hooks to 
his cifs module fur us, but I think no one came up with anything specific.
</p><p>

I'll be going to SambaXP again this 
year to show off our use of ntlm_auth to have outlook authenticate to an 
exchange server. Right before SambaXP starts, the Samba team will meet at 
SerNet for a "developer day", I'm going to be there for that, too. If we can 
come up with a hard list of requirements, I can look into getting this up to 
speed a little bit. </p><p>
Now, we've been at this topic before, but as far as I can recall, we never 
really made much progress on this. Named pipes, as well as user handling and 
some parts of netapi32.dll scream for a closer interaction with Samba. As 
discussed before, the LGPL vs. GPL licensing is an issue, but maybe we can 
work around that by interfacing with winbindd to get the stuff we need.
</p><p>
A quick search through our wiki shows me that Juan put up three pages about 
this when we discussed this last time.
<ul>
<li><a href="http://wiki.winehq.org/NamedPipes">
http://wiki.winehq.org/NamedPipes</a></li>
<li><a href="http://wiki.winehq.org/EndPointMapper">
http://wiki.winehq.org/EndPointMapper</a></li>
<li><a href="http://wiki.winehq.org/DcomInterfaces">
http://wiki.winehq.org/DcomInterfaces</a></li>
</ul></p><p>
If we can flesh those out in the next week or two, I'll have some more 
substantial things to take with me to SambaXP to discuss this. I think the 
wiki will be ideal to collect this.
</p></quote>

</section>
<section 
	title="DInput Bug"
	subject="dinput: fix mouse jitter in Halo (bug 7640)"
	archive="http://www.winehq.com/pipermail/wine-devel/2007-April/055931.html"
	posts="4"
>
<topic>DirectX</topic>
<p>Martin Traverse came up with a patch to fix a mouse handling problem
that was recently introduced:</p>
<quote who="Martin Traverse"><p>


I have done a bisection on bug #7640, mouse jitter in Halo which rendered the
game unplayable. I have a patch which fixes the problem on my Gentoo system
against wine-0.9.35.
</p><p>
Bug is introduced by
<ul><code>
commit b22ff8018aca7c365e505f1db7732f7050ae259b<br />
dinput: Remove MsgWaitForMultipleObjects call
</code></ul>
</p><p>
(Note: commit --59b also severely slows dinput response, fixed soon after by
<ul><code>
commit 685a3e6a6ed623718f640e8906bd44fbca3d8b2c<br />
dinput: Release critical section before warping mouse)
</code></ul>
</p><p>
Bug can be alleviated by reverting the original commit until
<ul><code>
commit af71538d3343a1cec73e75391a7ebfd5b3ed94ee<br />
dinput: Remove duplicate Keyboard->Poll it is the same as base class
</code></ul>
</p><p>
I put back the specialised version of Poll with MsgWaitForMultipleObjects,
which fixed the problem, and have sent a patch. It was only necessary to alter
Poll, not GetDeviceState. This is the first time I've sent in a patch,
obviously I'm not familiar with the code so I'd be grateful for any comments.
</p></quote>

<p>Vitaliy Margolen disagreed with the patch and explained why it was wrong:
</p>
<quote who="Vitaliy Margolen"><p>
You patch is not correct for one simple reason - it "fixes" mouse by
changing keyboard code. I have removed some code like that from dinput
while cleaning it up. It had way too many hacks - leftover from some
wholesale changes by TG. Of course none of their patches stated exactly
what they did and why.
</p><p>
To fix the problem, you first need to find the reason why the code Wine
has doesn't work. And how the code you're adding will fix the problem. Then you
need to make some tests to check/verify what's going on.
</p><p>
Running a small test program (attached) with native dinput shows that it
does not call MsgWaitForMultipleObjects in kbd-&gt;Poll at all (look at
+relay channel). You can experiment with this program a bit more to see
what dinput is doing and how ;)
</p></quote>



</section>
<section 
	title="Windows/Linux Shared Objects"
	subject="Windows dll as Linux Shared Object"
	archive="http://www.winehq.com/pipermail/wine-devel/2007-April/055852.html"
	posts="6"
>
<topic>Winelib</topic>
<p>A request that comes up from time to time is to take a Windows 
library and be able to reuse it as a Linux shared object.  Phil Lodwick
asked this week about it:</p>
<quote who="Phil Lodwick"><p>

My googling skills are letting me down today.   I believe I have seen several
people requesting to do the same and answers indicating it is possible.
However, after several hours of reading email archives from 2000-2007 are am
officially confused :-(
</p><p>
I have successfully ported an application using winelib.  However, what I
really want to do is port a DLL to an SO which I can use natively from a
Linux application.
</p><p>
I believe this is something that can be done with winemaker/winebuild etc if
I just get the recipe right -- correct?
</p></quote>

<p>Stefan D&#246;singer explained the problem with that and why a lot of 
people overlook why it's so hard to do that:</p>
<quote who="Stefan Dosinger"><p>
I'm not the DLL expert, but I think you're missing something here.
</p><p>
The problem is that your windows dll will most likely use the windows
APIs (otherwise, don't use wine at all). The windows APIs depend on some other
things, like a few memory management constraints, the windows registry, and
most likely other things too. So you can't lift the Wine core dlls outside of
the environment wine sets up.
</p><p>
Applications and DLLs ported using winelib are native Linux .so files. So you
can try to link them in, but you'll get unresolved symbols which in the long
run will end up somewhere in ntdll.dll.so and libwine.so. And I think both of
them depend on the environment wineloader sets up.
</p><p>
So the options you have are doing a real port of the dll if it does not depend
on the win32 api too much (so ditch wine), or put the whole app into wine (do a
full winelib port of the application), or to write some proxy winelib app and
talk to the DLL using ipc like sockets, pipes, shared memory, etc.
</p></quote>

<p>For that reason, it's recommended that a whole application gets built
as a Winelib app.  Phil didn't want to do that in this case because
he wanted to provide a library for other developers.</p>

</section></kc>

