WineHQ

Source Tree Structure: Difference between revisions

(Spelling fixes)
(various improvements)
Line 1: Line 1:
Wine was originally organized by topic so each related area of the API had its own directory. Unfortunately this didn't work out too well as Windows itself is rather badly organized, especially in the older parts, so now the Wine source tree is loosely based on the original Windows modules.  Most of the source is concerned with implementing the Wine API, although there are also various tools, documentation, sample Winelib code, and code specific to the binary loader.  Note that several of the libraries listed here are "stubbed out", meaning they still need to be implemented.
Wine was originally organized by topic so each related area of the API had its own directory. Unfortunately this didn't work out too well as Windows itself is rather badly organized, especially in the older parts, so now the Wine source tree is closely based on Windows modules.  Most of the source is concerned with implementing the Wine API, although there are also various tools, documentation, and code specific to the binary loader.  Note that several of the libraries listed here are "stubbed out", meaning they still need to be implemented.


== Overall structure ==
== Overall structure ==
{|class="wikitable"
{|class="wikitable"
||dlls/         ||DLL reimplementations (kernel32, ntdll, user32, gdiplus, etc)  
|| dlls/
|| Implementations of all native DLLs (kernel32, ntdll, user32, gdiplus, etc). This is the bulk of Wine's code.
|-
|-
||documentation/ ||some documentation
|| documentation/
|| Translations of the README.
|-
|-
||include/       ||header files  
|| include/
|| Header files. This closely matches the PSDK.
|-
|-
||libs/         ||libraries and a C preprocessor
|| libs/
|| Source code for libwine.
|-
|-
||loader/   ||the Wine program loader  
|| loader/
|| The Wine loader and preloader, and some files which are installed in the initial wineprefix.
|-
|-
||programs/ ||several utility programs (winecfg, regedit, notepad, wordpad, etc); see [[List of Commands ]]
|| programs/
|| Executable programs supplied with Windows, including some Wine-specific programs. See also [[List of Commands]].
|-
|-
||server/   ||the [[wineserver]]  
|| server/
|| The [[wineserver]].
|-
|-
||tools/   ||various tools used to build/check Wine  
|| tools/
|| Native tools used to build Wine.
|}
|}


== Under dlls/ ==
== Under dlls/ ==
Each DLL is in its own directory, named after the DLL itself. The ".dll" extension is omitted, except for 16-bit DLLs. All 16-bit DLLs also have the suffix "16" appended to them.
=== Notes on Core DLLs ===
=== Notes on Core DLLs ===
A few of the DLLs are particularly central to the Win32 API. As a result, some extra notes have been included for them:
A few of the DLLs are particularly central to the Win32 API. As a result, some extra notes have been included for them:
Line 27: Line 37:
* '''kernel32''' : mostly just forwards to '''ntdll''' in NT-based Windows, but in Windows 9x, most of the code from '''ntdll''' is here. The thinking behind this split was that NT would be able to support multiple modules for different operating system APIs, i.e. there could be a POSIX module, an OS/2 module, and '''kernel32''' would be the Win32 module. In practice Microsoft wiped out the competition so effectively that this abstraction was never really needed or used, so in today's NT-based, Windows systems, '''kernel32''' is mostly just a set of forwarders. In Wine, the migration of code from '''kernel32''' to '''ntdll''' isn't finished yet so we actually have a fairly even split.
* '''kernel32''' : mostly just forwards to '''ntdll''' in NT-based Windows, but in Windows 9x, most of the code from '''ntdll''' is here. The thinking behind this split was that NT would be able to support multiple modules for different operating system APIs, i.e. there could be a POSIX module, an OS/2 module, and '''kernel32''' would be the Win32 module. In practice Microsoft wiped out the competition so effectively that this abstraction was never really needed or used, so in today's NT-based, Windows systems, '''kernel32''' is mostly just a set of forwarders. In Wine, the migration of code from '''kernel32''' to '''ntdll''' isn't finished yet so we actually have a fairly even split.


* '''user32''' : userspace code responsible for most of the core windowing and messaging, as well as various other random things like the clipboard, networking, and a wsprintf implementation. Originally '''user32''' ''was'' the Windows API, until it grew large enough that having multiple DLLs made more sense, thus the rather odd and unrelated collection of code in this DLL. Basically, the very old mechanisms that date from the Windows 3.1 era are likely to be either in this DLL or '''kernel32'''.
* '''user32''' : userspace code responsible for most of the core windowing and messaging, as well as various other random things like the clipboard, networking, and a wsprintf implementation. Originally '''user32''' (actually, user.exe) ''was'' the Windows API, until it grew large enough that having multiple DLLs made more sense, thus the rather odd and unrelated collection of code in this DLL. Basically, the very old mechanisms that date from the Windows 3.1 era are likely to be either in this DLL or '''kernel32'''.


* '''ole32''', '''oleaut32''', '''rpcrt4''' : together implement COM and DCOM.
* '''ole32''', '''rpcrt4''' : together implement COM and DCOM.


=== Wine only DLLs under dlls/ ===
== Under libs/ ==
{|class="wikitable"
{|class="wikitable"
||gphoto2.ds/ ||TWAIN datasource driver using libgphoto2
|| libs/port/
|-
|| various portability wrappers, including code pages and wide-character string functions
||sane.ds/ ||TWAIN datasource driver using sane
|-
||winealsa.drv/ ||ALSA audio driver
|-
||winebus.sys/ ||Wine HID plug and play backend driver
|-
||winecoreaudio.drv/ ||CoreAudio audio driver (MacOS)
|-
||winecrt0 ||Entry point code for all wine dlls and wine programms
|-
||wined3d/ ||Wine Direct3D helper
|-
||winegstreamer/ ||DirectShow Filter using the gstreamer framework
|-
||winehid.drv/ ||Wine HID minidriver
|-
||winejoystick.drv/ ||Joystick driver for WinMM
|-
||winemac.drv/ ||macOS display driver
|-
||winemapi/ ||Mail API support using the host email programm
|-
||winemp3.acm/ ||MP3 audio codec for WinMM
|-
||wineoss.drv/ ||OSS audio driver
|-
|-
||wineps16.drv16/ ||16Bit Postscript printer driver
|| libs/wine/
|-
|| core Wine-specific functions
||wineps.drv/ ||Postscript printer driver
|-
||winepulse.drv/ ||Pulseaudio audio driver
|-
||wineqtdecoder/ ||DirectShow Filter using the QuickTime toolkit (macOS)
|-
||winex11.drv/ ||X11 display driver
|-
|-
|| libs/wpp/
|| C preprocessor
|}
|}


=== 16-bit DLLs under dlls/ ===
<!-- Fixme: This is becoming out of date just as I write it! Revisit when the PE conversion is done. -->
Wine is using the special ".dll16", ".exe16" or ".drv16" file extensions for 16Bit DLLs.
These together make up libwine, which is used for all Wine DLLs as well as for Winelib applications.


=== Support libraries under dlls/ ===
== Under tools/ ==
{|class="wikitable"
{|class="wikitable"
||dxerr8/ ||DirectX 8 error import lib
|| tools/sfnt2fon/
|-
|| the .FON compiler
||dxerr9/ ||DirectX 9 error import lib
|-
||dxguid/ ||DirectX UUID import lib
|-
||strmiids/ ||Exports class CLSIDs and interface IIDs
|-
|-
||uuid/ ||Windows-compatible UUID import lib
|| tools/widl/
|}
|| the IDL compiler
== Under libs/ ==
{|class="wikitable"
||libs/port/ ||portability library
|-
||libs/wine/ ||Wine bootstrap and unicode support library
|-
||libs/wpp/ ||C preprocessor
|}
== Under tools/ ==
{|class="wikitable"
||tools/widl/ ||the IDL compiler  
|-
|-
||tools/winapi/ ||A Win32 API checker  
|| tools/winapi/
|| A Win32 API checker  
|-
|-
||tools/winebuild/ ||Wine build tool
|| tools/winebuild/
|| Wine DLL builder
|-
|-
||tools/winedump/ ||a .DLL dump utility
|| tools/winedump/
|| dumps DLL headers and generates .spec files
|-
|-
||tools/winegcc/ ||a MinGW command line compatible gcc wrapper  
|| tools/winegcc/
|| a MinGW-compatible gcc wrapper  
|-
|-
||tools/winemaker ||a Makefile generator for winelib  
|| tools/winemaker
|| a Makefile generator for winelib
|-
|-
||tools/wmc/ ||the message compiler  
|| tools/wmc/
|| the message compiler
|-
|-
||tools/wrc/ ||the resource compiler  
|| tools/wrc/
|| the resource compiler  
|}
|}
== Under include/ ==
== Under include/ ==

Revision as of 21:43, 15 June 2019

Wine was originally organized by topic so each related area of the API had its own directory. Unfortunately this didn't work out too well as Windows itself is rather badly organized, especially in the older parts, so now the Wine source tree is closely based on Windows modules. Most of the source is concerned with implementing the Wine API, although there are also various tools, documentation, and code specific to the binary loader. Note that several of the libraries listed here are "stubbed out", meaning they still need to be implemented.

Overall structure

dlls/ Implementations of all native DLLs (kernel32, ntdll, user32, gdiplus, etc). This is the bulk of Wine's code.
documentation/ Translations of the README.
include/ Header files. This closely matches the PSDK.
libs/ Source code for libwine.
loader/ The Wine loader and preloader, and some files which are installed in the initial wineprefix.
programs/ Executable programs supplied with Windows, including some Wine-specific programs. See also List of Commands.
server/ The wineserver.
tools/ Native tools used to build Wine.

Under dlls/

Each DLL is in its own directory, named after the DLL itself. The ".dll" extension is omitted, except for 16-bit DLLs. All 16-bit DLLs also have the suffix "16" appended to them.

Notes on Core DLLs

A few of the DLLs are particularly central to the Win32 API. As a result, some extra notes have been included for them:

  • ntdll : forms the core of the Windows system. It first appeared in Windows NT, but didn't become part of the consumer-oriented versions of Windows (3.1/95/98/Me) until XP. In Windows, this has become little more than a userspace to kernelspace shim, and analogously in Wine, it's mostly an interface either to the wineserver or the underlying Unix kernel. It also contains things like the PE (EXE/DLL format) dynamic linker.
  • kernel32 : mostly just forwards to ntdll in NT-based Windows, but in Windows 9x, most of the code from ntdll is here. The thinking behind this split was that NT would be able to support multiple modules for different operating system APIs, i.e. there could be a POSIX module, an OS/2 module, and kernel32 would be the Win32 module. In practice Microsoft wiped out the competition so effectively that this abstraction was never really needed or used, so in today's NT-based, Windows systems, kernel32 is mostly just a set of forwarders. In Wine, the migration of code from kernel32 to ntdll isn't finished yet so we actually have a fairly even split.
  • user32 : userspace code responsible for most of the core windowing and messaging, as well as various other random things like the clipboard, networking, and a wsprintf implementation. Originally user32 (actually, user.exe) was the Windows API, until it grew large enough that having multiple DLLs made more sense, thus the rather odd and unrelated collection of code in this DLL. Basically, the very old mechanisms that date from the Windows 3.1 era are likely to be either in this DLL or kernel32.
  • ole32, rpcrt4 : together implement COM and DCOM.

Under libs/

libs/port/ various portability wrappers, including code pages and wide-character string functions
libs/wine/ core Wine-specific functions
libs/wpp/ C preprocessor

These together make up libwine, which is used for all Wine DLLs as well as for Winelib applications.

Under tools/

tools/sfnt2fon/ the .FON compiler
tools/widl/ the IDL compiler
tools/winapi/ A Win32 API checker
tools/winebuild/ Wine DLL builder
tools/winedump/ dumps DLL headers and generates .spec files
tools/winegcc/ a MinGW-compatible gcc wrapper
tools/winemaker a Makefile generator for winelib
tools/wmc/ the message compiler
tools/wrc/ the resource compiler

Under include/

include/ Windows standard includes
include/ddk/ Windows DDK compatible headers
include/msvcrt/ MSVC-compatible libc headers
include/wine/ Wine-specific headers

This page was last edited on 15 June 2019, at 21:43.