Wine, WineLib and "Programming Applications for Windows"

Table of contents

  1. General
    1. Introduction
    2. News
    3. Testing configuration
    4. Statistics
    5. Installation
    6. Wine notes
    7. Winelib notes
  2. Test Results
  3. API Index

1. General

1.1. Introduction

French title Développer sous Windows 95 et Windows NT
French ISBN 84082-082-X (2nd edition)
Original title The developper's guide to the Win32 API for Windows NT 3.5 and Windows 95
then renamed to: Advanced Windows
and then to: Programming Applications for Microsoft Windows
Original ISBN 1-55615-677-4
Author Jeffrey Richter
URL Programming Applications for Microsoft Windows
Buying online Barnes & Noble

Get the complete testing kit, including these pages, from:
(it's released under the X11 license)

1.2. News

1.3. Testing configuration

The tests have been performed on my Linux box:

I sometimes say that the values I get are different from what I get on Windows. In that case the reference is a Windows 98 laptop running in 1024x768x16. Of course I ignored differences related to the resolution.

1.4. Statistics

31 examples
20 have been tested (65%)
7 have Wine errors (35% of tested) 1 have warnings (5% of tested)
for a total of 9 errors for a total of 4 warnings
6 have Winelib errors (19% of total) 1 have warnings (3% of total)
for a total of 6 errors for a total of 1 warnings
27 executables 21 Winelib executables (78%)
4 libraries 3 Winelib libraries (75%)
35 C files 28 compiled (80%)
31 RC files 31 compiled (100%)

As you can see progress has been made since the last release, especially concerning Winelib.
31 examples
20 have been tested (65%)
9 have Wine errors (45% of tested) 1 have warnings (5% of tested)
for a total of 10 errors for a total of 4 warnings
16 have WineLib errors (52% of total) 1 have warnings (3% of total)
for a total of 17 errors for a total of 1 warnings
27 executables 10 WineLib executables (37%)
4 libraries 4 WineLib libraries (100%)
35 C files 27 compiled (77%)
31 RC files 31 compiled (100%)

1.5. Installation

To install this testing kit follow these steps:

 #Copy the contents of the CD to some directory.
 mkdir PrgApps
 cd PrgApps
 cp -r /cdrom/* .
 # The directories will be read-only, make them read-write
 chmod u+w *.[0-9][0-9]
 # Run winemaker as follows
 winemaker --nogenerated-files .
 # Uncompress the contents of the testing kit. Adapt to the version you got
 tar xvfz ~/PrgApps-0.2.0.tar.gz
 # Then complete the setup.
 ./generate --setup
 # And prepare the compilation
 ./configure --with-wine=~/wine
 # Make sure you have set up the environment correctly for using Wine
 # Then recompile everything, keeping a log
 make 2>&1 | tee make.log

To compile and perform the tests with Wine you will need to set up the Wine environment (LD_LIBRARY_PATH and PATH) as you usually do when you want to use Wine.

1.6. Wine notes

  1. No notes yet. The informal tests I have done seem to indicate that many programs do not work. This is quite logical regarding the advanced nature of these programs: asynchronous I/O, structured exception handling, virtual memory manipulation, injecting a DLL into another process's address space, ...

1.7. Winelib notes

  1. The '#include' case issues are now taken care of by winemaker. Likewise the 'afxres.h' vs. 'winres.h' problems have gone away.
  2. Most compilation/link problems related to the C library have been solved now that we can link with msvcrt.dll (actually, crtdll.dll can be used too).
  3. I removed my __try/__except/__finally SEH hacks so 6 files that used to compile don't compile anymore. I'll try to make it work again, and better one of these days. But it seems that the previous version just wasn't very good.
  4. I added an include of 'windef.h' in 'advwin32.h' so that '__stdcall' is defined properly.
  5. If you apply the patch in 'diff20000729-__try.txt' then you should be able to compile the files that make use of the '__try' construct. If you use '__try' + '_except' but not '__finally' then one needs to add '__endtry' to the source (this is already done by the regular patches). If the construct being used is '__try' + '__finally' then the source does not need to be modified. In either case one must first include 'wine/exception.h' but this is already done by 'advwin32.h' (which I patched). I'm not sure the 'diff20000729-__try.txt' can be integrated into Wine as is. It would be nice to have these definitions straight from 'windef.h' but this causes header dependency problems. It would be nice not to have to add an '__endtry' but I'm not sure this can be avoided.

2. Test Results

  1. Chapter 5 - Exploring the virtual memory (Exploration de la mémoire virtuelle)
    1. sysinfo Wine: 1 error Winelib: 1 error
    2. vmmap
    3. vmstat
  2. Chapter 6 - Using the virtual memory in your own applications (Utiliser la mémoire virtuelle dans vos propres applications)
    1. vmalloc
  3. Chapter 7 - Memory mapped files (Les fichier mappés en mémoire)
    1. filerev Winelib: 1 warning
    2. mmfshare
  4. Chapter 9 - Synhronizing threads (La synchronisation des threads)
    1. bucket Wine: 1 error
    2. critsecs Wine: 1 error
    3. docstats
    4. mutexes Wine: 3 errors
    5. sprmrkt
  5. Chapter 10 - Windows messages and asynchronous input/output (Messages de Windows et entrées sorties asynchrones)
    1. copydata Wine: 1 error
    2. lislab
  6. Chapter 11 - Dynamically linked libraries (Bibliothèques de liens dynamiques)
    1. module
    2. moduse
    3. multinst
  7. Chapter 12 - Thread local storage (Stockage local de thread)
    1. somelib
    2. tlsdyn
    3. tlsstat
  8. Chapter 13 - The filesystem and the file input/output (Systèmes de fichier entrées/sortie de fichier)
    1. alertio Wine: 1 error
    2. dirwalk
    3. diskinfo Wine: 4 warnings
    4. filechng Wine: 1 error
  9. Chapter 14 - Structures exception handling (Gestion structurée des exceptions)
    1. sehexcpt Winelib: 1 error
    2. sehsoft Winelib: 1 error
    3. sehsum Winelib: 1 error
    4. sehterm Winelib: 1 error
  10. Chapter 16 - Going beyond the process boundaries (Dépasser les frontières du processus)
    1. imgwalk
    2. pmrest
    3. pmrstsub
    4. tinjlib Winelib: 1 error

3. API Index

This is an inverted list of the APIs used by the examples. Click on one of the functions to find which of the sample programs invoke it.

  1. ADVAPI32
  2. GDI32
    GetStockObject, Rectangle, SelectObject
  3. KERNEL32
    CloseHandle, CopyFileA, CreateEventA, CreateFileA, CreateFileMappingA, CreateMutexA, CreateProcessA, CreateRemoteThread, CreateSemaphoreA, DeleteCriticalSection, EnterCriticalSection, FindClose, FindCloseChangeNotification, FindFirstChangeNotificationA, FindFirstFileA, FindNextChangeNotification, FindNextFileA, GetCommandLineA, GetCurrentDirectoryA, GetCurrentProcess, GetCurrentProcessId, GetCurrentThreadId, GetDiskFreeSpaceA, GetDriveTypeA, GetExitCodeThread, GetFileSize, GetLastError, GetLogicalDriveStringsA, GetLogicalDrives, GetModuleFileNameA, GetModuleHandleA, GetProcAddress, GetProcessHeap, GetStartupInfoA, GetSystemInfo, GetThreadContext, GetTickCount, GetVersion, GetVolumeInformationA, GlobalAlloc, GlobalFree, GlobalMemoryStatus, HeapAlloc, HeapFree, HeapSize, InitializeCriticalSection, InterlockedDecrement, InterlockedIncrement, LeaveCriticalSection, MapViewOfFile, OpenFileMappingA, OpenProcess, RaiseException, ReadFile, ReadFileEx, ReadProcessMemory, ReleaseMutex, ReleaseSemaphore, ResetEvent, ResumeThread, SetCurrentDirectoryA, SetEndOfFile, SetEvent, SetFilePointer, SetLastError, SetPriorityClass, SetThreadPriority, Sleep, SleepEx, SuspendThread, TerminateThread, UnmapViewOfFile, VirtualAlloc, VirtualFree, VirtualProtectEx, VirtualQuery, VirtualQueryEx, WaitForMultipleObjects, WaitForSingleObject, WriteFileEx, WriteProcessMemory, lstrlenA
  5. MSVCRT20
    _XcptFilter, __getmainargs, __p__acmdln, __p__commode, __p__fmode, _beginthreadex, _controlfp, _except_handler3, _exit, _initterm, _strrev, _wcsrev, exit, malloc, memmove, rand, sprintf, sscanf, strchr, strncpy, strrchr, vsprintf, wcschr, wcscpy
    SubclassProgManFrame, g_hHook
  8. USER32
    AppendMenuA, AttachThreadInput, BeginPaint, BringWindowToTop, CallNextHookEx, CallWindowProcA, ClipCursor, CreateDialogParamA, DestroyWindow, DialogBoxParamA, DispatchMessageA, DrawMenuBar, EnableWindow, EndDialog, EndPaint, EnumWindows, FindWindowA, GetActiveWindow, GetCapture, GetClassNameA, GetClientRect, GetClipCursor, GetDesktopWindow, GetDialogBaseUnits, GetDlgCtrlID, GetDlgItem, GetDlgItemInt, GetDlgItemTextA, GetFocus, GetForegroundWindow, GetMenu, GetMessageA, GetScrollPos, GetScrollRange, GetTopWindow, GetWindow, GetWindowLongA, GetWindowRect, GetWindowTextA, GetWindowTextLengthA, GetWindowThreadProcessId, InvalidateRect, IsCharAlphaA, IsDialogMessageA, IsDlgButtonChecked, IsIconic, IsWindow, IsWindowVisible, KillTimer, LoadCursorA, LoadIconA, MapWindowPoints, MessageBoxA, MsgWaitForMultipleObjects, PeekMessageA, PostMessageA, PostQuitMessage, PostThreadMessageA, RegisterWindowMessageA, ReleaseCapture, RemoveMenu, SendMessageA, SetActiveWindow, SetCapture, SetClassLongA, SetCursor, SetDlgItemInt, SetDlgItemTextA, SetFocus, SetForegroundWindow, SetRect, SetScrollPos, SetScrollRange, SetTimer, SetWindowLongA, SetWindowPos, SetWindowTextA, SetWindowsHookExA, ShowCursor, ShowWindow, TranslateMessage, UnhookWindowsHookEx, wsprintfA
  9. comdlg32
    GetOpenFileNameA This page is hosted for free by