Release 970914

Thu Sep 11 18:24:56 1997  Philippe De Muyter  <phdm@info.ucl.ac.be>

	* [objects/dc.c]
	In DC_SetupGCForPatBlt, replace R2_NOT by GXxor with (black xor white).

Tue Sep  9 23:04:02 1997  U. Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>

	* [memory/virtual.c] 
	Do not write debugging info unconditionally to stderr.

	* [files/profile.c]
	Call PROFILE_GetSection in PROFILE_GetString for key_name "" too.

	* [misc/crtdll.c]
	Many new functions.

	* [include/windows.h] [windows/winpos.c]
	ClientToScreen16 doesn't have a return value.

Sun Sep  7 10:06:39 1997  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [misc/main.c] [AUTHORS]
	Update the list of contributors. Please let me know if I forgot
	someone.

	* [if1632/*.spec] [if1632/builtin.c] [tools/build.c]
	Ordinal base for Win32 DLLs is now computed automatically from the
	lowest ordinal found.

	* [include/wintypes.h]
	WINAPI is now defined as attribute((stdcall)). This will require
	gcc to compile.

	* [if1632/thunk.c]
	Removed Win32 thunks (no longer needed with stdcall).

	* [if1632/crtdll.spec] [misc/crtdll.c]
	Make sure we only reference cdecl functions in the spec file.

	* [objects/dc.c]
	Use CapNotLast drawing style for 1-pixel wide lines.

	* [tools/build.c]
	Added 'double' argument type.
	Added 'varargs' function type for Win32.
	Made CallTo16_xxx functions stdcall.

Fri Sep  5 14:50:49 1997  Alex Korobka <alex@trantor.pharm.sunysb.edu>

	* [tools/build.c] [windows/win.c] [windows/event.c] [windows/message.c]
	More fixes to get message exchange closer to the original.

	* [misc/spy.c]
	Message logs now contain window names.

	* [loader/resource.c] [loader/ne_resource.c] [loader/task.c]
	  [objects/cursoricon.c] [windows/user.c]
	Added some obscure features to fix memory leaks.

Fri Sep  5 00:46:28 1997  Jan Willamowius <jan@janhh.shnet.org>

	* [if1632/kernel32.spec] [win32/newfns.c]
	Added stub for UTRegister() and UTUnRegister().

Thu Sep  4 12:03:12 1997  Frans van Dorsselaer <dorssel@rulhmpc49.LeidenUniv.nl>
	* [controls/edit.c]
	Allow ASCII codes > 127 in WM_CHAR.

Mon Sep  1 17:23:24 1997  Dimitrie O. Paun  <dimi@mail.cs.toronto.edu>

	* [controls/widgets.c]
	In InitCommonControls, remember the name of the class
	because lpszClassName was made to point to a local array
	Added the ProgressBar to the list of implemented controls.
	Call InitCommonControls from WIDGETS_Init to register all
	implemented Common Controls.
	
	* [include/commctrl.h]
	Added misc decl for the Progress Bar.

	* [controls/progress.c] [include/progress.h]
	First attempt at implementiong the Progress Bar class.

	* [objects/brush.h]
	Implementation for GetSysColorBrush[16|32]

	* [controls/status.c]
	Use DrawEdge to draw the borders and fill the background

	* [controls/uitools.c]
	Added DrawDiagEdge32 and DrawRectEdge32

	* [graphics/painting.c]
	Implement DrawEdge[16|32]
	Started DrawFrameControl32

Mon Sep  1 10:07:09 1997  Lawson Whitney <lawson_whitney@juno.com>

	* [misc/comm.c] [include/windows.h]
	SetCommEventMask returns a SEGPTR.

Sun Aug 31 23:28:32 1997  Marcus Meissner <msmeissn@cip.informatik.uni-erlangen.de>

	* [loader/pe_image.c][loader/module.c][include/pe_image.h]
	  [include/module.h]
	Cleaned up the whole Win32 library mess (a bit).

	* [debugger/stabs.c]
	If 'wine' has no absolute path and isn't found, check $PATH too.

	* [misc/ole2nls.c]
	Some fixes.

	* [misc/ver.c]
	Added support for PE style version resources.

	* [memory/string.c]
	Check for NULL pointers to _lstr* functions, just as Windows95 does.

	* [multimedia/time.c]
	Made list of timers a simple linked list.

	* [loader/resource.c]
	Netscape 3 seems to pass NEGATIVE resource Ids (in an
	unsigned int, yes). Don't know why, fixed it anyway.

	* [objects/bitmap.c]
	LoadImageW added.

	* [include/win.h][windows/win.c]
	Change wIDmenu from UINT16 to UINT32 and changed the
	SetWindow(Long|Word) accordingly.

Thu Aug 28 19:30:08 1997  Morten Welinder  <terra@diku.dk>

	* [include/windows.h]
	Add a few more colors defined for Win95.
	Add a few more brush styles.

	* [windows/syscolor.c]
 	Add error checks for SYSCOLOR_SetColor, SYSCOLOR_Init,
	GetSysColor16, GetSysColor32.  Add support for above colors.

Sun Aug 24 16:22:57 1997  Andrew Taylor <andrew@riscan.com>

	* [multimedia/mmsystem.c]
	Changed mmioDescend to use mmio functions for file I/O, neccessary
	for memory files.
diff --git a/include/bitmap.h b/include/bitmap.h
index 6ec1ad0..ae02e76 100644
--- a/include/bitmap.h
+++ b/include/bitmap.h
@@ -49,11 +49,13 @@
 }
 
   /* objects/bitmap.c */
-extern BOOL32 BITMAP_Init(void);
-extern INT16 BITMAP_GetObject16( BITMAPOBJ * bmp, INT16 count, LPVOID buffer );
-extern INT32 BITMAP_GetObject32( BITMAPOBJ * bmp, INT32 count, LPVOID buffer );
-extern BOOL32 BITMAP_DeleteObject( HBITMAP16 hbitmap, BITMAPOBJ * bitmap );
+extern BOOL32  BITMAP_Init(void);
+extern INT16   BITMAP_GetObject16( BITMAPOBJ * bmp, INT16 count, LPVOID buffer );
+extern INT32   BITMAP_GetObject32( BITMAPOBJ * bmp, INT32 count, LPVOID buffer );
+extern BOOL32  BITMAP_DeleteObject( HBITMAP16 hbitmap, BITMAPOBJ * bitmap );
 extern XImage *BITMAP_GetXImage( const BITMAPOBJ *bmp );
+extern INT32   BITMAP_GetBitsPadding( int width, int depth );
+extern INT32   BITMAP_GetBitsWidth( int width, int depth );
 
   /* objects/dib.c */
 extern int DIB_GetDIBWidthBytes( int width, int depth );
diff --git a/include/callback.h b/include/callback.h
index 4efb4e4..9bd9049 100644
--- a/include/callback.h
+++ b/include/callback.h
@@ -22,34 +22,36 @@
 
 #ifndef WINELIB
 
-extern LONG CallTo16_regs_     ( const CONTEXT *context );
-extern WORD CallTo16_word_     ( FARPROC16 );
-extern WORD CallTo16_word_w    ( FARPROC16, WORD );
-extern LONG CallTo16_long_l    ( FARPROC16, LONG );
-extern WORD CallTo16_word_ww   ( FARPROC16, WORD, WORD );
-extern WORD CallTo16_word_wl   ( FARPROC16, WORD, LONG );
-extern WORD CallTo16_word_ll   ( FARPROC16, LONG, LONG );
-extern WORD CallTo16_word_www  ( FARPROC16, WORD, WORD, WORD );
-extern WORD CallTo16_word_wwl  ( FARPROC16, WORD, WORD, LONG );
-extern WORD CallTo16_word_wlw  ( FARPROC16, WORD, LONG, WORD );
-extern LONG CallTo16_long_wwl  ( FARPROC16, WORD, WORD, LONG );
-extern WORD CallTo16_word_llwl ( FARPROC16, LONG, LONG, WORD, LONG );
-extern LONG CallTo16_long_wwwl ( FARPROC16, WORD, WORD, WORD, LONG );
-extern WORD CallTo16_word_lwww ( FARPROC16, LONG, WORD, WORD, WORD );
-extern WORD CallTo16_word_wwll ( FARPROC16, WORD, WORD, LONG, LONG );
-extern WORD CallTo16_word_wllwl( FARPROC16, WORD, LONG, LONG, WORD, LONG );
-extern LONG CallTo16_long_lwwll( FARPROC16, LONG, WORD, WORD, LONG, LONG );
-extern WORD CallTo16_word_wwlll( FARPROC16, WORD, WORD, LONG, LONG, LONG );
-extern LONG CallTo16_long_lllllllwlwwwl( FARPROC16, LONG, LONG, LONG,
-                                         LONG, LONG, LONG, LONG, WORD, LONG,
-                                         WORD, WORD, WORD, LONG );
-extern WORD CallTo16_word_lwll ( FARPROC16, LONG, WORD, LONG, LONG);
-extern WORD CallTo16_word_lwlll( FARPROC16, LONG, WORD, LONG, LONG, LONG );
-extern WORD CallTo16_word_llll ( FARPROC16, LONG, LONG, LONG, LONG);
-extern LONG CallTo16_long_lwlll( FARPROC16, LONG, WORD, LONG, LONG, LONG );
-extern LONG CallTo16_long_lwwllwlllllw( FARPROC16, LONG, WORD, WORD, LONG, 
-				       LONG, WORD, LONG, LONG, LONG, LONG, 
-				       LONG, WORD);
+extern LONG CALLBACK CallTo16_regs_     (const CONTEXT *context);
+extern WORD CALLBACK CallTo16_word_     (FARPROC16);
+extern WORD CALLBACK CallTo16_word_w    (FARPROC16,WORD);
+extern LONG CALLBACK CallTo16_long_l    (FARPROC16,LONG);
+extern WORD CALLBACK CallTo16_word_ww   (FARPROC16,WORD,WORD);
+extern WORD CALLBACK CallTo16_word_wl   (FARPROC16,WORD,LONG);
+extern WORD CALLBACK CallTo16_word_ll   (FARPROC16,LONG,LONG);
+extern WORD CALLBACK CallTo16_word_www  (FARPROC16,WORD,WORD,WORD);
+extern WORD CALLBACK CallTo16_word_wwl  (FARPROC16,WORD,WORD,LONG);
+extern WORD CALLBACK CallTo16_word_wlw  (FARPROC16,WORD,LONG,WORD);
+extern LONG CALLBACK CallTo16_long_wwl  (FARPROC16,WORD,WORD,LONG);
+extern WORD CALLBACK CallTo16_word_llwl (FARPROC16,LONG,LONG,WORD,LONG);
+extern WORD CALLBACK CallTo16_word_lwll (FARPROC16,LONG,WORD,LONG,LONG);
+extern LONG CALLBACK CallTo16_long_wwwl (FARPROC16,WORD,WORD,WORD,LONG);
+extern LONG CALLBACK CallTo16_wndp_wwwl (FARPROC16,WORD,WORD,WORD,LONG);
+extern WORD CALLBACK CallTo16_word_lwww (FARPROC16,LONG,WORD,WORD,WORD);
+extern WORD CALLBACK CallTo16_word_wwll (FARPROC16,WORD,WORD,LONG,LONG);
+extern WORD CALLBACK CallTo16_word_wllwl(FARPROC16,WORD,LONG,LONG,WORD,LONG);
+extern LONG CALLBACK CallTo16_long_lwwll(FARPROC16,LONG,WORD,WORD,LONG,LONG);
+extern WORD CALLBACK CallTo16_word_wwlll(FARPROC16,WORD,WORD,LONG,LONG,LONG);
+extern WORD CALLBACK CallTo16_word_wwwww(FARPROC16,WORD,WORD,WORD,WORD,WORD);
+extern LONG CALLBACK CallTo16_wndp_lllllllwlwwwl(FARPROC16,LONG,LONG,LONG,LONG,
+                                                 LONG,LONG,LONG,WORD,LONG,WORD,
+                                                 WORD,WORD,LONG);
+extern WORD CALLBACK CallTo16_word_lwlll(FARPROC16,LONG,WORD,LONG,LONG,LONG);
+extern WORD CALLBACK CallTo16_word_llll (FARPROC16,LONG,LONG,LONG,LONG);
+extern LONG CALLBACK CallTo16_long_lwlll(FARPROC16,LONG,WORD,LONG,LONG,LONG);
+extern LONG CALLBACK CallTo16_long_lwwllwlllllw(FARPROC16,LONG,WORD,WORD,LONG,
+                                                LONG,WORD,LONG,LONG,LONG,LONG,
+                                                LONG,WORD);
 
 #define CallDriverProc( func, dwId, msg, hdrvr, lparam1, lparam2 ) \
     CallTo16_long_lwwll( func, dwId, msg, hdrvr, lparam1, lparam2 )
@@ -66,28 +68,20 @@
 /* List of the 32-bit callback functions. This list is used  */
 /* by the build program to generate the file if1632/callto32.S */
 
-extern LONG CallTo32_0( FARPROC32 );
-extern LONG CallTo32_1( FARPROC32, DWORD );
-extern LONG CallTo32_2( FARPROC32, DWORD, DWORD );
-extern LONG CallTo32_3( FARPROC32, DWORD, DWORD, DWORD );
-extern LONG CallTo32_4( FARPROC32, DWORD, DWORD, DWORD, DWORD );
-extern LONG CallTo32_5( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD );
-extern LONG CallTo32_6( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
-extern LONG CallTo32_7( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
-extern LONG CallTo32_8( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
-extern LONG CallTo32_9( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
-extern LONG CallTo32_10( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
-extern LONG CallTo32_11( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
-extern LONG CallTo32_12( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
-extern LONG CallTo32_13( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
-
-#define CallTaskStart32( func ) \
-    CallTo32_0( func )
-#define CallDLLEntryProc32( func, hmodule, a, b ) \
-    CallTo32_3( func, hmodule, a, b )
-#define CallWordBreakProc32A( func, lpch, ichCurrent, cch, code ) \
-    CallTo32_4( func, (DWORD)lpch, ichCurrent, cch, code )
-
+extern LONG CALLBACK CallTo32_0( FARPROC32 );
+extern LONG CALLBACK CallTo32_1( FARPROC32, DWORD );
+extern LONG CALLBACK CallTo32_2( FARPROC32, DWORD, DWORD );
+extern LONG CALLBACK CallTo32_3( FARPROC32, DWORD, DWORD, DWORD );
+extern LONG CALLBACK CallTo32_4( FARPROC32, DWORD, DWORD, DWORD, DWORD );
+extern LONG CALLBACK CallTo32_5( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD );
+extern LONG CALLBACK CallTo32_6( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
+extern LONG CALLBACK CallTo32_7( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
+extern LONG CALLBACK CallTo32_8( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
+extern LONG CALLBACK CallTo32_9( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
+extern LONG CALLBACK CallTo32_10( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
+extern LONG CALLBACK CallTo32_11( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
+extern LONG CALLBACK CallTo32_12( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
+extern LONG CALLBACK CallTo32_13( FARPROC32, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD );
 
 #else  /* WINELIB */
 
@@ -101,8 +95,6 @@
     (*func)( nExitType )
 #define CallWordBreakProc16( func, lpch, ichCurrent, cch, code ) \
     (*func)( lpch, ichCurrent, cch, code )
-#define CallWordBreakProc32A( func, lpch, ichCurrent, cch, code ) \
-    (*func)( lpch, ichCurrent, cch, code )
 
 #endif  /* WINELIB */
 
diff --git a/include/class.h b/include/class.h
index faa94c7..cf110aa 100644
--- a/include/class.h
+++ b/include/class.h
@@ -38,6 +38,6 @@
 extern void CLASS_DumpClass( CLASS *class );
 extern void CLASS_WalkClasses(void);
 extern void CLASS_FreeModuleClasses( HMODULE16 hModule );
-extern CLASS *CLASS_FindClassByAtom( ATOM atom, HINSTANCE16 hinstance );
+extern CLASS *CLASS_FindClassByAtom( ATOM atom, HINSTANCE32 hinstance );
 
 #endif  /* __WINE_CLASS_H */
diff --git a/include/commctrl.h b/include/commctrl.h
index 7e6d09d..80a3898 100644
--- a/include/commctrl.h
+++ b/include/commctrl.h
@@ -41,25 +41,18 @@
 #define CCS_BOTTOM            0x0003
 #define SBARS_SIZEGRIP        0x0100
 
-/* UpDown control */
+/* UpDown */
 
-#define UPDOWN_CLASS32A  "msctls_updown32"
-#define UPDOWN_CLASS32W  "msctls_updown32"
-#define UPDOWN_CLASS16   "msctls_updown"
-#define UPDOWN_CLASS WINELIB_NAME_AW(UPDOWN_CLASS)
+#define UPDOWN_CLASS32A       "msctls_updown32"
+#define UPDOWN_CLASS32W      L"msctls_updown32"
+#define UPDOWN_CLASS16        "msctls_updown"
+#define UPDOWN_CLASS          WINELIB_NAME_AW(UPDOWN_CLASS)
 
 typedef struct tagUDACCEL
 {
   UINT32 nSec;
   UINT32 nInc;
 } UDACCEL;
- 
-typedef struct tagNM_UPDOWN
-{
-    NMHDR hdr;
-    int iPos;
-    int iDelta;
-} NM_UPDOWN;
 
 #define UD_MAXVAL          0x7fff
 #define UD_MINVAL          0x8001
@@ -74,7 +67,7 @@
 #define UDS_NOTHOUSANDS    0x0080
 
 #define UDN_FIRST          (0U-721)
-#define UDN_DELTAPOS       (UDN_FIRST - 1)
+#define UDN_DELTAPOS       (UDN_FIRST-1)
 
 #define UDM_SETRANGE       (WM_USER+101)
 #define UDM_GETRANGE       (WM_USER+102)
@@ -87,13 +80,28 @@
 #define UDM_SETBASE        (WM_USER+109)
 #define UDM_GETBASE        (WM_USER+110)
 
+/* Progress Bar */
+
+#define PROGRESS_CLASS32A   "msctls_progress32"
+#define PROGRESS_CLASS32W  L"msctls_progress32"
+#define PROGRESS_CLASS16    "msctls_progress"
+
+#define PROGRESS_CLASS      WINELIB_NAME_AW(PROGRESS_CLASS)
+
+#define PBM_SETRANGE        (WM_USER+1)
+#define PBM_SETPOS          (WM_USER+2)
+#define PBM_DELTAPOS        (WM_USER+3)
+#define PBM_SETSTEP         (WM_USER+4)
+#define PBM_STEPIT          (WM_USER+5)
+ 
 /* Functions prototypes */
 
 HWND32     WINAPI CreateStatusWindow32A(INT32,LPCSTR,HWND32,UINT32);
 HWND32     WINAPI CreateStatusWindow32W(INT32,LPCWSTR,HWND32,UINT32);
 #define    CreateStatusWindow WINELIB_NAME_AW(CreateStatusWindow)
-HWND32     WINAPI CreateUpDownControl(DWORD,INT32,INT32,INT32,INT32,HWND32,
-                                   INT32,HINSTANCE32,HWND32,INT32,INT32,INT32);
+HWND32     WINAPI CreateUpDownControl(DWORD,INT32,INT32,INT32,INT32,
+                                      HWND32,INT32,HINSTANCE32,HWND32,
+                                      INT32,INT32,INT32);
 VOID       WINAPI DrawStatusText32A(HDC32,LPRECT32,LPCSTR,UINT32);
 VOID       WINAPI DrawStatusText32W(HDC32,LPRECT32,LPCWSTR,UINT32);
 #define    DrawStatusText WINELIB_NAME_AW(DrawStatusText)
diff --git a/include/compobj.h b/include/compobj.h
index fb0d7ad..09fa2fc 100644
--- a/include/compobj.h
+++ b/include/compobj.h
@@ -1,14 +1,16 @@
 #if !defined(COMPOBJ_H)
 #define COMPOBJ_H
 
-struct tagCLSID {
-  DWORD	Data1;
-  WORD	Data2;
-  WORD  Data3;
-  BYTE	Data4[8];
+struct tagGUID
+{
+    DWORD Data1;
+    WORD  Data2;
+    WORD  Data3;
+    BYTE  Data4[8];
 };
 
-typedef struct tagCLSID CLSID;
+typedef struct tagGUID	GUID;
+typedef struct tagGUID	CLSID;
 
 OLESTATUS WINAPI StringFromCLSID(const CLSID *id, LPSTR);
 OLESTATUS WINAPI CLSIDFromString(const LPCSTR, CLSID *);
diff --git a/include/debug.h b/include/debug.h
index 9cc2e9a..fc4dae8 100644
--- a/include/debug.h
+++ b/include/debug.h
@@ -63,6 +63,7 @@
 #undef DEBUG_OLE
 #undef DEBUG_PALETTE
 #undef DEBUG_PROFILE
+#undef DEBUG_PROGRESS
 #undef DEBUG_PROP
 #undef DEBUG_REG
 #undef DEBUG_REGION
@@ -148,6 +149,7 @@
 #define DEBUG_OLE
 #define DEBUG_PALETTE
 #define DEBUG_PROFILE
+#define DEBUG_PROGRESS
 #define DEBUG_PROP
 #define DEBUG_REG
 #define DEBUG_REGION
@@ -463,6 +465,11 @@
 #else
     0,
 #endif
+#ifdef DEBUG_PROGRESS
+    1,
+#else
+    0,
+#endif
 #ifdef DEBUG_PROP
     1,
 #else
@@ -1337,8 +1344,21 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_prop if(!debug_msg_enabled[57]) ; else fprintf
-#define debugging_prop debug_msg_enabled[57]
+#define dprintf_progress if(!debug_msg_enabled[57]) ; else fprintf
+#define debugging_progress debug_msg_enabled[57]
+#else
+#ifdef DEBUG_PROGRESS
+#define dprintf_progress fprintf
+#define debugging_progress 1
+#else
+#define dprintf_progress while(0) fprintf
+#define debugging_progress 0
+#endif
+#endif
+
+#ifdef DEBUG_RUNTIME
+#define dprintf_prop if(!debug_msg_enabled[58]) ; else fprintf
+#define debugging_prop debug_msg_enabled[58]
 #else
 #ifdef DEBUG_PROP
 #define dprintf_prop fprintf
@@ -1350,8 +1370,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_reg if(!debug_msg_enabled[58]) ; else fprintf
-#define debugging_reg debug_msg_enabled[58]
+#define dprintf_reg if(!debug_msg_enabled[59]) ; else fprintf
+#define debugging_reg debug_msg_enabled[59]
 #else
 #ifdef DEBUG_REG
 #define dprintf_reg fprintf
@@ -1363,8 +1383,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_region if(!debug_msg_enabled[59]) ; else fprintf
-#define debugging_region debug_msg_enabled[59]
+#define dprintf_region if(!debug_msg_enabled[60]) ; else fprintf
+#define debugging_region debug_msg_enabled[60]
 #else
 #ifdef DEBUG_REGION
 #define dprintf_region fprintf
@@ -1376,8 +1396,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_relay if(!debug_msg_enabled[60]) ; else fprintf
-#define debugging_relay debug_msg_enabled[60]
+#define dprintf_relay if(!debug_msg_enabled[61]) ; else fprintf
+#define debugging_relay debug_msg_enabled[61]
 #else
 #ifdef DEBUG_RELAY
 #define dprintf_relay fprintf
@@ -1389,8 +1409,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_resource if(!debug_msg_enabled[61]) ; else fprintf
-#define debugging_resource debug_msg_enabled[61]
+#define dprintf_resource if(!debug_msg_enabled[62]) ; else fprintf
+#define debugging_resource debug_msg_enabled[62]
 #else
 #ifdef DEBUG_RESOURCE
 #define dprintf_resource fprintf
@@ -1402,8 +1422,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_scroll if(!debug_msg_enabled[62]) ; else fprintf
-#define debugging_scroll debug_msg_enabled[62]
+#define dprintf_scroll if(!debug_msg_enabled[63]) ; else fprintf
+#define debugging_scroll debug_msg_enabled[63]
 #else
 #ifdef DEBUG_SCROLL
 #define dprintf_scroll fprintf
@@ -1415,8 +1435,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_selector if(!debug_msg_enabled[63]) ; else fprintf
-#define debugging_selector debug_msg_enabled[63]
+#define dprintf_selector if(!debug_msg_enabled[64]) ; else fprintf
+#define debugging_selector debug_msg_enabled[64]
 #else
 #ifdef DEBUG_SELECTOR
 #define dprintf_selector fprintf
@@ -1428,8 +1448,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_sem if(!debug_msg_enabled[64]) ; else fprintf
-#define debugging_sem debug_msg_enabled[64]
+#define dprintf_sem if(!debug_msg_enabled[65]) ; else fprintf
+#define debugging_sem debug_msg_enabled[65]
 #else
 #ifdef DEBUG_SEM
 #define dprintf_sem fprintf
@@ -1441,8 +1461,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_sendmsg if(!debug_msg_enabled[65]) ; else fprintf
-#define debugging_sendmsg debug_msg_enabled[65]
+#define dprintf_sendmsg if(!debug_msg_enabled[66]) ; else fprintf
+#define debugging_sendmsg debug_msg_enabled[66]
 #else
 #ifdef DEBUG_SENDMSG
 #define dprintf_sendmsg fprintf
@@ -1454,8 +1474,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_shm if(!debug_msg_enabled[66]) ; else fprintf
-#define debugging_shm debug_msg_enabled[66]
+#define dprintf_shm if(!debug_msg_enabled[67]) ; else fprintf
+#define debugging_shm debug_msg_enabled[67]
 #else
 #ifdef DEBUG_SHM
 #define dprintf_shm fprintf
@@ -1467,8 +1487,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_stress if(!debug_msg_enabled[67]) ; else fprintf
-#define debugging_stress debug_msg_enabled[67]
+#define dprintf_stress if(!debug_msg_enabled[68]) ; else fprintf
+#define debugging_stress debug_msg_enabled[68]
 #else
 #ifdef DEBUG_STRESS
 #define dprintf_stress fprintf
@@ -1480,8 +1500,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_string if(!debug_msg_enabled[68]) ; else fprintf
-#define debugging_string debug_msg_enabled[68]
+#define dprintf_string if(!debug_msg_enabled[69]) ; else fprintf
+#define debugging_string debug_msg_enabled[69]
 #else
 #ifdef DEBUG_STRING
 #define dprintf_string fprintf
@@ -1493,8 +1513,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_task if(!debug_msg_enabled[69]) ; else fprintf
-#define debugging_task debug_msg_enabled[69]
+#define dprintf_task if(!debug_msg_enabled[70]) ; else fprintf
+#define debugging_task debug_msg_enabled[70]
 #else
 #ifdef DEBUG_TASK
 #define dprintf_task fprintf
@@ -1506,8 +1526,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_text if(!debug_msg_enabled[70]) ; else fprintf
-#define debugging_text debug_msg_enabled[70]
+#define dprintf_text if(!debug_msg_enabled[71]) ; else fprintf
+#define debugging_text debug_msg_enabled[71]
 #else
 #ifdef DEBUG_TEXT
 #define dprintf_text fprintf
@@ -1519,8 +1539,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_timer if(!debug_msg_enabled[71]) ; else fprintf
-#define debugging_timer debug_msg_enabled[71]
+#define dprintf_timer if(!debug_msg_enabled[72]) ; else fprintf
+#define debugging_timer debug_msg_enabled[72]
 #else
 #ifdef DEBUG_TIMER
 #define dprintf_timer fprintf
@@ -1532,8 +1552,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_toolhelp if(!debug_msg_enabled[72]) ; else fprintf
-#define debugging_toolhelp debug_msg_enabled[72]
+#define dprintf_toolhelp if(!debug_msg_enabled[73]) ; else fprintf
+#define debugging_toolhelp debug_msg_enabled[73]
 #else
 #ifdef DEBUG_TOOLHELP
 #define dprintf_toolhelp fprintf
@@ -1545,8 +1565,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_tweak if(!debug_msg_enabled[73]) ; else fprintf
-#define debugging_tweak debug_msg_enabled[73]
+#define dprintf_tweak if(!debug_msg_enabled[74]) ; else fprintf
+#define debugging_tweak debug_msg_enabled[74]
 #else
 #ifdef DEBUG_TWEAK
 #define dprintf_tweak fprintf
@@ -1558,8 +1578,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_updown if(!debug_msg_enabled[74]) ; else fprintf
-#define debugging_updown debug_msg_enabled[74]
+#define dprintf_updown if(!debug_msg_enabled[75]) ; else fprintf
+#define debugging_updown debug_msg_enabled[75]
 #else
 #ifdef DEBUG_UPDOWN
 #define dprintf_updown fprintf
@@ -1571,8 +1591,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_ver if(!debug_msg_enabled[75]) ; else fprintf
-#define debugging_ver debug_msg_enabled[75]
+#define dprintf_ver if(!debug_msg_enabled[76]) ; else fprintf
+#define debugging_ver debug_msg_enabled[76]
 #else
 #ifdef DEBUG_VER
 #define dprintf_ver fprintf
@@ -1584,8 +1604,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_virtual if(!debug_msg_enabled[76]) ; else fprintf
-#define debugging_virtual debug_msg_enabled[76]
+#define dprintf_virtual if(!debug_msg_enabled[77]) ; else fprintf
+#define debugging_virtual debug_msg_enabled[77]
 #else
 #ifdef DEBUG_VIRTUAL
 #define dprintf_virtual fprintf
@@ -1597,8 +1617,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_vxd if(!debug_msg_enabled[77]) ; else fprintf
-#define debugging_vxd debug_msg_enabled[77]
+#define dprintf_vxd if(!debug_msg_enabled[78]) ; else fprintf
+#define debugging_vxd debug_msg_enabled[78]
 #else
 #ifdef DEBUG_VXD
 #define dprintf_vxd fprintf
@@ -1610,8 +1630,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_win if(!debug_msg_enabled[78]) ; else fprintf
-#define debugging_win debug_msg_enabled[78]
+#define dprintf_win if(!debug_msg_enabled[79]) ; else fprintf
+#define debugging_win debug_msg_enabled[79]
 #else
 #ifdef DEBUG_WIN
 #define dprintf_win fprintf
@@ -1623,8 +1643,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_win16drv if(!debug_msg_enabled[79]) ; else fprintf
-#define debugging_win16drv debug_msg_enabled[79]
+#define dprintf_win16drv if(!debug_msg_enabled[80]) ; else fprintf
+#define debugging_win16drv debug_msg_enabled[80]
 #else
 #ifdef DEBUG_WIN16DRV
 #define dprintf_win16drv fprintf
@@ -1636,8 +1656,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_win32 if(!debug_msg_enabled[80]) ; else fprintf
-#define debugging_win32 debug_msg_enabled[80]
+#define dprintf_win32 if(!debug_msg_enabled[81]) ; else fprintf
+#define debugging_win32 debug_msg_enabled[81]
 #else
 #ifdef DEBUG_WIN32
 #define dprintf_win32 fprintf
@@ -1649,8 +1669,8 @@
 #endif
 
 #ifdef DEBUG_RUNTIME
-#define dprintf_winsock if(!debug_msg_enabled[81]) ; else fprintf
-#define debugging_winsock debug_msg_enabled[81]
+#define dprintf_winsock if(!debug_msg_enabled[82]) ; else fprintf
+#define debugging_winsock debug_msg_enabled[82]
 #else
 #ifdef DEBUG_WINSOCK
 #define dprintf_winsock fprintf
@@ -1722,6 +1742,7 @@
     "ole",
     "palette",
     "profile",
+    "progress",
     "prop",
     "reg",
     "region",
diff --git a/include/debugger.h b/include/debugger.h
index bf9ee7a..9117373 100644
--- a/include/debugger.h
+++ b/include/debugger.h
@@ -265,7 +265,7 @@
 extern int DEBUG_ReadExecutableDbgInfo(void);
 
   /* debugger/msc.c */
-extern int DEBUG_RegisterDebugInfo(int, struct pe_data *pe,
+extern int DEBUG_RegisterDebugInfo(struct pe_data *pe,
 				   int, unsigned long, unsigned long);
 extern int DEBUG_ProcessDeferredDebug(void);
 extern int DEBUG_RegisterELFDebugInfo(int load_addr, u_long size, char * name);
diff --git a/include/handle32.h b/include/handle32.h
index 9fa3021..9e5fca0 100644
--- a/include/handle32.h
+++ b/include/handle32.h
@@ -40,8 +40,27 @@
     DWORD         refcount;
 } K32OBJ;
 
+/* Kernel object list entry */
+typedef struct _K32OBJ_ENTRY
+{
+    K32OBJ               *obj;
+    struct _K32OBJ_ENTRY *next;
+    struct _K32OBJ_ENTRY *prev;
+} K32OBJ_ENTRY;
+
+/* Kernel object list */
+typedef struct
+{
+    K32OBJ_ENTRY *head;
+    K32OBJ_ENTRY *tail;
+} K32OBJ_LIST;
+
 extern void K32OBJ_IncCount( K32OBJ *ptr );
 extern void K32OBJ_DecCount( K32OBJ *ptr );
+extern void K32OBJ_AddHead( K32OBJ_LIST *list, K32OBJ *ptr );
+extern void K32OBJ_AddTail( K32OBJ_LIST *list, K32OBJ *ptr );
+extern void K32OBJ_Remove( K32OBJ_LIST *list, K32OBJ *ptr );
+extern K32OBJ *K32OBJ_RemoveHead( K32OBJ_LIST *list );
 extern BOOL32 K32OBJ_AddName( K32OBJ *obj, LPCSTR name );
 extern K32OBJ *K32OBJ_FindName( LPCSTR name );
 extern K32OBJ *K32OBJ_FindNameType( LPCSTR name, K32OBJ_TYPE type );
diff --git a/include/module.h b/include/module.h
index 563a2d8..1416362 100644
--- a/include/module.h
+++ b/include/module.h
@@ -111,22 +111,25 @@
                     ((NE_WIN32_EXTRAINFO *)((pModule) + 1))->pe_module : 0))
 
 /* module.c */
-extern NE_MODULE *MODULE_GetPtr( HMODULE16 hModule );
-extern void MODULE_DumpModule( HMODULE16 hmodule );
+extern NE_MODULE *MODULE_GetPtr( HMODULE32 hModule );
+extern HMODULE16 MODULE_HANDLEtoHMODULE16( HANDLE32 handle );
+extern HMODULE32 MODULE_HANDLEtoHMODULE32( HANDLE32 handle );
+extern void MODULE_DumpModule( HMODULE32 hmodule );
 extern void MODULE_WalkModules(void);
-extern int MODULE_OpenFile( HMODULE16 hModule );
-extern LPSTR MODULE_GetModuleName( HMODULE16 hModule );
+extern int MODULE_OpenFile( HMODULE32 hModule );
+extern LPSTR MODULE_GetModuleName( HMODULE32 hModule );
 extern void MODULE_RegisterModule( NE_MODULE *pModule );
-extern HMODULE16 MODULE_FindModule( LPCSTR path );
-extern HINSTANCE16 MODULE_GetInstance( HMODULE16 hModule );
-extern HMODULE16 MODULE_CreateDummyModule( const OFSTRUCT *ofs );
-extern HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, BOOL32 first );
-extern WORD MODULE_GetOrdinal( HMODULE16 hModule, const char *name );
-extern FARPROC16 MODULE_GetEntryPoint( HMODULE16 hModule, WORD ordinal );
-extern BOOL16 MODULE_SetEntryPoint( HMODULE16 hModule, WORD ordinal,
+extern HMODULE32 MODULE_FindModule( LPCSTR path );
+extern HINSTANCE16 MODULE_CreateInstance( HMODULE16 hModule, LOADPARAMS* paramBlock );
+extern HINSTANCE16 MODULE_GetInstance( HMODULE32 hModule );
+extern HMODULE32 MODULE_CreateDummyModule( const OFSTRUCT *ofs );
+extern HINSTANCE16 MODULE_Load( LPCSTR name, LPVOID paramBlock, UINT16 flags );
+extern WORD MODULE_GetOrdinal( HMODULE32 hModule, const char *name );
+extern FARPROC16 MODULE_GetEntryPoint( HMODULE32 hModule, WORD ordinal );
+extern BOOL16 MODULE_SetEntryPoint( HMODULE32 hModule, WORD ordinal,
                                     WORD offset );
 extern FARPROC16 MODULE_GetWndProcEntry16( const char *name );
-extern FARPROC16 WIN32_GetProcAddress16( HMODULE16 hmodule, LPSTR name );
+extern FARPROC16 WIN32_GetProcAddress16( HMODULE32 hmodule, LPSTR name );
 
 /* builtin.c */
 extern BOOL16 BUILTIN_Init(void);
diff --git a/include/neexe.h b/include/neexe.h
index ead7623..5378fd9 100644
--- a/include/neexe.h
+++ b/include/neexe.h
@@ -88,6 +88,10 @@
 #define NE_FFLAGS_MULTIPLEDATA	0x0002
 #define NE_FFLAGS_WIN32         0x0010
 #define NE_FFLAGS_BUILTIN       0x0020  /* Wine built-in module */
+#define NE_FFLAGS_IMPLICIT	0x0040
+#define NE_FFLAGS_FRAMEBUF	0x0100  /* OS/2 fullscreen app */
+#define NE_FFLAGS_CONSOLE	0x0200  /* OS/2 console app */
+#define NE_FFLAGS_GUI		0x0300	/* right, (NE_FFLAGS_FRAMEBUF | NE_FFLAGS_CONSOLE) */
 #define NE_FFLAGS_SELFLOAD	0x0800
 #define NE_FFLAGS_LINKERROR	0x2000
 #define NE_FFLAGS_CALLWEP       0x4000
@@ -225,7 +229,7 @@
 {
     unsigned short type_id;	/* Type identifier */
     unsigned short count;	/* Number of resources of this type */
-    unsigned long  reserved;
+    DWORD	   resloader;	/* SetResourceHandler() */
     /*
      * Name info array.
      */
@@ -244,7 +248,4 @@
 #define NE_RSCTYPE_RCDATA		0x800a
 #define NE_RSCTYPE_STRING		0x8006
 
-int  load_typeinfo  (int, struct resource_typeinfo_s *);
-int  load_nameinfo  (int, struct resource_nameinfo_s *);
-
 #endif  /* __WINE_NEEXE_H */
diff --git a/include/pe_image.h b/include/pe_image.h
index 433bcdc..482c0f3 100644
--- a/include/pe_image.h
+++ b/include/pe_image.h
@@ -6,20 +6,34 @@
 #include "winnt.h"
 #include "peexe.h"
 
+/* This struct is used for loaded PE .dlls */
 struct pe_data {
-	LPIMAGE_NT_HEADERS			pe_header;
-	LPIMAGE_SECTION_HEADER			pe_seg;
-	LPIMAGE_IMPORT_DESCRIPTOR		pe_import;
-	LPIMAGE_EXPORT_DIRECTORY		pe_export;
-	LPIMAGE_RESOURCE_DIRECTORY		pe_resource;
-	LPIMAGE_BASE_RELOCATION			pe_reloc;
-	int base_addr;
-	int load_addr;
-	int vma_size;
+	LPIMAGE_NT_HEADERS	pe_header;
+	LPIMAGE_SECTION_HEADER	pe_seg;
+	HMODULE32		mappeddll;
 };
 
 typedef struct pe_data PE_MODULE;
 
+/* modreference used for attached processes
+ * all section are calculated here, relocations etc.
+ */
+struct pe_modref {
+	struct pe_modref		*next;
+	PE_MODULE			*pe_module;
+	unsigned long int		load_addr;
+	LPIMAGE_IMPORT_DESCRIPTOR	pe_import;
+	LPIMAGE_EXPORT_DIRECTORY	pe_export;
+	LPIMAGE_RESOURCE_DIRECTORY	pe_resource;
+	LPIMAGE_BASE_RELOCATION		pe_reloc;
+	int				flags;
+#define PE_MODREF_PROCESS_ATTACHED	0x00000001
+#define PE_MODREF_NO_DLL_CALLS		0x00000002
+#define PE_MODREF_RELOCS_DONE		0x00000004
+};
+
+typedef struct pe_modref PE_MODREF;
+
 extern int PE_unloadImage(HMODULE32 hModule);
 extern FARPROC32 PE_FindExportedFunction(struct pe_data *pe, LPCSTR funcName);
 extern void my_wcstombs(char * result, u_short * source, int len);
@@ -31,7 +45,10 @@
 extern BOOL32 PE_EnumResourceLanguages32W(HMODULE32,LPCWSTR,LPCWSTR,ENUMRESLANGPROC32W,LONG);
 extern HRSRC32 PE_FindResourceEx32W(HINSTANCE32,LPCWSTR,LPCWSTR,WORD);
 extern DWORD PE_SizeofResource32(HINSTANCE32,HRSRC32);
+extern HMODULE32 PE_LoadLibraryEx32A(LPCSTR,HFILE32,DWORD);
 extern HGLOBAL32 PE_LoadResource32(HINSTANCE32,HRSRC32);
-extern void PE_InitializeDLLs(HMODULE16,DWORD,LPVOID);
+
+struct _PDB32; /* forward definition */
+extern void PE_InitializeDLLs(struct _PDB32*,DWORD,LPVOID);
 
 #endif /* __WINE_PE_IMAGE_H */
diff --git a/include/peexe.h b/include/peexe.h
index bc13148..49d7cf9 100644
--- a/include/peexe.h
+++ b/include/peexe.h
@@ -323,7 +323,7 @@
 	DWORD	OffsetToData;
 	DWORD	Size;
 	DWORD	CodePage;
-	DWORD	Reserved;
+	DWORD	ResourceHandle;
 } IMAGE_RESOURCE_DATA_ENTRY,*LPIMAGE_RESOURCE_DATA_ENTRY;
 
 typedef struct _IMAGE_BASE_RELOCATION
diff --git a/include/process.h b/include/process.h
index dc6b421..3cbd14c 100644
--- a/include/process.h
+++ b/include/process.h
@@ -11,6 +11,7 @@
 #include "winbase.h"
 #include "winnt.h"
 #include "handle32.h"
+#include "pe_image.h"
 #include "task.h"
 
 /* Process handle entry */
@@ -71,7 +72,7 @@
     ENVDB           *env_db;           /* 40 Environment database */
     HANDLE_TABLE    *handle_table;     /* 44 Handle table */
     struct _PDB32   *parent;           /* 48 Parent process */
-    void            *modref_list;      /* 4c MODREF list */
+    PE_MODREF       *modref_list;      /* 4c MODREF list */
     void            *thread_list;      /* 50 List of threads */
     void            *debuggee_CB;      /* 54 Debuggee context block */
     void            *local_heap_free;  /* 58 Head of local heap free list */
@@ -82,7 +83,7 @@
     DWORD            tls_bits[2];      /* 88 TLS in-use bits */
     DWORD            process_dword;    /* 90 Unknown */
     struct _PDB32   *group;            /* 94 Process group */
-    void            *exe_modref;       /* 98 MODREF for the process EXE */
+    PE_MODREF       *exe_modref;       /* 98 MODREF for the process EXE */
     LPTOP_LEVEL_EXCEPTION_FILTER top_filter; /* 9c Top exception filter */
     DWORD            priority;         /* a0 Priority level */
     HANDLE32         heap_list;        /* a4 Head of process heap list */
@@ -101,7 +102,7 @@
 extern K32OBJ *PROCESS_GetObjPtr( HANDLE32 handle, K32OBJ_TYPE type );
 extern BOOL32 PROCESS_SetObjPtr( HANDLE32 handle, K32OBJ *ptr, DWORD flags );
 
-extern PDB32 *PROCESS_Create( TDB *pTask );
+extern PDB32 *PROCESS_Create( TDB *pTask, LPCSTR cmd_line );
 extern void PROCESS_Destroy( K32OBJ *ptr );
 
 extern PDB32 *pCurrentProcess;
diff --git a/include/progress.h b/include/progress.h
new file mode 100644
index 0000000..0aadb15
--- /dev/null
+++ b/include/progress.h
@@ -0,0 +1,23 @@
+/*
+ * Progress class extra info
+ *
+ * Copyright 1997 Dimitrie O. Paun
+ */
+
+#ifndef __WINE_PROGRESS_H
+#define __WINE_PROGRESS_H
+
+#include "windows.h"
+#include "commctrl.h"
+
+typedef struct
+{
+  INT32       CurVal;       /* Current progress value */
+  INT32       MinVal;       /* Minimum progress value */
+  INT32       MaxVal;       /* Maximum progress value */
+  INT32       Step;         /* Step to use on PMB_STEPIT */
+} PROGRESS_INFO;
+
+LRESULT WINAPI ProgressWindowProc(HWND32, UINT32, WPARAM32, LPARAM);
+
+#endif  /* __WINE_PROGRESS_H */
diff --git a/include/resource.h b/include/resource.h
index 02a6dd4..50bd60a 100644
--- a/include/resource.h
+++ b/include/resource.h
@@ -44,14 +44,21 @@
 #define WINE_CONSTRUCTOR
 #endif
 
+typedef HGLOBAL16 (CALLBACK *RESOURCEHANDLER16)(HGLOBAL16, HMODULE16, HRSRC16 );
+
+/* FIXME: convert all NE_ functions to accept NE_MODULE pointer instead
+ * of redundant hModule (which is always verified prior to calling these).
+ */
+
 extern int NE_AccessResource( HMODULE16 hModule, HRSRC16 hRsrc );
 extern BOOL32 NE_FreeResource( HMODULE16 hModule, HGLOBAL16 handle );
 extern HRSRC16 NE_FindResource(HMODULE16 hModule, SEGPTR typeId, SEGPTR resId);
 extern DWORD NE_SizeofResource( HMODULE16 hModule, HRSRC16 hRsrc );
 extern SEGPTR NE_LockResource( HMODULE16 hModule, HGLOBAL16 handle );
-extern HGLOBAL16 NE_AllocResource( HMODULE16 hModule, HRSRC16 hRsrc,
-                                   DWORD size );
+extern HGLOBAL16 NE_AllocResource( HMODULE16 hModule, HRSRC16 hRsrc, DWORD size );
 extern HGLOBAL16 NE_LoadResource( HMODULE16 hModule,  HRSRC16 hRsrc );
+extern BOOL32 NE_InitResourceHandler( HMODULE16 hModule );
+extern FARPROC32 NE_SetResourceHandler( HMODULE16 hModule, SEGPTR typeId, FARPROC32 handler);
 
 extern HGLOBAL16 SYSRES_LoadResource( SYSTEM_RESOURCE id );
 extern void SYSRES_FreeResource( HGLOBAL16 handle );
diff --git a/include/spy.h b/include/spy.h
index a221ab8..bb6f776 100644
--- a/include/spy.h
+++ b/include/spy.h
@@ -18,6 +18,9 @@
 #define SPY_RESULT_OK32           0x0001
 #define SPY_RESULT_INVALIDHWND16  0x0002
 #define SPY_RESULT_INVALIDHWND32  0x0003
+#define SPY_RESULT_DEFWND16       0x0004
+#define SPY_RESULT_DEFWND32       0x0005
+
 
 extern const char *SPY_GetMsgName( UINT32 msg );
 extern void SPY_EnterMessage( INT32 iFlag, HWND32 hwnd, UINT32 msg,
diff --git a/include/stackframe.h b/include/stackframe.h
index 1e3711e..09cdb85 100644
--- a/include/stackframe.h
+++ b/include/stackframe.h
@@ -37,9 +37,10 @@
     DWORD   edx;
     DWORD   ecx;
     DWORD   ebx;
+    DWORD   restore_addr;   /* return address for restoring code selector */
+    DWORD   codeselector;   /* code selector to restore */
     DWORD   ebp;            /* saved 32-bit frame pointer */
-    DWORD   retaddr;        /* return address */
-    DWORD   codeselector;   /* code selector for return address */
+    DWORD   retaddr;        /* actual return address */
     DWORD   args[1];        /* arguments to 16-bit function */
 } STACK32FRAME;
 
diff --git a/include/stddebug.h b/include/stddebug.h
index 819ae53..c5ac25b 100644
--- a/include/stddebug.h
+++ b/include/stddebug.h
@@ -133,6 +133,7 @@
 #undef DEBUG_OLE
 #undef DEBUG_PALETTE
 #undef DEBUG_PROFILE
+#undef DEBUG_PROGRESS
 #undef DEBUG_PROP
 #undef DEBUG_REG
 #undef DEBUG_REGION
@@ -218,6 +219,7 @@
 #define DEBUG_OLE
 #define DEBUG_PALETTE
 #define DEBUG_PROFILE
+#define DEBUG_PROGRESS
 #define DEBUG_PROP
 #define DEBUG_REG
 #define DEBUG_REGION
diff --git a/include/struct32.h b/include/struct32.h
index 81a60e1..70875bf 100644
--- a/include/struct32.h
+++ b/include/struct32.h
@@ -23,45 +23,4 @@
                                       MDICREATESTRUCT16*);
 void STRUCT32_MDICREATESTRUCT16to32A( const MDICREATESTRUCT16*,
                                       MDICREATESTRUCT32A*);
-
-#pragma pack(1)
-
-typedef struct {
-	BYTE   bWidth;
-	BYTE   bHeight;
-	BYTE   bColorCount;
-	BYTE   bReserved;
-	WORD   wPlanes;
-	WORD   wBitCount;
-	DWORD  dwBytesInRes;
-	WORD   wResId WINE_PACKED;
-	/*WORD   padding;	Spec is wrong, no padding here*/
-} ICONDIRENTRY32;
-
-typedef struct {
-	WORD   wWidth;
-	WORD   wHeight;
-	WORD   wPlanes;
-	WORD   wBitCount;
-	DWORD  dwBytesInRes;
-	WORD   wResId WINE_PACKED;
-	/*WORD   padding;*/
-} CURSORDIRENTRY32;
-
-typedef union{
-	ICONDIRENTRY32	icon;
-	CURSORDIRENTRY32	cursor;
-} CURSORICONDIRENTRY32;
-
-typedef struct {
-	WORD    idReserved;
-	WORD    idType;
-	WORD    idCount;
-	/*WORD	padding;*/
-	CURSORICONDIRENTRY32	idEntries[1];
-} CURSORICONDIR32;
-
-
-#pragma pack(4)
-
 #endif  /* __WINE_STRUCT32_H */
diff --git a/include/syscolor.h b/include/syscolor.h
index f8bd654..a212336 100644
--- a/include/syscolor.h
+++ b/include/syscolor.h
@@ -32,6 +32,10 @@
                                      /* COLOR_BTNTEXT             */
                                      /* COLOR_INACTIVECAPTIONTEXT */
     HBRUSH32 hbrushBtnHighlight;     /* COLOR_BTNHIGHLIGHT        */
+                                     /* COLOR_3DDKSHADOW          */
+                                     /* COLOR_3DLIGHT             */
+                                     /* COLOR_INFOTEXT            */
+                                     /* COLOR_INFOBK              */
 };
 
 extern void SYSCOLOR_Init(void);
diff --git a/include/task.h b/include/task.h
index 5712979..1fe0a2c 100644
--- a/include/task.h
+++ b/include/task.h
@@ -51,11 +51,15 @@
 struct _THDB;
 struct _WSINFO;
 
+  /* signal proc typedef */
+typedef void (CALLBACK *USERSIGNALPROC)(HANDLE16, UINT16, UINT16,
+                                        HINSTANCE16, HQUEUE16);
+
   /* Task database. See 'Windows Internals' p. 226.
    * Note that 16-bit OLE 2 libs like to read it directly 
    * so we have to keep entry offsets as they are. 
    */
-typedef struct
+typedef struct _TDB
 {
     HTASK16   hNext;                      /* 00 Selector of next TDB */
     DWORD     ss_sp WINE_PACKED;          /* 02 Stack pointer of task */
@@ -75,7 +79,7 @@
     HTASK16   hParent;                    /* 22 Selector of TDB of parent */
     WORD      signal_flags;               /* 24 Flags for signal handler */
     FARPROC16 sighandler WINE_PACKED;     /* 26 Signal handler */
-    FARPROC16 userhandler WINE_PACKED;    /* 2a USER signal handler */
+    USERSIGNALPROC userhandler WINE_PACKED; /* 2a USER signal handler */
     FARPROC16 discardhandler WINE_PACKED; /* 2e Handler for GlobalNotify() */
     DWORD     int0 WINE_PACKED;           /* 32 int 0 (divide by 0) handler */
     DWORD     int2 WINE_PACKED;           /* 36 int 2 (NMI) handler */
@@ -112,6 +116,12 @@
 #define TDBF_OS2APP     0x0008
 #define TDBF_WIN32      0x0010
 
+  /* USER signals */
+#define USIG_TERMINATION	0x0020
+#define USIG_DLL_LOAD		0x0040
+#define USIG_DLL_UNLOAD		0x0080
+#define USIG_GPF		0x0666
+
 #pragma pack(4)
 
 extern BOOL32 TASK_Init(void);
diff --git a/include/thread.h b/include/thread.h
index ec3fa4a..347019e 100644
--- a/include/thread.h
+++ b/include/thread.h
@@ -79,6 +79,8 @@
 extern THDB *THREAD_Create( PDB32 *pdb, DWORD stack_size,
                             LPTHREAD_START_ROUTINE start_addr );
 extern void THREAD_Destroy( K32OBJ *ptr );
+extern THDB *THREAD_Current(void);
+extern THDB *THREAD_SwitchThread( CONTEXT *context );
 
 extern THDB *pCurrentThread;
 
diff --git a/include/updown.h b/include/updown.h
index 07b132e..bb56e13 100644
--- a/include/updown.h
+++ b/include/updown.h
@@ -22,7 +22,14 @@
   INT32       Flags;        /* Internal Flags FLAG_* */
 } UPDOWN_INFO;
 
-LRESULT WINAPI UpDownWindowProc( HWND32 hwnd, UINT32 message, WPARAM32 wParam,
-                                 LPARAM lParam);
+typedef struct tagNM_UPDOWN
+{
+  NMHDR hdr;
+  int iPos;
+  int iDelta;
+} NM_UPDOWN;
+
+LRESULT WINAPI UpDownWindowProc(HWND32 hwnd, UINT32 message, WPARAM32 wParam,
+                                LPARAM lParam);
 
 #endif  /* __WINE_UPDOWN_H */
diff --git a/include/user.h b/include/user.h
index cfb068b..68e023f 100644
--- a/include/user.h
+++ b/include/user.h
@@ -23,4 +23,6 @@
 #define USER_HEAP_SEG_ADDR(handle)  \
          ((handle) ? PTR_SEG_OFF_TO_SEGPTR(USER_HeapSel, (handle)) : (SEGPTR)0)
 
+void USER_SignalProc(HANDLE16, UINT16, UINT16, HINSTANCE16, HQUEUE16);
+
 #endif  /* __WINE_USER_H */
diff --git a/include/win.h b/include/win.h
index c952000..128a20f 100644
--- a/include/win.h
+++ b/include/win.h
@@ -61,7 +61,7 @@
     HWINDOWPROC    winproc;       /* Window procedure */
     DWORD          dwMagic;       /* Magic number (must be WND_MAGIC) */
     HWND32         hwndSelf;      /* Handle of this window */
-    HINSTANCE16    hInstance;     /* Window hInstance (from CreateWindow) */
+    HINSTANCE32    hInstance;     /* Window hInstance (from CreateWindow) */
     RECT32         rectClient;    /* Client area rel. to parent client area */
     RECT32         rectWindow;    /* Whole window rel. to parent client area */
     LPSTR          text;          /* Window text */
@@ -119,14 +119,12 @@
 extern BOOL32 WIN_UnlinkWindow( HWND32 hwnd );
 extern BOOL32 WIN_LinkWindow( HWND32 hwnd, HWND32 hwndInsertAfter );
 extern HWND32 WIN_FindWinToRepaint( HWND32 hwnd, HQUEUE16 hQueue );
-extern void   WIN_SendParentNotify( HWND32 hwnd, WORD event,
-                                    WORD idChild, LPARAM lValue );
-extern void   WIN_ResetQueueWindows( WND* wnd, HQUEUE16 hQueue, HQUEUE16 hNew );
+extern BOOL32 WIN_ResetQueueWindows( WND* wnd, HQUEUE16 hQueue, HQUEUE16 hNew);
 extern BOOL32 WIN_CreateDesktopWindow(void);
 extern HWND32 WIN_GetTopParent( HWND32 hwnd );
 extern WND*   WIN_GetTopParentPtr( WND* pWnd );
 extern BOOL32 WIN_IsWindowDrawable(WND*, BOOL32 );
-extern HINSTANCE16 WIN_GetWindowInstance( HWND32 hwnd );
+extern HINSTANCE32 WIN_GetWindowInstance( HWND32 hwnd );
 extern WND**  WIN_BuildWinArray( WND *wndPtr, UINT32 bwa, UINT32* pnum );
 
 extern void DEFWND_SetText( WND *wndPtr, LPCSTR text );		      /* windows/defwnd.c */
diff --git a/include/windows.h b/include/windows.h
index 139c33b..e2afd45 100644
--- a/include/windows.h
+++ b/include/windows.h
@@ -5,6 +5,7 @@
 extern "C" {
 #endif
 
+#include <stdarg.h>
 #include "wintypes.h"
 
 #pragma pack(1)
@@ -904,6 +905,16 @@
 #define COLOR_BTNTEXT		   18
 #define COLOR_INACTIVECAPTIONTEXT  19
 #define COLOR_BTNHIGHLIGHT         20
+#define COLOR_3DDKSHADOW           21
+#define COLOR_3DLIGHT              22
+#define COLOR_INFOTEXT             23
+#define COLOR_INFOBK               24
+#define COLOR_DESKTOP              COLOR_BACKGROUND
+#define COLOR_3DFACE               COLOR_BTNFACE
+#define COLOR_3DSHADOW             COLOR_BTNSHADOW
+#define COLOR_3DHIGHLIGHT          COLOR_BTNHIGHLIGHT
+#define COLOR_3DHILIGHT            COLOR_BTNHIGHLIGHT
+#define COLOR_BTNHILIGHT           COLOR_BTNHIGHLIGHT
 
   /* WM_CTLCOLOR values */
 #define CTLCOLOR_MSGBOX             0
@@ -968,6 +979,10 @@
 #define BS_PATTERN	    3
 #define BS_INDEXED	    4
 #define	BS_DIBPATTERN	    5
+#define	BS_DIBPATTERNPT	    6
+#define BS_PATTERN8X8	    7
+#define	BS_DIBPATTERN8X8    8
+#define BS_MONOPATTERN      9
 
   /* Hatch styles */
 #define HS_HORIZONTAL       0
@@ -1875,6 +1890,15 @@
 #define DIB_PAL_COLORS   1
 #define CBM_INIT         4
 
+typedef struct 
+{
+	BITMAP32		dsBm;
+	BITMAPINFOHEADER	dsBmih;
+	DWORD			dsBitfields[3];
+	HANDLE32		dshSection;
+	DWORD			dsOffset;
+} DIBSECTION,*LPDIBSECTION;
+
 
   /* Cursors / Icons */
 
@@ -4618,6 +4642,15 @@
 #define HELP_PARTIALKEY     0x0105
 #define HELP_MULTIKEY       0x0201
 #define HELP_SETWINPOS      0x0203
+#define HELP_CONTEXTMENU    0x000a
+#define HELP_FINDER	    0x000b
+#define HELP_WM_HELP	    0x000c
+#define HELP_SETPOPUP_POS   0x000d
+
+#define HELP_TCARD	    0x8000
+#define HELP_TCARD_DATA	    0x0010
+#define HELP_TCARD_OTHER_CALLER 0x0011
+
 
 /* ExitWindows() flags */
 #define EW_RESTARTWINDOWS   0x0042
@@ -5168,6 +5201,15 @@
     UINT32  code;
 } NMHDR, *LPNMHDR;
 
+typedef struct
+{
+	UINT32	cbSize;
+	INT32	iTabLength;
+	INT32	iLeftMargin;
+	INT32	iRightMargin;
+	UINT32	uiLengthDrawn;
+} DRAWTEXTPARAMS,*LPDRAWTEXTPARAMS;
+
 #pragma pack(4)
 
 /* Declarations for functions that exist only in Win16 */
@@ -5260,9 +5302,13 @@
 BOOL16      WINAPI IsSharedSelector(HANDLE16);
 BOOL16      WINAPI IsTask(HTASK16);
 HTASK16     WINAPI IsTaskLocked(void);
+BOOL16      WINAPI IsUserIdle(void);
 BOOL16      WINAPI IsValidMetaFile(HMETAFILE16);
 VOID        WINAPI LogError(UINT16, LPVOID);
 VOID        WINAPI LogParamError(UINT16,FARPROC16,LPVOID);
+HGLOBAL16   WINAPI LoadCursorIconHandler(HGLOBAL16,HMODULE16,HRSRC16);
+HGLOBAL16   WINAPI LoadDIBCursorHandler(HGLOBAL16,HMODULE16,HRSRC16);
+HGLOBAL16   WINAPI LoadDIBIconHandler(HGLOBAL16,HMODULE16,HRSRC16);
 WORD        WINAPI LocalCountFree(void);
 WORD        WINAPI LocalHandleDelta(WORD);
 WORD        WINAPI LocalHeapSize(void);
@@ -5290,7 +5336,7 @@
 INT16       WINAPI SelectVisRgn(HDC16,HRGN16);
 DWORD       WINAPI SetBitmapDimension(HBITMAP16,INT16,INT16);
 DWORD       WINAPI SetBrushOrg(HDC16,INT16,INT16);
-UINT16*     WINAPI SetCommEventMask(INT16,UINT16);
+SEGPTR      WINAPI SetCommEventMask(INT16,UINT16);
 BOOL16      WINAPI SetDCHook(HDC16,FARPROC16,DWORD);
 DWORD       WINAPI SetDCOrg(HDC16,INT16,INT16);
 VOID        WINAPI SetDCState(HDC16,HDC16);
@@ -5582,7 +5628,11 @@
 LONG        WINAPI GetMessageExtraInfo(void);
 DWORD       WINAPI GetMessagePos(void);
 LONG        WINAPI GetMessageTime(void);
+LANGID      WINAPI GetSystemDefaultLangID(void);
+LCID        WINAPI GetSystemDefaultLCID(void);
 DWORD       WINAPI GetTickCount(void);
+LANGID      WINAPI GetUserDefaultLangID(void);
+LCID        WINAPI GetUserDefaultLCID(void);
 ATOM        WINAPI GlobalDeleteAtom(ATOM);
 VOID        WINAPI LZDone(void);
 DWORD       WINAPI OemKeyScan(WORD);
@@ -5752,7 +5802,7 @@
 INT16       WINAPI ClearCommBreak16(INT16);
 BOOL32      WINAPI ClearCommBreak32(INT32);
 #define     ClearCommBreak WINELIB_NAME(ClearCommBreak)
-BOOL16      WINAPI ClientToScreen16(HWND16,LPPOINT16);
+VOID        WINAPI ClientToScreen16(HWND16,LPPOINT16);
 BOOL32      WINAPI ClientToScreen32(HWND32,LPPOINT32);
 #define     ClientToScreen WINELIB_NAME(ClientToScreen)
 BOOL16      WINAPI ClipCursor16(const RECT16*);
@@ -5889,6 +5939,9 @@
 HICON16     WINAPI CreateIcon16(HINSTANCE16,INT16,INT16,BYTE,BYTE,LPCVOID,LPCVOID);
 HICON32     WINAPI CreateIcon32(HINSTANCE32,INT32,INT32,BYTE,BYTE,LPCVOID,LPCVOID);
 #define     CreateIcon WINELIB_NAME(CreateIcon)
+HICON16     WINAPI CreateIconFromResourceEx16(LPBYTE,UINT16,BOOL16,DWORD,INT16,INT16,UINT16);
+HICON32     WINAPI CreateIconFromResourceEx32(LPBYTE,UINT32,BOOL32,DWORD,INT32,INT32,UINT32);
+#define     CreateIconFromResourceEx WINELIB_NAME(CreateIconFromResourceEx)
 HMENU16     WINAPI CreateMenu16(void);
 HMENU32     WINAPI CreateMenu32(void);
 #define     CreateMenu WINELIB_NAME(CreateMenu)
@@ -6477,7 +6530,7 @@
 #define     GetModuleFileName WINELIB_NAME_AW(GetModuleFileName)
 HMODULE16   WINAPI GetModuleHandle16(LPCSTR);
 HMODULE32   WINAPI GetModuleHandle32A(LPCSTR);
-HMODULE32   WINAPI GetModuleHandle32W(LPCSTR);
+HMODULE32   WINAPI GetModuleHandle32W(LPCWSTR);
 #define     GetModuleHandle WINELIB_NAME_AW(GetModuleHandle)
 DWORD       WINAPI GetNearestColor16(HDC16,DWORD);
 DWORD       WINAPI GetNearestColor32(HDC32,DWORD);
@@ -6910,9 +6963,12 @@
 HICON32     WINAPI LoadIcon32W(HINSTANCE32,LPCWSTR);
 #define     LoadIcon WINELIB_NAME_AW(LoadIcon)
 HINSTANCE16 WINAPI LoadLibrary16(LPCSTR);
-HINSTANCE32 WINAPI LoadLibrary32A(LPCSTR);
-HINSTANCE32 WINAPI LoadLibrary32W(LPCWSTR);
+HMODULE32   WINAPI LoadLibrary32A(LPCSTR);
+HMODULE32   WINAPI LoadLibrary32W(LPCWSTR);
 #define     LoadLibrary WINELIB_NAME_AW(LoadLibrary)
+HMODULE32   WINAPI LoadLibraryEx32A(LPCSTR,HFILE32,DWORD);
+HMODULE32   WINAPI LoadLibraryEx32W(LPCWSTR,HFILE32,DWORD);
+#define     LoadLibraryEx WINELIB_NAME_AW(LoadLibraryEx)
 HMENU16     WINAPI LoadMenu16(HINSTANCE16,SEGPTR);
 HMENU32     WINAPI LoadMenu32A(HINSTANCE32,LPCSTR);
 HMENU32     WINAPI LoadMenu32W(HINSTANCE32,LPCWSTR);
@@ -7699,12 +7755,12 @@
 INT32       WINAPIV wsprintf32W(LPWSTR,LPCWSTR,...);
 #define     wsprintf WINELIB_NAME_AW(wsprintf)
 INT16       WINAPI wvsnprintf16(LPSTR,UINT16,LPCSTR,LPCVOID);
-INT32       WINAPI wvsnprintf32A(LPSTR,UINT32,LPCSTR,LPCVOID);
-INT32       WINAPI wvsnprintf32W(LPWSTR,UINT32,LPCWSTR,LPCVOID);
+INT32       WINAPI wvsnprintf32A(LPSTR,UINT32,LPCSTR,va_list);
+INT32       WINAPI wvsnprintf32W(LPWSTR,UINT32,LPCWSTR,va_list);
 #define     wvsnprintf WINELIB_NAME_AW(wvsnprintf)
 INT16       WINAPI wvsprintf16(LPSTR,LPCSTR,LPCVOID);
-INT32       WINAPI wvsprintf32A(LPSTR,LPCSTR,LPCVOID);
-INT32       WINAPI wvsprintf32W(LPWSTR,LPCWSTR,LPCVOID);
+INT32       WINAPI wvsprintf32A(LPSTR,LPCSTR,va_list);
+INT32       WINAPI wvsprintf32W(LPWSTR,LPCWSTR,va_list);
 #define     wvsprintf WINELIB_NAME_AW(wvsprintf)
 LONG        WINAPI _hread16(HFILE16,LPVOID,LONG);
 LONG        WINAPI _hread32(HFILE32,LPVOID,LONG);
diff --git a/include/winnls.h b/include/winnls.h
index b0bb86b..11704ab 100644
--- a/include/winnls.h
+++ b/include/winnls.h
@@ -1,6 +1,10 @@
 #ifndef __WINE_WINNLS_H
 #define __WINE_WINNLS_H
 
+/* flags to GetLocaleInfo */
+#define	LOCALE_NOUSEROVERRIDE	    0x80000000
+#define	LOCALE_USE_CP_ACP	    0x40000000
+
 /* When adding new defines, don't forget to add an entry to the
  * locale2id map in misc/ole2nls.c
  */
@@ -103,6 +107,8 @@
 #define LOCALE_IPOSSEPBYSPACE       0x00000055   
 #define LOCALE_INEGSYMPRECEDES      0x00000056   
 #define LOCALE_INEGSEPBYSPACE       0x00000057   
+#define	LOCALE_FONTSIGNATURE        0x00000058
+
 
 #define NORM_IGNORECASE				1
 #define NORM_IGNORENONSPACE			2
@@ -129,4 +135,15 @@
 #define LOCALE_SYSTEM_DEFAULT (MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT))
 #define LOCALE_USER_DEFAULT   (MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT)) 
 
+/* Locale Dependent Mapping Flags */
+#define LCMAP_LOWERCASE	0x00000100	/* lower case letters */
+#define LCMAP_UPPERCASE	0x00000200	/* upper case letters */
+#define LCMAP_SORTKEY	0x00000400	/* WC sort key (normalize) */
+#define LCMAP_BYTEREV	0x00000800	/* byte reversal */
+
+#define LCMAP_HIRAGANA	0x00100000	/* map katakana to hiragana */
+#define LCMAP_KATAKANA	0x00200000	/* map hiragana to katakana */
+#define LCMAP_HALFWIDTH	0x00400000	/* map double byte to single byte */
+#define LCMAP_FULLWIDTH	0x00800000	/* map single byte to double byte */
+
 #endif  /* __WINE_WINNLS_H */
diff --git a/include/winnt.h b/include/winnt.h
index dc6b7cd..6664527 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -278,7 +278,7 @@
  * function pointer to a exception filter
  */
 
-typedef LONG (*PTOP_LEVEL_EXCEPTION_FILTER)(PEXCEPTION_POINTERS ExceptionInfo);
+typedef LONG (CALLBACK *PTOP_LEVEL_EXCEPTION_FILTER)(PEXCEPTION_POINTERS ExceptionInfo);
 typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;
 
 DWORD WINAPI UnhandledExceptionFilter( PEXCEPTION_POINTERS epointers );
diff --git a/include/winproc.h b/include/winproc.h
index c601898..592b357 100644
--- a/include/winproc.h
+++ b/include/winproc.h
@@ -77,8 +77,6 @@
                                      LPARAM lParam, MSGPARAM16* pm16 );
 
 typedef LRESULT (*WINPROC_CALLWNDPROC16)(WNDPROC16,HWND16,UINT16,WPARAM16,LPARAM);
-typedef LRESULT (*WINPROC_CALLWNDPROC32)(WNDPROC32,HWND32,UINT32,WPARAM32,LPARAM);
 extern void WINPROC_SetCallWndProc16( WINPROC_CALLWNDPROC16 proc );
-extern void WINPROC_SetCallWndProc32( WINPROC_CALLWNDPROC32 proc );
 
 #endif  /* __WINE_WINPROC_H */
diff --git a/include/wintypes.h b/include/wintypes.h
index 2626921..f420b39 100644
--- a/include/wintypes.h
+++ b/include/wintypes.h
@@ -66,27 +66,20 @@
 
 /* Calling conventions definitions */
 
-#ifdef not_used_yet
-
 #ifdef __i386__
 # if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)
 #  define __stdcall __attribute__((__stdcall__))
 #  define __cdecl   __attribute__((__cdecl__))
+#  define __RESTORE_ES  __asm__ __volatile__("pushw %ds\n\tpopw %es")
 # else
 #  error You need gcc >= 2.7 to build Wine on a 386
 # endif  /* __GNUC__ */
 #else  /* __i386__ */
-#  define __stdcall /* nothing */
-#  define __cdecl   /* nothing */
+# define __stdcall
+# define __cdecl
+# define __RESTORE_ES
 #endif  /* __i386__ */
 
-#else  /* not_used_yet */
-
-# define __stdcall /* nothing */
-# define __cdecl   /* nothing */
-
-#endif  /* not_used_yet */
-
 #define CALLBACK    __stdcall
 #define WINAPI      __stdcall
 #define APIPRIVATE  __stdcall
@@ -131,6 +124,7 @@
 typedef HANDLE32        HKEY;
 typedef HANDLE32        HMIXEROBJ;
 typedef DWORD           LCID;
+typedef WORD            LANGID;
 typedef DWORD           LCTYPE;
 
 /* Pointers types. These are the same for emulator and library. */
@@ -195,6 +189,7 @@
 DECLARE_HANDLE(HWAVEIN);
 DECLARE_HANDLE(HWAVEOUT);
 DECLARE_HANDLE(HWND);
+DECLARE_HANDLE(HKL);
 #undef DECLARE_HANDLE
 
 /* Callback function pointers types */