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

<title>Wine Traffic</title>

<author contact="http://www.theshell.com/~vinn">Brian Vincent</author>
<issue num="250" date="26 Nov 2004 00:00:00 -0800" />
<intro> <p>This is the 250th issue of the Wine Weekly News publication.
Its main goal is to eat deviled eggs. 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="234" size="947" contrib="59" multiples="38" lastweek="29">

<person posts="27" size="96" who="Mike Hearn" />
<person posts="16" size="55" who="Vincent B&#233;ron" />
<person posts="13" size="48" who="Shachar Shemesh" />
<person posts="12" size="38" who="Dmitry Timoshkov" />
<person posts="11" size="30" who="Dimitrie O. Paun" />
<person posts="10" size="43" who="Linus Torvalds" />
<person posts="9" size="28" who="Hans Leidekker" />
<person posts="9" size="28" who="Robert van Herk" />
<person posts="8" size="26" who="Robert Shearman" />
<person posts="7" size="19" who="Dan Kegel" />
<person posts="7" size="17" who="Ivan Leo Puoti" />
<person posts="6" size="17" who="Francois Gouget" />
<person posts="6" size="15" who="Tom" />
<person posts="6" size="14" who="Alexandre Julliard" />
<person posts="5" size="120" who="Gerald Pfeifer" />
<person posts="5" size="28" who="Mike McCormack" />
<person posts="5" size="14" who="Andreas Mohr" />
<person posts="4" size="20" who="Jesse Allen" />
<person posts="4" size="17" who="Davide Libenzi" />
<person posts="4" size="12" who="Scott Ritchie" />
<person posts="3" size="28" who="Marcus Meissner" />
<person posts="3" size="15" who="Steven Edwards" />
<person posts="3" size="13" who="Eric Pouech" />
<person posts="3" size="8" who="William Poetra Yoga H" />
<person posts="3" size="8" who="Kevin Koltzau" />
<person posts="2" size="20" who="Jon Griffiths" />
<person posts="2" size="17" who="Alexander Yaworsky" />
<person posts="2" size="7" who="James Hawkins" />
<person posts="2" size="7" who="Brian Vincent" />
<person posts="2" size="6" who="Raphael" />
<person posts="2" size="6" who="Andreas Schwab" />
<person posts="2" size="6" who="Jeremy White" />
<person posts="2" size="5" who="Adam Babcock" />
<person posts="2" size="5" who="mammique" />
<person posts="2" size="4" who="Brian Gunlogson" />
<person posts="2" size="4" who="Stefan D&#246;singer" />
<person posts="2" size="4" who="Adam Babcock" />
<person posts="1" size="9" who="Ge van Geldorp" />
<person posts="1" size="8" who="(alexanderhenry)" />
<person posts="1" size="6" who="Sam Lauber" />
<person posts="1" size="5" who="Pavel Troller" />
<person posts="1" size="4" who="Vitaliy Margolen" />
<person posts="1" size="4" who="=?ISO-8859-1?Q?R=E9mi_Assailly?=" />
<person posts="1" size="4" who=" (Sven Paschukat)" />
<person posts="1" size="3" who="Greg Chicares" />
<person posts="1" size="3" who="Daniel Jacobowitz" />
<person posts="1" size="3" who="Rolf Kalbermatter" />
<person posts="1" size="3" who="Roland McGrath" />
<person posts="1" size="2" who="Michael Stefaniuc" />
<person posts="1" size="2" who="Aaron W. LaFramboise" />
<person posts="1" size="2" who="Ferenc Wagner" />
<person posts="1" size="2" who="Saulius Krasuckas" />
<person posts="1" size="2" who="Kuba Ober" />
<person posts="1" size="2" who="Stefan Leichter" />
<person posts="1" size="2" who="Michael Jung" />
<person posts="1" size="1" who="lats" />
<person posts="1" size="1" who="Hajime Segawa" />

</stats>
<section
        title="News: Splash"
        subject="News"
        archive="http://www.tong-web.com/splash/index.html"
        posts="1"
        startdate="20 Nov 2004 00:00:00 -0800"
	enddate="26 Nov 2004 00:00:00 -0800"
>
<topic>News</topic>
<mention></mention>
<mention>WineHQ</mention>
<mention>Zack Brown</mention>
<mention>ReactOS</mention>
<mention>News</mention>

<p>Wine and the <a href="http://www.reactos.org">ReactOS</a> 
project have worked together for several years.  Recently
they've added a newsletter similar to this one to 
inform the broader community of what's going on.  
<a href="http://www.tong-web.com/splash/index.html">Splash</a>,
written by Zach Tong, 
will be published on a biweekly basis and cover the ReactOS
mailing lists.  In some ways it provides an interesting
contrast to news covered here because Wine developers
sometimes tackle the same issues.  However, most of the
topics touch on completely unrelated subjects.  Of course,
that's exactly what you'd expect from a project writing it's
own kernel, developing hardware drivers, and trying to clone
the world's most popular operating systems.</p>

<p>You can also find Splash published on Zack Brown's
<a href="http://www.kerneltraffic.org/kernel-traffic/index.html">Kernel
Traffic</a> under the name 
<a href="http://www.kerneltraffic.org/reactos/archives.html">ReactOS
Traffic</a>.  It's probably a good time to mention this newsletter
is also mirrored on two different sites: as 
<a href="http://www.kerneltraffic.org/wine/archives.html">Wine
Traffic</a> and as the 
<a href="http://www.winehq.com/?issue=back">Wine Weekly News</a>
on WineHQ.  I'd encourage you to check out both formats and
see which one you like the most - the content should be the
exact same.  Each one offers advantages over the other.  As
the WWN, this gets published pretty regularly and is updated
first each week.  As Wine Traffic you can opt to receive 
this 
<a href="http://www.kerneltraffic.org/lists.html">via email</a> 
or an <a href="http://www.kerneltraffic.org/rss.html">RSS feed</a>.
</p>

<p>What you're reading right now is issue #250, which I suppose
in some way is significant.  More importantly, it's 
Thanksgiving.  So, thank you to everyone who tunes in each
week to read this!  </p>

</section>

<section 
	title="Kernel Issue (con't)" 
	subject="Re: ptrace single-stepping change breaks Wine"
	archive="http://www.winehq.org/hypermail/wine-devel/2004/11/0459.html" 
	posts="25"
	startdate="19 Nov 2004 00:00:00 -0800"
	enddate="22 Nov 2004 00:00:00 -0800"
>
<topic>Integration</topic>
<mention></mention>
<mention>Roland</mention>
<mention>cvs</mention>

<p>
Last week (WWN <a href="http://www.winehq.com/?issue=249#Kernel%20Integration%20Problems">#249</a>)
we mentioned a problem that seems to have
popped up with certain kernels and certain Windows apps
run with Wine.  Some specific instructions can trigger
the kernel to behave differently than it used to.  Specifically
what's going on is a change with the ptrace() system call.  
Most people can go their whole lives without ever bothering
to learn about ptrace(), it provides functionality that most
programs don't really care about.  </p><p>
ptrace() allows one process to hook into another and control
it.  A common application would be a debugger - you can use
ptrace() to attach to a process, step through instructions,
and then detach from it.  In fact, the way
you do this is by calling ptrace() with special request,
such as ptrace(PTRACE_SINGLESTEP, &lt;pid&gt;, ...).  That translates
at the actual hardware level by setting a bit (the TF bit) 
in a register of the processor.  If you want
to get really fancy, you can begin changing instructions on
the fly using ptrace and requests such as PTRACE_POKEDATA with
some payload data attached - and that's exactly the type of 
stuff wineserver is capable of doing (see
<a href="http://cvs.winehq.com/cvsweb/wine/server/ptrace.c?rev=1.27&amp;content-type=text/x-cvsweb-markup">server/ptrace.c</a>.)
Sound obscure?  It is.  Eric Pouech explained one of the
cases Wine would need to use something like this:</p>
<quote who="Eric Pouech"><p>
we have (to control what's generated inside the 
various exception) to ptrace from our NT-kernel-like process (the ptracer) to 
get the context of the exception. Restart from the ptracer is done with 
PTRACE_SINGLESTEP.</p></quote>

<p>After the initial investigation last week, some discussion 
ensued about what exactly has changed in the past few kernel
releases and why it's broken Wine in some instances.  Linus
posted a patch and noted:</p>
<quote who="Linus Torvalds"><p>
Here's 
<a href="http://www.winehq.com/hypermail/wine-devel/2004/11/0481.html">a 
new patch</a> to try. Totally untested.
</p><p>
It is more careful about clearing PT_DTRACED (which by now should probably
be renamed PT_PRACE_SINGLESTEP or something on x86, since we should never
be lazy about this thing any more), and it may or may not help.
</p><p>
Pls test _together_ with the previous patch (which is already applied in
the current top-of-tree for anybody with really recent kernels).
</p></quote>

<p>Daniel Jacobwitz asked a question about it and Linus explained
more about what it did:</p>
<quote who="Linus Torvalds"><p>
 It's not like single-stepping into the signal handler in any way removes 
 any information (while _not_ single-stepping into it clearly does).
</p><p>
With the patch I just posted (assuming it works for people), Wine should 
at least have the choice. The behaviour now should be:
<ul>
 <li> if the app sets TF on its own, it will cause a SIGTRAP which it can 
   catch.</li>
 <li> if the debugger sets TF with SINGLESTEP, it will single-step into a 
   signal handler.</li>
 <li> it the app sets TF _and_ you ptrace it, you the ptracer will see the 
   debug event and catch it. However, doing a "continue" at that point
   will remove the TF flag (and always has), the app will normally then
   never see the trap. You can do a "signal SIGTRAP" to actually force
   the trap handler to tun, but that one won't actually single-step (it's 
   a "continue" in all other senses).</li>
</ul></p><p>
It sounds like the third case is what wine wants.
</p></quote>

<p>Linus then went back and came up with an example:</p>
<quote who="Linus Torvalds"><p>
Hmmm.. I think I may have a test-case for the problem.
</p><p>
Lookie here:
<ul><code>
	#include &lt;signal.h&gt;<br />
	#include &lt;sys/mman.h&gt;<br /><br />

	void function(void)<br />
	{<ul><code>
		printf("Copy protected: ok\n");</code></ul>
	}<br /><br />

	void handler(int signo)<br />
	{<ul><code>
		extern char smc;<br />
		smc++;</code></ul>
	}<br /><br />

	#define TF 0x100<br /><br />

	int main(int argc, char **argv)<br />
	{<ul><code>
		void (*fnp)(void);<br /><br />

		signal(SIGTRAP, handler);<br />
		mprotect((void *)(0xfffff000 &amp; (unsigned long)main), 4096, PROT_READ | PROT_WRITE);<br />
		asm volatile("pushfl ; orl %0,(%%esp) ; popfl"
		<ul><code>
			: :"i" (TF):"memory");</code></ul>
		asm volatile("pushfl ; andl %0,(%%esp) ; popfl"
		<ul><code>
			: :"i" (~TF):"memory");	</code></ul>
		asm volatile("\nsmc:\n\t"
		<ul><code>
			".byte 0xb7\n\t"<br />
			".long function"<br />
			:"=d" (fnp));</code></ul>
		fnp();<br />
		exit(1);</code></ul>
	}
</code></ul></p><p>
Compile it, run it, and it should say
<ul>
	<tt>Copy protected: ok</tt></ul></p><p>

Now, try to "strace" it, or debug it with gdb, and see if you can repeat 
the behaviour.
</p><p>
Roland? Think of it as a challenge
</p></quote>

<p>Ha!  Those wacky kernel guys!  I won't even pretend to
recognize the pushing and popping going on above.  Davide
Libenzi did understand though,
<quote who="Davide Libenzi">
You know you're sick, don't you? Making traps inc's to get you in the 
correct opcode to move function in edx-&gt;fnp, is indeed fruit of a sick 
mind :=)</quote></p>

<p>Linus explained a little more about his little program
from hell and how it might relate to Wine:</p>
<quote who="Linus Torvalds"><p>
It _should_ be perfectly easy to debug this, by using
<ul>
	<tt>signal SIGTRAP</tt></ul></p><p>

instead of "continue" when you get a SIGTRAP that wasn't due to anything 
you did.
</p><p>
But try it. It doesn't work. Why? Because the kernel will have cleared TF 
on the signal stack, so even when you do a "signal SIGTRAP", it will only 
run the trap handler _once_, even though it should run it three times 
(once for each instruction in between the "popfl"s.
</p><p>
I do think this is actually a bug, although whether it's the bug that 
causes problems for Wine is not clear at all. I'mm too lazy to build 
and boot an older kernel, but I bet that on an older kernel you _can_ do 
"signal SIGTRAP" three times, and it will work correctly. That would 
indeed make this a regression.
</p></quote>

<p>Later in the night, Linus came up with 
<a href="http://www.winehq.com/hypermail/wine-devel/2004/11/0559.html">another
patch</a> and asked if it fixed the Wine problem.  Jesse Allen
tried it out and reported,
<quote who="Jesse Allen">
 For the wine app in question, it does make a difference.  However, there is 
 a new problem.  The program gets stuck at the loading screen at 100% CPU.
 It's making a call to select, timing out, and then tries select again, 
 repeats.  It's waiting for something that seems to never happen.
</quote></p>

<p>Jesse made some logs available showing the app running under an
old kernel and then under a new one.  Eric Pouech went through them
and deciphered the differences:</p>
<quote who="Eric Pouech"><p>
For the linux folks, here a small comparison of what happens in the working 
(old) case and in the non-working (new) case:
</p><p>
In both case
<ol>
<li> Wine gets a first SIGTRAP (in it's sig_trap handler)
<ul>    
	<li> Wine converts it into a Windows exception (w-exception in short).
	  This includes creating a context for the generic CPU registers</li>
	<li> This w-exception is sent to the w-exception handler the program
	  installed (this one can modifiy the all registers)
	  <ul><li>
		 this handler touches one of the i386 debug registers</li></ul></li>
	<li> as we need to update the debug registers values (and we don't do in
	  the signal handler return), this task is delegated to the Wine server
	  (our central process, which is in charge of synchronisation...)
	  <ul>
		<li> the Wine server ptrace-attach:es to the process which handled
		  the SIGTRAP.</li>
		<li> Wine server wait4:s on the SIGSTOP (after ptrace:attach)</li>
		<li> modify (with ptrace) the debug registers</li>
		<li>> and resumes excution (ptrace: cont)</li></ul>
        </li>
	<li> wine terminates the sig trap handler and resumes the execution with
	  the modified basic registers (from the saved context), and the
	  modified debug registers (from the Wine server round trip)</li></ul>
</li>
<li> a second sig trap is generated
	<ul><li> since the wine server is still ptrace:attached, it gets the signal.</li></ul>
</li></ol></p><p>
What differs then in both execution:
in the working case, the sig trap handler is called on the client side, 
whereas it's never called in the non-working case. We do have a couple of 
protection (to avoid some misbehaving apps), but none of them get triggered. So 
it seems like the trap handler is not called (ugh).
</p><p>
A couple of notes:
as the program tested is copy protected, and as it seems that the copy 
protection is what causes the harm, it can be interesting to know that the 
programe seems to set the TF flag (some copy protection schemes directly do an 
"int 1", but given the exception code we get, this isn't the case).
- in Windows trap handling, the TF is explictly reset before calling the windows 
exception handler (which is what Wine does, before calling the window exception 
handler). Of course the handler can set it back if it wants to continue single 
stepping.</p></quote>

<p>Even though it seemed like the problem wasn't fixed for
Jesse, Linus thought at least one issue was resolved:</p>
<quote who="Linus Torvalds"><p>
This actually implies that the current -bk tree with my latest patch may 
actually fix it.
</p><p>
One of the things that 2.6.9 did wrong was exactly that it cleared TF too
much in the ptrace interface. The current development tree is a lot more
careful about that, and it fixes the horrid test-case that I used to debug
it. The test-case (when run under gdb) actually does something similar to
what Wine appears to do.
</p><p>
TF will be still set in Linux when ptrace gets access, but the ptracer can
choose to clear it with PTRACE_PEEKUSR/PTRACE_POKEUSR (or with
PTRACE_GETREGS/SETREGS). I assume you already do that, since I think that
has been true forever (although maybe you don't: PTRACE_CONTINUE used to
unconditionally clear TF, so it may be that Wine may need some minor
modification to not do that - but the good news is that mod should be
backwards-compatible, so it should be pretty easy).
</p><p>
I actually broke down and am downloading the latest source tree of wine,
let's see if I can find the place you do this.
</p></quote>

<p>After looking through Wine's dlls/ntdll/signal_i386.c, Linus thought
everything was ok.  </p>

</section>
<section
        title="Debian Packages"
        subject="Packaging Questions, New Debian Package, Packagers Guide"
        archive="http://www.winehq.org/hypermail/wine-devel/2004/11/0584.html"
        posts="21"
        startdate="23 Nov 2004 00:00:00 -0800"
        enddate="24 Nov 2004 00:00:00 -0800"
>
<topic>Project Management</topic>
<mention></mention>
<mention>Francois Gouget</mention>
<mention>Hans Leidekker</mention>
<mention>Dimi Paun</mention>
<mention>Marcus Meissner</mention>

<p>
Scott Ritchie stepped up this week to help out with packaging
Wine for Debian:</p>
<quote who="Scott Ritchie"><p>
The Debian packages have gotten rather out of date, and it looks like
Ove's not going to be making them any more.  I took the initiative and
decided to try making one myself.  I'm polishing off a new Debian
package now.
</p><p>
Some major things I noticed:
<ol>
<li> There were a lot of old hacks in the package that are probably no
longer necessary, due to advancements in wine like wineprefixcreate and
such.  There was also the remenants of a very old problem with compiling
using flex (which I remember experiencing the old days) in the form of a
special exception for installing newer flex packages.</li>

<li> Very old packages like winesetuptk should now be officially obsoleted
by making them conflicted and replaced.  I also did the same to the
libwine-* packages that weren't doing anything but making documentation
folders, like libwine-alsa.</li>

<li> Making my package looks to be a lot simpler than what's implied in
the (now year out of date) package makers guide.  I found that
documentation quite useless (and didn't even find it until I was about
half way done anyway).  Again, this is probably due to advancements in
wine itself.</li>

<li>  What I didn't find is a standard list of packages that aren't
strictly required for wine (like libxt-dev and flex), but that wine can
benefit from.  A good example would be the alsa development files.
These are all things that should be included in the build dependencies
for the package.</li></ol>
</p><p>
So far, my list of build dependant packages is the following:
flex, bison, libx11-dev, libasound2-dev, libxt-dev, libicu28-dev
</p><p>
However, I'm not sure if this means the wine binary package should
depend on them, since it's compiled in.  So, should I make libicu28 a
dependancy for wine?
</p><p>
Now, this leads to the question: is it worth even having a package
maintainers guide?  If so, who wants to update it?
</p></quote>

<p>The thread then branched out as lots of people wrote in to
answer the questions Scott raised.  Hans Leidekker pointed out
a list of dependencies can be found in documentation/PACKAGING.
That led to a side conversation about BiDi support and setting
up a system with ICU.  Francois Gouget added that NAS was
required for building the winenas audio driver.
</p><p>
Mike Hearn thought it would be nice to change the way the Debian
package was arranged,
<quote who="Mike Hearn">
Cool! While you're at it could you please combine them altogether so the
packaging matches the upstream sources? Last time I checked the Debian
packages were split into tons of little packages which is wrong and led to
strange breakages. Just one package with everything installed by "make
install" in the sources would be great.
</quote></p>

<p>Dimi Paun agreed and thought putting the packages on the
SourceForge download site would be nice too.  Francois Gouget
explained having a bunch of separate packages was standard on
Debian.  Mike thought this just caused more problems:</p>
<quote who="Mike Hearn"><p>
Well, it may be the Debian way but it's not the Wine way.
</p><p>
I'm not saying this just to be pedantic, the fact that distros like Debian
creatively ignore the way upstream is packaged caused me big problems
when I wrote the IE installer script way back in January (which still gets
~300 hits a day). I assumed that if you had Wine installed, you'd have
things like wineboot and regedit installed. These are shipped as part of
Wine after all. But they weren't, Debian had classified them as optional
utilities and my script broke. Gentoo had similar problems. I had to add
in lots of hacks to make sure all the programs I used were there, and
print out different messages for each distro giving the package name
needed.
</p><p>
It's not just my script. Wine and Windows programs sometimes assume these
applets are present too (eg notepad, wineboot, regedit, regsvr32).
</p><p>
The packaging on Red Hat/SuSE/Mandrake etc didn't have this problem
because they mostly followed upstream conventions.
</p><p>
If this way of splitting everything up really is better we should split
the Wine tarballs up into separate packages too. If it isn't then Debian
should follow the upstream conventions, it would save people a lot of
hassle debugging incomplete installs because some program tried to invoke
regedit or notepad and it wasn't there.
</p></quote>
<p>Scott made the change:</p>
<quote who="Scott Ritchie"><p>
Well, I am condensing it down.  Here's what I think we
should move towards with packaging:
<ul>
<li>wine : depends on libwine, contains the binaries for running windows programs</li>
<li>libwine : contains everything needed to run windows applications</li>
<li>libwine-dev : contains the files needed to compile windows applications with winelib</li>
</ul></p><p>
My reason for splitting off libwine and wine is that libwine can be
installed without wine and could someday be used to launch a program
that has been ported with winelib, without having to have wine proper in
it.
</p><p>
I imagine someday I'll take an open source Windows program like eMule,
set it up to compile with winelib, and have it turned into a Debian
package.  This way one could apt-get install emule and then have it
depend on and install libwine, but not wine.
</p><p>
The reason for using libwine rather than winelib is to comply with
Debian standards.
</p></quote>

<p>Dimi corrected Scott and pointed out that you really can't
split wine from winelib as they go hand in hand.  He then went on
to discuss the packaging guide, 
<quote who="Dimitrie Paun">
 Well, it would be great if you'd use the experience you gathered
 doing the .deb packages to update the guide. Really, it can only
 be updated by a packager, someone that went through the motions.
 Moreover, the experienced packagers don't need that document as much,
 and are not likely to update it. So the only hope we have is for
 someone 'new' to the wine-packaging business to take on the job.
</quote></p>

<p>Before Scott could even reply, Marcus Meissner did it.  You
can find that revised doc 
<a href="http://www.winehq.com/hypermail/wine-devel/2004/11/att-0609/01-PACKAGING">here</a>
for now.  


</p>
</section>
 
<section 
	title="Install Script for IE and Media Player" 
	subject="Internet Explorer 6 Installer script"
	archive="http://www.winehq.org/hypermail/wine-devel/2004/11/0673.html" 
	posts="1"
	startdate="25 Nov 2004 00:00:00 -0800"
>
<topic>Fixes</topic>
<mention></mention>
<mention>Microsoft</mention>

<p>Wine is getting increasingly better at running Internet 
Explorer and Windows Media Player.  Hajime Segawa announced
a simple way to get them working:</p>
<quote who="Hajime Segawa"><p>
I wrote a tiny shell script that can install IE6sp1 and WMP7.
I hope this script can help you.
RealPlayer 10, MSN Messenger 6.4, Yahoo!Japan Messenger seem to work
with this configuration.
<ul>
<a href="http://sidenet.ddo.jp/winetips/config.html">http://sidenet.ddo.jp/winetips/config.html</a></ul>
</p><p>
I took some screenshots.
<ul><a href="http://sidenet.ddo.jp/winetips/files/">
http://sidenet.ddo.jp/winetips/files/</a></ul></p></quote>

<p>If you dissect the script you'll notice a lot of what it
does is install some proprietary DLL's.  Specifically, DCOM98,
MFC 4.0, and Microsoft Installer.  So yes, it's cheating and
Wine isn't running these completely out of the box.  However,
you can run them.  </p>

</section>
<section 
	title="Customizing File Browsing" 
	subject="Winecfg -&gt; browse for folder"
	archive="http://www.winehq.org/hypermail/wine-devel/2004/11/0608.html" 
	posts="17"
	startdate="24 Nov 2004 00:00:00 -0800"
	enddate="25 Nov 2004 00:00:00 -0800"
>
<topic>Winelib</topic>
<mention></mention>

<p>Eradicating the config file continues.  Mike Hearn posted 
another patch to improve winecfg this week and noted these
additions:</p>
<quote who="Mike Hearn"><p>
</p></quote>

<p>That led Robert van Herk to begin working on it and
starting to make more additions.  Mike gave some pointers
for what needs to be tackled:</p>
<quote who="Mike Hearn"><p>

Here are some more winecfg todos for everybody to take a crack at now my
last patch got checked in:
<ul>
<li> The drive detection algorithm needs some polishing. It mapped my
  /boot directory on FC3 even though that's useless. Maybe we need
  a blacklist?  [easy]</li>

<li> We should also ensure the home directory is mapped in the same way
  that we ensure / and c:\windows is mapped.  [easy]</li>

<li> Integrate drive detection with wineprefixcreate. The code nearly
  supports this and was designed with that in mind, check out the 
  different ways errors are presented from the CLI and GUI. You just
  need to add a command line switch to the program that runs the 
  autodetect_drives() function.   [not too hard]</li>

<li> There's some weird clipping/painting corruption in the advanced view
  of the drives page. It looks like a WM rewrite regression so I asked
  Alexandre to check it out but if you're up for a challenge feel free to
  try and beat him to it!    [marine level hardness!]</li>

<li> Unicodify it, at the moment it uses some ANSI APIs and such  
  [intermediate]</li>

<li> Usability review   [intermediate]</li></ul></p><p>

.... and of course, the big cheese ....
<ul>
<li> Write the migration code to pull the users current config across to the
  new registry branch so we can actually start thinking about switching
  the config file off once and for all. Bonus points for adding an 
  explanation of what happened to the old config file itself!
  <br /><br />
  [easy in theory, might be hard getting it good enough to get past
   Alexandre!]
</li></ul></p></quote>

<p>Robert then presented a dilemna:</p>
<quote who="Robert van Herk"><p>
Thanks to Mike's help, I succeeded in showing a SHBrowseForFolder 
thingy, in the winecfg program, so that people can pick a directory they 
want to use as virtual C drive.
</p><p>
However, of course, this directory choosing thingy shows the virtual 
Windows file system, not the Unix file system. Hence, I think we have a 
tiny bootstrapping problem here. If I just show the user his windows 
file system, he might not be able to pick the directory he wants.
</p><p>
Is Z:\ always mapped to the root of the unix file system? Because that 
would seem to solve it: just let them choose a directory from Z:\ and 
then probably modify the returned string by removing Z: and replacing 
all /'s with \'s.
</p></quote>

<p>There was a lot of discussion about different ways to pull this off
but there definitely wasn't a simple solution.  Alexandre weighed in 
with the direction he'd like to see it go,
<quote who="Alexandre Julliard">
We need to somehow extend the Windows file dialogs to allow browsing
the Unix file system, this is something many Winelib apps will want too.
</quote></p>

<p>Robert was actually glad to hear this.  Implementing it could
be done a few different ways, so he asked for some advice:</p>
<quote who="Robert van Herk"><p>

OK, so how to do this? I see 3 ways:
<ol>
<li> Implement an extra api that do the same as the normal file open/save
and browse for folder api, but then with the Unix file system</li>
<li> Implement a thread local variable so that threads can put the Wine
file dialogs into unix file system mode / windows file system mode</li>
<li> Define some magic wine flags in the file dialogs that make the
dialogs appear in Unix mode</li></ol></p><p>

There are some pro's and con's to all of them:
<ol>
<li> Well, basically, we have to make an extra api :-), so there are more
functions exported. Probably the existing and new functions will need to
call each other, so this means an extra level of indirection.</li>
<li> Kinda ugly hacking, though we don't loose win32 compatibility</li>
<li> Nice, but we loose strict win32 compatibility, since there will be a
magic flags that doesn't exist in win32.</li></ol></p></quote>

<p>Mike suggested the 3rd approach,
<quote who="Mike Hearn">
This is the most lightweight so I'd go for it for now. If we find that the
flag value we pick is already in use we can just change it, no big deal.
We already use custom Wine flags in other parts of the code (eg
WS_EX_TRAYWINDOW).</quote></p>

</section>
<section
        title="No RichEdit20A Window Class"
        subject="No RichEdit20A window class"
        archive="http://www.winehq.org/hypermail/wine-devel/2004/11/0432.html"
        posts="11"
        startdate="18 Nov 2004 00:00:00 -0800"
	enddate="19 Nov 2004 00:00:00 -0800"
>
<topic>Controls</topic>
<mention>CodeWeavers</mention>
<mention></mention>
<mention>James Hawkins</mention>
<mention>WineHQ</mention>

<p>Michael Ost ran into a problem getting an app to use Wine's 
RichEdit controls:</p>
<quote who="Michael Ost"><p>
My winelib application can't create a window of class RichEdit20A. It
looks like the class is not being registered, because the DLL is not
being loaded. Any clues why this might be?
</p></quote>

<p>Mike McCormack described the RichEdit controls and what the
state of them is in Wine:</p>
<quote who="Mike McCormack"><p>
RICHEDIT_CLASS20A is provided by riched20.dll, not riched32.dll.  The 
windows 2000 implementation uses riched20.dll to implement riched32.dll 
  (ie. moves the richedit code to riched20.dll and implements the 
RICHEDIT_CLASS10A class using the new RICHEDIT_CLASS20A class.
</p><p>
In short, the existing code registers the correct class name, but we 
need to make a new dll dlls/riched20, and do alot of work on the 
richedit control :)
</p><p>
Actually, since we need to work on riched20, we might as will implement 
that properly, rather than trying to reuse the edit control.
</p></quote>


<p>Michael asked for some clarification and explained what he was trying to
do:</p>
<quote who="Michael Ost"><p>
This isn't quite clear to me. It sounds like you are saying there is a
riched20.dll in wine, but I can't find one. Are these statements
correct?
<ul>
<li> Wine's only implements RichEdit10A via riched32.dll. Wine does not
implement RichEdit20A. </li>

<li> Win2K (and later) provides riched20.dll which implements
RICHEDIT_CLASS20A. This one I can verify as true on my winxp system.</li>

<li> There are significant differences between the two window classes</li>
</ul></p><p> 
My winelib app is hosting a 3rd party DLL which is specifically
requesting "RichEdit20A". That suggests that the DLL was built with
win2K or later, from what you were saying. Sounds like my options are
to:
<ul>
<li> hack their request to use the window class registered by wine's
riched32.dll. How well could I expect this to work? How big are the
diffs between 10A and 20A?</li>

<li> get them to provide win2k's riched20.dll</li>

<li> have them change their DLL to ask for RichEdit10A instead</li>

<li> implement riched20.dll in Wine. Sounds like a big job!</li>
</ul></p></quote>

<p>Mike confirmed that richedit20.dll doesn't exist yet in Wine
and therefore the class name RICHEDIT_CLASS20A doesn't exist.
CodeWeavers has a hack to get around that fact and Mike described
it:</p>
<quote who="Mike McCormack"><p>
We have an empty implementation of riched20 that simply forwards 
requests to edit.  That is the wrong, and the existing riched32 code is 
broken too (since it uses the edit control).
</p><p>
CrossOver's riched20 code is attached... it's a quick and easy way to 
fix the problem, but the correct, longterm solution for Wine is to 
implement riched20.dll properly and then forward requests from riched32 
to riched20 rather than the edit control, which is why this code is not 
in WineHQ.
</p></quote>

<p>James Hawkins wanted to know why it wasn't in Wine, but
Mike reiterated that it was just a hack that avoided solving
the real problem,
<quote who="Mike McCormack">
The solution is to start work on a skeleton 
control, perhaps that just has some basic drawing functionality and not 
much else. Then gradually extend it to become the mini word processor it 
actually is.</quote></p>

<p>James wanted some clarification on the direction, so Mike
went on:</p>
<quote who="Mike McCormack"><p>
The current implementation of riched32 is Wrong(tm).
</p><p>
We'll implement riched20 from scratch and do it the right way.  When 
it's good enough, we can then rewrite riched32 to use the riched20 
control instead of the edit control.
</p><p>
All that can be done in small incremental improvements, which is the key 
to making cooperative development work.
</p></quote>

</section>
 
<section
        title="CVS Broken?"
        subject="Breakage on Debian Sarge"
        archive="http://www.winehq.org/hypermail/wine-devel/2004/11/0667.html"
        posts="3"
        startdate="25 Nov 2004 00:00:00 -0800"
>
<topic>Project Management</topic>
<mention></mention>
<mention>Michael Stefaniuc</mention>
<mention>cvs</mention>

<p>Reports seem to indicate that the current CVS of Wine is broken.  
Perhaps by the time you read this it will be fixed.  Michael Jung
mentioned it first:</p>
<quote who="Michael Jung"><p>
this patch 
(<a href="http://cvs.winehq.org/patch.py?id=14575">http://cvs.winehq.org/patch.py?id=14575</a>)
broke wine on a current
Debian Sarge. Tested this on two machines. GUI applications do not respond
any longer to mouse events. Tested regedit and winemine. Removing the patch
solves the problem.
</p></quote>

<p>Stefan D&#246;singer ran across the same problem on Gentoo and
Michael Stefaniuc also did on RHEL3 and Fedora Core 2.  </p>

</section>
</kc>
