<?xml version="1.0" ?>

<kc>
<title>Wine Traffic</title>
<author contact="mailto:eric.pouech@lemel.fr">Eric Pouech</author>
<issue num="80" date="29 Jan 2001 00:00:00 -0800" />

<intro>

<p />

This is the 80th release of the Wine's kernel cousin
publication. It's main goal is to distribute widely what's
going on around Wine (the Un*x  windows emulator).

<p />


</intro>

<stats posts="41" size="125" contrib="23" multiples="9" lastweek="12">
<person posts="4" size="13" who="Dmitry Timoshkov &lt;dmitry@sloboda.ru&gt;" />
<person posts="4" size="10" who="Martin Pilka &lt;mpilka@codeweavers.com&gt;" />
<person posts="3" size="8" who="Gerald Pfeifer &lt;pfeifer@dbai.tuwien.ac.at&gt;" />
<person posts="3" size="8" who="David Elliott &lt;dfe@infinite-internet.net&gt;" />
<person posts="3" size="8" who="Alexandre Julliard &lt;julliard@winehq.com&gt;" />
<person posts="3" size="4" who="Ove Kaaven &lt;ovehk@ping.uio.no&gt;" />
<person posts="3" size="13" who="Ulrich Weigand &lt;weigand@immd1.informatik.uni-erlangen.de&gt;" />
<person posts="2" size="8" who="Chris Morgan &lt;cmorgan@wpi.edu&gt;" />
<person posts="2" size="5" who="gerard patel &lt;gerard.patel@asi.fr&gt;" />
</stats>


<section 
  title="DeadKeys in Microsoft and X11 worlds"
  subject="I've tried to change keyboard table.. No good..."
  archive="http://www.winehq.com/hypermail/wine-devel/2001/01/0258.html"
  posts="9"
  startdate="17 Jan 2001 00:00:00 -0800"
  enddate="22 Jan 2001 00:00:00 -0800"
>

<mention></mention>

<p />

Joao Clemente reported some issues with his Portuguese keyboard:

<quote who="Joao Clemente">
I am trying to use wine (I installed this week's package) but once
again I found my keyboard doesn't work properly...

<p />


<p />

I can't have the following chars right: <code>\ &#124; ` ' &#187; &#171;</code>

<p />

I think that it's a problem related with "dead keys" (? I'm not even
sure of <b>WHAT</b> are dead keys, sorry...) 'cause I've looked somewhere
in windows/keyboard.c and it has there a comment saying something like
"<i>It works except for dead keys</i>"
</quote>


<p />

A dead key is used to generate complicated characters from the
keyboard. For example (in French, sorry I couldn't resist), the &#234;
character (e with diaresis ^), can be generated by hitting on the
keyboard the ^ key, then the e key. The first hit will generate a dead 
key, meaning it has not to be treated as a regular character but
rather as a modifier on the next character to be entered.

<p />

Dmitry Timoshkov answered a bit to Joao's questions:
<quote who="Dmitry Timoshkov">
Actually support for dead keys can be implemented now, since Alexandre 
added support for composite unicode characters. I even wrote several
tests to prove the concept and do 2-&gt;1 and 1-&gt;2 character
conversions in WideCharToMultiByte and MultiByteToWideChar. But I have
some problems:
<ol>
	<li>Actually I don't know how to generate dead key sequence
that will modify next character, because cyrillic has no this
"feature".</li>
	<li>Accent characters in different code pages has different
mappings to unicode characters. Perhaps we just have to create
internal table with mapping [combining character in code page] -&gt;
[combining character in unicode]? </li>
</ol>
</quote>


<p />

Ove Kaaven went even further:
<quote who="Ove Kaaven">
It's really not that hard... under Windoze, the keyboard driver keeps
some internal static variable that holds the last deadchar used (the
last deadchar fed to ToAscii/ToUnicode).

<p />

When a deadkey is given to ToUnicode, it stores the deadchar into its
static variable and returns -1 and the dead character. When the
TranslateMessage code sees a return value of -1, it generates a
<code>WM_DEADCHAR</code> using the returned character. 

<p />

On the subsequent ToUnicode invocation, it sees that a deadchar has
been stored, and tries to combine it with the incoming character. If
it's able to combine them, it returns the combined character and the
return value 1. If not, it returns both the uncombined dead character
and the incoming character, and the return value 2. Also, it clears
the static variable, of course...

<p />

TranslateMessage does send two <code>WM_CHAR</code>s when
ToAscii/ToUnicode returns 2, if I remember right, though this case is
often accompanied by a beep under Windows.
</quote>


<p />

Then, Dmitry (with some indication from Ove) tried to iron this
out. After some first unfruitful tries, and the help of some other
Russian folks, Dmitry felt he had enough information to implement
proper dead keys support. However, as Ove already put up, there was
two possible paths to follow:
<quote who="Dmitry Timoshkov">
There are two approaches in implementing support for dead keys:
<ol>
<li>Do all the character composing in Wine itself, completely ignoring
X. It will allow Wine to have full control over keyboard, but will
completely ignore characters about Wine is unaware and any custom
composing, that the user could have in his/her Compose file.</li>
<li>Delegate all the character composing tasks to Xlib. This will
allow the user to have his/her familiar environment, but will lead to
some cases, when some keyboard activity will be interpreted
differently in Wine then in Windows: for instance
Ctrl&lt;T&gt;&lt;plus&gt;&lt;plus&gt; will produce "#" numbersign
instead of, say, call font selection dialog on Ctrl&lt;T&gt;. But this
misinterpretations could be easy fixed by the user, because only
he/she knows what behavior they want to have.</li>
</ol></quote>


<p />

Dmitry (as Ove at first glance and Joao) preferred to use second
option, even if, as Dmitry noted later on, <quote who="Dmitry Timoshkov">Having Xlib
to do all dead key composition is an easy way to go. But there are (at
least in theory) another drivers (<i>EdNote: for display, like a pure
console one</i>). Having dead key support in Wine itself will simplify
creating those drivers, assuming that new driver should not worry
about character composing, only deliver keystrokes. But such an
internal support for dead keys in Wine core should not affect any
driver at all: driver just will never say "I have dead key for
processing", it just will silently process it itself.</quote>

<p />

However, no patch has been committed yet regarding this missing feature... 
</section>


<section 
  title="Chinese Wine"
  subject="Chinese support in wine?"
  archive="http://www.winehq.com/hypermail/wine-devel/2001/01/0336.html"
  posts="4"
  startdate="21 Jan 2001 00:00:00 -0800"
  enddate="23 Jan 2001 00:00:00 -0800"
>

<mention></mention>

<p />

On the matter of internationalization, Howard Chan stressed some other
areas:
<quote who="Howard Chan">
I was playing with wine and try to get some Chinese windows games
working (old games in the win95 era), but it seems that there are
problems with Chinese support. In particular, fonts are not right and
I can't get it to display the correct font. I'm using wine-20010112
snapshot. 

<p />

While hacking around (the docs on winehq has not much use since it is 
too outdated and file locations are totally changed) it seems that the 
cht (zh_TW locale) is using the wrong codepage (traditional Chinese 
should be using codepage 950) and it seems that the definition is not 
complete. I would like to help but the docs are outdated and I can't
do much without understanding how the locales work on wine. I tried to 
change the dlls/kernel/nls/cht.nls to use codepage 950 but still it 
can't get the font works. Since my fonts work in X11 and mozilla I
think it's wine that is causing the problem.

<p />

BTW, Japanese support seems OK since I can successfully load Japanese 
window games with correct text displayed, so the multibyte character 
locale support should be no problem.
</quote>


<p />

Aric Steward welcomed the help on this area of Wine. Aric also
suggested to map some Windows font to their X11 counterparts (using
the <code>[fonts]</code> section from the <code>~/.wine/config</code>
file), and suggested using the <code>-isas-song ti-</code> X11 fonts
for this purpose.

<p />

Howard didn't like the proposal:<quote who="Howard Chan">
<code>-isas-song ti-</code> is a GB font, which is used in
Communist China (zh_CN). Taiwan and Hong Kong (zh_TW and zh_HK) uses
big5 fonts <code>*-big5-0</code> which is not included in the standard
XFree86 distribution. 

<p />

One thing that may be of interest. xselfont cannot display my Chinese 
fonts also (just blank on the sample text area), but mozilla and 
windowmaker can use it without problem.
</quote>

<p />

So further posts appeared, still meaning that the Chinese (including
Taiwan and Hong Kong variants) needs some more work to be done.</section>


<section 
  title="Registry and main branches"
  subject="another question about that damned registry :-)"
  archive="http://www.winehq.com/hypermail/wine-devel/2001/01/0341.html"
  posts="6"
  startdate="24 Jan 2001 00:00:00 -0800"
  enddate="26 Jan 2001 00:00:00 -0800"
>

<mention>Juergend Schmied</mention>
<mention></mention>

<p />

Martin Pilka wrote:
<quote who="Martin Pilka">
File <code>~/.wine/userdef.reg</code> is quite mysterious to me. It
seems it contains some keys from <code>HKEY_LOCAL_MACHINE</code>,
<code>HKEY_USERS/.DEFAULT</code>,
<code>HKEY_USERS/%username%</code>. <code>HKEY_LOCAL_MACHINE</code> is
also contained in <code>system.reg</code> file, and
<code>HKEY_USERS/%username%</code> in <code>user.reg</code> file. what
is that duplicity good for? which value takes precedence?</quote>


<p />

Alexandre Julliard answered: <quote who="Alexandre Julliard"><code>userdef.reg</code>
is supposed to contain only <code>HKEY_USERS/.Default</code>; but it
seems a typo crept it at some point that causes it to contain the
whole registry.</quote>

<p />

Alexandre provided a one line patch to solve this. Martin confirmed it 
solved some issues. However, he continued
<quote who="Martin Pilka">
Ok, I see. That patch helped a bit. However: 
<code><pre>
system.reg   --&gt; HKEY_LOCAL_MACHINE
userdef.reg  --&gt; HKEY_USERS/.DEFAULT
user.reg     --&gt; HKEY_USERS/%username%
</pre></code>

<p />

Where is the place for <code>HKEY_USERS/Software/...</code> key? My
native windows registry contain one. I'm able to load it properly
where it belongs, but after wine exit that key will end in
<code>userdef.reg</code> file. Next time i run regedit (and load only
from home registry) the key is under <code>HKEY_USERS/.DEFAULT</code>
again, What is wrong. 
</quote>


<p />

Ove Kaaven answered:<quote who="Ove Kaaven">There shouldn't be such a
thing. What kind of idiot program created that? The closest correct
thing would be <code>HKEY_CURRENT_USER/Software</code>, which would
map to <code>HKEY_USERS/%username%/Software...</code></quote>

<p />

Juergend Schmied went further:<quote who="Juergen Schmied">The crapy program is
the microsoft dialer. <code>HKEY_USERS\Software\Microsoft\Windows\CurrentVersion\Telephony\HandoffPriorities</code>

<p />

Think we can ignore this key safely.</quote>

<p />

</section>


<section 
  title="Linux on PPC (and OSX)"
  subject="wine and ELF format?"
  archive="http://www.winehq.com/hypermail/wine-devel/2001/01/0349.html"
  posts="2"
  startdate="25 Jan 2001 00:00:00 -0800"
  enddate="28 Jan 2001 00:00:00 -0800"
>

<mention></mention>

<p />

Josh DuBois still struggling to let Wine run on PPC wrote:
<quote who="Josh DuBois">
How closely is Wine tied to the ELF format?  I've (finally! :-) ) got
the apps in the <code>programs/</code> dir running on linuxppc, so I
tried to scoot the code over to OSX just to see what happened. Of
course no dlopen on  OSX ==&gt; no compilation.
   
OSX uses Mach-O binaries, rather than ELF. A <code>dlopen()</code>
"equivalent" for Mach-O exists, but I've never called
<code>dlopen()</code> in my life, so I'm not sure on what criterion to
compare them. Does anyone know, broadly, what the hot spots will by
trying to make wine use a different shared object format?</quote>


<p />

Ulrich Weigand answered:
<quote who="Ulrich Weigand">
Well, Wine only needs the basic functionality of <code>dlopen</code>,
<code>dlclose</code>, <code>dlsym</code>, which are rather equivalent
to <code>LoadLibrary</code>, <code>FreeLibrary</code>, and
<code>GetProcAddress</code>. Anything that allows some sort of
run-time dynamic linking must really provide this functionality IMO...
You should be able to implement the corresponding routines in
<code>library/port.c</code>. 

<p />

There might be some further dependencies to the ELF format, however:
e.g. we rely on the fact that the <code>.init</code> and
<code>.fini</code> sections can be used to implement global
constructors / destructors.  (This is not a feature of the ELF
<b>format</b>, strictly speaking, but of the way ELF loading is done by the
Linux toolchain and dynamic loader. OSX probably has something
similar.)
</quote>

</section>


<section 
  title="Java and USER"
  subject="Notes and Java test on 20010112."
  archive="http://www.winehq.com/hypermail/wine-devel/2001/01/0310.html"
  posts="8"
  startdate="01 Jan 1919 00:00:00 -0800"
  enddate="01 Jan 1928 00:00:00 -0800"
>

<mention></mention>

<p />

David Goodenough did some testings with Wine 20010112 and tried the
Windows 1.1.8 java runtime environments:

<quote who="David Goodenough">
The Sun one fails with the <code>GetFastQueue16</code> error that I
mentioned with the last drop.  Does anyone know what needs to be done
to build a default queue. I put in a suggestion last time but no one
reacted to say whether it was the right approach. Also there was the
question about how it should be deleted when the thread is
cleared. The Windows SDK file I have does not seem to list
GetFastQueue16, so I do not know what the rules are. 

<p />

The IBM one just hangs. No errors, no GetFastQueue16 error, but a hard
and solid loop. I will try to use trace to see what is happening.
</quote>


<p />

Ulrich Weigand went on with some explanation:
<quote who="Ulrich Weigand">
<code>GetFastQueue16</code> is an undocumented kernel routine that is
used in Win9x to implement the specification that all threads except
the main thread by default don't have a message queue; when they call
the first 'GUI' routine that requires a message queue, one will be
created on the fly. 

<p />

This is done by having every routine that needs to access the thread's 
message queue call <code>GetFastQueue16</code> to retrieve the
queue. If the queue is already present, it will be simply returned. If
the thread doesn't yet own a queue, one will be created.

<p />

<code>GetFastQueue16</code> only gives the warning message if it tried
to create a message queue, but this failed for some reason. This is a
situation that should never occur, really ...

<p />

In fact, the only situation I could understand
<code>GetFastQueue16</code> to fail would be if the application
doesn't load the USER subsystem, so that the callout from KERNEL will
not be present.</quote>


<p />

The callout mechanism provides a way for KERNEL DLL pair to call
functions in USER even if dependencies between DLL would be the other
way around. It's just a table of function pointer which are filled
with the addresses of the needed USER functions when USER is loaded.

<p />

Ulrich then asked from some traces to shed some light. G&#233;rard Patel
continued the testing and confirmed Ulrich's thoughts: 

<quote who="G&#233;rard Patel">
I did not include the trace as it's rather large but what happens is
clear enough: the main exe loads implicitly KERNEL32 but not USER -
USER is loaded implicitly by a DLL loaded by <code>LoadLibrary</code>..
So when the kernel initialization is done, USER is not yet loaded. 
It's unusual but seems perfectly valid IMO.
</quote>


<p />

Ulrich answered:
<quote who="Ulrich Weigand">
Hmmm.  Strictly speaking, if an app dynamically loads USER, it can
also dynamically <b>unload</b> USER; we'd have to take care that we
invalidate the Callout pointers if this happens.</quote>


<p />

and provided a patch to fix the issue. G&#233;rard confirmed this actually
fixed the problem.

<p />


<p />

</section>

</kc>
