When reading resources in NLS_LoadStringExW we should map
[wine] / documentation / configuring.sgml
1   <chapter id="configuring">
2     <title>Configuring Wine</title>
3     <para>Setting up config files, etc.</para>
4
5     <sect1 id="config">
6       <title>General Configuration</title>
7       <para>
8         Copyright 1999 &name-adam-sacarny; <email>&email-adam-sacarny;</email>
9       </para>
10       <para>
11         (Extracted from <filename>wine/documentation/config</filename>)
12       </para>
13
14       <sect2>
15         <title>The Wine Config File</title>
16         <para>
17           The Wine config file stores various settings for Wine. These include:
18           <itemizedlist>
19             <listitem>
20               <para>
21                 Drives and Information about them
22               </para>
23             </listitem>
24             <listitem>
25               <para>
26                 Directory Settings
27               </para>
28             </listitem>
29             <listitem>
30               <para>
31                 Port Settings
32               </para>
33             </listitem>
34             <listitem>
35               <para>
36                 The Wine look and feel
37               </para>
38             </listitem>
39             <listitem>
40               <para>
41                 Wine's DLL Usage
42               </para>
43             </listitem>
44             <listitem>
45               <para>
46                 Wine's Multimedia drivers and DLL configuration
47               </para>
48             </listitem>
49           </itemizedlist>
50         </para>
51       </sect2>
52
53       <sect2>
54         <title>How Do I Make One?</title>
55         <para>
56           This section will guide you through the process of making a
57           config file. Take a look at the file <filename>&lt;dirs to
58           wine>/documentation/samples/config</filename>. It is organized by section.
59         </para>
60
61         <informaltable frame="all">
62           <tgroup cols="3">
63             <thead>
64               <row>
65                 <entry>Section Name</entry>
66                 <entry>Needed?</entry>
67                 <entry>What it Does</entry>
68               </row>
69             </thead>
70             <tbody>
71               <row>
72                 <entry>[Drive X]</entry>
73                 <entry>yes</entry>
74                 <entry>Sets up drives recognized by wine</entry>
75               </row>
76               <row>
77                 <entry>[wine]</entry>
78                 <entry>yes</entry>
79                 <entry>Settings for wine directories</entry>
80               </row>
81               <row>
82                 <entry>[DllDefaults]</entry>
83                 <entry>recmd</entry>
84                 <entry>Defaults for loading DLL's</entry>
85               </row>
86               <row>
87                 <entry>[DllPairs]</entry>
88                 <entry>recmd</entry>
89                 <entry>Sanity checkers for DLL's</entry>
90               </row>
91               <row>
92                 <entry>[DllOverrides]</entry>
93                 <entry>recmd</entry>
94                 <entry>Overides defaults for DLL loading</entry>
95               </row>
96               <row>
97                 <entry>[options]</entry>
98                 <entry>no</entry>
99                 <entry>No one seems to know</entry>
100               </row>
101               <row>
102                 <entry>[fonts]</entry>
103                 <entry>yes</entry>
104                 <entry>Font appearance and recognition</entry>
105               </row>
106               <row>
107                 <entry>[serialports]</entry>
108                 <entry>no</entry>
109                 <entry>COM ports seen by wine</entry>
110               </row>
111               <row>
112                 <entry>[parallelports]</entry>
113                 <entry>no</entry>
114                 <entry>LPT ports seen by wine</entry>
115               </row>
116               <row>
117                 <entry>[spooler]</entry>
118                 <entry>no</entry>
119                 <entry>Print spooling</entry>
120               </row>
121               <row>
122                 <entry>[ports]</entry>
123                 <entry>no</entry>
124                 <entry>Direct port access</entry>
125               </row>
126               <row>
127                 <entry>[spy]</entry>
128                 <entry>no</entry>
129                 <entry>What to do with certain debug messages</entry>
130               </row>
131               <row>
132                 <entry>[Registry]</entry>
133                 <entry>no</entry>
134                 <entry>Specifies locations of windows registry files</entry>
135               </row>
136               <row>
137                 <entry>[tweak.layout]</entry>
138                 <entry>recmd</entry>
139                 <entry>Appearance of wine</entry>
140               </row>
141               <row>
142                 <entry>[programs]</entry>
143                 <entry>no</entry>
144                 <entry>Programs to be run automatically</entry>
145               </row>
146               <row>
147                 <entry>[Console]</entry>
148                 <entry>no</entry>
149                 <entry>Console settings</entry>
150               </row>
151               <row>
152                 <entry>[WinMM]</entry>
153                 <entry>yes</entry>
154                 <entry>Multimedia settings</entry>
155               </row>
156             </tbody>
157           </tgroup>
158         </informaltable>
159
160         <sect3>
161           <title>The [Drive X] Section</title>
162           <para>
163             It should be pretty self explanatory, but here is an
164             in-depth tutorial about them. There are up to 6 lines for
165             each drive in Wine.
166           </para>
167           <para>
168             <programlisting>[Drive X]</programlisting>
169             The above line begins the section for a drive whose letter is X. 
170           </para>
171           <para>
172             <programlisting>Path=/dir/to/path</programlisting> This
173             path is where the drive will begin. When Wine is browsing
174             in drive X, it will see the files that are in the
175             directory <filename>/dir/to/path</filename>. Don't forget
176             to leave off the trailing slash!
177           </para>
178           <para>
179             <programlisting>
180 "Type" = "floppy|hd|cdrom|network" &lt;--- the |'s mean "Type = '&lt;one of the options&gt;'"
181             </programlisting>
182           </para>
183           <para>
184             Sets up the type of drive Wine will see it as. Type must
185             equal one of the four <literal>floppy</literal>,
186             <literal>hd</literal>, <literal>cdrom</literal>, or
187             <literal>network</literal>. They are self-explanatory.
188           </para>
189           <para>
190             <programlisting>"Label" = "blah"</programlisting> Defines the
191             drive label. Generally only needed for programs that look
192             for a special CD-ROM. Info on finding the lable is in
193             <literal>&lt;dirs to wine>/documentation/cdrom-labels</literal>.
194             The label may be up to 11 characters.
195           </para>
196           <para>
197             <programlisting>"Serial" = "deadbeef"</programlisting>
198             Tells Wine the serial number of the drive. A few programs with
199             intense protection for pirating might need this, but otherwise
200             don't use it. Up to 8 characters and hexadecimal.
201           </para>
202           <para>
203             <programlisting>"Filesystem" = "msdos|win95|unix"</programlisting>
204             Sets up the way Wine looks at files on the drive.
205           </para>
206
207           <variablelist>
208             <varlistentry>
209               <term><literal>msdos</literal></term>
210               <listitem>
211                 <para>
212                   Case insensitive filesystem. Alike to DOS and
213                   Windows 3.x. <literal>8.3</literal> is the maximum
214                   length of files (eightdot.123) - longer ones will be
215                   truncated. (NOTE: this is a very bad choice if you
216                   plan on running apps that use long filenames. win95
217                   should work fine with apps that were designed to run
218                   under the msdos system. In other words, you might
219                   not want to use this.)
220                 </para>
221               </listitem>
222             </varlistentry>
223             <varlistentry>
224               <term><literal>win95</literal></term>
225               <listitem>
226                 <para>
227                   Case insensitive. Alike to Windows 9x/NT 4. This is
228                   the long filename filesystem you are probably used
229                   to working with. The filesystem of choice for most
230                   applications to be run under wine.  PROBABLY THE ONE
231                   YOU WANT!
232                 </para>
233               </listitem>
234             </varlistentry>
235             <varlistentry>
236               <term><literal>unix</literal></term>
237               <listitem>
238                 <para>
239                   Case sensitive. This filesystem has almost no use
240                   (Windows apps expect case insensitive filenames).
241                   Try it if you dare, but win95 is a  much better
242                   choice.
243                 </para>
244               </listitem>
245             </varlistentry>
246           </variablelist>
247
248           <programlisting>"Device" = "/dev/xx"</programlisting>
249           <para>
250             Use this ONLY for floppy and cdrom devices. Using it on
251             Extended2 partitions can have dire results (when a windows
252             app tries to do a lowlevel write, they do it in a FAT way
253             -- FAT does not mix with Extended2).
254           </para>
255           <note>
256             <para>
257               This setting is not really important; almost all apps
258               will have no problem if it remains unspecified. For
259               CD-ROMs you might want to add it to get automatic label
260               detection, though. If you are unsure about specifying
261               device names, just leave out this setting for your
262               drives.
263             </para>
264           </note>
265           <para>
266             Here is a setup for Drive X, a generic hard drive:
267             <programlisting>
268 [Drive X]
269 "Path" = "/dos-a"
270 "Type" = "hd"
271 "Label" = "Hard Drive"
272 "Filesystem" = "win95"
273 This is a setup for Drive X, a generic CD-ROM drive:
274 [Drive X]
275 "Path" = "/dos-d"
276 "Type" = "cdrom"
277 "Label" = "Total Annihilation"
278 "Filesystem" = "win95"
279 "Device" = "/dev/hdc"
280 And here is a setup for Drive X, a generic floppy drive:
281 [Drive X]
282 "Type" = "floppy"
283 "Path" = "/mnt/floppy"
284 "Label" = "Floppy Drive"
285 "Serial" = "87654321"
286 "Filesystem" = "win95"
287 "Device" = "/dev/fd0"
288             </programlisting>
289           </para>
290         </sect3>
291
292         <sect3>
293           <title>The [wine] Section </title>
294           <para>
295             The [wine] section of the configuration file contains
296             information wine uses for directories. When specifying the
297             directories for the settings, make them as they would
298             appear in wine. If your drive <medialabel>C</medialabel>
299             has a path of <filename>/dos</filename>, and your
300             <filename>windows</filename> directory is located in
301             <filename>/dos/windows</filename>, then use:
302             <programlisting>"Windows" = "c:\\windows"</programlisting>
303           </para>
304           <para>
305             This sets up the <filename>windows</filename> directory.
306             Make one if you don't already have one. NO TRAILING SLASH
307             (NOT <filename>C:\\windows\</filename>)!
308           </para>
309           <para>
310             <programlisting>"System" = "c:\\windows\\system"</programlisting>
311             This sets up where the windows system files are. Should
312             reside in the directory used for the
313             <literal>Windows</literal> setting. If you don't have
314             <filename>windows</filename> then this is where the system
315             files will go. Again, NO TRAILING SLASH!
316           </para>
317           <para>
318             <programlisting>"Temp" = "c:\\temp"</programlisting> This should
319             be the directory you want your temp files stored in. YOU
320             MUST HAVE WRITE ACCESS TO IT.
321           </para>
322           <para>
323             <programlisting>
324 "Path" = "c:\\windows;c:\\windows\\system;c:\\blanco"
325             </programlisting>
326           </para>
327           <para>
328             Behaves like the <envar>PATH</envar> setting on UNIX
329             boxes. When wine is run like <userinput>wine
330               sol.exe</userinput>, if <filename>sol.exe</filename>
331             resides in a directory specified in the
332             <literal>Path</literal> setting, wine will run it (Of
333             course, if <filename>sol.exe</filename> resides in the
334             current directory, wine will run that one). Make sure it
335             always has your <filename>windows</filename> directory and
336             system directory (For this setup, it must have
337             <filename>"c:\\windows;c:\\windows\\system"</filename>).
338           </para>
339           <para>
340             <programlisting>"SymbolTableFile" = "wine.sym"</programlisting>
341             Sets up the symbol table file for the wine debugger. You
342             probably don't need to fiddle with this. May be useful if
343             your wine is stripped.
344           </para>
345           <para>
346             <programlisting>"printer" = "off|on"</programlisting> Tells wine
347             whether to allow printer drivers and printing to work.
348             Using these things are pretty alpha, so you might want to
349             watch out. Some people might find it useful, however. If
350             you're not planning on working on printing, don't even add
351             this to your <filename>~/.wine/config</filename> (It probably
352             isn't already in it). Check out the [spooler] and
353             [parallelports] sections too.
354           </para>
355         </sect3>
356
357         <sect3>
358           <title>Introduction To DLL Sections</title>
359           <para>
360             There are a few things you will need to know before
361             configuring the DLL sections in your wine configuration
362             file.
363           </para>
364           <sect4>
365             <title>Windows DLL Pairs</title>
366             <para>
367               Most windows DLL's have a win16 (Windows 3.x) and win32
368               (Windows 9x/NT) form.  The combination of the win16 and
369               win32 DLL versions are called the "DLL pair". This is a
370               list of the most common pairs:
371             </para>
372
373             <informaltable>
374               <tgroup cols="3">
375                 <thead>
376                   <row>
377                     <entry>Win16</entry>
378                     <entry>Win32</entry>
379                     <entry>
380                       Native
381                       <footnote>
382                         <para>
383                           Is it possible to use native dll with wine?
384                           (See next section)
385                         </para>
386                       </footnote>
387                     </entry>
388                   </row>
389                 </thead>
390                 <tbody>
391                   <row>
392                     <entry>KERNEL</entry>
393                     <entry>KERNEL32</entry>
394                     <entry>No!</entry>
395                   </row>
396                   <row>
397                     <entry>USER</entry>
398                     <entry>USER32</entry>
399                     <entry>No!</entry>
400                   </row>
401                   <row>
402                     <entry>SHELL</entry>
403                     <entry>SHELL32</entry>
404                     <entry>Yes</entry>
405                   </row>
406                   <row>
407                     <entry>GDI</entry>
408                     <entry>GDI32</entry>
409                     <entry>No!</entry>
410                   </row>
411                   <row>
412                     <entry>COMMDLG</entry>
413                     <entry>COMDLG32</entry>
414                     <entry>Yes</entry>
415                   </row>
416                   <row>
417                     <entry>VER</entry>
418                     <entry>VERSION</entry>
419                     <entry>Yes</entry>
420                   </row>
421                 </tbody>
422               </tgroup>
423             </informaltable>
424           </sect4>
425
426           <sect4>
427             <title>Different Forms Of DLL's</title>
428             <para>
429               There are a few different forms of DLL's wine can load:
430               <variablelist>
431                 <varlistentry>
432                   <term>native</term>
433                   <listitem><para>
434                       The DLL's that are included with windows. Many
435                       windows DLL's can be loaded in their native
436                       form. Many times these native versions work
437                       better than their non-Microsoft equivalent --
438                       other times they don't.
439                     </para></listitem>
440                 </varlistentry>
441                 <varlistentry>
442                   <term>elfdll</term>
443                   <listitem><para>
444                       ELF encapsulated windows DLL's. This is currently
445                       experimental (Not working yet).
446                     </para></listitem>
447                 </varlistentry>
448                 <varlistentry>
449                   <term>so</term>
450                   <listitem><para>
451                       Native ELF libraries. Will not work yet.
452                     </para></listitem>
453                 </varlistentry>
454                 <varlistentry>
455                   <term>builtin</term>
456                   <listitem><para>
457                       The most common form of DLL loading. This is
458                       what you will use if the DLL is error-prone in
459                       native form (KERNEL for example), you don't have
460                       the native DLL, or you just want to be
461                       Microsoft-free.
462                     </para></listitem>
463                 </varlistentry>
464               </variablelist>
465             </para>
466           </sect4>
467         </sect3>
468
469         <sect3>
470           <title>The [DllDefaults] Section</title>
471           <para>
472             These settings provide wine's default handling of DLL loading.
473           </para>
474           <para>
475             <programlisting>"DefaultLoadOrder" =" native, so, builtin"</programlisting>
476           </para>
477           <para>
478             This setting is a comma-delimited list of which order to
479             attempt loading DLL's. If the first option fails, it will
480             try the second, and so on. The order specified above is
481             probably the best in most conditions.
482           </para>
483         </sect3>
484
485         <sect3>
486           <title>The [DllPairs] Section</title>
487           <para>
488           At one time, there was a section called [DllPairs] in the 
489           default configuration file, but this has been obsoleted
490           because the pairing information has now been embedded into
491           Wine itself. (The purpose of this section was merely to be
492           able to issue warnings if the user attempted to pair
493           codependent 16-bit/32-bit DLLs of different types.) If you
494           still have this in your <filename>wine.conf</filename> or
495           <filename>~/.wine/config</filename>, you may safely delete it.
496           </para>
497         </sect3>
498
499         <sect3>
500           <title>The [DllOverrides] Section</title>
501           <para>
502             The format for this section is the same for each line:
503             <programlisting>
504 &lt;DLL>{,&lt;DLL>,&lt;DLL>...} = &lt;FORM>{,&lt;FORM>,&lt;FORM>...}
505             </programlisting>
506           </para>
507           <para>
508             For example, to load builtin KERNEL pair (case doesn't
509             matter here):
510             <programlisting>
511 "kernel,kernel32" = "builtin"
512             </programlisting>
513           </para>
514           <para>
515             To load the native COMMDLG pair, but if that doesn't work
516             try builtin:
517             <programlisting>
518 "commdlg,comdlg32" = "native,builtin"
519             </programlisting>
520           </para>
521           <para>
522             To load the native COMCTL32:
523             <programlisting>
524 "comctl32" = "native"
525             </programlisting>
526           </para>
527           <para>
528             Here is a good generic setup (As it is defined in config
529             that was included with your wine package):
530             <programlisting>
531 [DllOverrides]
532 "commdlg"      = "builtin, native"
533 "comdlg32"     = "builtin, native"
534 "ver"          = "builtin, native"
535 "version"      = "builtin, native"
536 "shell"        = "builtin, native"
537 "shell32"      = "builtin, native"
538 "lzexpand"     = "builtin, native"
539 "lz32"         = "builtin, native"
540 "comctl32"     = "builtin, native"
541 "commctrl"     = "builtin, native"
542 "wsock32"      = "builtin"
543 "winsock"      = "builtin"
544 "advapi32"     = "builtin, native"
545 "crtdll"       = "builtin, native"
546 "mpr"          = "builtin, native"
547 "winspool.drv" = "builtin, native"
548 "ddraw"        = "builtin, native"
549 "dinput"       = "builtin, native"
550 "dsound"       = "builtin, native"
551 "mmsystem"     = "builtin"
552 "winmm"        = "builtin"
553 "msvcrt"       = "native, builtin"
554 "msvideo"      = "builtin, native"
555 "msvfw32"      = "builtin, native"
556 "mcicda.drv"   = "builtin, native"
557 "mciseq.drv"   = "builtin, native"
558 "mciwave.drv"  = "builtin, native"
559 "mciavi.drv"   = "native, builtin"
560 "mcianim.drv"  = "native, builtin"
561 "msacm.drv"    = "builtin, native"
562 "msacm"        = "builtin, native"
563 "msacm32"      = "builtin, native"
564 "midimap.drv"  = "builtin, native"
565 "wnaspi32"     = "builtin"
566 "icmp"         = "builtin"
567             </programlisting>
568           </para>
569           <note>
570             <para>
571               You see that elfdll or so is the first option for a few
572               of these dll's. This will fail for you, but you won't
573               notice it as wine will just use the second or third
574               option.
575             </para>
576           </note>
577         </sect3>
578
579         <sect3>
580           <title>The [options] Section</title>
581           <para>
582             No one seems to know what this section is...
583           </para>
584           <para>
585             <programlisting>
586 "AllocSystemColors" = "100"
587             </programlisting>
588             System colors to allocate? Just leave it at 100.
589           </para>
590         </sect3>
591
592         <sect3>
593           <title>The [fonts] Section</title>
594           <para>
595             This section sets up wine's font handling.
596           </para>
597           <para>
598             <programlisting>"Resolution" = "96"</programlisting>
599           </para>
600           <para>
601             Since the way X handles fonts is different from the way
602             Windows does, wine uses a special mechanism to deal with
603             them. It must scale them using the number defined in the
604             "Resolution" setting. 60-120 are reasonable values, 96 is
605             a nice in the middle one. If you have the real windows
606             fonts available (<filename>&lt;dirs to
607               wine>/documentation/ttfserver</filename> and
608             <filename>fonts</filename>), this parameter will not be as
609             important. Of course, it's always good to get your X fonts
610             working acceptably in wine.
611           </para>
612           <para>
613             <programlisting>"Default" = "-adobe-times-"</programlisting>
614             The default font wine uses. Fool around with it if you'd like.
615           </para>
616           <para>
617 OPTIONAL: 
618           </para>
619           <para>
620             The <literal>Alias</literal> setting allows you to map an X font to a font
621             used in wine. This is good for apps that need a special font you don't have,
622             but a good replacement exists. The syntax is like so:
623             <programlisting>
624 "AliasX" = "[Fake windows name],[Real X name]"&lt;,optional "masking" section>
625             </programlisting>
626           </para>
627           <para>
628             Pretty straightforward. Replace "AliasX" with "Alias0",
629             then "Alias1" and so on. The fake windows name is the name
630             that the font will be under a windows app in wine. The
631             real X name is the font name as seen by X (Run
632             "xfontsel"). The optional "masking" section allows you to
633             utilize the fake windows name you define. If it is not
634             used, then wine will just try to extract the fake windows
635             name itself and not use the value you enter.
636           </para>
637           <para>
638             Here is an example of an alias without masking. The font will show up in windows
639             apps as "Google". When defining an alias in a config file, forget about my
640             comment text (The "&lt;-- blah" stuff)
641             <programlisting>
642 "Alias0" = "Foo,--google-"      &lt;
643             </programlisting>
644           </para>
645           <para>
646             Here is an example with masking enabled. The font will show up as "Foo" in
647             windows apps.
648             <programlisting>
649 "Alias1" = "Foo,--google-,subst"
650             </programlisting>
651           </para>
652           <para>
653             For more info check out <filename>&lt;dirs to wine>/documentation/fonts</filename>
654           </para>
655         </sect3>
656
657         <sect3>
658           <title>The [serialports], [parallelports], [spooler], and [ports] Sections</title>
659           <para>
660             Even though it sounds like a lot of sections, these are
661             all closely related. They are all for communications and
662             parallel ports. 
663           </para>
664           <para>
665             The [serialports] section tells wine what serial ports it
666             is allowed to use.
667             <programlisting>"ComX" = "/dev/cuaY"</programlisting>
668           </para>
669           <para>
670             Replace <literal>X</literal> with the number of the COM
671             port in Windows (1-8) and <literal>Y</literal> with the
672             number of it in <literal>X</literal> (Usually the number
673             of the port in Windows minus 1). <literal>ComX</literal>
674             can actually equal any device
675             (<medialabel>/dev/modem</medialabel> is acceptable). It is
676             not always necessary to define any COM ports (An optional
677             setting). Here is an example:
678             <programlisting>"Com1" = "/dev/cua0"</programlisting>
679           </para>
680           <para>
681             Use as many of these as you like in the section to define
682             all of the COM ports you need.
683           </para>
684           <para>
685             The [parallelports] section sets up any parallel ports
686             that will be allowed access under wine.
687             <programlisting>"LptX" = "/dev/lpY"</programlisting>
688           </para>
689           <para>
690             Sounds familiar? Syntax is just like the COM port setting.
691             Replace <literal>X</literal> with a value from 1-4 as it
692             is in Windows and <literal>Y</literal> with a value from
693             0-3 (<literal>Y</literal> is usually the value in windows
694             minus 1, just like for COM ports). You don't always need
695             to define a parallel port (AKA, it's optional). As with
696             the other section, LptX can equal  any device (Maybe
697             <medialabel>/dev/printer</medialabel>). Here is an
698             example:  <programlisting>"Lpt1" = "/dev/lp0"</programlisting>
699           </para>
700           <para>
701             The [spooler] section will inform wine where to spool
702             print jobs. Use this if you want to try printing. Wine
703             docs claim that spooling is "rather primitive" at this
704             time, so it won't work perfectly. IT IS OPTIONAL. The only
705             setting you use in this section works to map a port (LPT1,
706             for example) to a file or a command. Here is an example,
707             mapping LPT1 to the file <filename>out.ps</filename>: 
708             <programlisting>"LPT1:" = "out.ps"</programlisting>
709           </para>
710           <para>
711             The following command maps printing jobs to LPT1 to the
712             command <command>lpr</command>. Notice  the |: 
713             <programlisting>"LPT1:" = "|lpr"</programlisting>
714           </para>
715           <para>
716             The [ports] section is usually useful only for people who
717             need direct port access for programs requiring dongles or
718             scanners. IF YOU DON'T NEED IT, DON'T USE IT! 
719           </para>
720           <para>
721             <programlisting>"read" = "0x779,0x379,0x280-0x2a0"</programlisting>
722             Gives direct read access to those IO's.
723           </para>
724           <para>
725             <programlisting>"write" = "0x779,0x379,0x280-0x2a0"</programlisting>
726             Gives direct write access to those IO's. It's probably a
727             good idea to keep the values of the
728             <literal>read</literal> and <literal>write</literal>
729             settings the same. This stuff will only work when you're
730             root.
731           </para>
732         </sect3>
733
734         <sect3>
735           <title>The [spy], [Registry], [tweak.layout], and [programs] Sections</title>
736           <para>
737             [spy] is used to include or exclude debug messages, and to
738             output them to a file. The latter is rarely used. THESE
739             ARE ALL OPTIONAL AND YOU PROBABLY DON'T NEED TO ADD OR
740             REMOVE ANYTHING IN THIS SECTION TO YOUR CONFIG.
741           </para>
742           <para>
743             <programlisting>"File" = "/blanco"</programlisting>
744             Sets the logfile for wine. Set to CON to log to standard out.
745             THIS IS RARELY USED.
746           </para>
747           <para>
748             <programlisting>"Exclude" = "WM_SIZE;WM_TIMER;"</programlisting>
749             Excludes debug messages about <constant>WM_SIZE</constant>
750             and <constant>WM_TIMER</constant> in the logfile.
751           </para>
752           <para>
753             <programlisting>"Include" = "WM_SIZE;WM_TIMER;"</programlisting>
754             Includes debug messages about <constant>WM_SIZE</constant>
755             and <constant>WM_TIMER</constant> in the logfile.
756           </para>
757           <para>
758             [Registry] can be used to tell wine where your old windows
759             registry files exist. This section is completely optional
760             and useless to people using wine without an existing
761             windows installation.
762           </para>
763           <para>
764             <programlisting>"UserFileName" = "/dirs/to/user.reg"</programlisting>
765             The location of your old <filename>user.reg</filename> file.
766           </para>
767           <para>
768             [tweak.layout] is devoted to wine's look. There is only
769             one setting for it.
770           </para>
771           <para>
772             <programlisting>"WineLook" = "win31|win95|win98"</programlisting>
773             Will change the look of wine from Windows 3.1 to Windows 95.
774             The <literal>win98</literal> setting behaves
775             just like <literal>win95</literal> most of the time.
776           </para>
777           <para>
778             [programs] can be used to say what programs run under
779             special conditions.
780           </para>
781           <para>
782             <programlisting>"Default" = "/program/to/execute.exe"</programlisting>
783             Sets the program to be run if wine is started without specifying a program.
784           </para>
785           <para>
786             <programlisting>"Startup" = "/program/to/execute.exe"</programlisting>
787             Sets the program to automatically be run at startup every time.
788           </para>
789         </sect3>
790
791         <sect3>
792           <title>The [WinMM] Section</title>
793           <para>
794             [WinMM] is used to define which multimedia drivers have to be loaded. Since
795             those drivers may depend on the multimedia interfaces available on your sustem
796             (OSS, Alsa... to name a few), it's needed to be able to configure which driver
797             has to be loaded.
798           </para>
799
800           <para>
801             The content of the section looks like:
802             <programlisting> 
803 [WinMM]
804 "Drivers" = "wineoss.drv"
805 "WaveMapper" = "msacm.drv"
806 "MidiMapper" = "midimap.drv"
807             </programlisting> 
808             All the keys must be defined:
809             <itemizedlist>
810               <listitem>
811                 <para>
812                   The "Drivers" key is a ';' separated list of modules name, each of 
813                   them containing a low level driver. All those drivers will be loaded 
814                   when MMSYSTEM/WINMM is started and will provide their inner features.
815                 </para>
816               </listitem>
817               <listitem>
818                 <para>
819                   The "WaveMapper" represents the name of the module containing the Wave
820                   Mapper driver. Only one wave mapper can be defined in the system.
821                 </para>
822               </listitem>
823               <listitem>
824                 <para>
825                   The "MidiMapper" represents the name of the module containing the Midi 
826                   Mapper driver. Only one Midi mapper can be defined in the system.
827                 </para>
828               </listitem>
829             </itemizedlist>
830           </para>
831         </sect3>
832       </sect2>
833
834       <sect2>
835         <title>Where Do I Put It?</title>
836         <para>
837           The wine config file can go in two places.
838         </para>
839         <variablelist>
840           <varlistentry>
841             <term><filename>/usr/local/etc/wine.conf</filename></term>
842             <listitem><para>
843                 A systemwide config file, used for anyone who doesn't
844                 have their own. NOTE: this file is currently unused as a
845                 new global configuration mechanism is not in place at this
846                 time
847             </para></listitem>
848           </varlistentry>
849           <varlistentry>
850             <term><filename>$HOME/.wine/config</filename></term>
851             <listitem><para>
852                 Your own config file, that only is used for your user. 
853             </para></listitem>
854           </varlistentry>
855         </variablelist>
856         <para>
857           So copy your version of the <filename>wine.conf</filename> file to
858           <filename>/usr/local/etc/wine.conf</filename> or
859           <filename>$HOME/.wine/config</filename> for wine to recognize
860           it. 
861         </para>
862       </sect2>
863
864       <sect2>
865         <title>What If It Doesn't Work?</title>
866         <para>
867           There is always a chance that things will go wrong. If the
868           unthinkable happens,  try the newsgroup,
869           <systemitem>comp.emulators.ms-windows.wine</systemitem>,
870           or the IRCnet channel <systemitem>#WineHQ</systemitem> found on
871           irc.stealth.net:6668,  or connected servers.
872           Make sure that you have looked over this document thoroughly,
873           and have also read:
874         </para>
875         <itemizedlist>
876           <listitem>
877             <para><filename>README</filename></para>
878           </listitem>
879           <listitem>
880             <para>
881               <filename>http://www.la-sorciere.de/wine/index.html</filename>
882               (optional but recommended)
883             </para>
884           </listitem>
885         </itemizedlist>
886         <para>
887           If indeed it looks like you've done your research, be
888           prepared for helpful suggestions. If you haven't, brace
889           yourself for heaving flaming.
890         </para>
891       </sect2>
892     </sect1>
893
894     <sect1 id="win95look">
895       <title>Win95/98 Look</title>
896       <para>
897         Written by &name-david-cuthbert; <email>&email-david-cuthbert;</email>
898       </para>
899       <para>
900         (Extracted from <filename>wine/documentation/win95look</filename>)
901       </para>
902       <para>
903         Win95/Win98 interface code is being introduced.
904       </para>
905       <para>
906         Instead of compiling Wine for Win3.1 vs. Win95 using
907         <constant>#define</constant> switches, the code now looks in a
908         special [Tweak.Layout] section of
909         <filename>~/.wine/config</filename> for a
910         <literal>"WineLook" = "Win95"</literal> or
911         <literal>"WineLook" = "Win98"</literal> entry.
912       </para>
913       <para>
914         A few new sections and a number of entries have been added to
915         the <filename>~/.wine/config</filename> file -- these are for
916         debugging the Win95 tweaks only and may be removed in a future
917         release!  These entries/sections are:
918       </para>
919       <programlisting>
920 [Tweak.Fonts]
921 "System.Height" = "&lt;point size>"    # Sets the height of the system typeface
922 "System.Bold" = "[true|false]"      # Whether the system font should be boldfaced
923 "System.Italic" = "[true|false]"    # Whether the system font should be italicized
924 "System.Underline" = "[true|false]" # Whether the system font should be underlined
925 "System.StrikeOut" = "[true|false]" # Whether the system font should be struck out
926 "OEMFixed.xxx"                  # Same parameters for the OEM fixed typeface
927 "AnsiFixed.xxx"                 # Same parameters for the Ansi fixed typeface
928 "AnsiVar.xxx"                   # Same parameters for the Ansi variable typeface
929 "SystemFixed.xxx"               # Same parameters for the System fixed typeface
930
931 [Tweak.Layout]
932 "WineLook" = "[Win31|Win95|Win98]"  # Changes Wine's look and feel
933       </programlisting>
934     </sect1>
935
936     <sect1 id="x11drv">
937       <title>Configuring the x11drv Driver</title>
938
939       <para>
940         Written by &name-ove-kaaven; <email>&email-ove-kaaven;</email>
941       </para>
942       <para>
943         (Extracted from <filename>wine/documentation/cdrom-labels</filename>)
944       </para>
945
946       <para>
947         Most Wine users run Wine under the windowing system known as
948         X11. During most of Wine's history, this was the only display
949         driver available, but in recent years, parts of Wine has been
950         reorganized to allow for other display drivers (although the
951         only alternative currently available is Patrik Stridvall's
952         ncurses-based ttydrv, which he claims works for displaying
953         calc.exe). The display driver is chosen with the
954         <literal>GraphicsDriver</literal> option in the [wine] section
955         of <filename>~/.wine/config</filename>, but I will only cover the
956         x11drv driver in this article.
957       </para>
958
959       <sect2>
960         <title>x11drv modes of operation</title>
961
962         <para>
963           <!-- FIXME: This is outdated -->
964           Note: This is now all done in the config file. Needs an update...
965         </para>
966
967         <para>
968           The x11drv driver consists of two conceptually distinct
969           pieces, the graphics driver (GDI part), and the windowing
970           driver (USER part). Both of these are linked into the
971           <filename>libx11drv.so</filename> module, though (which you
972           load with the <literal>GraphicsDriver</literal> option). In
973           Wine, running on X11, the graphics driver must draw on
974           drawables (window interiors) provided by the windowing
975           driver. This differs a bit from the Windows model, where the
976           windowing system creates and configures device contexts
977           controlled by the graphics driver, and applications are
978           allowed to hook into this relationship anywhere they like.
979           Thus, to provide any reasonable tradeoff between
980           compatibility and usability, the x11drv has three different
981           modes of operation.
982         </para>
983
984         <variablelist>
985           <varlistentry>
986             <term>Unmanaged/Normal</term>
987             <listitem>
988               <para>
989                 The default. Window-manager-independent (any running
990                 window manager is ignored completely). Window
991                 decorations (title bars, borders, etc) are drawn by
992                 Wine to look and feel like the real Windows. This is
993                 compatible with applications that depend on being able
994                 to compute the exact sizes of any such decorations, or
995                 that want to draw their own.
996               </para>
997             </listitem>
998           </varlistentry>          
999           <varlistentry>
1000             <term>Managed</term>
1001             <listitem>
1002               <para>
1003                 Specified by using the
1004                 <parameter>--managed</parameter> command-line option
1005                 or the <literal>Managed</literal>
1006                 <filename>wine.conf</filename> option (see below).
1007                 Ordinary top-level frame windows with thick borders,
1008                 title bars, and system menus will be managed by your
1009                 window manager. This lets these applications integrate
1010                 better with the rest of your desktop, but may not
1011                 always work perfectly. (A rewrite of this mode of
1012                 operation, to make it more robust and less patchy, is
1013                 highly desirable, though, and is planned to be done
1014                 before the Wine 1.0 release.)
1015               </para>
1016             </listitem>
1017           </varlistentry>
1018           <varlistentry>
1019             <term>Desktop-in-a-Box</term>
1020             <listitem>
1021               <para>
1022                 Specified by using the
1023                 <parameter>--desktop</parameter> command-line option
1024                 (with a geometry, e.g. <parameter>--desktop
1025                   800x600</parameter> for a such-sized desktop, or
1026                 even <parameter>--desktop 800x600+0+0</parameter> to
1027                 automatically position the desktop at the upper-left
1028                 corner of the display). This is the mode most
1029                 compatible with the Windows model. All application
1030                 windows will just be Wine-drawn windows inside the
1031                 Wine-provided desktop window (which will itself be
1032                 managed by your window manager), and Windows
1033                 applications can roam freely within this virtual
1034                 workspace and think they own it all, without
1035                 disturbing your other X apps.
1036               </para>
1037             </listitem>
1038           </varlistentry>
1039         </variablelist>
1040       </sect2>
1041
1042       <sect2>
1043         <title>The [x11drv] section</title>
1044
1045         <variablelist>
1046           <varlistentry>
1047             <term>AllocSystemColors</term>
1048             <listitem>
1049               <para>
1050                 Applies only if you have a palette-based display, i.e.
1051                 if your X server is set to a depth of 8bpp, and if you
1052                 haven't requested a private color map. It specifies
1053                 the maximum number of shared colormap cells (palette
1054                 entries) Wine should occupy. The higher this value,
1055                 the less colors will be available to other
1056                 applications.
1057               </para>
1058             </listitem>
1059           </varlistentry>          
1060           <varlistentry>
1061             <term>PrivateColorMap</term>
1062             <listitem>
1063               <para>
1064                 Applies only if you have a palette-based display, i.e.
1065                 if your X server is set to a depth of 8bpp. It
1066                 specifies that you don't want to use the shared color
1067                 map, but a private color map, where all 256 colors are
1068                 available. The disadvantage is that Wine's private
1069                 color map is only seen while the mouse pointer is
1070                 inside a Wine window, so psychedelic flashing and
1071                 funky colors will become routine if you use the mouse
1072                 a lot.
1073               </para>
1074             </listitem>
1075           </varlistentry>          
1076           <varlistentry>
1077             <term>PerfectGraphics</term>
1078             <listitem>
1079               <para>
1080                 This option only determines whether fast X11 routines
1081                 or exact Wine routines will be used for certain ROP
1082                 codes in blit operations. Most users won't notice any
1083                 difference.
1084               </para>
1085             </listitem>
1086           </varlistentry>          
1087           <varlistentry>
1088             <term>ScreenDepth</term>
1089             <listitem>
1090               <para>
1091                 Applies only to multi-depth displays. It specifies
1092                 which of the available depths Wine should use (and
1093                 tell Windows apps about).
1094               </para>
1095             </listitem>
1096           </varlistentry>          
1097           <varlistentry>
1098             <term>Display</term>
1099             <listitem>
1100               <para>
1101                 This specifies which X11 display to use, and if
1102                 specified, will override both the
1103                 <envar>DISPLAY</envar> environment variable and the
1104                 <parameter>--display</parameter> command-line option.
1105               </para>
1106             </listitem>
1107           </varlistentry>          
1108           <varlistentry>
1109             <term>Managed</term>
1110             <listitem>
1111               <para>
1112                 Wine can let frame windows be managed by your window
1113                 manager. This option specifies whether you want that
1114                 by default.
1115               </para>
1116             </listitem>
1117           </varlistentry>          
1118           <varlistentry>
1119             <term>UseDGA</term>
1120             <listitem>
1121               <para>
1122                 This specifies whether you want DirectDraw to use
1123                 XFree86's <firstterm>Direct Graphics
1124                   Architecture</firstterm> (DGA), which is able to
1125                 take over the entire display and run the game
1126                 full-screen at maximum speed. (With DGA1 (XFree86
1127                 3.x), you still have to configure the X server to the
1128                 game's requested bpp first, but with DGA2 (XFree86
1129                 4.x), runtime depth-switching may be possible,
1130                 depending on your driver's capabilities.) But be aware
1131                 that if Wine crashes while in DGA mode, it may not be
1132                 possible to regain control over your computer without
1133                 rebooting. DGA normally requires either root
1134                 privileges or read/write access to
1135                 <filename>/dev/mem</filename>.
1136               </para>
1137             </listitem>
1138           </varlistentry>          
1139           <varlistentry>
1140             <term>UseXShm</term>
1141             <listitem>
1142               <para>
1143                 If you don't want DirectX to use DGA, you can at least
1144                 use X Shared Memory extensions (XShm). It is much
1145                 slower than DGA, since the app doesn't have direct
1146                 access to the physical frame buffer, but using shared
1147                 memory to draw the frame is at least faster than
1148                 sending the data through the standard X11 socket, even
1149                 though Wine's XShm support is still known to crash
1150                 sometimes.
1151               </para>
1152             </listitem>
1153           </varlistentry>          
1154           <varlistentry>
1155             <term>DXGrab</term>
1156             <listitem>
1157               <para>
1158                 If you don't use DGA, you may want an alternative
1159                 means to convince the mouse cursor to stay within the
1160                 game window. This option does that. Of course, as with
1161                 DGA, if Wine crashes, you're in trouble (although not
1162                 as badly as in the DGA case, since you can still use
1163                 the keyboard to get out of X).
1164               </para>
1165             </listitem>
1166           </varlistentry>          
1167           <varlistentry>
1168             <term>DesktopDoubleBuffered</term>
1169             <listitem>
1170               <para>
1171                 Applies only if you use the
1172                 <parameter>--desktop</parameter> command-line option
1173                 to run in a desktop window. Specifies whether to
1174                 create the desktop window with a double-buffered
1175                 visual, something most OpenGL games need to run
1176                 correctly.
1177               </para>
1178             </listitem>
1179           </varlistentry>
1180           <varlistentry>
1181             <term>TextCP</term>
1182             <listitem>
1183               <para>
1184                 <!-- FIXME: To be documented -->
1185                 To be documented...
1186               </para>
1187             </listitem>
1188           </varlistentry>
1189           <varlistentry>
1190             <term>XVideoPort</term>
1191             <listitem>
1192               <para>
1193                 <!-- FIXME: To be documented -->
1194                 To be documented...
1195               </para>
1196             </listitem>
1197           </varlistentry>
1198           <varlistentry>
1199             <term>Synchronous</term>
1200             <listitem>
1201               <para>
1202                 <!-- FIXME: To be documented -->
1203                 To be documented...
1204               </para>
1205             </listitem>
1206           </varlistentry>
1207         </variablelist>
1208       </sect2>          
1209     </sect1>
1210
1211     &registry;
1212
1213     <sect1 id="cdrom-labels">
1214       <sect1info>
1215         <authorgroup>
1216           <author>
1217             <firstname>Petr</firstname>
1218             <surname>Tomasek</surname>
1219             <affiliation>
1220               <address><email>&email-petr-tomasek;</email></address>
1221             </affiliation>
1222             <contrib>Nov 14 1999</contrib>
1223           </author>
1224           <author>
1225             <firstname>Andreas</firstname>
1226             <surname>Mohr</surname>
1227             <affiliation>
1228               <address><email>&email-andreas-mohr;</email></address>
1229             </affiliation>
1230             <contrib>Jan 25 2000</contrib>
1231           </author>
1232         </authorgroup>
1233       </sect1info>
1234
1235       <title>Drive labels and serial numbers with wine</title>
1236       <para>
1237         Written by &name-petr-tomasek; <email>&email-petr-tomasek;</email>
1238         Nov 14 1999
1239       </para>
1240       <para>
1241         Changes by &name-andreas-mohr; <email>&email-andreas-mohr;</email>
1242         Jan 25 2000
1243       </para>
1244       <para>
1245         (Extracted from <filename>wine/documentation/cdrom-labels</filename>)
1246       </para>
1247       <para>
1248         Until now, your only possibility of specifying drive volume
1249         labels and serial numbers was to set them manually in the wine
1250         config file. By now, wine can read them directly from the
1251         device as well. This may be useful for many Win 9x games or
1252         for setup programs distributed on CD-ROMs that check for
1253         volume label.
1254       </para>
1255
1256       <sect2>
1257         <title>What's Supported?</title>
1258
1259         <informaltable frame="all">
1260           <tgroup cols="3">
1261             <thead>
1262               <row>
1263                 <entry>File System</entry>
1264                 <entry>Types</entry>
1265                 <entry>Comment</entry>
1266               </row>
1267             </thead>
1268             <tbody>
1269               <row>
1270                 <entry>FAT systems</entry>
1271                 <entry>hd, floppy</entry>
1272                 <entry>reads labels and serial numbers</entry>
1273               </row>
1274               <row>
1275                 <entry>ISO9660</entry>
1276                 <entry>cdrom</entry>
1277                 <entry>reads labels only</entry>
1278               </row>
1279             </tbody>
1280           </tgroup>
1281         </informaltable>
1282
1283       </sect2>
1284
1285       <sect2>
1286         <title>How To Set Up?</title>
1287         <para>
1288           Reading labels and serial numbers just works automagically
1289           if you specify a <literal>Device=</literal> line in the
1290           [Drive X] section in your <filename>~/.wine/config</filename>.
1291           Note that the device has to exist and must be accessible if
1292           you do this, though.
1293         </para>
1294         <para>
1295           If you don't do that, then you should give fixed
1296           <literal>"Label" =</literal> or <literal>"Serial" =</literal>
1297           entries in <filename>~./wine/config</filename>, as Wine returns
1298           these entries instead if no device is given. If they don't
1299           exist, then Wine will return default values (label
1300           <literal>Drive X</literal> and serial
1301           <literal>12345678</literal>).
1302         </para>
1303         <para>
1304           If you want to give a <literal>"Device" =</literal> entry
1305           <emphasis>only</emphasis> for drive raw sector accesses,
1306           but not for reading the volume info from the device (i.e. you want
1307           a <emphasis>fixed</emphasis>, preconfigured label), you need
1308           to specify <literal>"ReadVolInfo" = "0"</literal> to tell Wine
1309           to skip the volume reading.
1310         </para>
1311       </sect2>
1312
1313       <sect2>
1314         <title>EXAMPLES</title>
1315         <para>
1316           Here's a simple example of cdrom and floppy; labels will be
1317           read from the device on both cdrom and floppy; serial
1318           numbers on floppy only:
1319         </para>
1320         <screen>
1321 [Drive A]
1322 "Path" = "/mnt/floppy"
1323 "Type" = "floppy"
1324 "Device" = "/dev/fd0"
1325 "Filesystem" = "msdos"
1326
1327 [Drive R]
1328 "Path" = "/mnt/cdrom"
1329 "Type" = "cdrom"
1330 "Device" = "/dev/hda1"
1331 "Filesystem" = "win95"
1332         </screen>
1333         <para>
1334           Here's an example of overriding the CD-ROM label:
1335         </para>
1336         <screen>
1337 [Drive J]
1338 "Path" = "/mnt/cdrom"
1339 "Type" = "cdrom"
1340 "Label" = "X234GCDSE"
1341 ; note that the device isn't really needed here as we have a fixed label
1342 "Device" = "/dev/cdrom"
1343 "Filesystem" = "msdos"
1344         </screen>
1345       </sect2>
1346
1347       <sect2>
1348         <title>Todo / Open Issues</title>
1349         <itemizedlist>
1350           <listitem> <para>
1351               The cdrom label can be read only if the data track of
1352               the disk resides in the first track and the cdrom is
1353               iso9660.
1354             </para> </listitem>
1355           <listitem> <para>
1356               Better checking for FAT superblock (it now checks only
1357               one byte). </para>
1358           </listitem>
1359           <listitem> <para>
1360               Support for labels/serial nums WRITING.
1361             </para> </listitem>
1362           <listitem> <para>
1363               Can the label be longer than 11 chars? (iso9660 has 32
1364               chars).
1365             </para> </listitem>
1366           <listitem> <para>
1367               What about reading ext2 volume label? ....
1368             </para> </listitem>
1369         </itemizedlist>
1370       </sect2>
1371     </sect1>
1372
1373     <sect1 id="dll-overrides">
1374       <title>Dll Overrides</title>
1375
1376       <para>
1377         Written by &name-ove-kaaven; <email>&email-ove-kaaven;</email>
1378       </para>
1379       <para>
1380         (Extracted from <filename>wine/documentation/dll-overrides</filename>)
1381       </para>
1382
1383       <para>
1384         The <filename>wine.conf</filename> directives [DllDefaults]
1385         and [DllOverrides] are the subject of some confusion. The
1386         overall purpose of most of these directives are clear enough,
1387         though - given a choice, should Wine use its own built-in
1388         DLLs, or should it use <filename>.DLL</filename> files found
1389         in an existing Windows installation? This document explains
1390         how this feature works.
1391       </para>
1392
1393       <sect2>
1394         <title>DLL types</title>
1395         <variablelist>
1396           <varlistentry>
1397             <term>native</term>
1398             <listitem> <para>
1399                 A "native" DLL is a <filename>.DLL</filename> file
1400                 written for the real Microsoft Windows.
1401               </para> </listitem>
1402           </varlistentry>
1403           <varlistentry>
1404             <term>builtin</term>
1405             <listitem> <para>
1406                 A "builtin" DLL is a Wine DLL. These can either be a
1407                 part of <filename>libwine.so</filename>, or more
1408                 recently, in a special <filename>.so</filename> file
1409                 that Wine is able to load on demand.
1410               </para> </listitem>
1411           </varlistentry>
1412           <varlistentry>
1413             <term>elfdll</term>
1414             <listitem> <para>
1415                 An "elfdll" is a Wine <filename>.so</filename> file
1416                 with a special Windows-like file structure that is as
1417                 close to Windows as possible, and that can also
1418                 seamlessly link dynamically with "native" DLLs, by
1419                 using special ELF loader and linker tricks. Bertho
1420                 Stultiens did some work on this, but this feature has
1421                 not yet been merged back into Wine (because of
1422                 political reasons and lack of time), so this DLL type
1423                 does not exist in the official Wine at this time. In
1424                 the meantime, the "builtin" DLL type gained some of
1425                 the features of elfdlls (such as dynamic loading), so
1426                 it's possible that "elfdll" functionality will be
1427                 folded into "builtin" at some point.
1428               </para> </listitem>
1429           </varlistentry>
1430           <varlistentry>
1431             <term>so</term>
1432             <listitem> <para>
1433                 A native Unix <filename>.so</filename> file, with
1434                 calling convention conversion thunks generated on the
1435                 fly as the library is loaded. This is mostly useful
1436                 for libraries such as "glide" that have exactly the
1437                 same API on both Windows and Unix.
1438               </para> </listitem>
1439           </varlistentry>
1440         </variablelist>          
1441       </sect2>
1442
1443       <sect2>
1444         <title>The [DllDefaults] section</title>
1445         <variablelist>
1446           <varlistentry>
1447             <term>DefaultLoadOrder</term>
1448             <listitem> <para>
1449                 This specifies in what order Wine should search for
1450                 available DLL types, if the DLL in question was not
1451                 found in the [DllOverrides] section.
1452               </para> </listitem>
1453           </varlistentry>
1454         </variablelist>
1455       </sect2>
1456
1457       <sect2>
1458         <title>The [DllPairs] section</title>
1459         <para>
1460           At one time, there was a section called [DllPairs] in the
1461           default configuration file, but this has been obsoleted
1462           because the pairing information has now been embedded into
1463           Wine itself. (The purpose of this section was merely to be
1464           able to issue warnings if the user attempted to pair
1465           codependent 16-bit/32-bit DLLs of different types.) If you
1466           still have this in your <filename>wine.conf</filename> or
1467           <filename>~/.wine/config</filename>, you may safely delete it.
1468         </para>
1469       </sect2>
1470
1471       <sect2>
1472         <title>The [DllOverrides] section</title>
1473         <para>
1474           This section specifies how you want specific DLLs to be
1475           handled, in particular whether you want to use "native" DLLs
1476           or not, if you have some from a real Windows configuration.
1477           Because builtins do not mix seamlessly with native DLLs yet,
1478           certain DLL dependencies may be problematic, but workarounds
1479           exist in Wine for many popular DLL configurations. Also see
1480           WWN's [16]Status Page to figure out how well your favorite
1481           DLL is implemented in Wine.
1482         </para>
1483         <para>
1484           It is of course also possible to override these settings by
1485           explictly using Wine's <parameter>--dll</parameter>
1486           command-line option (see the man page for details).  Some
1487           hints for choosing your optimal configuration (listed by
1488           16/32-bit DLL pair):
1489         </para>
1490         <variablelist>
1491           <varlistentry>
1492             <term>krnl386, kernel32</term>
1493             <listitem> <para>
1494                 Native versions of these will never work, so don't try. Leave
1495                 at <literal>builtin</literal>.
1496               </para> </listitem>
1497           </varlistentry>
1498           <varlistentry>
1499             <term>gdi, gdi32</term>
1500             <listitem> <para>
1501                 Graphics Device Interface. No effort has been made at trying to
1502                 run native GDI. Leave at <literal>builtin</literal>.
1503               </para> </listitem>
1504           </varlistentry>          
1505           <varlistentry>
1506             <term>user, user32</term>
1507             <listitem> <para>
1508                 Window management and standard controls. It was
1509                 possible to use Win95's <literal>native</literal>
1510                 versions at some point (if all other DLLs that depend
1511                 on it, such as comctl32 and comdlg32, were also run
1512                 <literal>native</literal>). However, this is no longer
1513                 possible after the Address Space Separation, so leave
1514                 at <literal>builtin</literal>.
1515               </para> </listitem>
1516           </varlistentry>
1517           <varlistentry>
1518             <term>ntdll</term>
1519             <listitem> <para>
1520                 NT kernel API. Although badly documented, the
1521                 <literal>native</literal> version of this will never
1522                 work. Leave at <literal>builtin</literal>.
1523               </para> </listitem>
1524           </varlistentry>
1525           <varlistentry>
1526             <term>w32skrnl</term>
1527             <listitem> <para>
1528                 Win32s (for Win3.x). The <literal>native</literal>
1529                 version will probably never work. Leave at
1530                 <literal>builtin</literal>.
1531               </para> </listitem>
1532           </varlistentry>
1533           <varlistentry>
1534             <term>wow32</term>
1535             <listitem> <para>
1536                 Win16 support library for NT. The
1537                 <literal>native</literal> version will probably never
1538                 work. Leave at <literal>builtin</literal>.
1539               </para> </listitem>
1540           </varlistentry>
1541           <varlistentry>
1542             <term>system</term>
1543             <listitem> <para>
1544                 Win16 kernel stuff. Will never work
1545                 <literal>native</literal>. Leave at
1546                 <literal>builtin</literal>.
1547               </para> </listitem>
1548           </varlistentry>          
1549           <varlistentry>
1550             <term>display</term>
1551             <listitem> <para>
1552                 Display driver. Definitely leave at <literal>builtin</literal>.
1553               </para> </listitem>
1554           </varlistentry>
1555           <varlistentry>
1556             <term>toolhelp</term>
1557             <listitem> <para>
1558                 Tool helper routines. This is rarely a source of problems.
1559                 Leave at <literal>builtin</literal>.
1560               </para> </listitem>
1561           </varlistentry>
1562           <varlistentry>
1563             <term>ver, version</term>
1564             <listitem> <para>
1565                 Versioning. Seldom useful to mess with.
1566               </para> </listitem>
1567           </varlistentry>
1568           <varlistentry>
1569             <term>advapi32</term>
1570             <listitem> <para>
1571                 Registry and security features. Trying the
1572                 <literal>native</literal> version of this may or may
1573                 not work.
1574               </para> </listitem>
1575           </varlistentry>
1576           <varlistentry>
1577             <term>commdlg, comdlg32</term>
1578             <listitem> <para>
1579                 Common Dialogs, such as color picker, font dialog,
1580                 print dialog, open/save dialog, etc. It is safe to try
1581                 <literal>native</literal>.
1582               </para> </listitem>
1583           </varlistentry>
1584           <varlistentry>
1585             <term>commctrl, comctl32</term>
1586             <listitem> <para>
1587                 Common Controls. This is toolbars, status bars, list controls,
1588                 the works. It is safe to try <literal>native</literal>.
1589               </para> </listitem>
1590           </varlistentry>
1591           <varlistentry>
1592             <term>shell, shell32</term>
1593             <listitem> <para>
1594                 Shell interface (desktop, filesystem, etc). Being one of the
1595                 most undocumented pieces of Windows, you may have luck with the
1596                 <literal>native</literal> version, should you need it.
1597               </para> </listitem>
1598           </varlistentry>          
1599           <varlistentry>
1600             <term>winsock, wsock32</term>
1601             <listitem> <para>
1602                 Windows Sockets. The <literal>native</literal> version
1603                 will not work under Wine, so leave at
1604                 <literal>builtin</literal>.
1605               </para> </listitem>
1606           </varlistentry>
1607           <varlistentry>
1608             <term>icmp</term>
1609             <listitem> <para>
1610                 ICMP routines for wsock32. As with wsock32, leave at
1611                 <literal>builtin</literal>.
1612               </para> </listitem>
1613           </varlistentry>
1614           <varlistentry>
1615             <term>mpr</term>
1616             <listitem> <para>
1617                 The <literal>native</literal> version may not work due
1618                 to thunking issues. Leave at
1619                 <literal>builtin</literal>.
1620               </para> </listitem>
1621           </varlistentry>
1622           <varlistentry>
1623             <term>lzexpand, lz32</term>
1624             <listitem> <para>
1625                 Lempel-Ziv decompression. Wine's
1626                 <literal>builtin</literal> version ought to work fine.
1627               </para> </listitem>
1628           </varlistentry>
1629           <varlistentry>
1630             <term>winaspi, wnaspi32</term>
1631             <listitem> <para>
1632                 Advanced SCSI Peripheral Interface. The
1633                 <literal>native</literal> version will probably never
1634                 work. Leave at <literal>builtin</literal>.
1635               </para> </listitem>
1636           </varlistentry>
1637           <varlistentry>
1638             <term>crtdll</term>
1639             <listitem> <para>
1640                 C Runtime library. The <literal>native</literal>
1641                 version will easily work better than Wine's on this
1642                 one.
1643               </para> </listitem>
1644           </varlistentry>
1645           <varlistentry>
1646             <term>winspool.drv</term>
1647             <listitem> <para>
1648                 Printer spooler. You are not likely to have more luck
1649                 with the <literal>native</literal> version.
1650               </para> </listitem>
1651           </varlistentry>
1652           <varlistentry>
1653             <term>ddraw</term>
1654             <listitem> <para>
1655                 DirectDraw/Direct3D. Since Wine does not implement the
1656                 DirectX HAL, the <literal>native</literal> version
1657                 will not work at this time.
1658               </para> </listitem>
1659           </varlistentry>
1660           <varlistentry>
1661             <term>dinput</term>
1662             <listitem> <para>
1663                 DirectInput. Running this <literal>native</literal>
1664                 may or may not work.
1665               </para> </listitem>
1666           </varlistentry>          
1667           <varlistentry>
1668             <term>dsound</term>
1669             <listitem> <para>
1670                 DirectSound. It may be possible to run this
1671                 <literal>native</literal>, but don't count on it.
1672               </para> </listitem>
1673           </varlistentry>
1674           <varlistentry>
1675             <term>dplay/dplayx</term>
1676             <listitem> <para>
1677                 DirectPlay. The <literal>native</literal> version
1678                 ought to work best on this, if at all.
1679               </para> </listitem>
1680           </varlistentry>
1681           <varlistentry>
1682             <term>mmsystem, winmm</term>
1683             <listitem> <para>
1684                 Multimedia system. The <literal>native</literal>
1685                 version is not likely to work. Leave at
1686                 <literal>builtin</literal>.
1687               </para> </listitem>
1688           </varlistentry>
1689           <varlistentry>
1690             <term>msacm, msacm32</term>
1691             <listitem> <para>
1692                 Audio Compression Manager. The
1693                 <literal>builtin</literal> version works best, if you
1694                 set msacm.drv to the same.
1695               </para> </listitem>
1696           </varlistentry>
1697           <varlistentry>
1698             <term>msvideo, msvfw32</term>
1699             <listitem> <para>
1700                 Video for Windows. It is safe (and recommended) to try
1701                 <literal>native</literal>.
1702               </para> </listitem>
1703           </varlistentry>
1704           <varlistentry>
1705             <term>mcicda.drv</term>
1706             <listitem> <para>
1707                 CD Audio MCI driver.
1708               </para> </listitem>
1709           </varlistentry>
1710           <varlistentry>
1711             <term>mciseq.drv</term>
1712             <listitem> <para>
1713                 MIDI Sequencer MCI driver (<filename>.MID</filename>
1714                 playback).
1715               </para> </listitem>
1716           </varlistentry>
1717           <varlistentry>
1718             <term>mciwave.drv</term>
1719             <listitem> <para>
1720                 Wave audio MCI driver (<filename>.WAV</filename> playback).
1721               </para> </listitem>
1722           </varlistentry>
1723           <varlistentry>
1724             <term>mciavi.drv</term>
1725             <listitem> <para>
1726                 AVI MCI driver (<filename>.AVI</filename> video
1727                 playback). Best to use <literal>native</literal>.
1728               </para> </listitem>
1729           </varlistentry>
1730           <varlistentry>
1731             <term>mcianim.drv</term>
1732             <listitem> <para>
1733                 Animation MCI driver.
1734               </para> </listitem>
1735           </varlistentry>
1736           <varlistentry>
1737             <term>msacm.drv</term>
1738             <listitem> <para>
1739                 Audio Compression Manager. Set to same as msacm32.
1740               </para> </listitem>
1741           </varlistentry>
1742           <varlistentry>
1743             <term>midimap.drv</term>
1744             <listitem> <para>
1745                 MIDI Mapper.
1746               </para> </listitem>
1747           </varlistentry>
1748           <varlistentry>
1749             <term>wprocs</term>
1750             <listitem> <para>
1751                 This is a pseudo-DLL used by Wine for thunking
1752                 purposes. A <literal>native</literal> version of this
1753                 doesn't exist.
1754               </para> </listitem>
1755           </varlistentry>
1756         </variablelist>          
1757       </sect2>
1758     </sect1>
1759
1760     <sect1 id="keyboard">
1761       <title>Keyboard</title>
1762
1763       <para>
1764         Written by &name-ove-kaaven; <email>&email-ove-kaaven;</email>
1765       </para>
1766       <para>
1767         (Extracted from <filename>wine/documentation/keyboard</filename>)
1768       </para>
1769
1770       <para>
1771         Wine now needs to know about your keyboard layout. This
1772         requirement comes from a need from many apps to have the
1773         correct scancodes available, since they read these directly,
1774         instead of just taking the characters returned by the X
1775         server. This means that Wine now needs to have a mapping from
1776         X keys to the scancodes these applications expect.
1777       </para>
1778       <para>
1779         On startup, Wine will try to recognize the active X layout by
1780         seeing if it matches any of the defined tables. If it does,
1781         everything is alright. If not, you need to define it.
1782       </para>
1783       <para>
1784         To do this, open the file
1785         <filename>windows/x11drv/keyboard.c</filename> and take a look
1786         at the existing tables. Make a backup copy of it, especially
1787         if you don't use CVS.
1788       </para>
1789       <para>
1790         What you really would need to do, is find out which scancode
1791         each key needs to generate.  Find it in the
1792         <function>main_key_scan</function> table, which looks like
1793         this:
1794       </para>
1795       <programlisting>
1796 static const int main_key_scan[MAIN_LEN] =
1797 {
1798 /* this is my (102-key) keyboard layout, sorry if it doesn't quite match yours */
1799    0x29,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,
1800    0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,
1801    0x1E,0x1F,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x2B,
1802    0x2C,0x2D,0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35,
1803    0x56 /* the 102nd key (actually to the right of l-shift) */
1804 };
1805       </programlisting>
1806       <para>
1807         Next, assign each scancode the characters imprinted on the
1808         keycaps. This was done (sort of) for the US 101-key keyboard,
1809         which you can find near the top in
1810         <filename>keyboard.c</filename>. It also shows that if there
1811         is no 102nd key, you can skip that.
1812       </para>
1813       <para>
1814         However, for most international 102-key keyboards, we have
1815         done it easy for you. The scancode layout for these already
1816         pretty much matches the physical layout in the
1817         <function>main_key_scan</function>, so all you need to do is
1818         to go through all the keys that generate characters on your
1819         main keyboard (except spacebar), and stuff those into an
1820         appropriate table. The only exception is that the 102nd key,
1821         which is usually to the left of the first key of the last line
1822         (usually <keycap>Z</keycap>), must be placed on a separate
1823         line after the last line.
1824       </para>
1825       <para>
1826         For example, my Norwegian keyboard looks like this
1827       </para>
1828       <screen>
1829 §  !  "  #  ¤  %  &  /  (  )  =  ?  `  Back-
1830 |  1  2@ 3£ 4$ 5  6  7{ 8[ 9] 0} +  \´ space
1831
1832 Tab Q  W  E  R  T  Y  U  I  O  P  Å  ^
1833                                      ¨~
1834                                         Enter
1835 Caps A  S  D  F  G  H  J  K  L  Ø  Æ  *
1836 Lock                                  '
1837
1838 Sh- > Z  X  C  V  B  N  M  ;  :  _  Shift
1839 ift &lt;                      ,  .  -
1840
1841 Ctrl  Alt       Spacebar       AltGr  Ctrl
1842       </screen>
1843       <para>
1844         Note the 102nd key, which is the <keycap>&lt;></keycap> key, to
1845         the left of <keycap>Z</keycap>. The character to the right of
1846         the main character is the character generated by
1847         <keycap>AltGr</keycap>.
1848       </para>
1849       <para>
1850         This keyboard is defined as follows:
1851       </para>
1852       <programlisting>
1853 static const char main_key_NO[MAIN_LEN][4] =
1854 {
1855  "|§","1!","2\"@","3#£","4¤$","5%","6&","7/{","8([","9)]","0=}","+?","\\´",
1856  "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","åÅ","¨^~",
1857  "aA","sS","dD","fF","gG","hH","jJ","kK","lL","øØ","æÆ","'*",
1858  "zZ","xX","cC","vV","bB","nN","mM",",;",".:","-_",
1859  "&lt;>"
1860 };   
1861       </programlisting>
1862       <para>
1863         Except that " and \ needs to be quoted with a backslash, and
1864         that the 102nd key is on a separate line, it's pretty
1865         straightforward.
1866       </para>
1867       <para>
1868         After you have written such a table, you need to add it to the
1869         <function>main_key_tab[]</function> layout index table. This
1870         will look like this:
1871       </para>
1872       <programlisting>
1873 static struct {
1874  WORD lang, ansi_codepage, oem_codepage;
1875  const char (*key)[MAIN_LEN][4];
1876 } main_key_tab[]={
1877 ...
1878 ...
1879  {MAKELANGID(LANG_NORWEGIAN,SUBLANG_DEFAULT),  1252, 865, &amp;main_key_NO},  
1880 ...
1881       </programlisting>
1882       <para>
1883         After you have added your table, recompile Wine and test that
1884         it works. If it fails to detect your table, try running
1885       </para>
1886       <screen>
1887 wine --debugmsg +key,+keyboard >& key.log
1888       </screen>
1889       <para>
1890         and look in the resulting <filename>key.log</filename> file to
1891         find the error messages it gives for your layout.
1892       </para>
1893       <para>
1894         Note that the <constant>LANG_*</constant> and
1895         <constant>SUBLANG_*</constant> definitions are in
1896         <filename>include/winnls.h</filename>, which you might need to
1897         know to find out which numbers your language is assigned, and
1898         find it in the debugmsg output. The numbers will be
1899         <literal>(SUBLANG * 0x400 + LANG)</literal>, so, for example
1900         the combination <literal>LANG_NORWEGIAN (0x14)</literal> and
1901         <literal>SUBLANG_DEFAULT (0x1)</literal> will be (in hex)
1902         <literal>14 + 1*400 = 414</literal>, so since I'm Norwegian, I
1903         could look for <literal>0414</literal> in the debugmsg output
1904         to find out why my keyboard won't detect.
1905       </para>
1906       <para>
1907         Once it works, submit it to the Wine project. If you use CVS,
1908         you will just have to do
1909       </para>
1910       <screen>
1911 cvs -z3 diff -u windows/x11drv/keyboard.c > layout.diff
1912       </screen>
1913       <para>
1914         from your main Wine directory, then submit
1915         <filename>layout.diff</filename> to
1916         <email>wine-patches@winehq.com</email> along with a brief note
1917         of what it is.
1918       </para>
1919       <para>
1920         If you don't use CVS, you need to do
1921       </para>
1922       <screen>
1923 diff -u the_backup_file_you_made windows/x11drv/keyboard.c > layout.diff
1924       </screen>
1925       <para>
1926         and submit it as explained above.
1927       </para>
1928       <para>
1929         If you did it right, it will be included in the next Wine
1930         release, and all the troublesome applications (especially
1931         remote-control applications) and games that use scancodes will
1932         be happily using your keyboard layout, and you won't get those
1933         annoying fixme messages either.
1934       </para>
1935       <para>
1936         Good luck.
1937       </para>
1938     </sect1>
1939
1940     &fonts;
1941     &printing;
1942
1943   </chapter>
1944
1945 <!-- Keep this comment at the end of the file
1946 Local variables:
1947 mode: sgml
1948 sgml-parent-document:("wine-doc.sgml" "set" "book" "chapter" "")
1949 End:
1950 -->