Release 951124

Tue Nov 21 18:49:10 1995  Alexandre Julliard  <julliard@sunsite.unc.edu>

	* [configure.in] [Makefile] [misc/dos_fs.c]
	Got rid of autoconf.h file.

	* [debugger/dbg.y]
	More logical behavior upon syntax errors.

	* [include/hook.h] [windows/hook.c]
	Changed hook structure and rewrote most of the hook functions for
	better compatibility, based on investigations by Alex Korobka.

	* [include/message.h] [windows/message.c]
	Added hooks to message queue structure and made the structure
	layout Windows-compatible.
	Added support for WH_MOUSE, WH_KEYBOARD, WH_HARDWARE and
	WH_JOURNALRECORD hooks.

	* [misc/main.c]
	Added command-line option for changing the language at run-time
 	(not implemented yet), based on a suggestion from Michael Patra.

	* [objects/cursoricon.c]
	Fixed silly SEGPTR bug in DumpIcon().

Mon Nov 20 22:22:22 1995  Alex Korobka <alex@phm30.pharm.sunysb.edu>

	* [controls/listbox.c] [controls/combo.c] [include/listbox.h]
	Partial implementaion of LBS_EXTENDEDSEL style,
	yet more updates for drag & drop support. Now works.

	* [windows/defwnd.c]
	More message handlers.

	* [windows/win.c]
	DragObject, DragDetect, AnyPopup functions. 

	* [controls/listbox.c]
	More kludgy fixes (WM_...TOITEM, etc.).

	* [objects/cursoricon.c] [objects/oembitmap.c]
	IconToCursor skeleton, patch for OBM_LoadCursorIcon to handle new
	cursor.

	* [include/bitmaps/ocr*]
	New OEM cursors.

Mon Nov 20 11:05:20 EST 1995  Jim Peterson <jspeter@birch.ee.vt.edu>

	* [toolkit/heap.c]
	Swapped flags and size arguments to LocalRealloc as per changes in
	memory/local.c by William Magro in previous release.

	* [include/wintypes.h]
	Reinstated the #define's for 'min' and 'max', since they're part of
	the Windows API.  I really don't think it's a wise idea, so I put
	a '#ifndef DONT_DEFINE_min_AND_max' around them.  I think the actual
	WINE code should never use these (it should use 'MIN' and 'MAX'
	instead).

	* [loader/*]
	Put '#ifndef WINELIB' around many things that WINElib should not need.

	* [controls/edit.c]
	Took out many '#if defined(WINELIB)' sections with the associated
	comment 'temporary fix, until Local memory is correctly implemented in
	WINELIB', since the effective translations are now in 
	toolkit/miscstubs.c.
	Took out the #ifndef's I put in EDIT_ClearText.  Whoever modified this
	file fixed (or at least postponed) the bug I had encountered.

	* [loader/task.c]
	Put an #ifdef in TASK_CreateTask() that hardwires the current drive to
	C:  This will probably cause a lot of trouble if this change is
	forgotten in the future, but it will let things like the OpenFileName
	dialog work for now.

	* [toolkit/libres.c] [toolkit/Makefile.in] [toolkit/Makefile]
	  [include/libres.h]
	Made new libres.c file, which will contain functions for supporting
	accessing resources by name in WINElib.  'winerc' will need to be
	changed.

	* [toolkit/heap.c]
	Refined memory routines to allow for differences between LocalAlloc
	and GlobalAlloc and between LocalSize and GlobalSize.

	* [windows/message.c] [include/windows.h]
	Defined the GetCurrentTime routine in windows/message.c, and removed
	the #define in windows.h.

Mon Nov 20 00:36:42 MET 1995 Sven Verdoolaege <skimo@dns.ufsia.ac.be>

	* [*/*]
	Added new debugging type DEBUG_WIN32 and DEBUG_ENV.

	* [loader/module.c]
	Added undocumented GetExpWinVer.

	* [tools/build.c]
	Previous code didn't pop possibly changed %esi, %edi and %edx
	from the stack.
	
	* [win32/advapi.c]
	Added GetUserNameA.

	* [win32/code_page.c]
	Added stub for MultiByteToWideChar.

	* [win32/console.c]
	Added SetConsoleCtrlHandler stub.

	* [win32/file.c]
	Added ReadFile CreateFileA GetFileInformationByHandle stubs.
	Added CloseHandle.

	* [win32/memory.c]
	Changed VirtualAlloc and VirtualFree.

	* [win32/process.c]
	Added ExitProcess.

Sun Nov 19 17:54:42 1995   Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>

	* [include/windows.h]
	Fixed a few broken structure definitions.

	* [loader/resource.c]
	FindResource(): Need to check for '#xxx' strings here.

	* [miscemu/int21.c]
	FindNext(): Return MS-DOS filenames uppercase.

	* [objects/cursoricon.c]
	CreateIcon(), CreateCursor(): Added missing element to CURSORICONINFO
	initializers.
	
	* [misc/file.c]
	_lopen(): Files opened in OF_WRITE mode are truncated.
	OpenFile(): Ignore OF_READ/OF_WRITE/OF_READWRITE when files are
	created; use read/write mode.
	
	* [misc/profile.c]
	load(): Rewritten.
	
	* [misc/commdlg.c]
	Fixed bad call to strncpy() that smashed the stack.

	* [controls/combo.c] [windows/winpos.c] [memory/selector.c]
	Operator precedence fixes. People who use gcc 2.7.1 don't need a
	debugger :-)
	
	* [if1632/gdi.spec] [objects/palette.c]
	Add ResizePalette() and AnimatePalette() stubs. They don't do anything,
	but sometimes that's good enough.

Fri Nov 17 09:10:35 GMT 1995  John Harvey <john@division.co.uk>

	* [include/wine.h] [include/registers.h] [include/winsock.h]
        Added definitions for Unixware.

	* [loader/signal.c] [misc/comm.c] [misc/winsocket.c]
	Misc. fixes for Unixware.

	* [loader/task.c]
        Made assignemts to context in InitTask for registers use the macros
        from registers.h to make them more portable. (Needed for Unixware)

	* [tools/build.c]
	Fixed register acces routines to work on Unixware. Bit grubby but
 	it seems to work.

	* [controls/edit.c]
	EDIT_WM_NCCreate allocates local heap if hasn't been previously
	allocated.
	
	* [miscemu/int21.c]
	mkdir now creates directory with permission to access it.

	* [misc/dos_fs.c]
	mkdir now creates directory with permission to access it.
	DOS_opendir now uses linked list of dirents to avoid problems with 
	realloc changing address of malloced memory.

Thu Nov 16 12:47:13 1995  Michael Patra  <patra@itp1.Physik.TU-Berlin.DE>

	* [controls/menu.c]
	MENU_CalcItemSize(): Fixed handling of empty menu items.

Sat Nov 11 21:46:54 1995  Hans de Graaff  <graaff@twi72.twi.tudelft.nl>

	* [misc/file.c]
	In OpenFile, unlink should be done on the unix filename.

Sat Nov 11 16:43:29 1995  Cameron Heide  (heide@ee.ualberta.ca)

        * [include/handle32.h]
        New header file containing internal Win32 kernel handle
        information.

        * [win32/file.c]
        Added ReadFile, CreateFile, and CloseFileHandle, and did
        some reorganizing to match the new handle allocation scheme.

        * [win32/init.c]
        Added CloseHandle and the creation of standard I/O handles.

        * [win32/object_mgt.c]
        New module for allocating and freeing Win32 kernel handles.
diff --git a/include/bitmaps/ocr_bummer b/include/bitmaps/ocr_bummer
new file mode 100644
index 0000000..fa31df1
--- /dev/null
+++ b/include/bitmaps/ocr_bummer
@@ -0,0 +1,38 @@
+/* XPM */
+static char * ocr_bummer[] = {
+"32 32 3 1 5 9",
+" 	s black c black",
+"X	s white	c white",
+".	s None	c None",
+"............       .............",
+"........... XXXXXXX ............",
+".........  XXXXXXXXX ...........",
+"........ XXXXXXXXXXXXX .........",
+"....... XX  XXXXXXX  XX ........",
+"....... X .. XXXXX .. X ........",
+"....... X ... XXX ... X ........",
+"....... X ... XXX ... X ........",
+"...... XX ... XXX ... XX .......",
+"...... XXX   XXXXX   XXX .......",
+"...... XXXXXXXX XXXXXXXX .......",
+"...... XXXXXXX . XXXXXXX .......",
+".  .... XXXXXX . XXXXXX ...  ...",
+" XX ....  XXXX . XXXX  ... XX ..",
+". XX  ....  XX   XX  ....  X ...",
+" XXXXX   .. XXXXXXX ..   XXXX ..",
+" XX   XXX   XXXXXXX   XXX  XX ..",
+".  ...   XXX   X   XXX   ..  ...",
+".........   XXX       ..........",
+"..........     XXXX   ..........",
+"......   XXXX      XXX   .......",
+".     XXX    ......   XXX    ...",
+" XXXXX   .............   XXXX ..",
+" XX   ...................  XX ..",
+". X ...................... X ...",
+". X ...................... X ...",
+".. ........................ ....",
+"................................",
+"................................",
+"................................",
+"................................",
+"................................"};
diff --git a/include/bitmaps/ocr_dragobject b/include/bitmaps/ocr_dragobject
new file mode 100644
index 0000000..def5290
--- /dev/null
+++ b/include/bitmaps/ocr_dragobject
@@ -0,0 +1,38 @@
+/* XPM */
+static char * ocr_dragobject[] = {
+"32 32 3 1 5 9",
+" 	s black	c black",
+".	s None	c None",
+"X	s white	c white",
+"         .......................",
+" XXXXXXX   .....................",
+" XXXXXXX X  ....................",
+" XXXXXXX    ....................",
+" XXXXXXXXXX ....................",
+" XXXXXXXXXX ....................",
+" XXXXXXXXXX ....................",
+" XXXXXXXXXX ....................",
+" XXXXXXXXXX ....................",
+" XXXX XXXXX ....................",
+" XXXX  XXXX ....................",
+" XXXX X XXX ....................",
+" XXXX XX XX ....................",
+" XXXX XXX X ....................",
+"      XXXX .....................",
+"..... XXXXX ....................",
+"..... XXXXXX ...................",
+"..... XXXXXXX ..................",
+"..... XXXXXXXX .................",
+"..... XXXXX     ................",
+"..... XX  X ....................",
+"..... X . XX ...................",
+".....  ... X ...................",
+"..... .... XX ..................",
+"........... X ..................",
+"........... XX .................",
+"............ X .................",
+"............. ..................",
+"................................",
+"................................",
+"................................",
+"................................"};
diff --git a/include/debug.h b/include/debug.h
index a67f722..928922e 100644
--- a/include/debug.h
+++ b/include/debug.h
@@ -37,6 +37,7 @@
 #undef DEBUG_DRIVER
 #undef DEBUG_EDIT
 #undef DEBUG_ENUM
+#undef DEBUG_ENV
 #undef DEBUG_EVENT
 #undef DEBUG_EXEC
 #undef DEBUG_FILE
@@ -45,6 +46,7 @@
 #undef DEBUG_GDI
 #undef DEBUG_GLOBAL
 #undef DEBUG_GRAPHICS
+#undef DEBUG_HOOK
 #undef DEBUG_ICON
 #undef DEBUG_INT
 #undef DEBUG_KEY
@@ -89,6 +91,7 @@
 #undef DEBUG_UTILITY
 #undef DEBUG_VXD
 #undef DEBUG_WIN
+#undef DEBUG_WIN32
 #undef DEBUG_WINSOCK
 #endif
 
@@ -114,6 +117,7 @@
 #define DEBUG_DRIVER
 #define DEBUG_EDIT
 #define DEBUG_ENUM
+#define DEBUG_ENV
 #define DEBUG_EVENT
 #define DEBUG_EXEC
 #define DEBUG_FILE
@@ -122,6 +126,7 @@
 #define DEBUG_GDI
 #define DEBUG_GLOBAL
 #define DEBUG_GRAPHICS
+#define DEBUG_HOOK
 #define DEBUG_ICON
 #define DEBUG_INT
 #define DEBUG_KEY
@@ -166,6 +171,7 @@
 #define DEBUG_UTILITY
 #define DEBUG_VXD
 #define DEBUG_WIN
+#define DEBUG_WIN32
 #define DEBUG_WINSOCK
 #endif
 
@@ -277,6 +283,11 @@
 #else
     0,
 #endif
+#ifdef DEBUG_ENV
+    1,
+#else
+    0,
+#endif
 #ifdef DEBUG_EVENT
     1,
 #else
@@ -317,6 +328,11 @@
 #else
     0,
 #endif
+#ifdef DEBUG_HOOK
+    1,
+#else
+    0,
+#endif
 #ifdef DEBUG_ICON
     1,
 #else
@@ -537,6 +553,11 @@
 #else
     0,
 #endif
+#ifdef DEBUG_WIN32
+    1,
+#else
+    0,
+#endif
 #ifdef DEBUG_WINSOCK
     1,
 #else
@@ -823,8 +844,21 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_event if(!debug_msg_enabled[21]) ; else fprintf
-#define debugging_event debug_msg_enabled[21]
+#define dprintf_env if(!debug_msg_enabled[21]) ; else fprintf
+#define debugging_env debug_msg_enabled[21]
+#else
+#ifdef DEBUG_ENV
+#define dprintf_env fprintf
+#define debugging_env 1
+#else
+#define dprintf_env while(0) fprintf
+#define debugging_env 0
+#endif
+#endif
+
+#ifdef DEBUG_RUNTIME
+#define dprintf_event if(!debug_msg_enabled[22]) ; else fprintf
+#define debugging_event debug_msg_enabled[22]
 #else
 #ifdef DEBUG_EVENT
 #define dprintf_event fprintf
@@ -836,8 +870,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_exec if(!debug_msg_enabled[22]) ; else fprintf
-#define debugging_exec debug_msg_enabled[22]
+#define dprintf_exec if(!debug_msg_enabled[23]) ; else fprintf
+#define debugging_exec debug_msg_enabled[23]
 #else
 #ifdef DEBUG_EXEC
 #define dprintf_exec fprintf
@@ -849,8 +883,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_file if(!debug_msg_enabled[23]) ; else fprintf
-#define debugging_file debug_msg_enabled[23]
+#define dprintf_file if(!debug_msg_enabled[24]) ; else fprintf
+#define debugging_file debug_msg_enabled[24]
 #else
 #ifdef DEBUG_FILE
 #define dprintf_file fprintf
@@ -862,8 +896,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_fixup if(!debug_msg_enabled[24]) ; else fprintf
-#define debugging_fixup debug_msg_enabled[24]
+#define dprintf_fixup if(!debug_msg_enabled[25]) ; else fprintf
+#define debugging_fixup debug_msg_enabled[25]
 #else
 #ifdef DEBUG_FIXUP
 #define dprintf_fixup fprintf
@@ -875,8 +909,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_font if(!debug_msg_enabled[25]) ; else fprintf
-#define debugging_font debug_msg_enabled[25]
+#define dprintf_font if(!debug_msg_enabled[26]) ; else fprintf
+#define debugging_font debug_msg_enabled[26]
 #else
 #ifdef DEBUG_FONT
 #define dprintf_font fprintf
@@ -888,8 +922,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_gdi if(!debug_msg_enabled[26]) ; else fprintf
-#define debugging_gdi debug_msg_enabled[26]
+#define dprintf_gdi if(!debug_msg_enabled[27]) ; else fprintf
+#define debugging_gdi debug_msg_enabled[27]
 #else
 #ifdef DEBUG_GDI
 #define dprintf_gdi fprintf
@@ -901,8 +935,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_global if(!debug_msg_enabled[27]) ; else fprintf
-#define debugging_global debug_msg_enabled[27]
+#define dprintf_global if(!debug_msg_enabled[28]) ; else fprintf
+#define debugging_global debug_msg_enabled[28]
 #else
 #ifdef DEBUG_GLOBAL
 #define dprintf_global fprintf
@@ -914,8 +948,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_graphics if(!debug_msg_enabled[28]) ; else fprintf
-#define debugging_graphics debug_msg_enabled[28]
+#define dprintf_graphics if(!debug_msg_enabled[29]) ; else fprintf
+#define debugging_graphics debug_msg_enabled[29]
 #else
 #ifdef DEBUG_GRAPHICS
 #define dprintf_graphics fprintf
@@ -927,8 +961,21 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_icon if(!debug_msg_enabled[29]) ; else fprintf
-#define debugging_icon debug_msg_enabled[29]
+#define dprintf_hook if(!debug_msg_enabled[30]) ; else fprintf
+#define debugging_hook debug_msg_enabled[30]
+#else
+#ifdef DEBUG_HOOK
+#define dprintf_hook fprintf
+#define debugging_hook 1
+#else
+#define dprintf_hook while(0) fprintf
+#define debugging_hook 0
+#endif
+#endif
+
+#ifdef DEBUG_RUNTIME
+#define dprintf_icon if(!debug_msg_enabled[31]) ; else fprintf
+#define debugging_icon debug_msg_enabled[31]
 #else
 #ifdef DEBUG_ICON
 #define dprintf_icon fprintf
@@ -940,8 +987,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_int if(!debug_msg_enabled[30]) ; else fprintf
-#define debugging_int debug_msg_enabled[30]
+#define dprintf_int if(!debug_msg_enabled[32]) ; else fprintf
+#define debugging_int debug_msg_enabled[32]
 #else
 #ifdef DEBUG_INT
 #define dprintf_int fprintf
@@ -953,8 +1000,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_key if(!debug_msg_enabled[31]) ; else fprintf
-#define debugging_key debug_msg_enabled[31]
+#define dprintf_key if(!debug_msg_enabled[33]) ; else fprintf
+#define debugging_key debug_msg_enabled[33]
 #else
 #ifdef DEBUG_KEY
 #define dprintf_key fprintf
@@ -966,8 +1013,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_keyboard if(!debug_msg_enabled[32]) ; else fprintf
-#define debugging_keyboard debug_msg_enabled[32]
+#define dprintf_keyboard if(!debug_msg_enabled[34]) ; else fprintf
+#define debugging_keyboard debug_msg_enabled[34]
 #else
 #ifdef DEBUG_KEYBOARD
 #define dprintf_keyboard fprintf
@@ -979,8 +1026,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_ldt if(!debug_msg_enabled[33]) ; else fprintf
-#define debugging_ldt debug_msg_enabled[33]
+#define dprintf_ldt if(!debug_msg_enabled[35]) ; else fprintf
+#define debugging_ldt debug_msg_enabled[35]
 #else
 #ifdef DEBUG_LDT
 #define dprintf_ldt fprintf
@@ -992,8 +1039,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_listbox if(!debug_msg_enabled[34]) ; else fprintf
-#define debugging_listbox debug_msg_enabled[34]
+#define dprintf_listbox if(!debug_msg_enabled[36]) ; else fprintf
+#define debugging_listbox debug_msg_enabled[36]
 #else
 #ifdef DEBUG_LISTBOX
 #define dprintf_listbox fprintf
@@ -1005,8 +1052,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_local if(!debug_msg_enabled[35]) ; else fprintf
-#define debugging_local debug_msg_enabled[35]
+#define dprintf_local if(!debug_msg_enabled[37]) ; else fprintf
+#define debugging_local debug_msg_enabled[37]
 #else
 #ifdef DEBUG_LOCAL
 #define dprintf_local fprintf
@@ -1018,8 +1065,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_malloc if(!debug_msg_enabled[36]) ; else fprintf
-#define debugging_malloc debug_msg_enabled[36]
+#define dprintf_malloc if(!debug_msg_enabled[38]) ; else fprintf
+#define debugging_malloc debug_msg_enabled[38]
 #else
 #ifdef DEBUG_MALLOC
 #define dprintf_malloc fprintf
@@ -1031,8 +1078,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_mci if(!debug_msg_enabled[37]) ; else fprintf
-#define debugging_mci debug_msg_enabled[37]
+#define dprintf_mci if(!debug_msg_enabled[39]) ; else fprintf
+#define debugging_mci debug_msg_enabled[39]
 #else
 #ifdef DEBUG_MCI
 #define dprintf_mci fprintf
@@ -1044,8 +1091,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_mcianim if(!debug_msg_enabled[38]) ; else fprintf
-#define debugging_mcianim debug_msg_enabled[38]
+#define dprintf_mcianim if(!debug_msg_enabled[40]) ; else fprintf
+#define debugging_mcianim debug_msg_enabled[40]
 #else
 #ifdef DEBUG_MCIANIM
 #define dprintf_mcianim fprintf
@@ -1057,8 +1104,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_mciwave if(!debug_msg_enabled[39]) ; else fprintf
-#define debugging_mciwave debug_msg_enabled[39]
+#define dprintf_mciwave if(!debug_msg_enabled[41]) ; else fprintf
+#define debugging_mciwave debug_msg_enabled[41]
 #else
 #ifdef DEBUG_MCIWAVE
 #define dprintf_mciwave fprintf
@@ -1070,8 +1117,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_mdi if(!debug_msg_enabled[40]) ; else fprintf
-#define debugging_mdi debug_msg_enabled[40]
+#define dprintf_mdi if(!debug_msg_enabled[42]) ; else fprintf
+#define debugging_mdi debug_msg_enabled[42]
 #else
 #ifdef DEBUG_MDI
 #define dprintf_mdi fprintf
@@ -1083,8 +1130,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_menu if(!debug_msg_enabled[41]) ; else fprintf
-#define debugging_menu debug_msg_enabled[41]
+#define dprintf_menu if(!debug_msg_enabled[43]) ; else fprintf
+#define debugging_menu debug_msg_enabled[43]
 #else
 #ifdef DEBUG_MENU
 #define dprintf_menu fprintf
@@ -1096,8 +1143,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_menucalc if(!debug_msg_enabled[42]) ; else fprintf
-#define debugging_menucalc debug_msg_enabled[42]
+#define dprintf_menucalc if(!debug_msg_enabled[44]) ; else fprintf
+#define debugging_menucalc debug_msg_enabled[44]
 #else
 #ifdef DEBUG_MENUCALC
 #define dprintf_menucalc fprintf
@@ -1109,8 +1156,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_message if(!debug_msg_enabled[43]) ; else fprintf
-#define debugging_message debug_msg_enabled[43]
+#define dprintf_message if(!debug_msg_enabled[45]) ; else fprintf
+#define debugging_message debug_msg_enabled[45]
 #else
 #ifdef DEBUG_MESSAGE
 #define dprintf_message fprintf
@@ -1122,8 +1169,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_metafile if(!debug_msg_enabled[44]) ; else fprintf
-#define debugging_metafile debug_msg_enabled[44]
+#define dprintf_metafile if(!debug_msg_enabled[46]) ; else fprintf
+#define debugging_metafile debug_msg_enabled[46]
 #else
 #ifdef DEBUG_METAFILE
 #define dprintf_metafile fprintf
@@ -1135,8 +1182,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_midi if(!debug_msg_enabled[45]) ; else fprintf
-#define debugging_midi debug_msg_enabled[45]
+#define dprintf_midi if(!debug_msg_enabled[47]) ; else fprintf
+#define debugging_midi debug_msg_enabled[47]
 #else
 #ifdef DEBUG_MIDI
 #define dprintf_midi fprintf
@@ -1148,8 +1195,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_mmio if(!debug_msg_enabled[46]) ; else fprintf
-#define debugging_mmio debug_msg_enabled[46]
+#define dprintf_mmio if(!debug_msg_enabled[48]) ; else fprintf
+#define debugging_mmio debug_msg_enabled[48]
 #else
 #ifdef DEBUG_MMIO
 #define dprintf_mmio fprintf
@@ -1161,8 +1208,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_mmsys if(!debug_msg_enabled[47]) ; else fprintf
-#define debugging_mmsys debug_msg_enabled[47]
+#define dprintf_mmsys if(!debug_msg_enabled[49]) ; else fprintf
+#define debugging_mmsys debug_msg_enabled[49]
 #else
 #ifdef DEBUG_MMSYS
 #define dprintf_mmsys fprintf
@@ -1174,8 +1221,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_mmtime if(!debug_msg_enabled[48]) ; else fprintf
-#define debugging_mmtime debug_msg_enabled[48]
+#define dprintf_mmtime if(!debug_msg_enabled[50]) ; else fprintf
+#define debugging_mmtime debug_msg_enabled[50]
 #else
 #ifdef DEBUG_MMTIME
 #define dprintf_mmtime fprintf
@@ -1187,8 +1234,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_module if(!debug_msg_enabled[49]) ; else fprintf
-#define debugging_module debug_msg_enabled[49]
+#define dprintf_module if(!debug_msg_enabled[51]) ; else fprintf
+#define debugging_module debug_msg_enabled[51]
 #else
 #ifdef DEBUG_MODULE
 #define dprintf_module fprintf
@@ -1200,8 +1247,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_msg if(!debug_msg_enabled[50]) ; else fprintf
-#define debugging_msg debug_msg_enabled[50]
+#define dprintf_msg if(!debug_msg_enabled[52]) ; else fprintf
+#define debugging_msg debug_msg_enabled[52]
 #else
 #ifdef DEBUG_MSG
 #define dprintf_msg fprintf
@@ -1213,8 +1260,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_nonclient if(!debug_msg_enabled[51]) ; else fprintf
-#define debugging_nonclient debug_msg_enabled[51]
+#define dprintf_nonclient if(!debug_msg_enabled[53]) ; else fprintf
+#define debugging_nonclient debug_msg_enabled[53]
 #else
 #ifdef DEBUG_NONCLIENT
 #define dprintf_nonclient fprintf
@@ -1226,8 +1273,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_ole if(!debug_msg_enabled[52]) ; else fprintf
-#define debugging_ole debug_msg_enabled[52]
+#define dprintf_ole if(!debug_msg_enabled[54]) ; else fprintf
+#define debugging_ole debug_msg_enabled[54]
 #else
 #ifdef DEBUG_OLE
 #define dprintf_ole fprintf
@@ -1239,8 +1286,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_palette if(!debug_msg_enabled[53]) ; else fprintf
-#define debugging_palette debug_msg_enabled[53]
+#define dprintf_palette if(!debug_msg_enabled[55]) ; else fprintf
+#define debugging_palette debug_msg_enabled[55]
 #else
 #ifdef DEBUG_PALETTE
 #define dprintf_palette fprintf
@@ -1252,8 +1299,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_profile if(!debug_msg_enabled[54]) ; else fprintf
-#define debugging_profile debug_msg_enabled[54]
+#define dprintf_profile if(!debug_msg_enabled[56]) ; else fprintf
+#define debugging_profile debug_msg_enabled[56]
 #else
 #ifdef DEBUG_PROFILE
 #define dprintf_profile fprintf
@@ -1265,8 +1312,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_prop if(!debug_msg_enabled[55]) ; else fprintf
-#define debugging_prop debug_msg_enabled[55]
+#define dprintf_prop if(!debug_msg_enabled[57]) ; else fprintf
+#define debugging_prop debug_msg_enabled[57]
 #else
 #ifdef DEBUG_PROP
 #define dprintf_prop fprintf
@@ -1278,8 +1325,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_reg if(!debug_msg_enabled[56]) ; else fprintf
-#define debugging_reg debug_msg_enabled[56]
+#define dprintf_reg if(!debug_msg_enabled[58]) ; else fprintf
+#define debugging_reg debug_msg_enabled[58]
 #else
 #ifdef DEBUG_REG
 #define dprintf_reg fprintf
@@ -1291,8 +1338,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_region if(!debug_msg_enabled[57]) ; else fprintf
-#define debugging_region debug_msg_enabled[57]
+#define dprintf_region if(!debug_msg_enabled[59]) ; else fprintf
+#define debugging_region debug_msg_enabled[59]
 #else
 #ifdef DEBUG_REGION
 #define dprintf_region fprintf
@@ -1304,8 +1351,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_relay if(!debug_msg_enabled[58]) ; else fprintf
-#define debugging_relay debug_msg_enabled[58]
+#define dprintf_relay if(!debug_msg_enabled[60]) ; else fprintf
+#define debugging_relay debug_msg_enabled[60]
 #else
 #ifdef DEBUG_RELAY
 #define dprintf_relay fprintf
@@ -1317,8 +1364,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_resource if(!debug_msg_enabled[59]) ; else fprintf
-#define debugging_resource debug_msg_enabled[59]
+#define dprintf_resource if(!debug_msg_enabled[61]) ; else fprintf
+#define debugging_resource debug_msg_enabled[61]
 #else
 #ifdef DEBUG_RESOURCE
 #define dprintf_resource fprintf
@@ -1330,8 +1377,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_scroll if(!debug_msg_enabled[60]) ; else fprintf
-#define debugging_scroll debug_msg_enabled[60]
+#define dprintf_scroll if(!debug_msg_enabled[62]) ; else fprintf
+#define debugging_scroll debug_msg_enabled[62]
 #else
 #ifdef DEBUG_SCROLL
 #define dprintf_scroll fprintf
@@ -1343,8 +1390,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_selector if(!debug_msg_enabled[61]) ; else fprintf
-#define debugging_selector debug_msg_enabled[61]
+#define dprintf_selector if(!debug_msg_enabled[63]) ; else fprintf
+#define debugging_selector debug_msg_enabled[63]
 #else
 #ifdef DEBUG_SELECTOR
 #define dprintf_selector fprintf
@@ -1356,8 +1403,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_sem if(!debug_msg_enabled[62]) ; else fprintf
-#define debugging_sem debug_msg_enabled[62]
+#define dprintf_sem if(!debug_msg_enabled[64]) ; else fprintf
+#define debugging_sem debug_msg_enabled[64]
 #else
 #ifdef DEBUG_SEM
 #define dprintf_sem fprintf
@@ -1369,8 +1416,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_shm if(!debug_msg_enabled[63]) ; else fprintf
-#define debugging_shm debug_msg_enabled[63]
+#define dprintf_shm if(!debug_msg_enabled[65]) ; else fprintf
+#define debugging_shm debug_msg_enabled[65]
 #else
 #ifdef DEBUG_SHM
 #define dprintf_shm fprintf
@@ -1382,8 +1429,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_stress if(!debug_msg_enabled[64]) ; else fprintf
-#define debugging_stress debug_msg_enabled[64]
+#define dprintf_stress if(!debug_msg_enabled[66]) ; else fprintf
+#define debugging_stress debug_msg_enabled[66]
 #else
 #ifdef DEBUG_STRESS
 #define dprintf_stress fprintf
@@ -1395,8 +1442,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_syscolor if(!debug_msg_enabled[65]) ; else fprintf
-#define debugging_syscolor debug_msg_enabled[65]
+#define dprintf_syscolor if(!debug_msg_enabled[67]) ; else fprintf
+#define debugging_syscolor debug_msg_enabled[67]
 #else
 #ifdef DEBUG_SYSCOLOR
 #define dprintf_syscolor fprintf
@@ -1408,8 +1455,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_task if(!debug_msg_enabled[66]) ; else fprintf
-#define debugging_task debug_msg_enabled[66]
+#define dprintf_task if(!debug_msg_enabled[68]) ; else fprintf
+#define debugging_task debug_msg_enabled[68]
 #else
 #ifdef DEBUG_TASK
 #define dprintf_task fprintf
@@ -1421,8 +1468,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_text if(!debug_msg_enabled[67]) ; else fprintf
-#define debugging_text debug_msg_enabled[67]
+#define dprintf_text if(!debug_msg_enabled[69]) ; else fprintf
+#define debugging_text debug_msg_enabled[69]
 #else
 #ifdef DEBUG_TEXT
 #define dprintf_text fprintf
@@ -1434,8 +1481,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_timer if(!debug_msg_enabled[68]) ; else fprintf
-#define debugging_timer debug_msg_enabled[68]
+#define dprintf_timer if(!debug_msg_enabled[70]) ; else fprintf
+#define debugging_timer debug_msg_enabled[70]
 #else
 #ifdef DEBUG_TIMER
 #define dprintf_timer fprintf
@@ -1447,8 +1494,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_toolhelp if(!debug_msg_enabled[69]) ; else fprintf
-#define debugging_toolhelp debug_msg_enabled[69]
+#define dprintf_toolhelp if(!debug_msg_enabled[71]) ; else fprintf
+#define debugging_toolhelp debug_msg_enabled[71]
 #else
 #ifdef DEBUG_TOOLHELP
 #define dprintf_toolhelp fprintf
@@ -1460,8 +1507,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_utility if(!debug_msg_enabled[70]) ; else fprintf
-#define debugging_utility debug_msg_enabled[70]
+#define dprintf_utility if(!debug_msg_enabled[72]) ; else fprintf
+#define debugging_utility debug_msg_enabled[72]
 #else
 #ifdef DEBUG_UTILITY
 #define dprintf_utility fprintf
@@ -1473,8 +1520,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_vxd if(!debug_msg_enabled[71]) ; else fprintf
-#define debugging_vxd debug_msg_enabled[71]
+#define dprintf_vxd if(!debug_msg_enabled[73]) ; else fprintf
+#define debugging_vxd debug_msg_enabled[73]
 #else
 #ifdef DEBUG_VXD
 #define dprintf_vxd fprintf
@@ -1486,8 +1533,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_win if(!debug_msg_enabled[72]) ; else fprintf
-#define debugging_win debug_msg_enabled[72]
+#define dprintf_win if(!debug_msg_enabled[74]) ; else fprintf
+#define debugging_win debug_msg_enabled[74]
 #else
 #ifdef DEBUG_WIN
 #define dprintf_win fprintf
@@ -1499,8 +1546,21 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_winsock if(!debug_msg_enabled[73]) ; else fprintf
-#define debugging_winsock debug_msg_enabled[73]
+#define dprintf_win32 if(!debug_msg_enabled[75]) ; else fprintf
+#define debugging_win32 debug_msg_enabled[75]
+#else
+#ifdef DEBUG_WIN32
+#define dprintf_win32 fprintf
+#define debugging_win32 1
+#else
+#define dprintf_win32 while(0) fprintf
+#define debugging_win32 0
+#endif
+#endif
+
+#ifdef DEBUG_RUNTIME
+#define dprintf_winsock if(!debug_msg_enabled[76]) ; else fprintf
+#define debugging_winsock debug_msg_enabled[76]
 #else
 #ifdef DEBUG_WINSOCK
 #define dprintf_winsock fprintf
@@ -1536,6 +1596,7 @@
     "driver",
     "edit",
     "enum",
+    "env",
     "event",
     "exec",
     "file",
@@ -1544,6 +1605,7 @@
     "gdi",
     "global",
     "graphics",
+    "hook",
     "icon",
     "int",
     "key",
@@ -1588,6 +1650,7 @@
     "utility",
     "vxd",
     "win",
+    "win32",
     "winsock",
     ""
 };
diff --git a/include/handle32.h b/include/handle32.h
new file mode 100644
index 0000000..f4e0d9e
--- /dev/null
+++ b/include/handle32.h
@@ -0,0 +1,87 @@
+#ifndef __WINE_HANDLE32_H
+#define __WINE_HANDLE32_H
+
+#include <malloc.h>
+
+/* The _*_OBJECT structures contain information needed about each
+ * particular type of handle.  This information is a combination of
+ * equivalent UNIX-style handles/descriptors and general information
+ * that the Win32 API might request.
+ *
+ * The KERNEL_OBJECT structure must be the first member of any specific
+ * kernel object type's structure.
+ */
+
+typedef struct {
+    unsigned long       magic;
+} KERNEL_OBJECT, *HANDLE32;
+
+typedef struct {
+    KERNEL_OBJECT       common;
+    unsigned long       thread_id;
+    unsigned long       process_id;
+} THREAD_OBJECT;
+
+typedef struct {
+    KERNEL_OBJECT       common;
+    unsigned long       process_id;
+    unsigned long       main_thread_id;
+} PROCESS_OBJECT;
+
+/* The FILE object includes things like disk files, pipes, and
+ * character devices (com ports, consoles, ...).
+ */
+typedef struct {
+    KERNEL_OBJECT       common;
+    int                 fd;                 /* UNIX fd */
+    int                 type;               /* FILE_TYPE_* */
+    unsigned long       misc_flags;         /* special flags */
+    unsigned long       access_flags;       /* UNIX access flags */
+    unsigned long       create_flags;       /* UNIX creation flags */
+} FILE_OBJECT;
+
+typedef struct {
+    KERNEL_OBJECT       common;
+} SEMAPHORE_OBJECT;
+
+typedef struct {
+    KERNEL_OBJECT       common;
+} EVENT_OBJECT;
+
+/* Should this even be here?
+ */
+typedef struct {
+    KERNEL_OBJECT       common;
+} REGKEY_OBJECT;
+
+/* Object number definitions.  These numbers are used to
+ * validate the kernel object by comparison against the
+ * object's 'magic' value.
+  */
+#define KERNEL_OBJECT_UNUSED    2404554046UL
+#define KERNEL_OBJECT_THREAD    (KERNEL_OBJECT_UNUSED + 1)
+#define KERNEL_OBJECT_PROCESS   (KERNEL_OBJECT_UNUSED + 2)
+#define KERNEL_OBJECT_FILE      (KERNEL_OBJECT_UNUSED + 3)
+#define KERNEL_OBJECT_SEMAPHORE (KERNEL_OBJECT_UNUSED + 4)
+#define KERNEL_OBJECT_EVENT     (KERNEL_OBJECT_UNUSED + 5)
+#define KERNEL_OBJECT_REGKEY    (KERNEL_OBJECT_UNUSED + 6)
+
+/* Define the invalid handle value
+ */
+#define INVALID_HANDLE_VALUE    ((HANDLE32)-1)
+
+/* Functions for checking kernel objects.
+ */
+int ValidateKernelObject(KERNEL_OBJECT *ptr);
+
+/* For now, CreateKernelObject and ReleaseKernelObject will
+ * simply map to malloc() and free().
+ */
+#define CreateKernelObject(size) (malloc(size))
+#define ReleaseKernelObject(ptr) (free(ptr))
+
+/* Prototypes for the Close*Handle functions
+ */
+int CloseFileHandle(FILE_OBJECT *hFile);
+
+#endif /* __WINE_HANDLE32_H */
diff --git a/include/hook.h b/include/hook.h
index bd91822..610b816 100644
--- a/include/hook.h
+++ b/include/hook.h
@@ -11,31 +11,28 @@
 #include "ldt.h"
 #include "callback.h"
 
+#ifndef WINELIB
+#pragma pack(1)
+#endif
+
   /* Hook data (pointed to by a HHOOK) */
 typedef struct
 {
-    HHOOK    next;   /* Next hook in chain */
-    HOOKPROC proc;   /* Hook procedure */
-    short    id;     /* Hook id (WH_xxx) */
-    HTASK    htask;  /* Task owning this hook */
+    HANDLE   next;               /* 00 Next hook in chain */
+    HOOKPROC proc WINE_PACKED;   /* 02 Hook procedure */
+    short    id;                 /* 06 Hook id (WH_xxx) */
+    HQUEUE   ownerQueue;         /* 08 Owner queue (0 for system hook) */
+    HMODULE  ownerModule;        /* 0a Owner module */
+    WORD     inHookProc;         /* 0c TRUE if in this->proc */
 } HOOKDATA;
 
+#ifndef WINELIB
+#pragma pack(4)
+#endif
 
-#define FIRST_HOOK  WH_MSGFILTER
-#define LAST_HOOK   WH_SHELL
+#define HOOK_MAGIC  ((int)'H' | (int)'K' << 8)  /* 'HK' */
 
-#define SYSTEM_HOOK(id)  (systemHooks[(id)-FIRST_HOOK])
-#define TASK_HOOK(id)    (taskHooks[(id)-FIRST_HOOK])
-#define INTERNAL_CALL_HOOK(hhook,code,wparam,lparam) \
-    ((hhook) ? CallHookProc(((HOOKDATA*)PTR_SEG_TO_LIN(hhook))->proc,\
-                            code, wparam, lparam) : 0)
-
-#define CALL_SYSTEM_HOOK(id,code,wparam,lparam) \
-    INTERNAL_CALL_HOOK(SYSTEM_HOOK(id),code,wparam,lparam)
-#define CALL_TASK_HOOK(id,code,wparam,lparam) \
-    INTERNAL_CALL_HOOK(TASK_HOOK(id),code,wparam,lparam)
-
-extern HHOOK systemHooks[];
-extern HHOOK taskHooks[];
+extern DWORD HOOK_CallHooks( short id, short code,
+                             WPARAM wParam, LPARAM lParam );
 
 #endif  /* HOOK_H */
diff --git a/include/kernel32.h b/include/kernel32.h
index 5fb595f..dd38cdc 100644
--- a/include/kernel32.h
+++ b/include/kernel32.h
@@ -2,6 +2,9 @@
  *
  * Win32 functions, structures, and types related to kernel functions
  */
+#ifndef __WINE_KERNEL32_H
+#define __WINE_KERNEL32_H
+
 #include <stddef.h>
 
 int KERN32_Init(void);
@@ -78,3 +81,54 @@
 #define TIME_ZONE_ID_STANDARD   1
 #define TIME_ZONE_ID_DAYLIGHT   2
 
+
+/* File object type definitions
+ */
+#define FILE_TYPE_UNKNOWN       0
+#define FILE_TYPE_DISK          1
+#define FILE_TYPE_CHAR          2
+#define FILE_TYPE_PIPE          3
+#define FILE_TYPE_REMOTE        32768
+
+/* File creation flags
+ */
+#define GENERIC_READ            0x80000000L
+#define GENERIC_WRITE           0x40000000L
+#define CREATE_NEW              1
+#define CREATE_ALWAYS           2
+#define OPEN_EXISTING           3
+#define OPEN_ALWAYS             4
+#define TRUNCATE_EXISTING       5
+
+/* Standard handle identifiers
+ */
+#define STD_INPUT_HANDLE        ((DWORD) -10)
+#define STD_OUTPUT_HANDLE       ((DWORD) -11)
+#define STD_ERROR_HANDLE        ((DWORD) -12)
+
+/* The security attributes structure (not filled in yet)
+ */
+typedef struct {
+    void *junk;
+} SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES;
+typedef struct
+{
+  int dwLowDateTime;
+  int dwHighDateTime;
+} FILETIME;
+
+typedef struct
+{
+  int dwFileAttributes;
+  FILETIME ftCreationTime;
+  FILETIME ftLastAccessTime;
+  FILETIME ftLastWriteTime;
+  int dwVolumeSerialNumber;
+  int nFileSizeHigh;
+  int nFileSizeLow;
+  int nNumberOfLinks;
+  int nFileIndexHigh;
+  int nFileIndexLow;
+} BY_HANDLE_FILE_INFORMATION ;
+
+#endif  /* __WINE_KERNEL32_H */
diff --git a/include/libres.h b/include/libres.h
new file mode 100644
index 0000000..68ada6f
--- /dev/null
+++ b/include/libres.h
@@ -0,0 +1,19 @@
+/*
+ * WINElib-Resources
+ */
+#ifndef __WINE_LIBRES_H
+#define __WINE_LIBRES_H
+
+#include "windows.h"
+
+#ifdef WINELIB
+HRSRC LIBRES_FindResource( HMODULE hModule, SEGPTR name, SEGPTR type );
+HGLOBAL LIBRES_LoadResource( HMODULE hModule, HRSRC hRsrc );
+LPSTR LIBRES_LockResource( HMODULE hModule, HGLOBAL handle );
+BOOL LIBRES_FreeResource( HMODULE hModule, HGLOBAL handle );
+INT LIBRES_AccessResource( HINSTANCE hModule, HRSRC hRsrc );
+DWORD LIBRES_SizeofResource( HMODULE hModule, HRSRC hRsrc );
+HGLOBAL LIBRES_AllocResource( HMODULE hModule, HRSRC hRsrc, DWORD size );
+#endif
+
+#endif
diff --git a/include/listbox.h b/include/listbox.h
index 405a110..1ca0891 100644
--- a/include/listbox.h
+++ b/include/listbox.h
@@ -24,7 +24,7 @@
 	WORD    DrawCtlType;
         WORD    CtlID;
 	LPLISTSTRUCT lpFirst;
-	DWORD   dwStyle;
+	HWND	hSelf;
 	HWND    hParent;
 	HFONT   hFont;
 	BOOL    bRedrawFlag;
@@ -34,6 +34,7 @@
 	LPINT   TabStops;
 	HANDLE  hDrawItemStruct;
         BOOL    needMeasure;
+	WORD	HeapSel;
 /*	MDESC   *Heap; */
 } HEADLIST,*LPHEADLIST;
 
@@ -41,7 +42,7 @@
 extern void CreateListBoxStruct(HWND hwnd, WORD CtlType, LONG styles, HWND parent);
 extern void DestroyListBoxStruct(LPHEADLIST lphl);
 
-extern void ListBoxSendNotification(LPHEADLIST lphl,HWND hwnd, WORD code);
+extern void ListBoxSendNotification(LPHEADLIST lphl, WORD code);
 
 extern LPLISTSTRUCT ListBoxGetItem(LPHEADLIST lphl, UINT uIndex);
 extern int ListMaxFirstVisible(LPHEADLIST lphl);
diff --git a/include/message.h b/include/message.h
index 10832ef..e604a41 100644
--- a/include/message.h
+++ b/include/message.h
@@ -9,6 +9,10 @@
 
 #include "windows.h"
 
+#ifndef WINELIB
+#pragma pack(1)
+#endif
+
   /* Message as stored in the queue (contains the extraInfo field) */
 typedef struct tagQMSG
 {
@@ -19,30 +23,45 @@
 
 typedef struct tagMESSAGEQUEUE
 {
-  WORD      next;
-  HTASK     hTask;                  /* hTask owning the queue                */
-  WORD      msgSize;                /* Size of messages in the queue         */
-  WORD      msgCount;               /* Number of waiting messages            */
-  WORD      nextMessage;            /* Next message to be retrieved          */
-  WORD      nextFreeMessage;        /* Next available slot in the queue      */
-  WORD      queueSize;              /* Size of the queue                     */
-  DWORD     GetMessageTimeVal;      /* Value returned by GetMessageTime      */
-  DWORD     GetMessagePosVal;       /* Value returned by GetMessagePos       */
-  DWORD     GetMessageExtraInfoVal; /* Value returned by GetMessageExtraInfo */
-  LPARAM    lParam;                 /* Next four values set by SendMessage   */
-  WPARAM    wParam;
-  UINT      msg;
-  HWND      hWnd;
-  WORD      wPostQMsg;              /* PostQuitMessage flag                  */
-  WORD      wExitCode;              /* PostQuitMessage exit code             */
-  WORD      InSendMessageHandle;    /* Handle of task that sent a message    */
-  WORD      wPaintCount;            /* Number of WM_PAINT needed             */
-  WORD      wTimerCount;            /* Number of timers for this application */
-  WORD      tempStatus;             /* State reset by GetQueueStatus         */
-  WORD      status;                 /* Queue state                           */
-  QMSG      messages[1];            /* Queue messages                        */
+  WORD      next;                   /* 00 Next queue */
+  HTASK     hTask;                  /* 02 hTask owning the queue */
+  WORD      msgSize;                /* 04 Size of messages in the queue */
+  WORD      msgCount;               /* 06 Number of waiting messages */
+  WORD      nextMessage;            /* 08 Next message to be retrieved */
+  WORD      nextFreeMessage;        /* 0a Next available slot in the queue */
+  WORD      queueSize;              /* 0c Size of the queue */
+  DWORD     GetMessageTimeVal WINE_PACKED;  /* 0e Value for GetMessageTime */
+  DWORD     GetMessagePosVal WINE_PACKED;   /* 12 Value for GetMessagePos */
+  WORD      reserved1;              /* 16 Unknown */
+  DWORD     GetMessageExtraInfoVal; /* 18 Value for GetMessageExtraInfo */
+  WORD      reserved2;              /* 1c Unknown */
+  LPARAM    lParam WINE_PACKED;     /* 1e Next 4 values set by SendMessage */
+  WPARAM    wParam;                 /* 22 */
+  UINT      msg;                    /* 24 */
+  HWND      hWnd;                   /* 26 */
+  DWORD     SendMessageReturn;      /* 28 Return value for SendMessage */
+  WORD      wPostQMsg;              /* 2c PostQuitMessage flag */
+  WORD      wExitCode;              /* 2e PostQuitMessage exit code */
+  WORD      reserved3[3];           /* 30 Unknown */
+  WORD      wWinVersion;            /* 36 Expected Windows version */
+  HQUEUE    InSendMessageHandle;    /* 38 Queue of task that sent a message */
+  HTASK     hSendingTask;           /* 3a Handle of task that sent a message */
+  HTASK     hPrevSendingTask;       /* 3c Handle of previous sender */
+  WORD      wPaintCount;            /* 3e Number of WM_PAINT needed */
+  WORD      wTimerCount;            /* 40 Number of timers for this task */
+  WORD      tempStatus;             /* 42 State reset by GetQueueStatus */
+  WORD      status;                 /* 44 Queue state */
+  WORD      wakeMask;               /* 46 Task wake-up mask */
+  WORD      SendMsgReturnPtrs[3];   /* 48 Near ptr to return values (?) */
+  HANDLE    hCurHook;               /* 4e Current hook */
+  HANDLE    hooks[WH_NB_HOOKS];     /* 50 Task hooks list */
+  WORD      reserved4[3];           /* 68 Unknown */
+  QMSG      messages[1];            /* 6e Queue messages */
 } MESSAGEQUEUE;
 
+#ifndef WINELIB
+#pragma pack(4)
+#endif
 
 extern void MSG_IncPaintCount( HANDLE hQueue );
 extern void MSG_DecPaintCount( HANDLE hQueue );
diff --git a/include/msdos.h b/include/msdos.h
index 6861971..5ee696a 100644
--- a/include/msdos.h
+++ b/include/msdos.h
@@ -5,11 +5,12 @@
 #include <windows.h>
 #include "comm.h"
 
+#define WINE_PATH_LENGTH 256
 struct dosdirent {
 	int  inuse;
 	DIR *ds;
-	char unixpath[256];
-	char filename[256];
+	char unixpath[WINE_PATH_LENGTH];
+	char filename[WINE_PATH_LENGTH];
 	char filemask[13];
 	char attribute;
 	char search_attribute;
@@ -17,6 +18,7 @@
 	long filetime;
         int telldirnum;
         short entnum;           /* Directory entry number */
+        struct dosdirent *next;
 };
 
 struct fcb {
diff --git a/include/options.h b/include/options.h
index 8ac6d2d..834713c 100644
--- a/include/options.h
+++ b/include/options.h
@@ -7,6 +7,18 @@
 #ifndef OPTIONS_H
 #define OPTIONS_H
 
+  /* Supported languages */
+typedef enum
+{
+    LANG_En,  /* English */
+    LANG_Es,  /* Spanish */
+    LANG_De,  /* German */
+    LANG_No,  /* Norwegian */
+    LANG_Fr,  /* French */
+    LANG_Fi,  /* Finnish */
+    LANG_Da   /* Danish */
+} WINE_LANGUAGE;
+
 struct options
 {
     char * desktopGeometry; /* NULL when no desktop */
@@ -21,6 +33,7 @@
 			       if write access is requested */
     int    enhanced;        /* Start Wine in enhanced mode */
     int    ipc;             /* Use IPC mechanisms */
+    WINE_LANGUAGE language; /* Current language */
 };
 
 extern struct options Options;
diff --git a/include/registers.h b/include/registers.h
index 777522d..2114b54 100644
--- a/include/registers.h
+++ b/include/registers.h
@@ -10,6 +10,8 @@
 #include <windows.h>
 #include "wine.h"
 
+#ifndef __svr4__
+
 #define EAX_reg(context)     ((context)->sc_eax)
 #define EBX_reg(context)     ((context)->sc_ebx)
 #define ECX_reg(context)     ((context)->sc_ecx)
@@ -63,4 +65,55 @@
 #define SET_CFLAG(context)   (EFL_reg(context) |= 0x0001)
 #define RESET_CFLAG(context) (EFL_reg(context) &= 0xfffffffe)
 
+#else  /* __svr4__ */
+
+#define EAX_reg(context)      ((context)->uc_mcontext.gregs[EAX])
+#define EBX_reg(context)      ((context)->uc_mcontext.gregs[EBX])
+#define ECX_reg(context)      ((context)->uc_mcontext.gregs[ECX])
+#define EDX_reg(context)      ((context)->uc_mcontext.gregs[EDX])
+#define ESI_reg(context)      ((context)->uc_mcontext.gregs[ESI])
+#define EDI_reg(context)      ((context)->uc_mcontext.gregs[EDI])
+#define EBP_reg(context)      ((context)->uc_mcontext.gregs[EBP])
+                            
+#define AX_reg(context)      (*(WORD*)&((context)->uc_mcontext.gregs[EAX]))
+#define BX_reg(context)      (*(WORD*)&((context)->uc_mcontext.gregs[EBX]))
+#define CX_reg(context)      (*(WORD*)&((context)->uc_mcontext.gregs[ECX]))
+#define DX_reg(context)      (*(WORD*)&((context)->uc_mcontext.gregs[EDX]))
+#define SI_reg(context)      (*(WORD*)&((context)->uc_mcontext.gregs[ESI]))
+#define DI_reg(context)      (*(WORD*)&((context)->uc_mcontext.gregs[EDI]))
+#define BP_reg(context)      (*(WORD*)&((context)->uc_mcontext.gregs[EBP]))
+                            
+#define AL_reg(context)      (*(BYTE*)(&(context)->uc_mcontext.gregs[EAX]))
+#define AH_reg(context)      (*(((BYTE*)(&(context)->uc_mcontext.gregs[EAX])+1)))
+#define BL_reg(context)      (*(BYTE*)(&(context)->uc_mcontext.gregs[EBX]))
+#define BH_reg(context)      (*(((BYTE*)(&(context)->uc_mcontext.gregs[EBX])+1)))
+#define CL_reg(context)      (*(BYTE*)(&(context)->uc_mcontext.gregs[ECX]))
+#define CH_reg(context)      (*(((BYTE*)(&(context)->uc_mcontext.gregs[ECX])+1)))
+#define DL_reg(context)      (*(BYTE*)(&(context)->uc_mcontext.gregs[EDX]))
+#define DH_reg(context)      (*(((BYTE*)(&(context)->uc_mcontext.gregs[EDX])+1)))
+                            
+#define CS_reg(context)      ((context)->uc_mcontext.gregs[CS])
+#define DS_reg(context)      ((context)->uc_mcontext.gregs[DS])
+#define ES_reg(context)      ((context)->uc_mcontext.gregs[ES])
+#define SS_reg(context)      ((context)->uc_mcontext.gregs[SS])
+                            
+#define FS_reg(context)      ((context)->uc_mcontext.gregs[FS])
+#define GS_reg(context)      ((context)->uc_mcontext.gregs[GS])
+
+                            
+#define EFL_reg(context)     ((context)->uc_mcontext.gregs[EFL])
+#define FL_reg(context)      (*(WORD*)(&(context)->uc_mcontext.gregs[EFL]))
+
+                            
+#define EIP_reg(context)      ((context)->uc_mcontext.gregs[EIP])
+#define ESP_reg(context)     ((context)->uc_mcontext.gregs[R_ESP])
+                            
+#define IP_reg(context)      (*(WORD*)(&(context)->uc_mcontext.gregs[EIP]))
+#define SP_reg(context)      (*(WORD*)(&(context)->uc_mcontext.gregs[R_ESP]))
+                            
+#define SET_CFLAG(context)   (EFL_reg(context) |= 0x0001)
+#define RESET_CFLAG(context) (EFL_reg(context) &= 0xfffffffe)
+
+#endif  /* __svr4__ */
+
 #endif /* __WINE_REGISTERS_H */
diff --git a/include/stddebug.h b/include/stddebug.h
index 0b5a5c4..b5c8917 100644
--- a/include/stddebug.h
+++ b/include/stddebug.h
@@ -97,6 +97,7 @@
 #undef DEBUG_DRIVER
 #undef DEBUG_EDIT
 #undef DEBUG_ENUM
+#undef DEBUG_ENV
 #undef DEBUG_EVENT
 #undef DEBUG_EXEC
 #undef DEBUG_FILE
@@ -105,6 +106,7 @@
 #undef DEBUG_GDI
 #undef DEBUG_GLOBAL
 #undef DEBUG_GRAPHICS
+#undef DEBUG_HOOK
 #undef DEBUG_ICON
 #undef DEBUG_INT
 #undef DEBUG_KEY
@@ -149,6 +151,7 @@
 #undef DEBUG_UTILITY
 #undef DEBUG_VXD
 #undef DEBUG_WIN
+#undef DEBUG_WIN32
 #undef DEBUG_WINSOCK
 #endif
 
@@ -174,6 +177,7 @@
 #define DEBUG_DRIVER
 #define DEBUG_EDIT
 #define DEBUG_ENUM
+#define DEBUG_ENV
 #define DEBUG_EVENT
 #define DEBUG_EXEC
 #define DEBUG_FILE
@@ -182,6 +186,7 @@
 #define DEBUG_GDI
 #define DEBUG_GLOBAL
 #define DEBUG_GRAPHICS
+#define DEBUG_HOOK
 #define DEBUG_ICON
 #define DEBUG_INT
 #define DEBUG_KEY
@@ -226,5 +231,6 @@
 #define DEBUG_UTILITY
 #define DEBUG_VXD
 #define DEBUG_WIN
+#define DEBUG_WIN32
 #define DEBUG_WINSOCK
 #endif
diff --git a/include/winbase.h b/include/winbase.h
new file mode 100644
index 0000000..38f5e3c
--- /dev/null
+++ b/include/winbase.h
@@ -0,0 +1,124 @@
+#ifndef _WINBASE_H
+#define _WINBASE_H
+
+
+
+#ifdef UNICODE
+#define LoadAccelerators LoadAcceleratorsW
+#define TranslateAccelat
+#else
+#define LoadAccelerators LoadAcceleratorsA
+#endif
+
+
+#define INVALID_HANDLE_VALUE ((HANDLE) -1)
+
+#define WAIT_FAILED		0xffffffff
+#define WAIT_OBJECT_0		0
+#define WAIT_ABANDONED		STATUS_ABANDONED_WAIT_0
+#define WAIT_ABANDONED_0	STATUS_ABANDONED_WAIT_0
+#define WAIT_TIMEOUT		STATUS_TIMEOUT
+
+#define MEM_COMMIT      0x1000
+#define MEM_RESERVE	0x2000
+#define MEM_TOPDOWN	0x100000
+
+#define MEM_RELEASE	0x8000
+
+#define	PAGE_NOACCESS		0x01
+#define	PAGE_READONLY		0x02
+#define	PAGE_READWRITE		0x04
+#define	PAGE_WRITECOPY		0x08
+#define	PAGE_EXECUTE		0x10
+#define	PAGE_EXECUTE_READ	0x20
+#define	PAGE_EXECUTE_READWRITE	0x40
+#define	PAGE_EXECUTE_WRITECOPY	0x80
+#define	PAGE_GUARD		0x100
+#define	PAGE_NOCACHE		0x200
+
+HANDLE WINAPI OpenProcess(DWORD access, BOOL inherit, DWORD id);
+int WINAPI GetCurrentProcessId(void);
+int WINAPI TerminateProcess(HANDLE h, int ret);
+
+WINAPI void *  VirtualAlloc (void *addr,DWORD size,DWORD type,DWORD protect);
+
+struct _EXCEPTION_POINTERS;
+
+typedef LONG (TOP_LEVEL_EXCEPTION_FILTER)(struct _EXCEPTION_POINTERS *);
+
+WINAPI  TOP_LEVEL_EXCEPTION_FILTER *SetUnhandledExceptionFilter(TOP_LEVEL_EXCEPTION_FILTER *func);
+
+/*WINAPI int  SetErrorMode(int);*/
+
+#define STATUS_WAIT_0                    0x00000000    
+#define STATUS_ABANDONED_WAIT_0          0x00000080    
+#define STATUS_USER_APC                  0x000000C0    
+#define STATUS_TIMEOUT                   0x00000102    
+#define STATUS_PENDING                   0x00000103    
+#define STATUS_GUARD_PAGE_VIOLATION      0x80000001    
+#define STATUS_DATATYPE_MISALIGNMENT     0x80000002    
+#define STATUS_BREAKPOINT                0x80000003    
+#define STATUS_SINGLE_STEP               0x80000004    
+#define STATUS_ACCESS_VIOLATION          0xC0000005    
+#define STATUS_IN_PAGE_ERROR             0xC0000006    
+#define STATUS_NO_MEMORY                 0xC0000017    
+#define STATUS_ILLEGAL_INSTRUCTION       0xC000001D    
+#define STATUS_NONCONTINUABLE_EXCEPTION  0xC0000025    
+#define STATUS_INVALID_DISPOSITION       0xC0000026    
+#define STATUS_ARRAY_BOUNDS_EXCEEDED     0xC000008C    
+#define STATUS_FLOAT_DENORMAL_OPERAND    0xC000008D    
+#define STATUS_FLOAT_DIVIDE_BY_ZERO      0xC000008E    
+#define STATUS_FLOAT_INEXACT_RESULT      0xC000008F    
+#define STATUS_FLOAT_INVALID_OPERATION   0xC0000090    
+#define STATUS_FLOAT_OVERFLOW            0xC0000091    
+#define STATUS_FLOAT_STACK_CHECK         0xC0000092    
+#define STATUS_FLOAT_UNDERFLOW           0xC0000093    
+#define STATUS_INTEGER_DIVIDE_BY_ZERO    0xC0000094    
+#define STATUS_INTEGER_OVERFLOW          0xC0000095    
+#define STATUS_PRIVILEGED_INSTRUCTION    0xC0000096    
+#define STATUS_STACK_OVERFLOW            0xC00000FD    
+#define STATUS_CONTROL_C_EXIT            0xC000013A    
+
+#define DUPLICATE_CLOSE_SOURCE		0x00000001
+#define DUPLICATE_SAME_ACCESS		0x00000002
+
+typedef struct 
+{
+  int type;
+} exception;
+
+typedef struct 
+{
+  int pad[39];
+  int edi;
+  int esi;
+  int ebx;
+  int edx;
+  int ecx;
+  int eax;
+
+  int ebp;
+  int eip;
+  int cs;
+  int eflags;
+  int esp;
+  int ss;
+} exception_info;
+
+#endif
+
+
+/*DWORD WINAPI GetVersion( void );*/
+
+int
+WINAPI WinMain(HINSTANCE, HINSTANCE prev, char *cmd, int show);
+
+#define GMEM_FIXED          0x0000
+#define GMEM_MOVEABLE 	    0x0002
+
+DECLARE_HANDLE(HACCEL);
+
+HACCEL WINAPI LoadAcceleratorsA(   HINSTANCE, const char *);
+#define FreeModule(hLibModule) FreeLibrary((hLibModule))
+#define MakeProcInstance(lpProc,hInstance) (lpProc)
+#define FreeProcInstance(lpProc) (lpProc)
diff --git a/include/wincon.h b/include/wincon.h
new file mode 100644
index 0000000..c10560c
--- /dev/null
+++ b/include/wincon.h
@@ -0,0 +1,335 @@
+#ifndef _WINCON_H_
+#define _WINCON_H_
+
+
+#ifdef UNICODE
+#define FillConsoleOutputCharacter FillConsoleOutputCharacterW
+#define GetConsoleTitle GetConsoleTitleW
+#define PeekConsoleInput PeekConsoleInputW
+#define ReadConsole ReadConsoleW
+#define ReadConsoleInput ReadConsoleInputW
+#define ReadConsoleOutput ReadConsoleOutputW
+#define ReadConsoleOutputCharacter ReadConsoleOutputCharacterW
+#define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferW
+#define SetConsoleTitle SetConsoleTitleW
+#define WriteConsole WriteConsoleW
+#define WriteConsoleInput WriteConsoleInputW
+#define WriteConsoleOutput WriteConsoleOutputW
+#define WriteConsoleOutputCharacter WriteConsoleOutputCharacterW
+#else
+#define FillConsoleOutputCharacter FillConsoleOutputCharacterA
+#define GetConsoleTitle GetConsoleTitleA
+#define PeekConsoleInput PeekConsoleInputA
+#define ReadConsole ReadConsoleA
+#define ReadConsoleInput ReadConsoleInputA
+#define ReadConsoleOutput ReadConsoleOutputA
+#define ReadConsoleOutputCharacter ReadConsoleOutputCharacterA
+#define ScrollConsoleScreenBuffer ScrollConsoleScreenBufferA
+#define SetConsoleTitle SetConsoleTitleA
+#define WriteConsole WriteConsoleA
+#define WriteConsoleInput WriteConsoleInputA
+#define WriteConsoleOutput WriteConsoleOutputA
+#define WriteConsoleOutputCharacter WriteConsoleOutputCharacterA
+#endif
+
+
+
+#if 0
+
+typedef struct
+  {
+    int bKeyDown;
+    WORD wRepeatCount;
+    WORD wVirtualKeyCode;
+    WORD wVirtualScanCode;
+
+    char AsciiChar;
+char pad;
+#if 0
+    union
+      {
+	WCHAR UnicodeChar;
+	CHAR AsciiChar;
+      }
+    uChar;
+#endif
+    DWORD dwControlKeyState;
+  } __attribute__ ((packed)) KEY_EVENT_RECORD;
+
+
+
+#define RIGHT_ALT_PRESSED 0x1
+#define LEFT_ALT_PRESSED 0x2
+#define RIGHT_CTRL_PRESSED 0x4
+#define LEFT_CTRL_PRESSED 0x8
+#define SHIFT_PRESSED 0x10
+#define NUMLOCK_ON 0x20
+#define SCROLLLOCK_ON 0x40
+#define CAPSLOCK_ON 0x80
+#define ENHANCED_KEY 0x100
+
+typedef struct
+  {
+    COORD dwMousePosition;
+    DWORD dwButtonState;
+    DWORD dwControlKeyState;
+    DWORD dwEventFlags;
+  }
+MOUSE_EVENT_RECORD;
+
+#define CONSOLE_TEXTMODE_BUFFER 1
+
+
+#define FROM_LEFT_1ST_BUTTON_PRESSED 0x0001
+#define RIGHTMOST_BUTTON_PRESSED 0x0002
+#define FROM_LEFT_2ND_BUTTON_PRESSED 0x0004
+#define FROM_LEFT_3RD_BUTTON_PRESSED 0x0008
+#define FROM_LEFT_4TH_BUTTON_PRESSED 0x0010
+
+
+
+
+#define MOUSE_MOVED 0x0001
+#define DOUBLE_CLICK 0x0002
+
+typedef struct
+  {
+    COORD size;
+  }
+WINDOW_BUFFER_SIZE_RECORD;
+
+typedef struct
+  {
+    UINT dwCommandId;
+  }
+MENU_EVENT_RECORD;
+
+typedef struct
+  {
+    BOOL bSetFocus;
+  }
+FOCUS_EVENT_RECORD;
+
+typedef struct
+  {
+    WORD EventType;
+    union
+      {
+	KEY_EVENT_RECORD KeyEvent;
+	MOUSE_EVENT_RECORD MouseEvent;
+	WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent;
+	MENU_EVENT_RECORD MenuEvent;
+	FOCUS_EVENT_RECORD FocusEvent;
+      }
+    Event;
+  }
+INPUT_RECORD;
+
+#define KEY_EVENT 0x1
+#define MOUSE_EVENT 0x2
+#define WINDOW_BUFFER_SIZE_EVENT 0x4
+#define MENU_EVENT 0x8
+#define FOCUS_EVENT 0x10
+
+typedef struct
+  {
+    union
+      {
+	WCHAR UnicodeChar;
+	CHAR AsciiChar;
+      }
+    Char;
+    WORD Attributes;
+  }
+CHAR_INFO;
+
+
+
+
+#define FOREGROUND_BLUE 0x01
+#define FOREGROUND_GREEN 0x02
+#define FOREGROUND_RED 0x04
+#define FOREGROUND_INTENSITY 0x08
+#define BACKGROUND_BLUE 0x10
+#define BACKGROUND_GREEN 0x20
+#define BACKGROUND_RED 0x40
+#define BACKGROUND_INTENSITY 0x80
+
+
+typedef struct
+  {
+    COORD dwSize;
+    COORD dwCursorPosition;
+    WORD wAttrs;
+    SMALL_RECT srWindow;
+    COORD dwMaximumWindowSize;
+  }
+CONSOLE_SCREEN_BUFFER_INFO;
+
+typedef struct
+  {
+    DWORD size;
+    BOOL bVisible;
+  }
+CONSOLE_CURSOR_INFO;
+
+#endif
+
+
+#define CTRL_C_EVENT 0
+#define CTRL_BREAK_EVENT 1
+#define CTRL_CLOSE_EVENT 2
+#define CTRL_LOGOFF_EVENT 5
+#define CTRL_SHUTDOWN_EVENT 6
+
+typedef BOOL HANDLER_ROUTINE (WORD ctrltype);
+
+#if 0
+
+#define ENABLE_PROCESSED_INPUT 0x01
+#define ENABLE_LINE_INPUT 0x02
+#define ENABLE_ECHO_INPUT 0x04
+#define ENABLE_WINDOW_INPUT 0x08
+#define ENABLE_MOUSE_INPUT 0x10
+
+#define ENABLE_PROCESSED_OUTPUT 0x01
+#define ENABLE_WRAP_AT_EOL_OUTPUT 0x02
+
+
+BOOL WINAPI AllocConsole (VOID);
+
+
+HANDLE WINAPI CreateConsoleScreenBuffer (DWORD access,
+					 DWORD mode,
+					 CONST SECURITY_ATTRIBUTES * lattr,
+					 DWORD flags,
+					 VOID * ptr);
+
+BOOL WINAPI FillConsoleOutputAttribute (HANDLE h,
+					WORD attr,
+					DWORD len,
+					COORD co,
+					DWORD * done);
+
+BOOL WINAPI FillConsoleOutputCharacterA (HANDLE h,
+					 CHAR c,
+					 DWORD len,
+					 COORD co,
+					 DWORD * done);
+
+
+BOOL WINAPI FlushBuffer (HANDLE h);
+
+BOOL WINAPI FreeConsole (VOID);
+BOOL WINAPI GenerateConsoleCtrlEvent (DWORD  ev,    DWORD group);
+UINT WINAPI GetConsoleCP (VOID);
+BOOL WINAPI GetConsoleCursorInfo (HANDLE h, CONSOLE_CURSOR_INFO *info);
+BOOL WINAPI GetConsoleMode (HANDLE h, DWORD * mode);
+UINT WINAPI GetConsoleOutputCP (VOID);
+BOOL WINAPI GetConsoleScreenBufferInfo (HANDLE h, CONSOLE_SCREEN_BUFFER_INFO *
+					ptr);
+
+DWORD WINAPI GetConsoleTitleA (LPSTR str, DWORD len);
+
+
+COORD WINAPI GetLargestConsoleWindowSize (HANDLE h);
+
+BOOL WINAPI GetNumberOfConsoleInputEvents (HANDLE h,
+					   DWORD * n);
+
+BOOL WINAPI GetNumberOfConsoleMouseButtons (DWORD * n);
+
+BOOL WINAPI PeekConsoleInputA (HANDLE h,
+			       INPUT_RECORD * ptr,
+			       DWORD len,
+			       DWORD * done);
+
+
+
+BOOL WINAPI ReadConsoleA (HANDLE h,
+			  VOID * ptr,
+			  DWORD len,
+			  DWORD * done,
+			  VOID * res);
+
+BOOL WINAPI ReadConsoleInputA (HANDLE h,
+			       INPUT_RECORD * ptr,
+			       DWORD len,
+			       DWORD * done);
+
+BOOL WINAPI ReadConsoleOutputA (HANDLE h,
+				CHAR_INFO * ptr,
+				COORD size,
+				COORD fred,
+				SMALL_RECT * reg);
+
+BOOL WINAPI ReadConsoleOutputAttribute (HANDLE h,
+					WORD * attr,
+					DWORD len,
+					COORD rc,
+					DWORD * done);
+
+BOOL WINAPI ReadConsoleOutputCharacterA (HANDLE h,
+					 LPSTR c,
+					 DWORD len,
+					 COORD rc,
+					 DWORD * done);
+
+BOOL WINAPI ScrollConsoleScreenBufferA (HANDLE h,
+					CONST SMALL_RECT * sr,
+					CONST SMALL_RECT * cr,
+					COORD cpos,
+					CONST CHAR_INFO * i);
+
+
+BOOL WINAPI SetConsoleActiveScreenBuffer (HANDLE h);
+BOOL WINAPI SetConsoleCP (UINT i);
+BOOL WINAPI SetConsoleCtrlHandler (HANDLER_ROUTINE * func,  BOOL a);
+
+BOOL WINAPI SetConsoleCursorInfo (HANDLE h,  CONST CONSOLE_CURSOR_INFO * info);
+
+BOOL WINAPI SetConsoleCursorPosition (HANDLE h, COORD pos);
+
+BOOL WINAPI SetConsoleMode (HANDLE h, DWORD mode);
+
+BOOL WINAPI SetConsoleOutputCP (UINT i);
+BOOL WINAPI SetConsoleScreenBufferSize (HANDLE h, COORD size);
+BOOL WINAPI SetConsoleTextAttribute (HANDLE h,
+				     WORD attrs);
+BOOL WINAPI SetConsoleTitleA (const char * str);
+
+BOOL WINAPI SetConsoleWindowInfo (HANDLE h,
+				  BOOL abs, 
+				  CONST SMALL_RECT * wnd);
+
+BOOL WINAPI WriteConsoleA (HANDLE h, 
+			   CONST VOID *   ptr,
+			   DWORD slen,
+			   DWORD * done,
+			   VOID * res);
+
+BOOL WINAPI WriteConsoleInputA (HANDLE	h, 
+				CONST INPUT_RECORD * ptr,
+				DWORD len, 
+				DWORD * done);
+
+BOOL WINAPI WriteConsoleOutputA (HANDLE  h,
+				 CONST CHAR_INFO * ptr,
+				 COORD size, 
+				 COORD fred, 
+				 SMALL_RECT* where);
+
+BOOL WINAPI WriteConsoleOutputAttribute (HANDLE h,
+					 CONST WORD *attr,
+					 DWORD len,
+					 COORD co,
+					 DWORD * done);
+
+BOOL WINAPI WriteConsoleOutputCharacterA (HANDLE h,
+					  const char * c,
+					  DWORD len,
+					  COORD co,
+					  DWORD * done);
+#endif
+#endif
+
diff --git a/include/windows.h b/include/windows.h
index 064434d..02542d0 100644
--- a/include/windows.h
+++ b/include/windows.h
@@ -173,10 +173,10 @@
 {
     HWND    hwnd;
     HWND    hwndInsertAfter;
-    int     x;
-    int     y;
-    int     cx;
-    int     cy;
+    INT     x;
+    INT     y;
+    INT     cx;
+    INT     cy;
     UINT    flags;
 } WINDOWPOS;
 
@@ -270,6 +270,7 @@
 /***** Window hooks *****/
 
   /* Hook values */
+#define WH_MSGFILTER	    (-1)
 #define WH_JOURNALRECORD    0
 #define WH_JOURNALPLAYBACK  1
 #define WH_KEYBOARD	    2
@@ -280,8 +281,11 @@
 #define WH_MOUSE	    7
 #define WH_HARDWARE	    8
 #define WH_DEBUG	    9
-#define WH_SHELL           10
-#define WH_MSGFILTER	    (-1)
+#define WH_SHELL            10
+
+#define WH_FIRST_HOOK       WH_MSGFILTER
+#define WH_LAST_HOOK        WH_SHELL
+#define WH_NB_HOOKS         (WH_LAST_HOOK-WH_FIRST_HOOK+1)
 
   /* Hook action codes */
 #define HC_ACTION           0
@@ -302,14 +306,6 @@
 #define MSGF_MAINLOOP       8
 #define MSGF_USER        4096
 
-  /* Journalling hook values */
-#define HC_GETNEXT	    1
-#define HC_SKIP 	    2
-#define HC_NOREMOVE	    3
-#define HC_NOREM	    HC_NOREMOVE
-#define HC_SYSMODALON       4
-#define HC_SYSMODALOFF	    5
-
   /* Journalling hook structure */
 typedef struct tagEVENTMSG
 {
@@ -532,7 +528,7 @@
     INT  bmWidthBytes;
     BYTE   bmPlanes;
     BYTE   bmBitsPixel;
-    void * bmBits WINE_PACKED;
+    SEGPTR bmBits WINE_PACKED;
 } BITMAP;
 
 typedef BITMAP *PBITMAP;
@@ -999,7 +995,7 @@
 
 typedef struct
 {
-    unsigned long bcSize;
+    DWORD bcSize;
     UINT bcWidth;
     UINT bcHeight;
     UINT bcPlanes;
@@ -1307,6 +1303,7 @@
 #define IDI_EXCLAMATION  MAKEINTRESOURCE(32515)
 #define IDI_ASTERISK     MAKEINTRESOURCE(32516)
 
+#define IDC_BUMMER	 MAKEINTRESOURCE(100)
 #define IDC_ARROW        MAKEINTRESOURCE(32512)
 #define IDC_IBEAM        MAKEINTRESOURCE(32513)
 #define IDC_WAIT         MAKEINTRESOURCE(32514)
@@ -1362,6 +1359,9 @@
 #define OBM_OLD_ZOOM        32756
 #define OBM_OLD_RESTORE     32755
 
+#define OCR_BUMMER	    100
+#define OCR_DRAGOBJECT	    101
+
 #define OCR_NORMAL          32512
 #define OCR_IBEAM           32513
 #define OCR_WAIT            32514
@@ -1405,6 +1405,28 @@
 #define DEFAULT_PALETTE     15
 #define SYSTEM_FIXED_FONT   16
 
+/* DragObject stuff */
+
+typedef struct tagDRAGINFO {
+	HWND 	hWnd;
+	HANDLE	hScope;
+	WORD	wFlags;
+	HANDLE  hList;
+	HANDLE  hOfStruct;
+	POINT	pt WINE_PACKED;
+	LONG	l  WINE_PACKED;
+}	DRAGINFO, FAR* LPDRAGINFO;
+
+#define DRAGOBJ_PROGRAM		0x0001
+#define DRAGOBJ_DATA		0x0002
+#define DRAGOBJ_DIRECTORY	0x0004
+#define DRAGOBJ_MULTIPLE	0x0008
+#define DRAGOBJ_EXTERNAL	0x8000
+
+#define DRAG_PRINT		0x544E5250
+#define DRAG_FILE		0x454C4946
+
+/* Messages */
 
 enum {  WM_NULL, WM_CREATE, WM_DESTROY, WM_MOVE, WM_UNUSED0, WM_SIZE, WM_ACTIVATE,
 	WM_SETFOCUS, WM_KILLFOCUS, WM_SETVISIBLE, WM_ENABLE, WM_SETREDRAW, 
@@ -1523,6 +1545,7 @@
 #define WM_MDIGETACTIVE     0x0229
 #define WM_DROPOBJECT	    0x022A
 #define WM_QUERYDROPOBJECT  0x022B
+#define WM_BEGINDRAG	    0x022C
 #define WM_DRAGLOOP	    0x022D
 #define WM_DRAGSELECT	    0x022E
 #define WM_DRAGMOVE	    0x022F
@@ -1757,6 +1780,7 @@
 
 /* Window extended styles */
 #define WS_EX_DLGMODALFRAME    0x00000001L
+#define WS_EX_DRAGDETECT       0x00000002L
 #define WS_EX_NOPARENTNOTIFY   0x00000004L
 #define WS_EX_TOPMOST          0x00000008L
 #define WS_EX_ACCEPTFILES      0x00000010L
@@ -2073,7 +2097,7 @@
 
 #define WM_DRAWITEM         0x002B
 
-typedef struct tagDRAWITEMSTRUCT
+typedef struct
 {
     UINT        CtlType;
     UINT        CtlID;
@@ -2090,7 +2114,7 @@
 
 #define WM_MEASUREITEM      0x002C
 
-typedef struct tagMEASUREITEMSTRUCT
+typedef struct
 {
     UINT        CtlType;
     UINT        CtlID;
@@ -2104,7 +2128,7 @@
 
 #define WM_DELETEITEM       0x002D
 
-typedef struct tagDELETEITEMSTRUCT
+typedef struct
 {
     UINT       CtlType;
     UINT       CtlID;
@@ -2117,7 +2141,7 @@
 
 #define WM_COMPAREITEM      0x0039
 
-typedef struct tagCOMPAREITEMSTRUCT
+typedef struct
 {
     UINT        CtlType;
     UINT        CtlID;
@@ -2282,7 +2306,7 @@
 #define WM_CHANGECBCHAIN    0x030D
 
 /* Metafile header structure */
-typedef struct tagMETAHEADER
+typedef struct
 {
     WORD       mtType;
     WORD       mtHeaderSize;
@@ -2294,7 +2318,7 @@
 } METAHEADER;
 
 /* Metafile typical record structure */
-typedef struct tagMETARECORD
+typedef struct
 {
     DWORD      rdSize;
     WORD       rdFunction;
@@ -2304,7 +2328,7 @@
 typedef METARECORD *LPMETARECORD;
 
 /* Handle table structure */
-typedef struct tagHANDLETABLE
+typedef struct
 {
     HANDLE     objectHandle[1];
 } HANDLETABLE;
@@ -2312,7 +2336,7 @@
 typedef HANDLETABLE *LPHANDLETABLE;
 
 /* Clipboard metafile picture structure */
-typedef struct tagMETAFILEPICT
+typedef struct
 {
     INT        mm;
     INT        xExt;
@@ -2402,16 +2426,15 @@
 #define META_CREATEREGION            0x06FF
 
 /* Debugging support (DEBUG SYSTEM ONLY) */
-typedef struct tagWINDEBUGINFO
+typedef struct
 {
     UINT    flags;
-    DWORD   dwOptions;
-    DWORD   dwFilter;
-    char    achAllocModule[8];
-    DWORD   dwAllocBreak;
-    DWORD   dwAllocCount;
-} WINDEBUGINFO;
-typedef WINDEBUGINFO FAR* LPWINDEBUGINFO;
+    DWORD   dwOptions WINE_PACKED;
+    DWORD   dwFilter WINE_PACKED;
+    char    achAllocModule[8] WINE_PACKED;
+    DWORD   dwAllocBreak WINE_PACKED;
+    DWORD   dwAllocCount WINE_PACKED;
+} WINDEBUGINFO, *LPWINDEBUGINFO;
 
 /* WINDEBUGINFO flags values */
 #define WDI_OPTIONS         0x0001
@@ -2455,683 +2478,691 @@
 #pragma pack(4)
 #endif
 
-ATOM AddAtom(SEGPTR);
-ATOM DeleteAtom(ATOM);
-ATOM FindAtom(SEGPTR);
-ATOM GlobalAddAtom(SEGPTR);
-ATOM GlobalDeleteAtom(ATOM);
-ATOM GlobalFindAtom(SEGPTR);
-ATOM RegisterClass(LPWNDCLASS);
-BOOL AnyPopup(void);
-BOOL AppendMenu(HMENU,UINT,UINT,LPSTR);
-BOOL Arc(HDC,int,int,int,int,int,int,int,int);
-BOOL BitBlt(HDC,short,short,short,short,HDC,short,short,DWORD);
-BOOL BringWindowToTop(HWND);
-BOOL CallMsgFilter(SEGPTR,short);
-BOOL ChangeClipboardChain(HWND,HWND);
-BOOL ChangeMenu(HMENU,UINT,LPSTR,UINT,UINT);
-BOOL CheckMenuItem(HMENU,UINT,UINT);
-BOOL Chord(HDC,int,int,int,int,int,int,int,int);
-BOOL CloseClipboard(void);
-BOOL DPtoLP(HDC,LPPOINT,int);
-BOOL DeleteDC(HDC);
-BOOL DeleteMenu(HMENU,UINT,UINT);
-BOOL DeleteMetaFile(HMETAFILE);
-BOOL DeleteObject(HANDLE);
-BOOL DestroyCursor(HCURSOR);
-BOOL DestroyIcon(HICON);
-BOOL DestroyMenu(HMENU);
-BOOL DestroyWindow(HWND);
-BOOL DlgDirSelect(HWND,LPSTR,int);
-BOOL DlgDirSelectComboBox(HWND,LPSTR,int);
-BOOL DrawIcon(HDC,short,short,HICON);
-BOOL Ellipse(HDC,int,int,int,int);
-BOOL EmptyClipboard(void);
-BOOL EnableHardwareInput(BOOL);
-BOOL EnableMenuItem(HMENU,UINT,UINT);
-BOOL EnableScrollBar(HWND,INT,UINT);
-BOOL EnableWindow(HWND,BOOL);
-BOOL EndDeferWindowPos(HDWP);
-BOOL EnumChildWindows(HWND,FARPROC,LONG);
-BOOL EnumMetaFile(HDC,LOCALHANDLE,FARPROC,BYTE*);
-BOOL EnumTaskWindows(HANDLE,FARPROC,LONG);
-BOOL EnumWindows(FARPROC,LONG);
-BOOL EqualRect(LPRECT,LPRECT);
-BOOL EqualRgn(HRGN,HRGN);
-BOOL ExitWindows(DWORD,WORD);
-BOOL ExtFloodFill(HDC,INT,INT,COLORREF,WORD);
-BOOL ExtTextOut(HDC,short,short,WORD,LPRECT,LPSTR,WORD,LPINT);
-BOOL FillRgn(HDC,HRGN,HBRUSH);
-BOOL FlashWindow(HWND,BOOL);
-BOOL FloodFill(HDC,INT,INT,COLORREF);
-BOOL FrameRgn(HDC,HRGN,HBRUSH,int,int);
-BOOL FreeModule(HANDLE);
-BOOL FreeResource(HANDLE);
-BOOL GetBitmapDimensionEx(HBITMAP,LPSIZE);
-BOOL GetBrushOrgEx(HDC,LPPOINT);
-BOOL GetCharWidth(HDC,WORD,WORD,LPINT);
-BOOL GetClassInfo(HANDLE,SEGPTR,LPWNDCLASS);
-BOOL GetCurrentPositionEx(HDC,LPPOINT);
-BOOL GetInputState(void);
-BOOL GetMessage(SEGPTR,HWND,UINT,UINT);
-BOOL GetTextExtentPoint(HDC,LPSTR,short,LPSIZE);
-BOOL GetTextMetrics(HDC,LPTEXTMETRIC);
-BOOL GetUpdateRect(HWND,LPRECT,BOOL);
-BOOL GetViewportExtEx(HDC,LPPOINT);
-BOOL GetViewportOrgEx(HDC,LPPOINT);
-BOOL GetWinDebugInfo(LPWINDEBUGINFO,UINT);
-BOOL GetWindowExtEx(HDC,LPPOINT);
-BOOL GetWindowOrgEx(HDC,LPPOINT);
-BOOL GetWindowPlacement(HWND,LPWINDOWPLACEMENT);
-BOOL GlobalUnWire(HGLOBAL);
-BOOL GlobalUnlock(HGLOBAL);
-BOOL GrayString(HDC,HBRUSH,FARPROC,LPARAM,INT,INT,INT,INT,INT);
-BOOL HiliteMenuItem(HWND,HMENU,UINT,UINT);
-BOOL InSendMessage(void);
-BOOL InsertMenu(HMENU,UINT,UINT,UINT,LPSTR);
-BOOL IntersectRect(LPRECT,LPRECT,LPRECT);
-BOOL InvertRgn(HDC,HRGN);
-BOOL IsBadCodePtr(SEGPTR);
-BOOL IsBadHugeReadPtr(SEGPTR,DWORD);
-BOOL IsBadHugeWritePtr(SEGPTR,DWORD);
-BOOL IsBadReadPtr(SEGPTR,WORD);
-BOOL IsBadStringPtr(SEGPTR,WORD);
-BOOL IsBadWritePtr(SEGPTR,WORD);
-BOOL IsCharAlpha(char);
-BOOL IsCharAlphaNumeric(char);
-BOOL IsCharLower(char);
-BOOL IsCharUpper(char);
-BOOL IsChild(HWND,HWND);
-BOOL IsClipboardFormatAvailable(WORD);
-BOOL IsDialogMessage(HWND,LPMSG);
-BOOL IsIconic(HWND);
-BOOL IsRectEmpty(LPRECT);
-BOOL IsTwoByteCharPrefix(char);
-BOOL IsWindow(HWND);
-BOOL IsWindowEnabled(HWND);
-BOOL IsWindowVisible(HWND);
-BOOL IsZoomed(HWND);
-BOOL KillSystemTimer(HWND,WORD);
-BOOL KillTimer(HWND,WORD);
-BOOL LPtoDP(HDC,LPPOINT,int);
-BOOL LineTo(HDC,short,short);
-BOOL LocalInit(HANDLE,WORD,WORD);
-BOOL LocalUnlock(HANDLE);
-BOOL ModifyMenu(HMENU,UINT,UINT,UINT,LPSTR);
-BOOL MoveToEx(HDC,short,short,LPPOINT);
-BOOL MoveWindow(HWND,short,short,short,short,BOOL);
-BOOL OemToAnsi(LPSTR,LPSTR);
-BOOL OffsetViewportOrgEx(HDC,short,short,LPPOINT);
-BOOL OffsetWindowOrgEx(HDC,short,short,LPPOINT);
-BOOL OpenClipboard(HWND);
-BOOL OpenIcon(HWND);
-BOOL PaintRgn(HDC,HRGN);
-BOOL PatBlt(HDC,short,short,short,short,DWORD);
-BOOL PeekMessage(LPMSG,HWND,WORD,WORD,WORD);
-BOOL Pie(HDC,int,int,int,int,int,int,int,int);
-BOOL PlayMetaFile(HDC,HANDLE);
-BOOL PolyPolygon(HDC,LPPOINT,LPINT,WORD);
-BOOL Polygon(HDC,LPPOINT,int);
-BOOL Polyline(HDC,LPPOINT,int);
-BOOL PostAppMessage(HANDLE,WORD,WORD,LONG);
-BOOL PostMessage(HWND,WORD,WORD,LONG);
-BOOL PtInRect(LPRECT,POINT);
-BOOL PtInRegion(HRGN,short,short);
-BOOL PtVisible(HDC,short,short);
-BOOL RectInRegion(HRGN,LPRECT);
-BOOL RectVisible(HDC,LPRECT);
-BOOL Rectangle(HDC,int,int,int,int);
-BOOL RedrawWindow(HWND,LPRECT,HRGN,UINT);
-BOOL RemoveFontResource(LPSTR);
-BOOL RemoveMenu(HMENU,UINT,UINT);
-BOOL ResizePalette(HPALETTE,UINT);
-BOOL RestoreDC(HDC,short);
-BOOL RoundRect(HDC,short,short,short,short,short,short);
-BOOL ScaleViewportExtEx(HDC,short,short,short,short,LPSIZE);
-BOOL ScaleWindowExtEx(HDC,short,short,short,short,LPSIZE);
-BOOL ScrollDC(HDC,short,short,LPRECT,LPRECT,HRGN,LPRECT);
-BOOL SetBitmapDimensionEx(HBITMAP,short,short,LPSIZE);
-BOOL SetConvertParams(int,int);
-BOOL SetDeskPattern(void);
-BOOL SetDeskWallPaper(LPSTR);
-BOOL SetErrorMode(WORD);
-BOOL SetMenu(HWND,HMENU);
-BOOL SetMenuItemBitmaps(HMENU,UINT,UINT,HBITMAP,HBITMAP);
-BOOL SetMessageQueue(int);
-BOOL SetProp(HWND,SEGPTR,HANDLE);
-BOOL SetViewportExtEx(HDC,short,short,LPSIZE);
-BOOL SetViewportOrgEx(HDC,short,short,LPPOINT);
-BOOL SetWinDebugInfo(LPWINDEBUGINFO);
-BOOL SetWindowExtEx(HDC,short,short,LPSIZE);
-BOOL SetWindowOrgEx(HDC,short,short,LPPOINT);
-BOOL SetWindowPlacement(HWND,LPWINDOWPLACEMENT);
-BOOL SetWindowPos(HWND,HWND,short,short,short,short,WORD);
-BOOL ShowWindow(HWND,int);
-BOOL StretchBlt(HDC,short,short,short,short,HDC,short,short,short,short,DWORD);
-BOOL SubtractRect(LPRECT,LPRECT,LPRECT);
-BOOL SwapMouseButton(BOOL);
-BOOL TextOut(HDC,short,short,LPSTR,short);
-BOOL TrackPopupMenu(HMENU,UINT,short,short,short,HWND,LPRECT);
-BOOL TranslateMDISysAccel(HWND,LPMSG);
-BOOL TranslateMessage(LPMSG);
-BOOL UnhookWindowsHook(short,FARPROC);
-BOOL UnhookWindowsHookEx(HHOOK);
-BOOL UnionRect(LPRECT,LPRECT,LPRECT);
-BOOL UnrealizeObject(HBRUSH);
-BOOL UnregisterClass(SEGPTR,HANDLE);
-BOOL WinHelp(HWND,LPSTR,WORD,DWORD);
-BOOL WritePrivateProfileString(LPSTR,LPSTR,LPSTR,LPSTR);
-BOOL WriteProfileString(LPSTR,LPSTR,LPSTR);
-BYTE GetTempDrive(BYTE);
-COLORREF GetBkColor(HDC);
-COLORREF GetSysColor(short);
-COLORREF GetTextColor(HDC);
-COLORREF SetPixel(HDC,short,short,COLORREF);
-DWORD CallNextHookEx(HHOOK,short,WPARAM,LPARAM);
-DWORD DefHookProc(short,WORD,DWORD,HHOOK*);
-DWORD GetAspectRatioFilter(HDC);
-DWORD GetBitmapDimension(HBITMAP);
-DWORD GetBrushOrg(HDC);
-DWORD GetCurrentPosition(HDC);
-/*DWORD GetCurrentTime(void);*/
-#define GetCurrentTime GetTickCount
-DWORD GetDCOrg(HDC);
-DWORD GetDialogBaseUnits(void);
-DWORD GetFreeSpace(WORD);
-DWORD GetHeapSpaces(HMODULE);
-DWORD GetMenuCheckMarkDimensions(void);
-DWORD GetMessagePos(void);
-DWORD GetNearestColor(HDC,DWORD);
-DWORD GetPixel(HDC,short,short);
-DWORD GetSelectorBase(WORD);
-DWORD GetSelectorLimit(WORD);
-DWORD GetTabbedTextExtent(HDC,LPSTR,int,int,LPINT);
-DWORD GetTextExtent(HDC,LPSTR,short);
-DWORD GetTickCount(void);
-DWORD GetViewportExt(HDC);
-DWORD GetViewportOrg(HDC);
-DWORD GetWindowExt(HDC);
-DWORD GetWindowOrg(HDC);
-DWORD GlobalCompact(DWORD);
-DWORD GlobalDOSAlloc(DWORD);
-#ifdef WINELIB32
-HGLOBAL GlobalHandle(LPCVOID);
-#else
-DWORD GlobalHandle(UINT);
+INT        AccessResource(HINSTANCE,HRSRC);
+ATOM       AddAtom(SEGPTR);
+INT        AddFontResource(LPCSTR);
+void       AdjustWindowRect(LPRECT,DWORD,BOOL);
+void       AdjustWindowRectEx(LPRECT,DWORD,BOOL,DWORD);
+WORD       AllocCStoDSAlias(WORD);
+WORD       AllocDStoCSAlias(WORD);
+HGLOBAL    AllocResource(HINSTANCE,HRSRC,DWORD);
+WORD       AllocSelector(WORD);
+WORD       AllocSelectorArray(WORD);
+void       AnimatePalette(HPALETTE,UINT,UINT,LPPALETTEENTRY);
+LPSTR      AnsiLower(LPSTR);
+UINT       AnsiLowerBuff(LPSTR,UINT);
+SEGPTR     AnsiNext(SEGPTR);
+SEGPTR     AnsiPrev(SEGPTR,SEGPTR);
+INT        AnsiToOem(LPSTR,LPSTR);
+void       AnsiToOemBuff(LPSTR,LPSTR,INT);
+LPSTR      AnsiUpper(LPSTR);
+UINT       AnsiUpperBuff(LPSTR,UINT);
+BOOL       AnyPopup(void);
+BOOL       AppendMenu(HMENU,UINT,UINT,LPSTR);
+BOOL       Arc(HDC,int,int,int,int,int,int,int,int);
+WORD       ArrangeIconicWindows(HWND);
+HDWP       BeginDeferWindowPos(INT);
+HDC        BeginPaint(HWND,LPPAINTSTRUCT);
+BOOL       BitBlt(HDC,short,short,short,short,HDC,short,short,DWORD);
+BOOL       BringWindowToTop(HWND);
+int        BuildCommDCB(LPSTR,DCB*);
+BOOL       CallMsgFilter(SEGPTR,short);
+DWORD      CallNextHookEx(HHOOK,short,WPARAM,LPARAM);
+LONG       CallWindowProc(WNDPROC,HWND,UINT,WPARAM,LPARAM);
+int        Catch(LPCATCHBUF);
+BOOL       ChangeClipboardChain(HWND,HWND);
+BOOL       ChangeMenu(HMENU,UINT,LPSTR,UINT,UINT);
+WORD       ChangeSelector(WORD,WORD);
+void       CheckDlgButton(HWND,WORD,WORD);
+BOOL       CheckMenuItem(HMENU,UINT,UINT);
+void       CheckRadioButton(HWND,WORD,WORD,WORD);
+HWND       ChildWindowFromPoint(HWND,POINT);
+BOOL       Chord(HDC,int,int,int,int,int,int,int,int);
+int        ClearCommBreak(int);
+void       ClientToScreen(HWND,LPPOINT);
+void       ClipCursor(LPRECT);
+BOOL       CloseClipboard(void);
+int        CloseComm(int);
+HMETAFILE  CloseMetaFile(HANDLE);
+void       CloseSound(void);
+void       CloseWindow(HWND);
+int        CombineRgn(HRGN,HRGN,HRGN,short);
+int        ConvertRequest(HWND,LPKANJISTRUCT);
+HANDLE     CopyMetaFile(HANDLE,LPSTR);
+void       CopyRect(LPRECT,LPRECT);
+int        CountClipboardFormats(void);
+int        CountVoiceNotes(int);
+HBITMAP    CreateBitmap(short,short,BYTE,BYTE,LPSTR);
+HBITMAP    CreateBitmapIndirect(BITMAP*);
+HBRUSH     CreateBrushIndirect(LOGBRUSH*);
+void       CreateCaret(HWND,HBITMAP,short,short);
+HBITMAP    CreateCompatibleBitmap(HDC,short,short);
+HDC        CreateCompatibleDC(HDC);
+HCURSOR    CreateCursor(HANDLE,INT,INT,INT,INT,LPSTR,LPSTR);
+HANDLE     CreateCursorIconIndirect(HANDLE,CURSORICONINFO*,LPSTR,LPSTR);
+HDC        CreateDC(LPSTR,LPSTR,LPSTR,LPSTR);
+HBRUSH     CreateDIBPatternBrush(HANDLE,WORD);
+HBITMAP    CreateDIBitmap(HDC,LPBITMAPINFOHEADER,DWORD,LPSTR,LPBITMAPINFO,WORD);
+HWND       CreateDialog(HANDLE,SEGPTR,HWND,WNDPROC);
+HWND       CreateDialogIndirect(HANDLE,SEGPTR,HWND,WNDPROC);
+HWND       CreateDialogIndirectParam(HANDLE,SEGPTR,HWND,WNDPROC,LPARAM);
+HWND       CreateDialogParam(HANDLE,SEGPTR,HWND,WNDPROC,LPARAM);
+HBITMAP    CreateDiscardableBitmap(HDC,short,short);
+HRGN       CreateEllipticRgn(short,short,short,short);
+HRGN       CreateEllipticRgnIndirect(LPRECT);
+HFONT      CreateFont(int,int,int,int,int,BYTE,BYTE,BYTE,BYTE,BYTE,BYTE,BYTE,BYTE,LPSTR);
+HFONT      CreateFontIndirect(LOGFONT*);
+HBRUSH     CreateHatchBrush(short,COLORREF);
+HDC        CreateIC(LPSTR,LPSTR,LPSTR,LPSTR);
+HICON      CreateIcon(HANDLE,INT,INT,BYTE,BYTE,LPSTR,LPSTR);
+HMENU      CreateMenu(void);
+HANDLE     CreateMetaFile(LPSTR);
+HPALETTE   CreatePalette(LPLOGPALETTE);
+HBRUSH     CreatePatternBrush(HBITMAP);
+HPEN       CreatePen(short,short,COLORREF);
+HPEN       CreatePenIndirect(LOGPEN*);
+HRGN       CreatePolyPolygonRgn(LPPOINT,LPINT,INT,INT);
+HRGN       CreatePolygonRgn(LPPOINT,INT,INT);
+HMENU      CreatePopupMenu(void);
+HRGN       CreateRectRgn(short,short,short,short);
+HRGN       CreateRectRgnIndirect(LPRECT);
+HRGN       CreateRoundRectRgn(short,short,short,short,short,short);
+HBRUSH     CreateSolidBrush(DWORD);
+HWND       CreateWindow(SEGPTR,SEGPTR,DWORD,INT,INT,INT,INT,HWND,HMENU,HINSTANCE,SEGPTR);
+HWND       CreateWindowEx(DWORD,SEGPTR,SEGPTR,DWORD,INT,INT,INT,INT,HWND,HMENU,HINSTANCE,SEGPTR);
+BOOL       DPtoLP(HDC,LPPOINT,int);
+void       DebugBreak(void);
+LONG       DefDlgProc(HWND,UINT,WPARAM,LPARAM);
+LONG       DefFrameProc(HWND,HWND,UINT,WPARAM,LPARAM);
+DWORD      DefHookProc(short,WORD,DWORD,HHOOK*);
+LONG       DefMDIChildProc(HWND,UINT,WPARAM,LPARAM);
+LRESULT    DefWindowProc(HWND,UINT,WPARAM,LPARAM);
+HDWP       DeferWindowPos(HDWP,HWND,HWND,INT,INT,INT,INT,WORD);
+ATOM       DeleteAtom(ATOM);
+BOOL       DeleteDC(HDC);
+BOOL       DeleteMenu(HMENU,UINT,UINT);
+BOOL       DeleteMetaFile(HMETAFILE);
+BOOL       DeleteObject(HANDLE);
+void       DestroyCaret(void);
+BOOL       DestroyCursor(HCURSOR);
+BOOL       DestroyIcon(HICON);
+BOOL       DestroyMenu(HMENU);
+BOOL       DestroyWindow(HWND);
+int        DialogBox(HINSTANCE,SEGPTR,HWND,WNDPROC);
+int        DialogBoxIndirect(HANDLE,HANDLE,HWND,WNDPROC);
+int        DialogBoxIndirectParam(HANDLE,HANDLE,HWND,WNDPROC,LONG);
+int        DialogBoxParam(HANDLE,SEGPTR,HWND,WNDPROC,LONG);
+HANDLE     DirectResAlloc(HANDLE,WORD,WORD);
+void       DirectedYield(HTASK);
+LONG       DispatchMessage(LPMSG);
+int        DlgDirList(HWND,LPSTR,int,int,WORD);
+int        DlgDirListComboBox(HWND,SEGPTR,int,int,WORD);
+BOOL       DlgDirSelect(HWND,LPSTR,int);
+BOOL       DlgDirSelectComboBox(HWND,LPSTR,int);
+BOOL       DragDetect(HWND,POINT);
+DWORD      DragObject(HWND, HWND, WORD, WORD, WORD, HCURSOR);
+void       DrawFocusRect(HDC,LPRECT);
+BOOL       DrawIcon(HDC,short,short,HICON);
+void       DrawMenuBar(HWND);
+int        DrawText(HDC,LPSTR,int,LPRECT,WORD);
+DWORD      DumpIcon(SEGPTR,WORD*,SEGPTR*,SEGPTR*);
+BOOL       Ellipse(HDC,int,int,int,int);
+BOOL       EmptyClipboard(void);
+BOOL       EnableHardwareInput(BOOL);
+BOOL       EnableMenuItem(HMENU,UINT,UINT);
+BOOL       EnableScrollBar(HWND,INT,UINT);
+BOOL       EnableWindow(HWND,BOOL);
+BOOL       EndDeferWindowPos(HDWP);
+void       EndDialog(HWND,short);
+void       EndPaint(HWND,LPPAINTSTRUCT);
+BOOL       EnumChildWindows(HWND,FARPROC,LONG);
+WORD       EnumClipboardFormats(WORD);
+int        EnumFonts(HDC,LPSTR,FARPROC,LPSTR);
+BOOL       EnumMetaFile(HDC,LOCALHANDLE,FARPROC,BYTE*);
+int        EnumObjects(HDC,int,FARPROC,LPSTR);
+int        EnumProps(HWND,FARPROC);
+BOOL       EnumTaskWindows(HANDLE,FARPROC,LONG);
+BOOL       EnumWindows(FARPROC,LONG);
+BOOL       EqualRect(LPRECT,LPRECT);
+BOOL       EqualRgn(HRGN,HRGN);
+int        Escape(HDC,int,int,LPSTR,LPSTR);
+LONG       EscapeCommFunction(int,int);
+int        ExcludeClipRect(HDC,short,short,short,short);
+int        ExcludeUpdateRgn(HDC,HWND);
+int        ExcludeVisRect(HDC,short,short,short,short);
+BOOL       ExitWindows(DWORD,WORD);
+BOOL       ExtFloodFill(HDC,INT,INT,COLORREF,WORD);
+BOOL       ExtTextOut(HDC,short,short,WORD,LPRECT,LPSTR,WORD,LPINT);
+WORD       FarGetOwner(HANDLE);
+void       FarSetOwner(HANDLE,WORD);
+void       FatalExit(int);
+int        FillRect(HDC,LPRECT,HBRUSH);
+BOOL       FillRgn(HDC,HRGN,HBRUSH);
+void       FillWindow(HWND,HWND,HDC,HBRUSH);
+ATOM       FindAtom(SEGPTR);
+HANDLE     FindResource(HANDLE,SEGPTR,SEGPTR);
+HWND       FindWindow(SEGPTR,LPSTR);
+BOOL       FlashWindow(HWND,BOOL);
+BOOL       FloodFill(HDC,INT,INT,COLORREF);
+int        FlushComm(int,int);
+int        FrameRect(HDC,LPRECT,HBRUSH);
+BOOL       FrameRgn(HDC,HRGN,HBRUSH,int,int);
+void       FreeLibrary(HANDLE);
+BOOL       FreeModule(HANDLE);
+void       FreeProcInstance(FARPROC);
+BOOL       FreeResource(HANDLE);
+WORD       FreeSelector(WORD);
+UINT       GDIRealizePalette(HDC);
+HPALETTE   GDISelectPalette(HDC,HPALETTE);
+HWND       GetActiveWindow(void);
+DWORD      GetAspectRatioFilter(HDC);
+int        GetAsyncKeyState(int);
+HANDLE     GetAtomHandle(ATOM);
+WORD       GetAtomName(ATOM,LPSTR,short);
+LONG       GetBitmapBits(HBITMAP,LONG,LPSTR);
+DWORD      GetBitmapDimension(HBITMAP);
+BOOL       GetBitmapDimensionEx(HBITMAP,LPSIZE);
+COLORREF   GetBkColor(HDC);
+WORD       GetBkMode(HDC);
+DWORD      GetBrushOrg(HDC);
+BOOL       GetBrushOrgEx(HDC,LPPOINT);
+HWND       GetCapture(void);
+WORD       GetCaretBlinkTime(void);
+void       GetCaretPos(LPPOINT);
+BOOL       GetCharWidth(HDC,WORD,WORD,LPINT);
+BOOL       GetClassInfo(HANDLE,SEGPTR,LPWNDCLASS);
+LONG       GetClassLong(HWND,short);
+int        GetClassName(HWND,LPSTR,short);
+WORD       GetClassWord(HWND,short);
+void       GetClientRect(HWND,LPRECT);
+int        GetClipBox(HDC,LPRECT);
+HRGN       GetClipRgn(HDC);
+HANDLE     GetClipboardData(WORD);
+int        GetClipboardFormatName(WORD,LPSTR,short);
+HWND       GetClipboardOwner(void);
+HWND       GetClipboardViewer(void);
+HANDLE     GetCodeHandle(FARPROC);
+void       GetCodeInfo(FARPROC,LPVOID);
+int        GetCommError(int,COMSTAT*);
+UINT       GetCommEventMask(int,int);
+int        GetCommState(int,DCB*);
+HBRUSH     GetControlBrush(HWND,HDC,WORD);
+HANDLE     GetCurrentPDB(void);
+DWORD      GetCurrentPosition(HDC);
+BOOL       GetCurrentPositionEx(HDC,LPPOINT);
+HANDLE     GetCurrentTask(void);
+DWORD      GetCurrentTime(void);
+HCURSOR    GetCursor(void);
+void       GetCursorPos(LPPOINT);
+HDC        GetDC(HWND);
+HDC        GetDCEx(HWND,HRGN,DWORD);
+DWORD      GetDCOrg(HDC);
+HDC        GetDCState(HDC);
+int        GetDIBits(HDC,HANDLE,WORD,WORD,LPSTR,LPBITMAPINFO,WORD);
+SEGPTR     GetDOSEnvironment(void);
+HWND       GetDesktopHwnd(void);
+HWND       GetDesktopWindow(void);
+int        GetDeviceCaps(HDC,WORD);
+DWORD      GetDialogBaseUnits(void);
+int        GetDlgCtrlID(HWND);
+HWND       GetDlgItem(HWND,WORD);
+WORD       GetDlgItemInt(HWND,WORD,BOOL*,BOOL);
+int        GetDlgItemText(HWND,WORD,SEGPTR,WORD);
+WORD       GetDoubleClickTime(void);
+WORD       GetDriveType(INT);
+int        GetEnvironment(LPSTR,LPSTR,WORD);
+HMODULE    GetExePtr(HANDLE);
+HWND       GetFocus(void);
+DWORD      GetFreeSpace(WORD);
+DWORD      GetHeapSpaces(HMODULE);
+BOOL       GetInputState(void);
+int        GetInstanceData(HANDLE,WORD,int);
+WORD       GetInternalWindowPos(HWND,LPRECT,LPPOINT);
+int        GetKBCodePage(void);
+int        GetKeyNameText(LONG,LPSTR,int);
+int        GetKeyState(int);
+void       GetKeyboardState(BYTE*);
+int        GetKeyboardType(int);
+HWND       GetLastActivePopup(HWND);
+WORD       GetMapMode(HDC);
+HMENU      GetMenu(HWND);
+DWORD      GetMenuCheckMarkDimensions(void);
+WORD       GetMenuItemCount(HMENU);
+UINT       GetMenuItemID(HMENU,int);
+UINT       GetMenuState(HMENU,UINT,UINT);
+int        GetMenuString(HMENU,UINT,LPSTR,short,UINT);
+BOOL       GetMessage(SEGPTR,HWND,UINT,UINT);
+LONG       GetMessageExtraInfo(void);
+DWORD      GetMessagePos(void);
+LONG       GetMessageTime(void);
+HANDLE     GetMetaFile(LPSTR);
+HANDLE     GetMetaFileBits(HANDLE);
+int        GetModuleFileName(HANDLE,LPSTR,short);
+HANDLE     GetModuleHandle(LPCSTR);
+int        GetModuleUsage(HANDLE);
+FARPROC    GetMouseEventProc(void);
+DWORD      GetNearestColor(HDC,DWORD);
+WORD       GetNearestPaletteIndex(HPALETTE,DWORD);
+HWND       GetNextDlgGroupItem(HWND,HWND,BOOL);
+HWND       GetNextDlgTabItem(HWND,HWND,BOOL);
+HWND       GetNextWindow(HWND,WORD);
+WORD       GetNumTasks(void);
+int        GetObject(HANDLE,int,LPSTR);
+HWND       GetOpenClipboardWindow(void);
+WORD       GetPaletteEntries(HPALETTE,WORD,WORD,LPPALETTEENTRY);
+HWND       GetParent(HWND);
+DWORD      GetPixel(HDC,short,short);
+WORD       GetPolyFillMode(HDC);
+int        GetPriorityClipboardFormat(WORD*,short);
+WORD       GetPrivateProfileInt(LPSTR,LPSTR,short,LPSTR);
+short      GetPrivateProfileString(LPSTR,LPSTR,LPSTR,LPSTR,short,LPSTR);
+FARPROC    GetProcAddress(HANDLE,SEGPTR);
+WORD       GetProfileInt(LPSTR,LPSTR,int);
+int        GetProfileString(LPSTR,LPSTR,LPSTR,LPSTR,int);
+HANDLE     GetProp(HWND,SEGPTR);
+WORD       GetROP2(HDC);
+WORD       GetRelAbs(HDC);
+int        GetRgnBox(HRGN,LPRECT);
+int        GetScrollPos(HWND,int);
+void       GetScrollRange(HWND,int,LPINT,LPINT);
+DWORD      GetSelectorBase(WORD);
+DWORD      GetSelectorLimit(WORD);
+HANDLE     GetStockObject(int);
+WORD       GetStretchBltMode(HDC);
+HMENU      GetSubMenu(HMENU,short);
+COLORREF   GetSysColor(short);
+HWND       GetSysModalWindow(void);
+UINT       GetSystemDirectory(LPSTR,UINT);
+HMENU      GetSystemMenu(HWND,BOOL);
+int        GetSystemMetrics(WORD);
+WORD       GetSystemPaletteEntries(HDC,WORD,WORD,LPPALETTEENTRY);
+WORD       GetSystemPaletteUse(HDC);
+DWORD      GetTabbedTextExtent(HDC,LPSTR,int,int,LPINT);
+HINSTANCE  GetTaskDS(void);
+HGLOBAL    GetTaskQueue(HTASK);
+BYTE       GetTempDrive(BYTE);
+INT        GetTempFileName(BYTE,LPCSTR,UINT,LPSTR);
+WORD       GetTextAlign(HDC);
+short      GetTextCharacterExtra(HDC);
+COLORREF   GetTextColor(HDC);
+DWORD      GetTextExtent(HDC,LPSTR,short);
+BOOL       GetTextExtentPoint(HDC,LPSTR,short,LPSIZE);
+INT        GetTextFace(HDC,INT,LPSTR);
+BOOL       GetTextMetrics(HDC,LPTEXTMETRIC);
+LPINT      GetThresholdEvent(void);
+int        GetThresholdStatus(void);
+DWORD      GetTickCount(void);
+HWND       GetTopWindow(HWND);
+BOOL       GetUpdateRect(HWND,LPRECT,BOOL);
+int        GetUpdateRgn(HWND,HRGN,BOOL);
+LONG       GetVersion(void);
+DWORD      GetViewportExt(HDC);
+BOOL       GetViewportExtEx(HDC,LPPOINT);
+DWORD      GetViewportOrg(HDC);
+BOOL       GetViewportOrgEx(HDC,LPPOINT);
+BOOL       GetWinDebugInfo(LPWINDEBUGINFO,UINT);
+LONG       GetWinFlags(void);
+HWND       GetWindow(HWND,WORD);
+HDC        GetWindowDC(HWND);
+DWORD      GetWindowExt(HDC);
+BOOL       GetWindowExtEx(HDC,LPPOINT);
+LONG       GetWindowLong(HWND,short);
+DWORD      GetWindowOrg(HDC);
+BOOL       GetWindowOrgEx(HDC,LPPOINT);
+BOOL       GetWindowPlacement(HWND,LPWINDOWPLACEMENT);
+void       GetWindowRect(HWND,LPRECT);
+HANDLE     GetWindowTask(HWND);
+int        GetWindowText(HWND,LPSTR,int);
+int        GetWindowTextLength(HWND);
+WORD       GetWindowWord(HWND,short);
+UINT       GetWindowsDirectory(LPSTR,UINT);
+ATOM       GlobalAddAtom(SEGPTR);
+HGLOBAL    GlobalAlloc(WORD,DWORD);
+#ifndef WINELIB32 /* Obsolete in Win32 */
+DWORD      GlobalCompact(DWORD);
 #endif
-DWORD GlobalSize(HGLOBAL);
-DWORD MoveTo(HDC,short,short);
-DWORD OemKeyScan(WORD);
-DWORD OffsetViewportOrg(HDC,short,short);
-DWORD OffsetWindowOrg(HDC,short,short);
-DWORD ScaleViewportExt(HDC,short,short,short,short);
-DWORD ScaleWindowExt(HDC,short,short,short,short);
-DWORD SetBitmapDimension(HBITMAP,short,short);
-DWORD SetBkColor(HDC,COLORREF);
-DWORD SetBrushOrg(HDC,short,short);
-DWORD SetMapperFlags(HDC,DWORD);
-DWORD SetTextColor(HDC,DWORD);
-DWORD SetViewportExt(HDC,short,short);
-DWORD SetViewportOrg(HDC,short,short);
-DWORD SetWindowExt(HDC,short,short);
-DWORD SetWindowOrg(HDC,short,short);
-DWORD SizeofResource(HANDLE,HRSRC);
-FARPROC GetMouseEventProc(void);
-FARPROC GetProcAddress(HANDLE,SEGPTR);
-FARPROC LocalNotify(FARPROC);
-FARPROC MakeProcInstance(FARPROC,HANDLE);
-FARPROC SetResourceHandler(HANDLE,LPSTR,FARPROC);
-FARPROC SetWindowsHook(short,FARPROC);
-HANDLE CopyMetaFile(HANDLE,LPSTR);
-HANDLE CreateCursorIconIndirect(HANDLE,CURSORICONINFO*,LPSTR,LPSTR);
-HANDLE CreateMetaFile(LPSTR);
-HANDLE DirectResAlloc(HANDLE,WORD,WORD);
-HANDLE FindResource(HANDLE,SEGPTR,SEGPTR);
-HANDLE GetAtomHandle(ATOM);
-HANDLE GetClipboardData(WORD);
-HANDLE GetCodeHandle(FARPROC);
-HANDLE GetCurrentPDB(void);
-HANDLE GetCurrentTask(void);
-HANDLE GetMetaFile(LPSTR);
-HANDLE GetMetaFileBits(HANDLE);
-HANDLE GetModuleHandle(LPCSTR);
-HANDLE GetProp(HWND,SEGPTR);
-HANDLE GetStockObject(int);
-HANDLE GetWindowTask(HWND);
-HANDLE LoadAccelerators(HANDLE,SEGPTR);
-HANDLE LoadLibrary(LPCSTR);
-HANDLE LoadModule(LPCSTR,LPVOID);
-HANDLE LoadResource(HANDLE,HANDLE);
-HANDLE LocalAlloc(WORD,WORD);
-HANDLE LocalFree(HANDLE);
-HANDLE LocalHandle(WORD);
-HANDLE LocalReAlloc(HANDLE,WORD,WORD);
-HANDLE RemoveProp(HWND,SEGPTR);
-HANDLE SelectObject(HDC,HANDLE);
-HANDLE SetClipboardData(WORD,HANDLE);
-HANDLE SetMetaFileBits(HANDLE);
-HANDLE WinExec(LPSTR,WORD);
-HBITMAP CreateBitmap(short,short,BYTE,BYTE,LPSTR);
-HBITMAP CreateBitmapIndirect(BITMAP*);
-HBITMAP CreateCompatibleBitmap(HDC,short,short);
-HBITMAP CreateDIBitmap(HDC,LPBITMAPINFOHEADER,DWORD,LPSTR,LPBITMAPINFO,WORD);
-HBITMAP CreateDiscardableBitmap(HDC,short,short);
-HBITMAP LoadBitmap(HANDLE,SEGPTR);
-HBRUSH CreateBrushIndirect(LOGBRUSH*);
-HBRUSH CreateDIBPatternBrush(HANDLE,WORD);
-HBRUSH CreateHatchBrush(short,COLORREF);
-HBRUSH CreatePatternBrush(HBITMAP);
-HBRUSH CreateSolidBrush(DWORD);
-HBRUSH GetControlBrush(HWND,HDC,WORD);
-HCURSOR CreateCursor(HANDLE,INT,INT,INT,INT,LPSTR,LPSTR);
-HCURSOR GetCursor(void);
-HCURSOR LoadCursor(HANDLE,SEGPTR);
-HCURSOR SetCursor(HCURSOR);
-HDC BeginPaint(HWND,LPPAINTSTRUCT);
-HDC CreateCompatibleDC(HDC);
-HDC CreateDC(LPSTR,LPSTR,LPSTR,LPSTR);
-HDC CreateIC(LPSTR,LPSTR,LPSTR,LPSTR);
-HDC GetDC(HWND);
-HDC GetDCEx(HWND,HRGN,DWORD);
-HDC GetDCState(HDC);
-HDC GetWindowDC(HWND);
-HDWP BeginDeferWindowPos(INT);
-HDWP DeferWindowPos(HDWP,HWND,HWND,INT,INT,INT,INT,WORD);
-HFONT CreateFont(int,int,int,int,int,BYTE,BYTE,BYTE,BYTE,BYTE,BYTE,BYTE,BYTE,LPSTR);
-HFONT CreateFontIndirect(LOGFONT*);
-HGLOBAL AllocResource(HINSTANCE,HRSRC,DWORD);
-HGLOBAL GetTaskQueue(HTASK);
-HGLOBAL GlobalAlloc(WORD,DWORD);
-HGLOBAL GlobalFree(HGLOBAL);
-HGLOBAL GlobalLRUNewest(HGLOBAL);
-HGLOBAL GlobalLRUOldest(HGLOBAL);
-HGLOBAL GlobalReAlloc(HGLOBAL,DWORD,WORD);
-HGLOBAL LockSegment(HGLOBAL);
-HGLOBAL SetTaskQueue(HTASK,HGLOBAL);
-HHOOK SetWindowsHookEx(short,HOOKPROC,HINSTANCE,HTASK);
-HICON CreateIcon(HANDLE,INT,INT,BYTE,BYTE,LPSTR,LPSTR);
-HICON LoadIcon(HANDLE,SEGPTR);
-HINSTANCE GetTaskDS(void);
-HMENU CreateMenu(void);
-HMENU CreatePopupMenu(void);
-HMENU GetMenu(HWND);
-HMENU GetSubMenu(HMENU,short);
-HMENU GetSystemMenu(HWND,BOOL);
-HMENU LoadMenu(HANDLE,SEGPTR);
-HMENU LoadMenuIndirect(LPSTR);
-HMENU LookupMenuHandle(HMENU,INT);
-HMETAFILE CloseMetaFile(HANDLE);
-HMODULE GetExePtr(HANDLE);
-HPALETTE CreatePalette(LPLOGPALETTE);
-HPALETTE GDISelectPalette(HDC,HPALETTE);
-HPALETTE SelectPalette(HDC,HPALETTE,BOOL);
-HPEN CreatePen(short,short,COLORREF);
-HPEN CreatePenIndirect(LOGPEN*);
-HRGN CreateEllipticRgn(short,short,short,short);
-HRGN CreateEllipticRgnIndirect(LPRECT);
-HRGN CreatePolyPolygonRgn(LPPOINT,LPINT,INT,INT);
-HRGN CreatePolygonRgn(LPPOINT,INT,INT);
-HRGN CreateRectRgn(short,short,short,short);
-HRGN CreateRectRgnIndirect(LPRECT);
-HRGN CreateRoundRectRgn(short,short,short,short,short,short);
-HRGN GetClipRgn(HDC);
-HRGN InquireVisRgn(HDC);
-HRGN SaveVisRgn(HDC);
-HWND ChildWindowFromPoint(HWND,POINT);
-HWND CreateDialog(HANDLE,SEGPTR,HWND,WNDPROC);
-HWND CreateDialogIndirect(HANDLE,SEGPTR,HWND,WNDPROC);
-HWND CreateDialogIndirectParam(HANDLE,SEGPTR,HWND,WNDPROC,LPARAM);
-HWND CreateDialogParam(HANDLE,SEGPTR,HWND,WNDPROC,LPARAM);
-HWND CreateWindow(SEGPTR,SEGPTR,DWORD,INT,INT,INT,INT,HWND,HMENU,HINSTANCE,SEGPTR);
-HWND CreateWindowEx(DWORD,SEGPTR,SEGPTR,DWORD,INT,INT,INT,INT,HWND,HMENU,HINSTANCE,SEGPTR);
-HWND FindWindow(SEGPTR,LPSTR);
-HWND GetActiveWindow(void);
-HWND GetCapture(void);
-HWND GetClipboardOwner(void);
-HWND GetClipboardViewer(void);
-HWND GetDesktopHwnd(void);
-HWND GetDesktopWindow(void);
-HWND GetDlgItem(HWND,WORD);
-HWND GetFocus(void);
-HWND GetLastActivePopup(HWND);
-HWND GetNextDlgGroupItem(HWND,HWND,BOOL);
-HWND GetNextDlgTabItem(HWND,HWND,BOOL);
-HWND GetNextWindow(HWND,WORD);
-HWND GetOpenClipboardWindow(void);
-HWND GetParent(HWND);
-HWND GetSysModalWindow(void);
-HWND GetTopWindow(HWND);
-HWND GetWindow(HWND,WORD);
-HWND SetActiveWindow(HWND);
-HWND SetCapture(HWND);
-HWND SetClipboardViewer(HWND);
-HWND SetFocus(HWND);
-HWND SetParent(HWND,HWND);
-HWND SetSysModalWindow(HWND);
-HWND WindowFromPoint(POINT);
-INT AccessResource(HINSTANCE,HRSRC);
-INT AddFontResource(LPCSTR);
-INT AnsiToOem(LPSTR,LPSTR);
-INT GetTempFileName(BYTE,LPCSTR,UINT,LPSTR);
-INT GetTextFace(HDC,INT,LPSTR);
-INT OpenFile(LPCSTR,LPOFSTRUCT,UINT);
-INT _lclose(INT);
-INT _lcreat(LPSTR,INT);
-INT _lopen(LPSTR,INT);
-INT _lread(INT,LPSTR,WORD);
-INT _lwrite(INT,LPCSTR,WORD);
-INT lstrcmp(LPCSTR,LPCSTR);
-INT lstrcmpi(LPCSTR,LPCSTR);
-INT lstrlen(LPCSTR);
-LONG CallWindowProc(WNDPROC,HWND,UINT,WPARAM,LPARAM);
-LONG DefDlgProc(HWND,UINT,WPARAM,LPARAM);
-LONG DefFrameProc(HWND,HWND,UINT,WPARAM,LPARAM);
-LONG DefMDIChildProc(HWND,UINT,WPARAM,LPARAM);
-LONG DispatchMessage(LPMSG);
-LONG EscapeCommFunction(int,int);
-LONG GetBitmapBits(HBITMAP,LONG,LPSTR);
-LONG GetClassLong(HWND,short);
-LONG GetMessageExtraInfo(void);
-LONG GetMessageTime(void);
-LONG GetVersion(void);
-LONG GetWinFlags(void);
-LONG GetWindowLong(HWND,short);
-LONG SendDlgItemMessage(HWND,INT,UINT,WPARAM,LPARAM);
-LONG SetBitmapBits(HBITMAP,LONG,LPSTR);
-LONG SetClassLong(HWND,short,LONG);
-LONG SetSwapAreaSize(WORD);
-LONG SetWindowLong(HWND,short,LONG);
-LONG TabbedTextOut(HDC,short,short,LPSTR,short,short,LPINT,short);
-LONG _hread(INT,LPSTR,LONG);
-LONG _hwrite(INT,LPCSTR,LONG);
-LONG _llseek(INT,LONG,INT);
-LPINT GetThresholdEvent(void);
-LPSTR AnsiLower(LPSTR);
-LPSTR AnsiUpper(LPSTR);
-LPSTR LockResource(HANDLE);
-LPSTR ValidateFreeSpaces(void);
-LPVOID GlobalLock(HGLOBAL);
-LRESULT DefWindowProc(HWND,UINT,WPARAM,LPARAM);
-LRESULT SendMessage(HWND,UINT,WPARAM,LPARAM);
-NPVOID LocalLock(HLOCAL);
-SEGPTR AnsiNext(SEGPTR);
-SEGPTR AnsiPrev(SEGPTR,SEGPTR);
-SEGPTR GetDOSEnvironment(void);
-SEGPTR GlobalWire(HGLOBAL);
-SEGPTR WIN16_GlobalLock(HGLOBAL);
-SEGPTR WIN16_LockResource(HANDLE);
-SEGPTR lstrcat(SEGPTR,SEGPTR);
-SEGPTR lstrcpy(SEGPTR,SEGPTR);
-SEGPTR lstrcpyn(SEGPTR,SEGPTR,WORD);
-UINT AnsiLowerBuff(LPSTR,UINT);
-UINT AnsiUpperBuff(LPSTR,UINT);
-UINT GDIRealizePalette(HDC);
-UINT RealizePalette(HDC);
-WORD AllocCStoDSAlias(WORD);
-WORD AllocDStoCSAlias(WORD);
-WORD AllocSelector(WORD);
-WORD AllocSelectorArray(WORD);
-WORD ArrangeIconicWindows(HWND);
-WORD ChangeSelector(WORD,WORD);
-WORD EnumClipboardFormats(WORD);
-WORD FarGetOwner(HANDLE);
-WORD FreeSelector(WORD);
-WORD GetAtomName(ATOM,LPSTR,short);
-WORD GetBkMode(HDC);
-WORD GetCaretBlinkTime(void);
-WORD GetClassWord(HWND,short);
-UINT GetCommEventMask(int,int);
-WORD GetDlgItemInt(HWND,WORD,BOOL*,BOOL);
-WORD GetDoubleClickTime(void);
-WORD GetDriveType(INT);
-WORD GetInternalWindowPos(HWND,LPRECT,LPPOINT);
-WORD GetMapMode(HDC);
-WORD GetMenuItemCount(HMENU);
-UINT GetMenuItemID(HMENU,int);
-UINT GetMenuState(HMENU,UINT,UINT);
-WORD GetNearestPaletteIndex(HPALETTE,DWORD);
-WORD GetNumTasks(void);
-WORD GetPaletteEntries(HPALETTE,WORD,WORD,LPPALETTEENTRY);
-WORD GetPolyFillMode(HDC);
-WORD GetPrivateProfileInt(LPSTR,LPSTR,short,LPSTR);
-WORD GetProfileInt(LPSTR,LPSTR,int);
-WORD GetROP2(HDC);
-WORD GetRelAbs(HDC);
-WORD GetStretchBltMode(HDC);
-UINT GetSystemDirectory(LPSTR,UINT);
-WORD GetSystemPaletteEntries(HDC,WORD,WORD,LPPALETTEENTRY);
-WORD GetSystemPaletteUse(HDC);
-WORD GetTextAlign(HDC);
-WORD GetWindowWord(HWND,short);
-UINT GetWindowsDirectory(LPSTR,UINT);
-WORD GlobalDOSFree(WORD);
-WORD GlobalFlags(HGLOBAL);
-WORD GlobalGetAtomName(ATOM,LPSTR,short);
-WORD GlobalPageLock(HGLOBAL);
-WORD GlobalPageUnlock(HGLOBAL);
-WORD InitAtomTable(WORD);
-WORD IsDlgButtonChecked(HWND,WORD);
-WORD LocalCompact(WORD);
-WORD LocalFlags(HLOCAL);
-WORD LocalShrink(HANDLE,WORD);
-WORD LocalSize(HLOCAL);
-WORD MapVirtualKey(WORD,WORD);
-WORD PrestoChangoSelector(WORD,WORD);
-WORD RealizeDefaultPalette(HDC);
-WORD RegisterClipboardFormat(LPCSTR);
-WORD RegisterWindowMessage(SEGPTR);
-WORD SelectorAccessRights(WORD,WORD,WORD);
-WORD SetBkMode(HDC,WORD);
-WORD SetClassWord(HWND,short,WORD);
-WORD SetHandleCount(WORD);
-WORD SetMapMode(HDC,WORD);
-WORD SetPaletteEntries(HPALETTE,WORD,WORD,LPPALETTEENTRY);
-WORD SetPolyFillMode(HDC,WORD);
-WORD SetROP2(HDC,WORD);
-WORD SetRelAbs(HDC,WORD);
-WORD SetSelectorBase(WORD,DWORD);
-WORD SetSelectorLimit(WORD,DWORD);
-WORD SetStretchBltMode(HDC,WORD);
-WORD SetSystemPaletteUse(HDC,WORD);
-WORD SetSystemTimer(HWND,WORD,WORD,FARPROC);
-WORD SetTextAlign(HDC,WORD);
-WORD SetTimer(HWND,WORD,WORD,FARPROC);
-WORD SetWindowWord(HWND,short,WORD);
-WORD VkKeyScan(WORD);
-UINT* SetCommEventMask(int,UINT);
-int BuildCommDCB(LPSTR,DCB*);
-int Catch(LPCATCHBUF);
-int ClearCommBreak(int);
-int CloseComm(int);
-int CombineRgn(HRGN,HRGN,HRGN,short);
-int ConvertRequest(HWND,LPKANJISTRUCT);
-int CountClipboardFormats(void);
-int CountVoiceNotes(int);
-int DialogBox(HINSTANCE,SEGPTR,HWND,WNDPROC);
-int DialogBoxIndirect(HANDLE,HANDLE,HWND,WNDPROC);
-int DialogBoxIndirectParam(HANDLE,HANDLE,HWND,WNDPROC,LONG);
-int DialogBoxParam(HANDLE,SEGPTR,HWND,WNDPROC,LONG);
-int DlgDirList(HWND,LPSTR,int,int,WORD);
-int DlgDirListComboBox(HWND,SEGPTR,int,int,WORD);
-int DrawText(HDC,LPSTR,int,LPRECT,WORD);
-int EnumFonts(HDC,LPSTR,FARPROC,LPSTR);
-int EnumObjects(HDC,int,FARPROC,LPSTR);
-int EnumProps(HWND,FARPROC);
-int Escape(HDC,int,int,LPSTR,LPSTR);
-int ExcludeClipRect(HDC,short,short,short,short);
-int ExcludeUpdateRgn(HDC,HWND);
-int ExcludeVisRect(HDC,short,short,short,short);
-int FillRect(HDC,LPRECT,HBRUSH);
-int FlushComm(int,int);
-int FrameRect(HDC,LPRECT,HBRUSH);
-int GetAsyncKeyState(int);
-int GetClassName(HWND,LPSTR,short);
-int GetClipBox(HDC,LPRECT);
-int GetClipboardFormatName(WORD,LPSTR,short);
-int GetCommError(int,COMSTAT*);
-int GetCommState(int,DCB*);
-int GetDIBits(HDC,HANDLE,WORD,WORD,LPSTR,LPBITMAPINFO,WORD);
-int GetDeviceCaps(HDC,WORD);
-int GetDlgCtrlID(HWND);
-int GetDlgItemText(HWND,WORD,SEGPTR,WORD);
-int GetEnvironment(LPSTR,LPSTR,WORD);
-int GetInstanceData(HANDLE,WORD,int);
-int GetKBCodePage(void);
-int GetKeyNameText(LONG,LPSTR,int);
-int GetKeyState(int);
-int GetKeyboardType(int);
-int GetMenuString(HMENU,UINT,LPSTR,short,UINT);
-int GetModuleFileName(HANDLE,LPSTR,short);
-int GetModuleUsage(HANDLE);
-int GetObject(HANDLE,int,LPSTR);
-int GetPriorityClipboardFormat(WORD*,short);
-int GetProfileString(LPSTR,LPSTR,LPSTR,LPSTR,int);
-int GetRgnBox(HRGN,LPRECT);
-int GetScrollPos(HWND,int);
-int GetSystemMetrics(WORD);
-int GetThresholdStatus(void);
-int GetUpdateRgn(HWND,HRGN,BOOL);
-int GetWindowText(HWND,LPSTR,int);
-int GetWindowTextLength(HWND);
-int IntersectClipRect(HDC,short,short,short,short);
-int IntersectVisRect(HDC,short,short,short,short);
-int LoadString(HANDLE,WORD,LPSTR,int);
-int MessageBox(HWND,LPSTR,LPSTR,WORD);
-int MulDiv(int,int,int);
-int OffsetClipRgn(HDC,short,short);
-int OffsetRgn(HRGN,short,short);
-int OpenComm(LPSTR,UINT,UINT);
-int OpenSound(void);
-int ProfInsChk(void);
-int ReadComm(int,LPSTR,int);
-int ReleaseDC(HWND,HDC);
-int RestoreVisRgn(HDC);
-int SaveDC(HDC);
-int ScrollWindowEx(HWND,short,short,LPRECT,LPRECT,HRGN,LPRECT,WORD);
-int SelectClipRgn(HDC,HRGN);
-int SelectVisRgn(HDC,HRGN);
-int SetCommBreak(int);
-int SetCommState(DCB*);
-int SetDIBits(HDC,HANDLE,WORD,WORD,LPSTR,LPBITMAPINFO,WORD);
-int SetDIBitsToDevice(HDC,short,short,WORD,WORD,WORD,WORD,WORD,WORD,LPSTR,LPBITMAPINFO,WORD);
-int SetEnvironment(LPSTR,LPSTR,WORD);
-int SetScrollPos(HWND,int,int,BOOL);
-int SetSoundNoise(int,int);
-int SetVoiceAccent(int,int,int,int,int);
-int SetVoiceEnvelope(int,int,int);
-int SetVoiceNote(int,int,int,int);
-int SetVoiceQueueSize(int,int);
-int SetVoiceSound(int,LONG,int);
-int SetVoiceThreshold(int,int);
-int ShowCursor(BOOL);
-int StartSound(void);
-int StopSound(void);
-int StretchDIBits(HDC,WORD,WORD,WORD,WORD,WORD,WORD,WORD,WORD,LPSTR,LPBITMAPINFO,WORD,DWORD);
-int SyncAllVoices(void);
-int Throw(LPCATCHBUF,int);
-int ToAscii(WORD,WORD,LPSTR,LPVOID,WORD);
-int TranslateAccelerator(HWND,HANDLE,LPMSG);
-int TransmitCommChar(int,char);
-int UngetCommChar(int,char);
-int UpdateColors(HDC);
-int WaitSoundState(int);
-int WriteComm(int,LPSTR,int);
-int wvsprintf(LPSTR,LPSTR,LPSTR);
-short GetPrivateProfileString(LPSTR,LPSTR,LPSTR,LPSTR,short,LPSTR);
-short GetTextCharacterExtra(HDC);
-short SetTextCharacterExtra(HDC,short);
-short SetTextJustification(HDC,short,short);
-void AdjustWindowRect(LPRECT,DWORD,BOOL);
-void AdjustWindowRectEx(LPRECT,DWORD,BOOL,DWORD);
-void AnimatePalette(HPALETTE,UINT,UINT,LPPALETTEENTRY);
-void AnsiToOemBuff(LPSTR,LPSTR,INT);
-void CheckDlgButton(HWND,WORD,WORD);
-void CheckRadioButton(HWND,WORD,WORD,WORD);
-void ClientToScreen(HWND,LPPOINT);
-void ClipCursor(LPRECT);
-void CloseSound(void);
-void CloseWindow(HWND);
-void CopyRect(LPRECT,LPRECT);
-void CreateCaret(HWND,HBITMAP,short,short);
-void DebugBreak(void);
-void DestroyCaret(void);
-void DirectedYield(HTASK);
-void DrawFocusRect(HDC,LPRECT);
-void DrawMenuBar(HWND);
-void EndDialog(HWND,short);
-void EndPaint(HWND,LPPAINTSTRUCT);
-void FarSetOwner(HANDLE,WORD);
-void FatalExit(int);
-void FillWindow(HWND,HWND,HDC,HBRUSH);
-void FreeLibrary(HANDLE);
-void FreeProcInstance(FARPROC);
-void GetCaretPos(LPPOINT);
-void GetClientRect(HWND,LPRECT);
-void GetCodeInfo(FARPROC,LPVOID);
-void GetCursorPos(LPPOINT);
-void GetKeyboardState(BYTE*);
-void GetScrollRange(HWND,int,LPINT,LPINT);
-void GetWindowRect(HWND,LPRECT);
-void GlobalFix(HGLOBAL);
-void GlobalFreeAll(HANDLE);
-void GlobalNotify(FARPROC);
-void GlobalUnfix(HGLOBAL);
-void HideCaret(HWND);
-void InflateRect(LPRECT,short,short);
-void InvalidateRect(HWND,LPRECT,BOOL);
-void InvalidateRgn(HWND,HRGN,BOOL);
-void InvertRect(HDC,LPRECT);
-void LimitEmsPages(DWORD);
-void LineDDA(short,short,short,short,FARPROC,long);
-void MapDialogRect(HWND,LPRECT);
-void MapWindowPoints(HWND,HWND,LPPOINT,WORD);
-void MessageBeep(WORD);
-void OemToAnsiBuff(LPSTR,LPSTR,INT);
-void OffsetRect(LPRECT,short,short);
-void OutputDebugString(LPSTR);
-void PaintRect(HWND,HWND,HDC,HBRUSH,LPRECT);
-void PlayMetaFileRecord(HDC,LPHANDLETABLE,LPMETARECORD,WORD);
-void PostQuitMessage(int);
-void ProfClear(void);
-void ProfFinish(void);
-void ProfFlush(void);
-void ProfSampRate(int,int);
-void ProfSetup(int,int);
-void ProfStart(void);
-void ProfStop(void);
-void ReleaseCapture(void);
-void ReplyMessage(LONG);
-void ScreenToClient(HWND,LPPOINT);
-void ScrollWindow(HWND,short,short,LPRECT,LPRECT);
-void SetCaretBlinkTime(WORD);
-void SetCaretPos(short,short);
-void SetConvertHook(BOOL);
-void SetCursorPos(short,short);
-void SetDCState(HDC,HDC);
-void SetDlgItemInt(HWND,WORD,WORD,BOOL);
-void SetDlgItemText(HWND,WORD,SEGPTR);
-void SetDoubleClickTime(WORD);
-void SetInternalWindowPos(HWND,WORD,LPRECT,LPPOINT);
-void SetKeyboardState(BYTE*);
-void SetRect(LPRECT,short,short,short,short);
-void SetRectEmpty(LPRECT);
-void SetRectRgn(HRGN,short,short,short,short);
-void SetScrollRange(HWND,int,int,int,BOOL);
-void SetSysColors(int,LPINT,COLORREF*);
-void SetWindowText(HWND,LPSTR);
-void ShowCaret(HWND);
-void ShowOwnedPopups(HWND,BOOL);
-void ShowScrollBar(HWND,WORD,BOOL);
-void SwapRecording(WORD);
-void SwitchStackBack(void);
-void SwitchStackTo(WORD,WORD,WORD);
-void UnlockSegment(HGLOBAL);
-void UpdateWindow(HWND);
-void ValidateCodeSegments(void);
-void ValidateRect(HWND,LPRECT);
-void ValidateRgn(HWND,HRGN);
-void WaitMessage(void);
-void Yield(void);
+DWORD      GlobalDOSAlloc(DWORD);
+WORD       GlobalDOSFree(WORD);
+ATOM       GlobalDeleteAtom(ATOM);
+ATOM       GlobalFindAtom(SEGPTR);
+void       GlobalFix(HGLOBAL);
+WORD       GlobalFlags(HGLOBAL);
+HGLOBAL    GlobalFree(HGLOBAL);
+void       GlobalFreeAll(HANDLE);
+WORD       GlobalGetAtomName(ATOM,LPSTR,short);
+#ifdef WINELIB32
+HGLOBAL    GlobalHandle(LPCVOID);
+#else
+DWORD      GlobalHandle(UINT);
+#endif
+HGLOBAL    GlobalLRUNewest(HGLOBAL);
+HGLOBAL    GlobalLRUOldest(HGLOBAL);
+LPVOID     GlobalLock(HGLOBAL);
+void       GlobalNotify(FARPROC);
+WORD       GlobalPageLock(HGLOBAL);
+WORD       GlobalPageUnlock(HGLOBAL);
+HGLOBAL    GlobalReAlloc(HGLOBAL,DWORD,WORD);
+DWORD      GlobalSize(HGLOBAL);
+BOOL       GlobalUnWire(HGLOBAL);
+void       GlobalUnfix(HGLOBAL);
+BOOL       GlobalUnlock(HGLOBAL);
+SEGPTR     GlobalWire(HGLOBAL);
+BOOL       GrayString(HDC,HBRUSH,FARPROC,LPARAM,INT,INT,INT,INT,INT);
+void       HideCaret(HWND);
+BOOL       HiliteMenuItem(HWND,HMENU,UINT,UINT);
+BOOL       InSendMessage(void);
+void       InflateRect(LPRECT,short,short);
+WORD       InitAtomTable(WORD);
+HRGN       InquireVisRgn(HDC);
+BOOL       InsertMenu(HMENU,UINT,UINT,UINT,LPSTR);
+int        IntersectClipRect(HDC,short,short,short,short);
+BOOL       IntersectRect(LPRECT,LPRECT,LPRECT);
+int        IntersectVisRect(HDC,short,short,short,short);
+void       InvalidateRect(HWND,LPRECT,BOOL);
+void       InvalidateRgn(HWND,HRGN,BOOL);
+void       InvertRect(HDC,LPRECT);
+BOOL       InvertRgn(HDC,HRGN);
+BOOL       IsBadCodePtr(SEGPTR);
+BOOL       IsBadHugeReadPtr(SEGPTR,DWORD);
+BOOL       IsBadHugeWritePtr(SEGPTR,DWORD);
+BOOL       IsBadReadPtr(SEGPTR,WORD);
+BOOL       IsBadStringPtr(SEGPTR,WORD);
+BOOL       IsBadWritePtr(SEGPTR,WORD);
+BOOL       IsCharAlpha(char);
+BOOL       IsCharAlphaNumeric(char);
+BOOL       IsCharLower(char);
+BOOL       IsCharUpper(char);
+BOOL       IsChild(HWND,HWND);
+BOOL       IsClipboardFormatAvailable(WORD);
+BOOL       IsDialogMessage(HWND,LPMSG);
+WORD       IsDlgButtonChecked(HWND,WORD);
+BOOL       IsIconic(HWND);
+BOOL       IsRectEmpty(LPRECT);
+BOOL       IsTwoByteCharPrefix(char);
+BOOL       IsWindow(HWND);
+BOOL       IsWindowEnabled(HWND);
+BOOL       IsWindowVisible(HWND);
+BOOL       IsZoomed(HWND);
+BOOL       KillSystemTimer(HWND,WORD);
+BOOL       KillTimer(HWND,WORD);
+BOOL       LPtoDP(HDC,LPPOINT,int);
+void       LimitEmsPages(DWORD);
+void       LineDDA(short,short,short,short,FARPROC,long);
+BOOL       LineTo(HDC,short,short);
+HANDLE     LoadAccelerators(HANDLE,SEGPTR);
+HBITMAP    LoadBitmap(HANDLE,SEGPTR);
+HCURSOR    LoadCursor(HANDLE,SEGPTR);
+HICON      LoadIcon(HANDLE,SEGPTR);
+HANDLE     LoadLibrary(LPCSTR);
+HMENU      LoadMenu(HANDLE,SEGPTR);
+HMENU      LoadMenuIndirect(LPSTR);
+HANDLE     LoadModule(LPCSTR,LPVOID);
+HANDLE     LoadResource(HANDLE,HANDLE);
+int        LoadString(HANDLE,WORD,LPSTR,int);
+HANDLE     LocalAlloc(WORD,WORD);
+#ifndef WINELIB32 /* Obsolete in Win32 */
+UINT       LocalCompact(WORD);
+#endif
+UINT       LocalFlags(HLOCAL);
+HANDLE     LocalFree(HANDLE);
+HANDLE     LocalHandle(WORD);
+BOOL       LocalInit(HANDLE,WORD,WORD);
+NPVOID     LocalLock(HLOCAL);
+FARPROC    LocalNotify(FARPROC);
+HANDLE     LocalReAlloc(HANDLE,WORD,WORD);
+#ifndef WINELIB32 /* Obsolete in Win32 */
+UINT       LocalShrink(HANDLE,WORD);
+#endif
+UINT       LocalSize(HLOCAL);
+BOOL       LocalUnlock(HANDLE);
+LPSTR      LockResource(HANDLE);
+HGLOBAL    LockSegment(HGLOBAL);
+HMENU      LookupMenuHandle(HMENU,INT);
+FARPROC    MakeProcInstance(FARPROC,HANDLE);
+void       MapDialogRect(HWND,LPRECT);
+WORD       MapVirtualKey(WORD,WORD);
+void       MapWindowPoints(HWND,HWND,LPPOINT,WORD);
+void       MessageBeep(WORD);
+int        MessageBox(HWND,LPSTR,LPSTR,WORD);
+BOOL       ModifyMenu(HMENU,UINT,UINT,UINT,LPSTR);
+DWORD      MoveTo(HDC,short,short);
+BOOL       MoveToEx(HDC,short,short,LPPOINT);
+BOOL       MoveWindow(HWND,short,short,short,short,BOOL);
+int        MulDiv(int,int,int);
+DWORD      OemKeyScan(WORD);
+BOOL       OemToAnsi(LPSTR,LPSTR);
+void       OemToAnsiBuff(LPSTR,LPSTR,INT);
+int        OffsetClipRgn(HDC,short,short);
+void       OffsetRect(LPRECT,short,short);
+int        OffsetRgn(HRGN,short,short);
+DWORD      OffsetViewportOrg(HDC,short,short);
+BOOL       OffsetViewportOrgEx(HDC,short,short,LPPOINT);
+DWORD      OffsetWindowOrg(HDC,short,short);
+BOOL       OffsetWindowOrgEx(HDC,short,short,LPPOINT);
+BOOL       OpenClipboard(HWND);
+int        OpenComm(LPSTR,UINT,UINT);
+INT        OpenFile(LPCSTR,LPOFSTRUCT,UINT);
+BOOL       OpenIcon(HWND);
+int        OpenSound(void);
+void       OutputDebugString(LPSTR);
+void       PaintRect(HWND,HWND,HDC,HBRUSH,LPRECT);
+BOOL       PaintRgn(HDC,HRGN);
+BOOL       PatBlt(HDC,short,short,short,short,DWORD);
+BOOL       PeekMessage(LPMSG,HWND,WORD,WORD,WORD);
+BOOL       Pie(HDC,int,int,int,int,int,int,int,int);
+BOOL       PlayMetaFile(HDC,HANDLE);
+void       PlayMetaFileRecord(HDC,LPHANDLETABLE,LPMETARECORD,WORD);
+BOOL       PolyPolygon(HDC,LPPOINT,LPINT,WORD);
+BOOL       Polygon(HDC,LPPOINT,int);
+BOOL       Polyline(HDC,LPPOINT,int);
+BOOL       PostAppMessage(HANDLE,WORD,WORD,LONG);
+BOOL       PostMessage(HWND,WORD,WORD,LONG);
+void       PostQuitMessage(int);
+WORD       PrestoChangoSelector(WORD,WORD);
+void       ProfClear(void);
+void       ProfFinish(void);
+void       ProfFlush(void);
+int        ProfInsChk(void);
+void       ProfSampRate(int,int);
+void       ProfSetup(int,int);
+void       ProfStart(void);
+void       ProfStop(void);
+BOOL       PtInRect(LPRECT,POINT);
+BOOL       PtInRegion(HRGN,short,short);
+BOOL       PtVisible(HDC,short,short);
+int        ReadComm(int,LPSTR,int);
+WORD       RealizeDefaultPalette(HDC);
+UINT       RealizePalette(HDC);
+BOOL       RectInRegion(HRGN,LPRECT);
+BOOL       RectVisible(HDC,LPRECT);
+BOOL       Rectangle(HDC,int,int,int,int);
+BOOL       RedrawWindow(HWND,LPRECT,HRGN,UINT);
+ATOM       RegisterClass(LPWNDCLASS);
+WORD       RegisterClipboardFormat(LPCSTR);
+WORD       RegisterWindowMessage(SEGPTR);
+void       ReleaseCapture(void);
+int        ReleaseDC(HWND,HDC);
+BOOL       RemoveFontResource(LPSTR);
+BOOL       RemoveMenu(HMENU,UINT,UINT);
+HANDLE     RemoveProp(HWND,SEGPTR);
+void       ReplyMessage(LONG);
+BOOL       ResizePalette(HPALETTE,UINT);
+BOOL       RestoreDC(HDC,short);
+int        RestoreVisRgn(HDC);
+BOOL       RoundRect(HDC,short,short,short,short,short,short);
+int        SaveDC(HDC);
+HRGN       SaveVisRgn(HDC);
+DWORD      ScaleViewportExt(HDC,short,short,short,short);
+BOOL       ScaleViewportExtEx(HDC,short,short,short,short,LPSIZE);
+DWORD      ScaleWindowExt(HDC,short,short,short,short);
+BOOL       ScaleWindowExtEx(HDC,short,short,short,short,LPSIZE);
+void       ScreenToClient(HWND,LPPOINT);
+BOOL       ScrollDC(HDC,short,short,LPRECT,LPRECT,HRGN,LPRECT);
+void       ScrollWindow(HWND,short,short,LPRECT,LPRECT);
+int        ScrollWindowEx(HWND,short,short,LPRECT,LPRECT,HRGN,LPRECT,WORD);
+int        SelectClipRgn(HDC,HRGN);
+HANDLE     SelectObject(HDC,HANDLE);
+HPALETTE   SelectPalette(HDC,HPALETTE,BOOL);
+int        SelectVisRgn(HDC,HRGN);
+WORD       SelectorAccessRights(WORD,WORD,WORD);
+LONG       SendDlgItemMessage(HWND,INT,UINT,WPARAM,LPARAM);
+LRESULT    SendMessage(HWND,UINT,WPARAM,LPARAM);
+HWND       SetActiveWindow(HWND);
+LONG       SetBitmapBits(HBITMAP,LONG,LPSTR);
+DWORD      SetBitmapDimension(HBITMAP,short,short);
+BOOL       SetBitmapDimensionEx(HBITMAP,short,short,LPSIZE);
+DWORD      SetBkColor(HDC,COLORREF);
+WORD       SetBkMode(HDC,WORD);
+DWORD      SetBrushOrg(HDC,short,short);
+HWND       SetCapture(HWND);
+void       SetCaretBlinkTime(WORD);
+void       SetCaretPos(short,short);
+LONG       SetClassLong(HWND,short,LONG);
+WORD       SetClassWord(HWND,short,WORD);
+HANDLE     SetClipboardData(WORD,HANDLE);
+HWND       SetClipboardViewer(HWND);
+int        SetCommBreak(int);
+UINT*      SetCommEventMask(int,UINT);
+int        SetCommState(DCB*);
+void       SetConvertHook(BOOL);
+BOOL       SetConvertParams(int,int);
+HCURSOR    SetCursor(HCURSOR);
+void       SetCursorPos(short,short);
+void       SetDCState(HDC,HDC);
+int        SetDIBits(HDC,HANDLE,WORD,WORD,LPSTR,LPBITMAPINFO,WORD);
+int        SetDIBitsToDevice(HDC,short,short,WORD,WORD,WORD,WORD,WORD,WORD,LPSTR,LPBITMAPINFO,WORD);
+BOOL       SetDeskPattern(void);
+BOOL       SetDeskWallPaper(LPSTR);
+void       SetDlgItemInt(HWND,WORD,WORD,BOOL);
+void       SetDlgItemText(HWND,WORD,SEGPTR);
+void       SetDoubleClickTime(WORD);
+int        SetEnvironment(LPSTR,LPSTR,WORD);
+BOOL       SetErrorMode(WORD);
+HWND       SetFocus(HWND);
+WORD       SetHandleCount(WORD);
+void       SetInternalWindowPos(HWND,WORD,LPRECT,LPPOINT);
+void       SetKeyboardState(BYTE*);
+WORD       SetMapMode(HDC,WORD);
+DWORD      SetMapperFlags(HDC,DWORD);
+BOOL       SetMenu(HWND,HMENU);
+BOOL       SetMenuItemBitmaps(HMENU,UINT,UINT,HBITMAP,HBITMAP);
+BOOL       SetMessageQueue(int);
+HANDLE     SetMetaFileBits(HANDLE);
+WORD       SetPaletteEntries(HPALETTE,WORD,WORD,LPPALETTEENTRY);
+HWND       SetParent(HWND,HWND);
+COLORREF   SetPixel(HDC,short,short,COLORREF);
+WORD       SetPolyFillMode(HDC,WORD);
+BOOL       SetProp(HWND,SEGPTR,HANDLE);
+WORD       SetROP2(HDC,WORD);
+void       SetRect(LPRECT,short,short,short,short);
+void       SetRectEmpty(LPRECT);
+void       SetRectRgn(HRGN,short,short,short,short);
+WORD       SetRelAbs(HDC,WORD);
+FARPROC    SetResourceHandler(HANDLE,LPSTR,FARPROC);
+int        SetScrollPos(HWND,int,int,BOOL);
+void       SetScrollRange(HWND,int,int,int,BOOL);
+WORD       SetSelectorBase(WORD,DWORD);
+WORD       SetSelectorLimit(WORD,DWORD);
+int        SetSoundNoise(int,int);
+WORD       SetStretchBltMode(HDC,WORD);
+LONG       SetSwapAreaSize(WORD);
+void       SetSysColors(int,LPINT,COLORREF*);
+HWND       SetSysModalWindow(HWND);
+WORD       SetSystemPaletteUse(HDC,WORD);
+WORD       SetSystemTimer(HWND,WORD,WORD,FARPROC);
+HGLOBAL    SetTaskQueue(HTASK,HGLOBAL);
+WORD       SetTextAlign(HDC,WORD);
+short      SetTextCharacterExtra(HDC,short);
+DWORD      SetTextColor(HDC,DWORD);
+short      SetTextJustification(HDC,short,short);
+WORD       SetTimer(HWND,WORD,WORD,FARPROC);
+DWORD      SetViewportExt(HDC,short,short);
+BOOL       SetViewportExtEx(HDC,short,short,LPSIZE);
+DWORD      SetViewportOrg(HDC,short,short);
+BOOL       SetViewportOrgEx(HDC,short,short,LPPOINT);
+int        SetVoiceAccent(int,int,int,int,int);
+int        SetVoiceEnvelope(int,int,int);
+int        SetVoiceNote(int,int,int,int);
+int        SetVoiceQueueSize(int,int);
+int        SetVoiceSound(int,LONG,int);
+int        SetVoiceThreshold(int,int);
+BOOL       SetWinDebugInfo(LPWINDEBUGINFO);
+DWORD      SetWindowExt(HDC,short,short);
+BOOL       SetWindowExtEx(HDC,short,short,LPSIZE);
+LONG       SetWindowLong(HWND,short,LONG);
+DWORD      SetWindowOrg(HDC,short,short);
+BOOL       SetWindowOrgEx(HDC,short,short,LPPOINT);
+BOOL       SetWindowPlacement(HWND,LPWINDOWPLACEMENT);
+BOOL       SetWindowPos(HWND,HWND,INT,INT,INT,INT,WORD);
+void       SetWindowText(HWND,LPSTR);
+WORD       SetWindowWord(HWND,short,WORD);
+FARPROC    SetWindowsHook(short,FARPROC);
+HHOOK      SetWindowsHookEx(short,HOOKPROC,HINSTANCE,HTASK);
+void       ShowCaret(HWND);
+int        ShowCursor(BOOL);
+void       ShowOwnedPopups(HWND,BOOL);
+void       ShowScrollBar(HWND,WORD,BOOL);
+BOOL       ShowWindow(HWND,int);
+DWORD      SizeofResource(HANDLE,HRSRC);
+int        StartSound(void);
+int        StopSound(void);
+BOOL       StretchBlt(HDC,short,short,short,short,HDC,short,short,short,short,DWORD);
+int        StretchDIBits(HDC,WORD,WORD,WORD,WORD,WORD,WORD,WORD,WORD,LPSTR,LPBITMAPINFO,WORD,DWORD);
+BOOL       SubtractRect(LPRECT,LPRECT,LPRECT);
+BOOL       SwapMouseButton(BOOL);
+void       SwapRecording(WORD);
+void       SwitchStackBack(void);
+void       SwitchStackTo(WORD,WORD,WORD);
+int        SyncAllVoices(void);
+LONG       TabbedTextOut(HDC,short,short,LPSTR,short,short,LPINT,short);
+BOOL       TextOut(HDC,short,short,LPSTR,short);
+int        Throw(LPCATCHBUF,int);
+int        ToAscii(WORD,WORD,LPSTR,LPVOID,WORD);
+BOOL       TrackPopupMenu(HMENU,UINT,short,short,short,HWND,LPRECT);
+int        TranslateAccelerator(HWND,HANDLE,LPMSG);
+BOOL       TranslateMDISysAccel(HWND,LPMSG);
+BOOL       TranslateMessage(LPMSG);
+int        TransmitCommChar(int,char);
+int        UngetCommChar(int,char);
+BOOL       UnhookWindowsHook(short,FARPROC);
+BOOL       UnhookWindowsHookEx(HHOOK);
+BOOL       UnionRect(LPRECT,LPRECT,LPRECT);
+void       UnlockSegment(HGLOBAL);
+BOOL       UnrealizeObject(HBRUSH);
+BOOL       UnregisterClass(SEGPTR,HANDLE);
+int        UpdateColors(HDC);
+void       UpdateWindow(HWND);
+void       ValidateCodeSegments(void);
+LPSTR      ValidateFreeSpaces(void);
+void       ValidateRect(HWND,LPRECT);
+void       ValidateRgn(HWND,HRGN);
+WORD       VkKeyScan(WORD);
+SEGPTR     WIN16_GlobalLock(HGLOBAL);
+SEGPTR     WIN16_LockResource(HANDLE);
+void       WaitMessage(void);
+int        WaitSoundState(int);
+HANDLE     WinExec(LPSTR,WORD);
+BOOL       WinHelp(HWND,LPSTR,WORD,DWORD);
+HWND       WindowFromPoint(POINT);
+int        WriteComm(int,LPSTR,int);
+BOOL       WritePrivateProfileString(LPSTR,LPSTR,LPSTR,LPSTR);
+BOOL       WriteProfileString(LPSTR,LPSTR,LPSTR);
+void       Yield(void);
+LONG       _hread(INT,LPSTR,LONG);
+LONG       _hwrite(INT,LPCSTR,LONG);
+INT        _lclose(INT);
+INT        _lcreat(LPSTR,INT);
+LONG       _llseek(INT,LONG,INT);
+INT        _lopen(LPSTR,INT);
+INT        _lread(INT,LPSTR,WORD);
+INT        _lwrite(INT,LPCSTR,WORD);
+SEGPTR     lstrcat(SEGPTR,SEGPTR);
+INT        lstrcmp(LPCSTR,LPCSTR);
+INT        lstrcmpi(LPCSTR,LPCSTR);
+SEGPTR     lstrcpy(SEGPTR,SEGPTR);
+SEGPTR     lstrcpyn(SEGPTR,SEGPTR,WORD);
+INT        lstrlen(LPCSTR);
+int        wvsprintf(LPSTR,LPSTR,LPSTR);
 
 #ifdef WINELIB
 #define WINELIB_UNIMP(x) fprintf (stderr, "WineLib: Unimplemented %s\n", x)
diff --git a/include/wine.h b/include/wine.h
index f6748e0..29b6c44 100644
--- a/include/wine.h
+++ b/include/wine.h
@@ -14,13 +14,9 @@
 #endif
 
 
-#if defined ( linux) || defined(__svr4__)
-/*
- * SVR4 NOTE:
- * This is not correct but gets it through the compiler
- * Must come back and look at this again
- */
-struct sigcontext_struct {
+#if defined ( linux) 
+struct sigcontext_struct
+{
 	unsigned short sc_gs, __gsh;
 	unsigned short sc_fs, __fsh;
 	unsigned short sc_es, __esh;
@@ -44,20 +40,21 @@
 	unsigned long oldmask;
 	unsigned long cr2;
 };
-#ifdef linux
 #define WINE_DATA_SELECTOR 0x2b
 #define WINE_CODE_SELECTOR 0x23
-#endif
-#ifdef __svr4__
-#define WINE_DATA_SELECTOR 0x1f
-#define WINE_CODE_SELECTOR 0x17
-#endif
 #endif  /* linux */
 
 #ifdef __NetBSD__
 #include <signal.h>
 #define sigcontext_struct sigcontext
-#define HZ 100
+#define WINE_DATA_SELECTOR 0x1f
+#define WINE_CODE_SELECTOR 0x17
+#endif
+
+#ifdef __svr4__
+#include <signal.h>
+#include <sys/ucontext.h>
+#define sigcontext_struct ucontext
 #define WINE_DATA_SELECTOR 0x1f
 #define WINE_CODE_SELECTOR 0x17
 #endif
@@ -65,7 +62,6 @@
 #ifdef __FreeBSD__
 #include <signal.h>
 #define sigcontext_struct sigcontext
-#define HZ 100
 #define WINE_DATA_SELECTOR 0x27
 #define WINE_CODE_SELECTOR 0x1f
 #endif
diff --git a/include/winerror.h b/include/winerror.h
index e1c1dbf..ec4ba25 100644
--- a/include/winerror.h
+++ b/include/winerror.h
@@ -1,2 +1,12 @@
 extern int WIN32_LastError;
-#define	ERROR_CALL_NOT_IMPLEMENTED	120
+
+/* ERROR_UNKNOWN is a placeholder for error conditions which haven't
+ * been tested yet so we're not exactly sure what will be returned.
+ * All instances of ERROR_UNKNOWN should be tested under Win95/NT
+ * and replaced.
+ */
+#define     ERROR_UNKNOWN               99999
+
+#define     ERROR_INVALID_HANDLE        6
+#define     ERROR_INVALID_PARAMETER     87
+#define     ERROR_CALL_NOT_IMPLEMENTED  120
diff --git a/include/winnls.h b/include/winnls.h
index 77d3890..003ad2f 100644
--- a/include/winnls.h
+++ b/include/winnls.h
@@ -1,3 +1,6 @@
+#ifndef __WINE_WINNLS_H
+#define __WINE_WINNLS_H
+
 #define LOCALE_ILANGUAGE            0x00000001   
 #define LOCALE_SLANGUAGE            0x00000002   
 #define LOCALE_SENGLANGUAGE         0x00001001   
@@ -102,3 +105,5 @@
 #define NORM_IGNORENONSPACE			2
 #define NORM_IGNORESYMBOLS			4
 #define NORM_STRINGSORT				0x1000
+
+#endif  /* __WINE_WINNLS_H */
diff --git a/include/winsock.h b/include/winsock.h
index 46471ac..6223573 100644
--- a/include/winsock.h
+++ b/include/winsock.h
@@ -65,6 +65,7 @@
 #ifndef _SYS_SOCKET_H_
 #ifndef _sys_socket_h
 #ifndef _NET_TRANSPORT_SOCKET_H
+#ifndef _NET_SOCKET_H
 /*
  * Structure used by kernel to pass protocol
  * information in raw sockets.
@@ -76,6 +77,7 @@
 #endif
 #endif
 #endif
+#endif
 
 /*
  * Maximum queue length specifiable by listen.
diff --git a/include/wintypes.h b/include/wintypes.h
index ff785d1..eb917b5 100644
--- a/include/wintypes.h
+++ b/include/wintypes.h
@@ -79,6 +79,7 @@
 DECLARE_HANDLE(HMODULE);
 DECLARE_HANDLE(HPALETTE);
 DECLARE_HANDLE(HPEN);
+DECLARE_HANDLE(HQUEUE);
 DECLARE_HANDLE(HRGN);
 DECLARE_HANDLE(HRSRC);
 DECLARE_HANDLE(HTASK);
@@ -137,4 +138,13 @@
 #define MIN(a,b) (((a) < (b)) ? (a) : (b))
 #endif
 
+#ifndef DONT_DEFINE_min_AND_max
+#ifndef min
+#define min(a,b) MIN(a,b)
+#endif
+#ifndef max
+#define max(a,b) MAX(a,b)
+#endif
+#endif
+
 #endif /* __WINE_WINTYPES_H */