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

<title>Wine Traffic</title>

<author contact="http://www.theshell.com/~vinn">Brian Vincent</author>
<issue num="314" date="26 May 2006 00:00:00 -0800" />
<intro> <p>This is the 314th issue of the Wine Weekly News publication.
Its main goal is to <a href="http://www.skithe14ers.com/">be inspired</a>. 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="141" size="300" contrib="76" multiples="26" lastweek="37">

<person posts="9" size="11" who="julliard at winehq.org (Alexandre Julliard)" />
<person posts="7" size="13" who="tom at dbservice.com (Tomas Carnecky)" />
<person posts="6" size="13" who="ivg2 at cornell.edu (Ivan Gyurdiev)" />
<person posts="5" size="13" who="wine at troy.rollo.name (Troy Rollo)" />
<person posts="5" size="8" who="dmitry at codeweavers.com (Dmitry Timoshkov)" />
<person posts="5" size="7" who="rob at codeweavers.com (Robert Shearman)" />
<person posts="4" size="24" who="ulrich.czekalla at utoronto.ca (Ulrich Czekalla)" />
<person posts="4" size="5" who="thunderbird2k at gmx.net (Roderick Colenbrander)" />
<person posts="4" size="5" who="saulius2 at ar.fi.lt (Saulius Krasuckas)" />
<person posts="4" size="3" who="hverbeet at gmail.com (H. Verbeet)" />
<person posts="4" size="3" who="dimi at lattica.com (Dimi Paun)" />
<person posts="3" size="5" who="dragosmg at yahoo.ca (Dragos)" />
<person posts="3" size="4" who="wine-devel at kievinfo.com (Vitaliy Margolen)" />
<person posts="3" size="2" who="reif at earthlink.net (Robert Reif)" />
<person posts="3" size="2" who="hans at it.vu.nl (Hans Leidekker)" />
<person posts="2" size="35" who="speeddymon at gmail.com (Tom Booker)" />
<person posts="2" size="6" who="mike at codeweavers.com (Mike McCormack)" />
<person posts="2" size="4" who="winorojo at hotmail.com (Wino Rojo)" />
<person posts="2" size="4" who="hk at isphuset.no (Hans Kristian Rosbach)" />
<person posts="2" size="2" who="blin at gmx.net (Kai Blin)" />
<person posts="2" size="2" who="davea42 at earthlink.net (David Anderson)" />
<person posts="2" size="2" who="jave27 at gmail.com (Jason Green)" />
<person posts="2" size="2" who="p.beutner at gmx.net (Peter Beutner)" />
<person posts="2" size="1" who="bon at elektron.ikp.physik.tu-darmstadt.de (Uwe Bonnes)" />
<person posts="2" size="1" who="eric.pouech at wanadoo.fr (Eric Pouech)" />
<person posts="2" size="1" who="wine.dev at web.de (Detlef Riekenberg)" />
<person posts="1" size="29" who="dsb35 at cornell.edu (Stu Black)" />
<person posts="1" size="6" who="muziwind at yahoo.com.cn (mengzhuo li)" />
<person posts="1" size="5" who="nick.law at mic-nucmed.co.uk (Nick Law)" />
<person posts="1" size="5" who="the3dfxdude at gmail.com (Jesse Allen)" />
<person posts="1" size="4" who="jacobcpeters at gmail.com (Jacob Peters)" />
<person posts="1" size="4" who="xerox_xerox2000 at yahoo.co.uk (Louis. Lenders)" />
<person posts="1" size="2" who="marcin.kardas at gmail.com (Marcin Kardas)" />
<person posts="1" size="2" who="yuriy.kozlov at gmail.com (Yuriy)" />
<person posts="1" size="2" who="sebastien.fievet at free.fr (Sebastien Fievet)" />
<person posts="1" size="1" who="fenix at club-internet.fr (Raphael)" />
<person posts="1" size="1" who="qingdao33122 at yahoo.com (qingdoa daoo)" />
<person posts="1" size="1" who="stefan at codeweavers.com (Stefan D&#246;singer" />
<person posts="1" size="1" who="ahziem1 at mailbolt.com (Andrew Ziem)" />
<person posts="1" size="1" who="brent.pinkney at aircom.co.za (Brent Pinkney)" />
<person posts="1" size="1" who="wine at electrozaur.com (Boaz Harrosh)" />
<person posts="1" size="1" who="dtremenak at gmail.com (Daniel Remenak)" />
<person posts="1" size="1" who="Paul.Vriens at xs4all.nl (Paul Vriens)" />
<person posts="1" size="1" who="wine at shadovald.dyndns.org (Aneurin Price)" />
<person posts="1" size="1" who="fenix at club-internet.fr" />
<person posts="1" size="1" who="bobl at optushome.com.au (Robert Lunnon)" />
<person posts="1" size="1" who="dclark at akamail.com (Duane Clark)" />
<person posts="1" size="1" who="pragya.goyal at airtightnetworks.net (Pragyag)" />
<person posts="1" size="1" who="meissner at suse.de (Marcus Meissner)" />
<person posts="1" size="1" who="truiken at gmail.com (James Hawkins)" />
<person posts="1" size="1" who="andi at rhlx01.fht-esslingen.de (Andreas Mohr)" />
<person posts="1" size="1" who="jwhite at winehq.org (Jeremy White)" />
<person posts="1" size="1" who="paulc at voip.null.ro (Paul Chitescu)" />
<person posts="1" size="1" who="hurtta+gmane at siilo.fmi.fi (Kari Hurtta)" />
<person posts="1" size="1" who="brian.vincent at gmail.com (Brian Vincent)" />
<person posts="1" size="1" who="roli8200 at yahoo.de (Roland Kaeser)" />
<person posts="1" size="1" who="jacek at codeweavers.com (Jacek Caban)" />
<person posts="1" size="1" who="efrias at syncad.com (Eric Frias)" />
<person posts="1" size="1" who="scott at open-vote.org (Scott Ritchie)" />
<person posts="1" size="1" who="skorka at gmx.net (Daniel Skorka)" />
<person posts="1" size="0" who="mstefani at redhat.com (Michael Stefaniuc)" />
<person posts="1" size="0" who="mattfinn at gmail.com (Matt Finnicum)" />
<person posts="1" size="0" who="kelfe at gmx.de (Karsten Elfenbein)" />
<person posts="1" size="0" who="jan.wine at zerebecki.de (Jan Zerebecki)" />
<person posts="1" size="0" who="Aric.Cyr at gmail.com (Aric Cyr)" />
<person posts="1" size="0" who="most at museresearch.com (Michael Ost)" />
<person posts="1" size="0" who="sam_herzog at yahoo.com (samuel herzog)" />
<person posts="1" size="0" who="wsun013.wine at gmail.com (Wei-Tsun Sun)" />
<person posts="1" size="0" who="remus.c at plutohome.com (Remus)" />
<person posts="1" size="0" who="kenneth.l.armstrong at us.army.mil (Kenneth Armstrong)" />
<person posts="1" size="0" who="WOLFProductions at gmx.de (KGJ)" />
<person posts="1" size="0" who="mike at plan99.net (Mike Hearn)" />
<person posts="1" size="0" who="twickline at gmail.com (Tom Wickline)" />
<person posts="1" size="0" who="Stefan.Leichter at camLine.com (Stefan Leichter)" />
<person posts="1" size="0" who="balihb at freepop.hu (=?ISO-8859-2?Q?H=E1morszky_Bal=E1zs?=)" />

</stats>
<section 
	title="News: Picasa, Wine 0.9.14, LJ Article"
	subject="News"
	archive="http://www.winehq.org/?announce=1.118"
	posts="3"
>
<topic>News</topic>
<mention>Oliver Stieber</mention>
<mention>Uwe Bonnes</mention>
<mention>Linux Journal</mention>
<mention>News</mention>
<mention>Marcus Meissner</mention>
<mention>Google</mention>

<p>The biggest news of the week is the port of Google's Picasa to Linux.  
We're actually going to cover that in the next section below since there's
a fair amount of news.
</p><p>
Alexandre released Wine 0.9.14 this past week.  There's a ton of patches in
it, but a lot of the work is more behind the scenes than other releases
we've seen recently.  Noted changes:</p>
<quote who="Alexandre Julliard"><p><ul>
  <li> Better MS/RPC compatibility.</li>
  <li> Many fixes to Direct3D shaders.</li>
  <li> Several improvements to the header control.</li></ul></p></quote>

<p>We're seeing a ton of development going on with DirectX, particularly
Direct3D.  You might remember that about a year and a half ago Oliver
Stieber began contributing some large patches to get Direct3D 9 working.
After that, work began to port Direct3D 8 to the new library, wined3d,
used by D3D9.  Since then, work has branched out into many areas.  We've
picked up some new developers along the way, which is great.  </p><p>

I mentioned the following on wine-devel about a recent Linux Journal
article:</p>
<quote who="Brian Vincent"><p>
I just saw the May issue of Linux Journal and it has an article titled
<i>Running Sound Applications Under Wine</i>.  It's written by Dave
Phillips and it's pretty good.  Things seemed to work about as well as
you'd expect, well, maybe even better than a lot of you would expect.
Programs installed ok, audio configuration seemed pretty easy, etc.  I
actually think it's a great that Wine isn't the focus of the article;
he spends most of the time talking about applications.  I guess that
means all the magic was successfully hidden.  I half expected the
article to complain about broken things, but there was hardly a
mention of it at all.  At the end he did list about 4 applications
that issues, including one named "Finale" that didn't install.
</p><p>

Dave did mention he'd like to see the JACK audio driver working:
"Hopefully, Wine's JACK driver will work again by the time this
article is printed.  JACK is the present and future of Linux audio,
and it world be a definite Good Thing for the Wine Project.  A virtual
ASIO driver might be a helpful addition as well."
</p><p>

All in all, it's a wonderful article written by one of the top Linux
sound gurus.
</p><p>
[Oops.  I just noticed there's a glaring mistake in it.  He said he
tested with Wine 0.9.6 and then has a paragraph discussing
<tt>~/.wine/config</tt>.  I think it's a remnant of an old installation.]
</p></quote>
<p>
Finally, Uwe Bonnes, Stefan Maunz, and Marcus Meissner attended Linuxtag in 
Wiesbaden a few weeks ago.  Marcus provided 
<a href="http://gallery.kuschelt.net/main.php?g2_view=core.ShowItem&amp;g2_itemId=93395">a picture</a>
showing Stefan on the left and Uwe next to him.  Check out the nice Wine
poster on the wall behind them.</p>
</section>
<section 
	title="Picasa Port to Linux"
	subject="Picasa for Linux available!"
	archive="http://www.winehq.com/pipermail/wine-devel/2006-May/047806.html"
	posts="6"
>
<topic>Ports</topic>
<mention>CodeWeavers</mention>
<mention>Slashdot</mention>
<mention>News</mention>
<mention>Codeweavers</mention>
<mention>Marcus Meissner</mention>
<mention>Google</mention>
<mention>Jacek Caban</mention>

<p>Several months ago we reported that CodeWeavers was contracted to port
some Google apps to Linux (see WWN
<a href="http://www.winehq.com/?issue=306#News:%20Google%20&amp;%20Wine,%20v0.9.8">#306</a> for details.)
That news came out the last week in February.  Here we are less than 3 months
later and Picasa is running.  So let's take a look at some of the details.
You might have missed some of this if you only read things like Slashdot or
wine-devel.
</p><p>
First, one of the most interesting revelations came from Linux Today and
Chris DiBona's
<a href="http://www.linuxtoday.com/infrastructure/2006052601826NWSWRL">
description</a> of the port.  Chris revealed that Google
Earth is slated to be the next app ported.  From that report:</p>
<quote who="Chris Dibona"><p>
Picasa, founded in 2001, was purchased by Google in July of 2004, and the photo 
management tool has seen some extensive use, albeit from Windows users. DiBona 
indicated that Google made a public committment to begin porting two 
applications to Linux about a year ago. The other application in this project 
is Google Earth. Picasa for Linux was announced first simply because it was 
finished first. </p><p>
When asked if the additions to WINE would bootstrap Google Earth's porting 
progress, DiBona answered in the negative, explaining that Google Earth relied 
on Qt and GL libraries and code, so additional WINE support would not help. No 
timeline for that application's release was revealed at this time. 
</p></quote>
<p>
Interestingly, Google Earth is suffering from an OpenGL and Wine windowing 
problem that's a showstopper for a ton of other programs.  It's a regression
in Wine that dates back about a year ago to when window management code
was modified to perform better.  There should be some nice collateral damage
from fixing that bug.  You might be able to get a sneak preview of Google
Earth on Linux if you start tracking CVS.  This seems like the type of
bug only Alexandre can fix, so if you see him mucking around with window
management and/or OpenGL, you might want to try installing the Windows 
verson of Google Earth to see if it'll run.</p><p>

Now, back in February I conjectured that Google would probably provide a copy
of Wine to run Picasa with and that it would be a straight up Windows app rather
than a traditional Winelib port.  That proved to be the case and you can expect
the same for Google Earth.  Even
more important, Google Earth and Picasa will likely be able to share the same
version of Wine libraries, so we may see a collection of desktop apps appearing
for Linux similar to the <a href="http://pack.google.com/">Google
Pack</a> available for Windows.</p>
<p>Okay, back to the news about Picasa.  If you're unfamiliar with this
program it's an image archive/management tool.  Besides just storing 
pictures and making them searchable, there's a lot of features like mail
integration, photo manipulation, and the ability to import pictures from
devices like digital cameras.  It's very well done and has a very well
designed interface. </p>
<p>Dan Kegel broke the news on wine-devel about the port.  His email is 
below.  Of note is that CodeWeavers contributed 
<a href="http://code.google.com/wine.html">225 patches</a> back to Wine
to get Picasa working.  Actually, the count of 225 dates to April 18th
and there's been more patches since then.  From the announcements made,
it sounded like these patches were developed in the dark and were about
to be patch bombed into Wine.  That's not the case.  CodeWeavers employees
openly contributed these patches as they were developed over the past few
months.  That's the Right Way to do development and it's great there was
an open line of communication from the beginning.  </p>

<p>Google's 
<a href="http://picasa.google.com/linux/">Picasa on Linux</a> page describes
some of the features of the port.  Slashdot 
<a href="http://slashdot.org/article.pl?sid=06/05/26/0310229">covered</a> 
the story with a post by Chris and included some positive comments,
<quote who="Chris DiBona">
Picasa for Linux uses Wine internally; this shows a bit in the interface, but 
it works even better than we had hoped. ... 
Thanks to our pals at CodeWeavers who did much of the heavy lifting, and to 
Marcus Meissner, whose libgphoto support patch was a welcome 
surprise."</quote></p>

<p>Speaking of Marcus' patch, we covered that in two recent issues,
<a href="http://www.winehq.org/?issue=311#gPhoto%20&amp;%20TWAIN">#311</a>
and <a href="http://www.winehq.org/?issue=313#GPhoto%20/%20TWAIN%20Integration">#313</a>.
Apparently Google and CodeWeavers made an assumption up front that digital
cameras all could be accessed like a typical USB storage device.  It seems
that most can and as a result we have Alexandre's patches from a few weeks
ago to add HAL event support to Wine.  USB devices will be noticed
and have drive letters assigned to them automatically.  Well, Marcus'
patch utilizes the traditional TWAIN interfaces to link the TWAIN API's
to libgphoto.  In turn, libghoto can access cameras.  This makes image
acquisition a lot more like Windows but integrating with native Linux code.
Unbeknownst to Marcus, his code came at a critical time.</p>

<p>Dan Kegel's mail to wine-devel provides an inside perspective on the
port:</p>
<quote who="Dan Kegel"><p>
Google has indeed been working on Picasa, and it's finally available for
download at
  <ul><a href="http://labs.google.com/">http://labs.google.com/</a></ul>
</p><p>
For the curious, here are a few tidbits about how it came to be.
</p><p>
When Google wanted to port Picasa to Linux, they faced a
problem: the Picasa team was busy working on new projects, and
having them also do a native port would have taken a while.
As an experiment, Google decided to give Wine a try.
A quick look showed that much of Picasa already worked,
but key features were missing: the IWebBrowser API, SSL,
scanner/camera support, removable media notification (so you can
insert a flash drive and have Windows notice it right away),
and change notification (so Windows can notify apps when new
files are created), among others.   Fortunately, Wine was
already halfway to having an implementation of IWebBrowser
thanks to Jacek Caban's Summer of Code 2005 project.  And all
that other stuff couldn't be *that* hard, right? :-)  So
Google engaged Codeweavers to add those features and fix any
other bugs.  This resulted in tons of improvements to Wine (see
the list at 
<a href="http://code.google.com/wine.html">code.google.com/wine.html</a>), 
all of which are now in the public tree at winehq.org.
</p><p>
Many people assume that when porting a Windows app to Linux
using Wine, the best thing to do is link Winelib into the
application to create a native Linux application.  Not so!
It's just as effective, and a heck of a lot easier, to run
the same binary on both Windows and Wine.  So that's what the
Picasa team did.  Picasa for Linux uses slightly different
text messages, but the .exe file is identical for both Windows
and Linux.
</p><p>
Toward the very end, everything was looking great except
that the initial assumption that most cameras emulate storage
devices turned out to be wrong.  Fortunately, Marcus Meissner
just happened to decide to implement libgphoto support; his
patch appeared at the perfect moment, and now Picasa supports
both common flavors of cameras.
</p><p>
Two features left out of the Linux version were CD-ROM
burning (the driver Picasa uses is hard to support under Wine)
and movie playback (Wine doesn't have the necessary codecs).
Both are potentially fixable in a future version, but were
beyond the scope of this first port.
</p><p>
One interesting challenge when shipping commercial apps for
Linux is packaging -- do you choose RPM or Debian packages,
or do you use a WIndows-style installer?  The Picasa for
Linux team chose all three, in hopes of pleasing everybody.
(Let's see how well *that* works :-)  The Windows-style
installer was implemented using the open-source Loki installer,
and a few patches were contributed back for that, too.
</p><p>
The Picasa for Linux team had a blast.  It's not often you
get to pour resources into a vital open source project to help
ship a commercial application!  We hope we get to do it again
sometime soon, and we hope the results are good enough to
encourage other companies to give Wine a try.
</p><p>
Thanks to the Wine community for a very capable platform!</p></quote>

<p>This could be really interesting.  It's been quite a few years since
a company has ported their app with Wine.  Back then, the traditional thinking
was the code needed to be moved from Windows to Linux and completely 
recompiled with Winelib.  Well, that approach doesn't really offer any
performance advantages and about the only benefit is you have the 
ability to link against native Linux libraries.  Linking against native
libraries would allow for better integration, except no one ever bothered
to go that far.  Google's approach is much more pragmatic.  By shipping
a known, self-contained version of Wine they can ensure future regressions
don't slip in that break Picasa.  At 24MB for the entire download (9MB
of Picasa, 12MB of Wine, and 3MB for a Gecko engine) it's conceivable
other companies would be interested in doing the same.</p>


<p>There ya have it.  Go 
<a href="http://picasa.google.com/linux/download.html">download it</a>.  
</p> 

</section>
<section 
	title="DirectDraw Patch"
	subject="Announcing another ddraw/d3d7 patch"
	archive="http://www.winehq.com/pipermail/wine-devel/2006-May/047821.html"
	posts="1"
>
<topic>DirectX</topic>
<topic>Status Updates</topic>
<mention>Lionel Ulmer</mention>

<p>As I mentioned, there's a lot happening in the world of Direct3D and
DirectDraw.  Stefan D&#246;singer dropped an email to wine-devel to 
give an update of the work he's doing: moving Wine's 2D DirectDraw code
over to wined3d and OpenGL rendering.  It then facilitates moving
Direct3D 7 and earlier versions of D3D to wined3d.  He wrote:</p>
<quote who="Stefan Dosinger"><p>
Merging the code into WineD3D is done now, so the last thing is to merge the 
new ddraw code. I have uploaded a new diff to 
<a href="http://stud4.tuwien.ac.at/~e0526822/">
http://stud4.tuwien.ac.at/~e0526822/</a>, 
with some updated screenshots. The diff 
is against wine git from May, 26th, 12 am(yep, the site has an older date). 
It should apply to much older versions too, but it won't work because a few 
crucial patches were applied in the last 2 days. 2 games are missing in my 
game list, Anarchy Online and Worms 2 are also known to work.
</p><p>
Ok, what to do now? The patch fixes quite a few games, but with all bigger 
changes there are problems. I know some games which worked before that are 
broken now(Tibia, Z-Ball, Battlezone 2 and Swat 3). Battlezone 2 and Swat 3 
have fogging issues, I have to talk to Lionel Ulmer about that, and BZ2 also 
needs tripple buffering. Tibia does some Blt Voodoo which doesn't work in 
OpenGL yet, z-ball is similar. It's likely that there are other breakages 
too. Another issue is that wined3d still has a hard dependency on OpenGL, and 
that means that my DirectDraw lib cannot do 2D rendering without libGL.so. It 
doesn't need hardware acceleration, only the lib has to be available. Roderic 
is working on that.
</p><p>
So what can we do?
<ul>
<li> Wait with the merge until WineD3D does lazy linking to libGL</li>

<li> Wait with the merge until all games that worked before work now(gonna take 
some time)</li>

<li> Merge it now and fix the regressions as they occur. This would have the 
advantage that the code is in and it will only improve from that point, and 
it's easier for users to test. The drawback is that some users might complain 
that their games are broken :-|. On the other had, lots of others are waiting 
for this to get their games working.</li></ul>
</p><p>
What is missing except of fixing regressions? Mostly performance improvements:
<ol>
<li> Make all ddraw games working with the OpenGL renderer</li>

<li> More intelligent texture upload: I have some hacks in that in my tree(Swat 
3!, Half-Life 2 maybe?)</li>

<li> The same for render targets(System shock 2, swat 3, Prince of persia 3D)</li>

<li> Try to write an OpenGL gdi driver which handles TextOut and friends 
directly in OpenGL(Age of Empires, Settlers 3 combined with 1)</li>

<li> Rendering fixes: Fog and color keying(Pop3D, Battlezone 2, Swat 3)</li>

<li> Better OpenGL state management, this the lack of that takes performance 
down.</li>

<li> Multi-threaded D3D(Need for speed 3, Empire Earth, many others)</li></ol>
</p><p>
All this will happen in wined3d, and the improvements aren't limited to D3D7 
games. They don't have to be done in that order.
</p><p>
If you're on wine-users, please CC me, I'm not yet subscribed there.</p>
</quote>
</section>
<section 
	title="Patch Submission Ideas"
	subject="Easy patch submission with GIT + imap folders"
	archive="http://www.winehq.com/pipermail/wine-devel/2006-April/046788.html"
	posts="4"
>
<topic>Patches</topic>
<mention>James Hawkins</mention>
<mention>codeweavers</mention>

<p>This thread actually came up last month while I was traveling and I'm
just playing catchup here.  Mike McCormack described how to use GIT with
an IMAP folder for submitting patches:</p>
<quote who="Mike McCormack"><p>

As of the recently released GIT 1.3.0, sending patches via an IMAP 
folder with GIT just got easier.
</p><p>
If everything is set up right, you should be able to run the following 
command:
<ul><code>
git-format-patch --attach --stdout --keep origin | git-imap-send</code></ul>
</p><p>
This requires some configuration in <tt>~/.git/config</tt>:
<ul><code>
[core]
  <ul><code>
         name = "Mike McCormack"<br />
         email = "mike at codeweavers.com"
  </code></ul>
[imap]
  <ul><code>
         Folder = "INBOX.Drafts"<br />
         Tunnel = "ssh -q usr at svr /usr/bin/imapd ./Maildir 2&gt; /dev/null"
  </code></ul>
[format]
  <ul><code>
         headers = "To: wine-patches &lt;wine-patches at winehq.org&gt;\n"
  </code></ul>
</code></ul>
</p><p>
Using Mozilla, you can just click on the "Edit Draft:" in the message, 
check/edit the message and then click send.
</p><p>
Alexandre has said that he doesn't mind if the subject line contains the 
ChangeLog entry.
</p><p>
No more missing patches, missing ChangeLog entries, or patches generated 
from the wrong directory.
</p><p>
I think James Hawkins has written a program similar to git-imap-send 
that works with GMail...</p></quote>

<p>Alexandre replied that this was a good method and that subject lines
that contain the ChangeLog entry make things easier for him.</p>

</section>
<section 
	title="MSI Problem"
	subject="MSI installer flaw"
	archive="http://www.winehq.com/pipermail/wine-devel/2006-May/047805.html"
	posts="2"
>
<topic>MSI</topic>
<mention>Microsoft</mention>
<mention>Aric Stewart</mention>
<mention>Mike McCormack</mention>

<p>Mike McCormack and Aric Stewart have done most of the work in Wine
to support the Microsoft Installer file format and API's.  The framework
they've put in place works well, but there's a need for others to pick
up where they've left off.  For example, MSI has a concept of 
<i>actions</i>, which might consist of copying or deleting files.  
Well, the most commonly used actions have been implemented, but it's
known there are others that need to be fleshed out.  Mike has mentioned
before that MSI is rather nice in that's a relatively contained bit of
code, so someone wanting to jump into Wine development might like starting
there.</p>
<p>This week EA Durbin described in-depth an MSI problem of a different kind
that's in need of some attention:</p>
<quote who="EA Durbin"><p>
Currently the MSI Installer is working backwards, In the file files.c it 
reads the files from the msi package and iterates through them and queries 
the Media table in order by LastSequence. The sort order for the media table 
should be DiskId according to MSDN. Just changing the sort order wont work 
unless the msi installer is revamped to work the right way. The code is 
written wrong for this. Currently its using LIST_FOR_EACH_ENTRY in the 
Install Files function for the files and then trying to ready the media per 
file using the sequence number of the file in the query on the media table 
using the file sequence as last sequence and returning the results order by 
LastSequence.
</p><p>
It should first be reading the Media table first and  sorting by DiskId. The 
installer then iterates through each row returned by the query from the 
media table  and then for each file in the file table that falls within that 
disk id it should ready the media. Currently wine is doing it backwards 
which ends up trying to ready the wrong media if the last sequence.
</p><p>
It needs to read the media table, then starting with DiskId 1, iterate 
through all of disk Id 1 and read from the file table order by sequence 
until it reaches the last sequence as indicated in the media table for the 
working DiskId, then it jumps to the next DiskId 2, 3, and so on. The 
lastsequence of the working DiskId should always be greater than that of the 
last sequence of the previous DiskId, if not the results should be skipped, 
currently it is trying to read from DiskId's that have zero as the 
LastSequence but 22 as the DiskId. Zero indicates the first entry in the 
media table(if your in DiskId 1). as you increment through the DiskId's the 
LastSequence should increment as well, if it doesnt you skip that install 
media.
</p><p>
This is what causes the cabinet bugs in bugs #4533 and #5139.
</p><p>
A quick fix , but not the solution would be to change the query so it 
doesn't return the results from the media table if the LastSequence is 0 and 
the DiskId is greater than 1.
</p><p>
The solution would be to rewrite the installer to do things the right way 
querying the Media table first, and then installing the files in order from 
the media table.
</p><p>
If someone could help me work on this it would be much appreciated as I'm 
kind of rusty in C, I'm a perl monger by trade and not very familiar with 
wine's msi innerworkings.

<ul>
<li><a href="http://msdn.microsoft.com/library/en-us/msi/setup/ordering_file_sequence_numbers_in_a_cabinet_file_table_and_media_table.asp">
http://msdn.microsoft.com/library/en-us/msi/setup/
ordering_file_sequence_numbers_in_a_cabinet_file_table_and_media_table.asp</a>
</li>
<li><a href="http://msdn.microsoft.com/library/en-us/msi/setup/file_table.asp?frame=true">
http://msdn.microsoft.com/library/en-us/msi/setup/file_table.asp?frame=true</a>
</li></ul>
</p><p>
As you'll see in MSDN the file and media table sequence and LastSequence 
correspond with one another. Each has checks upon the other to determine the 
proper install order.</p></quote>

<p>Mike thought that analysis was correct, but mentioned he wouldn't have
time to work on it.</p>

</section>
<section 
	title="Font Issue"
	subject="Fonts getting corrupted in x11drv"
	archive="http://www.winehq.com/pipermail/wine-devel/2006-May/047786.html"
	posts="6"
>
<topic>Fonts</topic>
<mention>Huw Davies</mention>

<p>On a different note, Troy Rollo found a problem Wine's font handling:</p>
<quote who="Troy Rollo"><p>
The 
<a href="http://www.winehq.org/pipermail/wine-devel/attachments/20060525/609ccda9/sysfont.c">attached</a> 
sample program demonstrates a bug in font handling that can lead 
to corrupted fonts. Compile with "winegcc -g sysfont.c -lgdi32 -lcomdlg32". 
Run the resulting a.out, and you will see the letter "C" in the top left 
corner of the window, rendered in the system font. Click anywhere in the 
client area of the window and the letter will change its shape, even though 
it is still using the stock SYSTEM_FONT.
</p><p>
The left click action creates a device context for the default printer and 
immediately deletes it. As part of the deletion of that device context, 
DeleteDC selects the stock SYSTEM_FONT into the device context. Since printer 
device contexts insist on scalable fonts, the existing (bitmapped) GDI font 
for the system font is unable to serve, so a new one is created, which ends 
up being based on the Tahoma (TrueType) font. On the next paint loop, when 
the test program calls SetFont it is the new, scalable font (based on Tahoma) 
that is found.
</p><p>
The Tahoma font has different glyph codes to the System font, such that 'C' is 
glyph code 36 in the System font and 38 in Tahoma. Accordingly, x11drv 
identifies the glyph as not having been uploaded (it has uploaded glyph 36 
before), and uploads it as glyph 38 based on its outline in Tahoma.
</p><p>
The problem gets worse later on because some glyphs in the glyphset have been 
uploaded according to their "System" font positions (or in this case ,the 
same character has been uploaded in its position in both fonts). Rendering a 
character that uses the other glyph code results in the wrong character. You 
can get a mix of Tahoma and System characters appearing on the screen with 
the System characters displaying the shape of the wrong character.
</p><p>
Every fix I look at seems like a horrible hack. Perhaps find_in_cache should 
only return bitmap fonts if the device can use them. If the caller then finds 
there is no bitmap font that matches it can then look for scalable fonts in 
the cache.
</p></quote>

<p>Three hours later Huw Davies had a 5 line patch that fixed it.</p>
</section></kc>
