Release 971012

Sun Oct 12 15:03:01 1997  Alexandre Julliard  <julliard@lrc.epfl.ch>

	* [if1632/builtin.c] [if1632/relay.c]
	Relay debugging entry points are now generated on the fly for
	Win32 DLLs.

	* [include/stackframe.h]
	Added VA_LIST16 type and macros to access arguments on the 16-bit
	stack.

	* [memory/global.c]
	Fixed GlobalHandle32 to work with fixed blocks.

	* [misc/ddeml.c] (New file)
	Added a lot of stubs for DDEML functions.

	* [objects/dc.c]
	Added Get/SetGraphicsMode().

	* [objects/gdiobj.c] [windows/winpos.c]
	Added a few stubs.

	* [tools/build.c]
	Removed 'byte', 'word', 'long' and 'return' entry points for Win32.
	'register' functions can no longer take arguments in Win32.
 	The Win32 NE module is now generated by MODULE_CreateDummyModule.
	CallFrom32 callbacks removed except for register functions.

Fri Oct 10 18:22:18 1997  John Harvey <john@division.co.uk>

	* [graphics/win16drv/Makefile.in] [graphics/win16drv/brush.c]
	  [graphics/win16drv/graphics.c] [graphics/win16drv/init.c]
	  [graphics/win16drv/objects.c] [graphics/win16drv/pen.c]
	  [graphics/win16drv/prtdrv.c] [graphics/win16drv/text.c]
	  [include/callback.h] [include/win16drv.h]
	Added support for pens and brushes in SelectObject. Added support
	for LineTo, MoveToEx, PatBlt (very preliminary), Polygon and
	Rectangle. Text is drawn in the correct place more often. These
	changes may only work with the Windows Postscript driver since
	many other drivers now need more GDI support.

Tue Oct  7 21:06:23 1997  Kristian Nielsen  <kristian.nielsen@risoe.dk>

	* [debugger/expr.c]
	Fixed typo for the >> operator.

	* [loader/task.c]
	Fixed SwitchStackTo(); it used to return with the new stack placed
	four bytes too high in memory.

	* [loader/ne_resource.c]
	Removed problematic nametable code introduced in Wine 970914.

Tue Oct  7 02:24:12 1997  Dimitrie O. Paun  <dimi@cs.toronto.edu>

	* [controls/commctrl.c]
	Added this files to hold functions from the comctl32.dll
	Added to this files some functions scattered in different places
	(such as InitCommonControls) and added some new ones as well.

	* [include/syscolor.h] [windows/syscolor.c]
	Added proper entries for all possible COLOR_* values.

	* [objects/brush.c]
	Modified GetSysColorBrush to return the correct brush for 
	all possible COLOR_* constants.

Sat Oct  4 23:35:20 1997  U.Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>

	* [loader/module.c] [scheduler/process.c] [win32/environment.c]
	Another approach to get access to an unrestricted commandline.

	* [misc/crtdll.c]
	Make fclose work again.

	* [if1632/crtdll.spec]
	Use sprintf for crtdll-sprintf again as e.g. %g is not available
	for wsprintf.

	* [misc/wsprintf.c]
	Make WPR_STRING work in more situations.
	Added debug output for the wsprintf functions.

	* [misc/crtdll.c] [misc/main.c]
	Use argv[0] as comand with CRTDLL_system.

Fri Oct  3 14:00:29 MET DST 1997  Jan Willamowius  <jan@janhh.shnet.org>

	* [*/*]
        Removed some compiler warnings.

	* [msdos/int15.c]
        New INT 15 handler.
diff --git a/include/arch.h b/include/arch.h
deleted file mode 100644
index fc7c5cb..0000000
--- a/include/arch.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Machine dependent integer conversions
- *
- * Copyright Miguel de Icaza, 1994
-*/
-
-#if defined (mc68000) || defined (sparc)
-
-#define CONV_LONG(a) (((int)(a)&0xFF) << 24) | (((int)(a) & 0xFF00) << 8) | (((unsigned long)(a) & 0xFF0000) >> 8) | (((unsigned long)(a)&0xFF000000) >> 24) 
-#define CONV_SHORT(a) (((int)(a) & 0xFF) << 8) | (((unsigned long)(a) & 0xFF00) >> 8)
-#define CONV_CHAR_TO_LONG(x) ((unsigned long)(x) >> 24)
-#define CONV_SHORT_TO_LONG(x) ((unsigned long)(x) >> 16)
-
-#define CONV_BITMAPINFO(a) ARCH_ConvBitmapInfo(a)
-#define CONV_BITMAPCOREHEADER(a) ARCH_ConvCoreHeader(a)
-#else
-#define CONV_LONG(a) (a)
-#define CONV_SHORT(a) (a)
-#define CONV_CHAR_TO_LONG(a) (a)
-#define CONV_SHORT_TO_LONG(a) (a)
-
-#define CONV_BITMAPINFO(a)		/* */
-#define CONV_BITMAPCOREHEADER(a)	/* */
-#endif
diff --git a/include/callback.h b/include/callback.h
index 40bf782..e2e230e 100644
--- a/include/callback.h
+++ b/include/callback.h
@@ -45,9 +45,15 @@
 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_word_lwwlllll(FARPROC16,LONG,WORD,WORD,LONG,LONG,
+                                            LONG,LONG,WORD);
 extern LONG CALLBACK CallTo16_long_lwwllwlllllw(FARPROC16,LONG,WORD,WORD,LONG,
                                                 LONG,WORD,LONG,LONG,LONG,LONG,
                                                 LONG,WORD);
+extern LONG CALLBACK CallTo16_word_lwwwwlwwwwllll(FARPROC16,LONG,WORD,WORD,
+                                                  WORD,WORD,LONG,WORD,WORD,
+                                                  WORD,WORD,LONG,LONG,LONG,
+                                                  LONG);
 
 #define CallDriverProc( func, dwId, msg, hdrvr, lparam1, lparam2 ) \
     CallTo16_long_lwwll( func, dwId, msg, hdrvr, lparam1, lparam2 )
diff --git a/include/commctrl.h b/include/commctrl.h
index 80a3898..a8b0ae1 100644
--- a/include/commctrl.h
+++ b/include/commctrl.h
@@ -11,9 +11,9 @@
 
 /* StatusWindow */
 
-#define STATUSCLASSNAME16  "msctls_statusbar"
-#define STATUSCLASSNAME32A "msctls_statusbar32"
-#define STATUSCLASSNAME32W "msctls_statusbar32"
+#define STATUSCLASSNAME16     "msctls_statusbar"
+#define STATUSCLASSNAME32A    "msctls_statusbar32"
+#define STATUSCLASSNAME32W   L"msctls_statusbar32"       /*FIXME*/
 #define STATUSCLASSNAME WINELIB_NAME_AW(STATUSCLASSNAME)
 
 #define SB_SETTEXT32A         (WM_USER+1)
@@ -43,9 +43,9 @@
 
 /* UpDown */
 
-#define UPDOWN_CLASS32A       "msctls_updown32"
-#define UPDOWN_CLASS32W      L"msctls_updown32"
 #define UPDOWN_CLASS16        "msctls_updown"
+#define UPDOWN_CLASS32A       "msctls_updown32"
+#define UPDOWN_CLASS32W      L"msctls_updown32"   /*FIXME*/
 #define UPDOWN_CLASS          WINELIB_NAME_AW(UPDOWN_CLASS)
 
 typedef struct tagUDACCEL
@@ -96,12 +96,14 @@
  
 /* Functions prototypes */
 
+HWND16     WINAPI CreateStatusWindow16(INT16,LPCSTR,HWND16,UINT16);
 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);
+VOID       WINAPI DrawStatusText16(HDC16,LPRECT16,LPCSTR,UINT16);
 VOID       WINAPI DrawStatusText32A(HDC32,LPRECT32,LPCSTR,UINT32);
 VOID       WINAPI DrawStatusText32W(HDC32,LPRECT32,LPCWSTR,UINT32);
 #define    DrawStatusText WINELIB_NAME_AW(DrawStatusText)
diff --git a/include/commdlg.h b/include/commdlg.h
index 01d7bb7..2cac612 100644
--- a/include/commdlg.h
+++ b/include/commdlg.h
@@ -253,28 +253,80 @@
 #define CD_LBSELSUB      1
 #define CD_LBSELADD      2
 
-typedef struct {
-	DWORD 		lStructSize;
-	HWND16 		hwndOwner;
-	HGLOBAL16       hDevMode;
-	HGLOBAL16       hDevNames;
-	HDC16	       	hDC;
-	DWORD 		Flags;
-	UINT16		nFromPage;
-	UINT16		nToPage;
-	UINT16		nMinPage;
-	UINT16		nMaxPage;
-	UINT16		nCopies;
-	HINSTANCE16 	hInstance;
-	LPARAM 		lCustData;
-        WNDPROC16       lpfnPrintHook;
-        WNDPROC16       lpfnSetupHook;
-	SEGPTR 		lpPrintTemplateName;
-	SEGPTR 		lpSetupTemplateName;
-	HGLOBAL16       hPrintTemplate;
-	HGLOBAL16       hSetupTemplate;
-	} PRINTDLG;
-typedef PRINTDLG * LPPRINTDLG;
+typedef struct
+{
+    DWORD            lStructSize;
+    HWND16           hwndOwner;
+    HGLOBAL16        hDevMode;
+    HGLOBAL16        hDevNames;
+    HDC16            hDC;
+    DWORD            Flags;
+    WORD             nFromPage;
+    WORD             nToPage;
+    WORD             nMinPage;
+    WORD             nMaxPage;
+    WORD             nCopies;
+    HINSTANCE16      hInstance;
+    LPARAM           lCustData;
+    WNDPROC16        lpfnPrintHook;
+    WNDPROC16        lpfnSetupHook;
+    SEGPTR           lpPrintTemplateName;
+    SEGPTR           lpSetupTemplateName;
+    HGLOBAL16        hPrintTemplate;
+    HGLOBAL16        hSetupTemplate;
+} PRINTDLG16, *LPPRINTDLG16;
+
+typedef UINT32 (CALLBACK *LPPRINTHOOKPROC) (HWND32, UINT32, WPARAM32, LPARAM);
+typedef UINT32 (CALLBACK *LPSETUPHOOKPROC) (HWND32, UINT32, WPARAM32, LPARAM);
+
+typedef struct
+{
+    DWORD            lStructSize;
+    HWND32           hwndOwner;
+    HGLOBAL32        hDevMode;
+    HGLOBAL32        hDevNames;
+    HDC32            hDC;
+    DWORD            Flags;
+    WORD             nFromPage;
+    WORD             nToPage;
+    WORD             nMinPage;
+    WORD             nMaxPage;
+    WORD             nCopies;
+    HINSTANCE32      hInstance;
+    LPARAM           lCustData;
+    LPPRINTHOOKPROC  lpfnPrintHook;
+    LPSETUPHOOKPROC  lpfnSetupHook;
+    LPCSTR           lpPrintTemplateName;
+    LPCSTR           lpSetupTemplateName;
+    HGLOBAL32        hPrintTemplate;
+    HGLOBAL32        hSetupTemplate;
+} PRINTDLG32A, *LPPRINTDLG32A;
+
+typedef struct
+{
+    DWORD            lStructSize;
+    HWND32           hwndOwner;
+    HGLOBAL32        hDevMode;
+    HGLOBAL32        hDevNames;
+    HDC32            hDC;
+    DWORD            Flags;
+    WORD             nFromPage;
+    WORD             nToPage;
+    WORD             nMinPage;
+    WORD             nMaxPage;
+    WORD             nCopies;
+    HINSTANCE32      hInstance;
+    LPARAM           lCustData;
+    LPPRINTHOOKPROC  lpfnPrintHook;
+    LPSETUPHOOKPROC  lpfnSetupHook;
+    LPCWSTR          lpPrintTemplateName;
+    LPCWSTR          lpSetupTemplateName;
+    HGLOBAL32        hPrintTemplate;
+    HGLOBAL32        hSetupTemplate;
+} PRINTDLG32W, *LPPRINTDLG32W;
+
+DECL_WINELIB_TYPE_AW(PRINTDLG);
+DECL_WINELIB_TYPE_AW(LPPRINTDLG);
 
 #define PD_ALLPAGES                  0x00000000
 #define PD_SELECTION                 0x00000001
diff --git a/include/ddeml.h b/include/ddeml.h
new file mode 100644
index 0000000..d2d4d11
--- /dev/null
+++ b/include/ddeml.h
@@ -0,0 +1,85 @@
+/*
+ * DDEML library definitions
+ *
+ * Copyright 1997 Alexandre Julliard
+ */
+
+#ifndef __WINE__DDEML_H
+#define __WINE__DDEML_H
+
+#include "wintypes.h"
+
+typedef DWORD HCONVLIST;
+typedef DWORD HCONV;
+typedef DWORD HSZ;
+typedef DWORD HDDEDATA;
+
+typedef HDDEDATA (CALLBACK *PFNCALLBACK16)(UINT16,UINT16,HCONV,HSZ,HSZ,
+                                           HDDEDATA,DWORD,DWORD);
+typedef HDDEDATA (CALLBACK *PFNCALLBACK32)(UINT32,UINT32,HCONV,HSZ,HSZ,
+                                           HDDEDATA,DWORD,DWORD);
+DECL_WINELIB_TYPE(PFNCALLBACK);
+
+typedef struct
+{
+    UINT16  cb;
+    UINT16  wFlags;
+    UINT16  wCountryID;
+    INT16   iCodePage;
+    DWORD   dwLangID;
+    DWORD   dwSecurity;
+} CONVCONTEXT16, *LPCONVCONTEXT16;
+
+typedef struct
+{
+    UINT32  cb;
+    UINT32  wFlags;
+    UINT32  wCountryID;
+    INT32   iCodePage;
+    DWORD   dwLangID;
+    DWORD   dwSecurity;
+} CONVCONTEXT32, *LPCONVCONTEXT32;
+
+DECL_WINELIB_TYPE(CONVCONTEXT);
+DECL_WINELIB_TYPE(LPCONVCONTEXT);
+
+UINT16    WINAPI DdeInitialize16(LPDWORD,PFNCALLBACK16,DWORD,DWORD);
+UINT32    WINAPI DdeInitialize32A(LPDWORD,PFNCALLBACK32,DWORD,DWORD);
+UINT32    WINAPI DdeInitialize32W(LPDWORD,PFNCALLBACK32,DWORD,DWORD);
+#define   DdeInitialize WINELIB_NAME_AW(DdeInitialize)
+BOOL16    WINAPI DdeUninitialize16(DWORD);
+BOOL32    WINAPI DdeUninitialize32(DWORD);
+#define   DdeUninitialize WINELIB_NAME(DdeUninitialize)
+HCONV     WINAPI DdeConnect16(DWORD,HSZ,HSZ,LPCONVCONTEXT16);
+HCONV     WINAPI DdeConnect32(DWORD,HSZ,HSZ,LPCONVCONTEXT32);
+#define   DdeConnect WINELIB_NAME(DdeConnect)
+BOOL16    WINAPI DdeDisconnect16(HCONV);
+BOOL32    WINAPI DdeDisconnect32(HCONV);
+#define   DdeDisconnect WINELIB_NAME(DdeDisconnect)
+HCONV     WINAPI DdeReconnect(HCONV);
+HSZ       WINAPI DdeCreateStringHandle16(DWORD,LPCSTR,INT16);
+HSZ       WINAPI DdeCreateStringHandle32A(DWORD,LPCSTR,INT32);
+HSZ       WINAPI DdeCreateStringHandle32W(DWORD,LPCWSTR,INT32);
+#define   DdeCreateStringHandle WINELIB_NAME_AW(DdeCreateStringHandle)
+BOOL16    WINAPI DdeFreeStringHandle16(DWORD,HSZ);
+BOOL32    WINAPI DdeFreeStringHandle32(DWORD,HSZ);
+#define   DdeFreeStringHandle WINELIB_NAME(DdeFreeStringHandle)
+BOOL16    WINAPI DdeFreeDataHandle16(HDDEDATA);
+BOOL32    WINAPI DdeFreeDataHandle32(HDDEDATA);
+#define   DdeFreeDataHandle WINELIB_NAME(DdeFreeDataHandle)
+BOOL16    WINAPI DdeKeepStringHandle16(DWORD,HSZ);
+BOOL32    WINAPI DdeKeepStringHandle32(DWORD,HSZ);
+#define   DdeKeepStringHandle WINELIB_NAME(DdeKeepStringHandle)
+HDDEDATA  WINAPI DdeClientTransaction16(LPVOID,DWORD,HCONV,HSZ,UINT16,
+                                        UINT16,DWORD,LPDWORD);
+HDDEDATA  WINAPI DdeClientTransaction32(LPBYTE,DWORD,HCONV,HSZ,UINT32,
+                                        UINT32,DWORD,LPDWORD);
+#define   DdeClientTransaction WINELIB_NAME(DdeClientTransaction)
+HDDEDATA  WINAPI DdeNameService16(DWORD,HSZ,HSZ,UINT16);
+HDDEDATA  WINAPI DdeNameService32(DWORD,HSZ,HSZ,UINT32);
+#define   DdeNameService WINELIB_NAME(DdeNameService)
+UINT16    WINAPI DdeGetLastError16(DWORD);
+UINT32    WINAPI DdeGetLastError32(DWORD);
+#define   DdeGetLastError WINELIB_NAME(DdeGetLastError)
+
+#endif  /* __WINE__DDEML_H */
diff --git a/include/gdi.h b/include/gdi.h
index 817fdf7..17e2741 100644
--- a/include/gdi.h
+++ b/include/gdi.h
@@ -108,6 +108,7 @@
     BYTE          bitsPerPixel;
 
     INT32         MapMode;
+    INT32         GraphicsMode;      /* Graphics mode */
     INT32         DCOrgX;            /* DC origin */
     INT32         DCOrgY;
     INT32         CursPosX;          /* Current position */
diff --git a/include/mmsystem.h b/include/mmsystem.h
index d2f5c16..73b46d4 100644
--- a/include/mmsystem.h
+++ b/include/mmsystem.h
@@ -454,7 +454,7 @@
 #define TIMERR_NOCANDO        (TIMERR_BASE+1)      /* request not completed */
 #define TIMERR_STRUCT         (TIMERR_BASE+33)     /* time struct size */
 
-typedef void (*LPTIMECALLBACK) (UINT16 uTimerID, UINT16 uMessage, DWORD dwUser, DWORD dw1, DWORD dw2);
+typedef void (CALLBACK *LPTIMECALLBACK) (UINT16 uTimerID, UINT16 uMessage, DWORD dwUser, DWORD dw1, DWORD dw2);
 
 #define TIME_ONESHOT    0   /* program timer for single event */
 #define TIME_PERIODIC   1   /* program for continuous periodic event */
diff --git a/include/module.h b/include/module.h
index 1416362..b411b97 100644
--- a/include/module.h
+++ b/include/module.h
@@ -132,12 +132,12 @@
 extern FARPROC16 WIN32_GetProcAddress16( HMODULE32 hmodule, LPSTR name );
 
 /* builtin.c */
-extern BOOL16 BUILTIN_Init(void);
-extern HMODULE16 BUILTIN_LoadModule( LPCSTR name, BOOL16 force );
+extern BOOL32 BUILTIN_Init(void);
+extern HMODULE16 BUILTIN_LoadModule( LPCSTR name, BOOL32 force );
 extern LPCSTR BUILTIN_GetEntryPoint16( WORD cs, WORD ip, WORD *pOrd );
-extern LPCSTR BUILTIN_GetEntryPoint32( void *relay );
+extern FARPROC32 BUILTIN_GetEntryPoint32( char *buffer, void *relay );
 extern FARPROC32 BUILTIN_GetProcAddress32(NE_MODULE *pModule, LPCSTR function);
-extern BOOL16 BUILTIN_ParseDLLOptions( const char *str );
+extern BOOL32 BUILTIN_ParseDLLOptions( const char *str );
 extern void BUILTIN_PrintDLLs(void);
 
 /* ne_image.c */
diff --git a/include/options.h b/include/options.h
index 542613c..ba48841 100644
--- a/include/options.h
+++ b/include/options.h
@@ -47,6 +47,7 @@
 {
     char * desktopGeometry; /* NULL when no desktop */
     char * programName;     /* To use when loading resources */
+    char * argv0;           /* argv[0] of Wine process */
     int    usePrivateMap;
     int    useFixedMap;
     int    synchronous;     /* X synchronous mode */
diff --git a/include/peexe.h b/include/peexe.h
index 49d7cf9..364e44d 100644
--- a/include/peexe.h
+++ b/include/peexe.h
@@ -350,7 +350,7 @@
 	DWORD	Reserved[ 4 ];
 } IMAGE_LOAD_CONFIG_DIRECTORY,*LPIMAGE_LOAD_CONFIG_DIRECTORY;
 
-typedef VOID (*LPIMAGE_TLS_CALLBACK)(
+typedef VOID (CALLBACK *LPIMAGE_TLS_CALLBACK)(
 	LPVOID DllHandle,DWORD Reason,LPVOID Reserved
 );
 
diff --git a/include/stackframe.h b/include/stackframe.h
index f1b513a..e1cfa77 100644
--- a/include/stackframe.h
+++ b/include/stackframe.h
@@ -7,7 +7,8 @@
 #ifndef __WINE_STACKFRAME_H
 #define __WINE_STACKFRAME_H
 
-#include <windows.h>
+#include <string.h>
+#include "windows.h"
 #include "ldt.h"
 
 #pragma pack(1)
@@ -25,7 +26,6 @@
     WORD    bp;             /* 14 16-bit bp */
     WORD    ip;             /* 16 return address */
     WORD    cs;             /* 18 */
-    WORD    args[1];        /* 1a arguments to API function */
 } STACK16FRAME;
 
   /* 32-bit stack layout after CallTo16() */
@@ -48,14 +48,30 @@
   /* Saved 16-bit stack for current process (Win16 only) */
 extern DWORD IF1632_Saved16_ss_sp;
 
-  /* Saved 32-bit stack for current process (Win16 only) */
-extern DWORD IF1632_Saved32_esp;
+#define CURRENT_STACK16 ((STACK16FRAME *)PTR_SEG_TO_LIN(IF1632_Saved16_ss_sp))
+#define CURRENT_DS      (CURRENT_STACK16->ds)
 
-  /* Original Unix stack */
-extern DWORD IF1632_Original32_esp;
+/* varargs lists on the 16-bit stack */
 
-#define CURRENT_STACK16  ((STACK16FRAME *)PTR_SEG_TO_LIN(IF1632_Saved16_ss_sp))
+typedef void *VA_LIST16;
 
-#define CURRENT_DS   (CURRENT_STACK16->ds)
+#define __VA_ROUNDED16(type) \
+    ((sizeof(type) + sizeof(WORD) - 1) / sizeof(WORD) * sizeof(WORD))
+#define VA_START16(list) ((list) = (VA_LIST16)(CURRENT_STACK16 + 1))
+#define VA_ARG16(list,type) \
+    (((list) = (VA_LIST16)((char *)(list) + __VA_ROUNDED16(type))), \
+     *((type *)(void *)((char *)(list) - __VA_ROUNDED16(type))))
+#define VA_END16(list) ((void)0)
+
+/* Push bytes on the 16-bit stack; return a segptr to the first pushed byte */
+#define STACK16_PUSH(size) \
+ (memmove((char*)CURRENT_STACK16-(size),CURRENT_STACK16,sizeof(STACK16FRAME)),\
+  IF1632_Saved16_ss_sp -= (size), \
+  (SEGPTR)(IF1632_Saved16_ss_sp + sizeof(STACK16FRAME)))
+
+/* Pop bytes from the 16-bit stack */
+#define STACK16_POP(size) \
+ (memmove((char*)CURRENT_STACK16+(size),CURRENT_STACK16,sizeof(STACK16FRAME)),\
+  IF1632_Saved16_ss_sp += (size))
 
 #endif /* __WINE_STACKFRAME_H */
diff --git a/include/syscolor.h b/include/syscolor.h
index a212336..7845858 100644
--- a/include/syscolor.h
+++ b/include/syscolor.h
@@ -12,30 +12,33 @@
 struct SysColorObjects
 {
     HBRUSH32 hbrushScrollbar;        /* COLOR_SCROLLBAR           */
-                                     /* COLOR_BACKGROUND          */
+    HBRUSH32 hbrushBackground;       /* COLOR_BACKGROUND          */
     HBRUSH32 hbrushActiveCaption;    /* COLOR_ACTIVECAPTION       */
     HBRUSH32 hbrushInactiveCaption;  /* COLOR_INACTIVECAPTION     */
     HBRUSH32 hbrushMenu;             /* COLOR_MENU                */
     HBRUSH32 hbrushWindow;           /* COLOR_WINDOW              */
-    HPEN32   hpenWindowFrame;        /* COLOR_WINDOWFRAME         */
-                                     /* COLOR_MENUTEXT            */
-    HPEN32   hpenWindowText;         /* COLOR_WINDOWTEXT          */
-                                     /* COLOR_CAPTIONTEXT         */
+    HBRUSH32 hbrushWindowFrame;      /* COLOR_WINDOWFRAME         */
+    HBRUSH32 hbrushMenuText;         /* COLOR_MENUTEXT            */
+    HBRUSH32 hbrushWindowText;       /* COLOR_WINDOWTEXT          */
+    HBRUSH32 hbrushCaptionText;      /* COLOR_CAPTIONTEXT         */
     HBRUSH32 hbrushActiveBorder;     /* COLOR_ACTIVEBORDER        */
     HBRUSH32 hbrushInactiveBorder;   /* COLOR_INACTIVEBORDER      */
-                                     /* COLOR_APPWORKSPACE        */
+    HBRUSH32 hbrushAppWorkspace;     /* COLOR_APPWORKSPACE        */
     HBRUSH32 hbrushHighlight;        /* COLOR_HIGHLIGHT           */
-                                     /* COLOR_HIGHLIGHTTEXT       */
+    HBRUSH32 hbrushHighlightText;    /* COLOR_HIGHLIGHTTEXT       */
     HBRUSH32 hbrushBtnFace;          /* COLOR_BTNFACE             */
     HBRUSH32 hbrushBtnShadow;        /* COLOR_BTNSHADOW           */
-                                     /* COLOR_GRAYTEXT            */
-                                     /* COLOR_BTNTEXT             */
-                                     /* COLOR_INACTIVECAPTIONTEXT */
+    HBRUSH32 hbrushGrayText;         /* COLOR_GRAYTEXT            */
+    HBRUSH32 hbrushBtnText;          /* COLOR_BTNTEXT             */
+    HBRUSH32 hbrushInactiveCaptionText; /* COLOR_INACTIVECAPTIONTEXT */
     HBRUSH32 hbrushBtnHighlight;     /* COLOR_BTNHIGHLIGHT        */
-                                     /* COLOR_3DDKSHADOW          */
-                                     /* COLOR_3DLIGHT             */
-                                     /* COLOR_INFOTEXT            */
-                                     /* COLOR_INFOBK              */
+    HBRUSH32 hbrush3DDkShadow;       /* COLOR_3DDKSHADOW          */
+    HBRUSH32 hbrush3DLight;          /* COLOR_3DLIGHT             */
+    HBRUSH32 hbrushInfoText;         /* COLOR_INFOTEXT            */
+    HBRUSH32 hbrushInfoBk;           /* COLOR_INFOBK              */
+
+    HPEN32   hpenWindowFrame;        /* COLOR_WINDOWFRAME         */
+    HPEN32   hpenWindowText;         /* COLOR_WINDOWTEXT          */
 };
 
 extern void SYSCOLOR_Init(void);
diff --git a/include/win16drv.h b/include/win16drv.h
index 88acb12..62d9d7f 100644
--- a/include/win16drv.h
+++ b/include/win16drv.h
@@ -18,6 +18,20 @@
 #define INITPDEVICE 0x0000
 #endif
 
+#define     OS_ARC		3
+#define     OS_SCANLINES	4
+#define     OS_RECTANGLE	6
+#define     OS_ELLIPSE		7
+#define     OS_MARKER		8
+#define     OS_POLYLINE 	18
+#define     OS_ALTPOLYGON	22
+#define     OS_WINDPOLYGON	20
+#define     OS_PIE		23
+#define     OS_POLYMARKER	24
+#define     OS_CHORD		39
+#define     OS_CIRCLE		55
+#define     OS_ROUNDRECT	72
+
 /* Internal Data */
 #define ORD_BITBLT		1
 #define ORD_COLORINFO		2		
@@ -89,7 +103,7 @@
 
 typedef struct
 {
-    char 	szDriver[9];		/* Driver name eg EPSON */
+    LPSTR 	szDriver;		/* Driver name eg EPSON */
     HINSTANCE16	hInst;			/* Handle for driver */
     WORD	ds_reg;			/* DS of driver */
     FARPROC16 	fn[TOTAL_PRINTER_DRIVER_FUNCTIONS];	/* Printer functions */
@@ -97,9 +111,6 @@
     int		nPrinterFonts;		/* Number of printer fonts */
     PRINTER_FONTS_INFO *paPrinterFonts; /* array of printer fonts */
     int		nIndex;			/* Index in global driver array */
-    HGLOBAL16   hThunk;			/* Thunking buffer */
-    SEGPTR	ThunkBufSegPtr;
-    SEGPTR	ThunkBufLimit;
 } LOADED_PRINTER_DRIVER;
 
 typedef struct PDEVICE_HEADER
@@ -146,10 +157,12 @@
 /* Win16 printer driver physical DC */
 typedef struct
 {
-    SEGPTR	segptrPDEVICE;	/* PDEVICE used by 16 bit printer drivers */
-    LOGFONT16	lf;		/* Current font details */
+    SEGPTR		segptrPDEVICE;	/* PDEVICE used by 16 bit printer drivers */
+    LOGFONT16		lf;		/* Current font details */
     TEXTMETRIC16	tm;		/* Current font metrics */
-    SEGPTR	segptrFontInfo; /* Current font realized by printer driver */
+    SEGPTR		segptrFontInfo; /* Current font realized by printer driver */
+    SEGPTR		segptrBrushInfo; /* Current brush realized by printer driver */
+    SEGPTR		segptrPenInfo;   /* Current pen realized by printer driver */
 } WIN16DRV_PDEVICE;
 
 /*
@@ -187,6 +200,10 @@
 extern BOOL32 WIN16DRV_ExtTextOut( DC *dc, INT32 x, INT32 y, UINT32 flags,
                                   const RECT32 *lprect, LPCSTR str, UINT32 count,
                                   const INT32 *lpDx );
+extern BOOL32 WIN16DRV_LineTo( DC *dc, INT32 x, INT32 y );
+extern BOOL32 WIN16DRV_MoveToEx(DC *dc,INT32 x,INT32 y,LPPOINT32 pt);
+extern BOOL32 WIN16DRV_Polygon(DC *dc, LPPOINT32 pt, INT32 count );
+extern BOOL32 WIN16DRV_Rectangle(DC *dc, INT32 left, INT32 top, INT32 right, INT32 bottom);
 extern HGDIOBJ32 WIN16DRV_SelectObject( DC *dc, HGDIOBJ32 handle );
 extern BOOL32 WIN16DRV_PatBlt( struct tagDC *dc, INT32 left, INT32 top,
                                INT32 width, INT32 height, DWORD rop );
@@ -202,3 +219,4 @@
 extern LPDRAWMODE 	win16drv_DrawModeP;
 
 #endif  /* __WINE_WIN16DRV_H */
+
diff --git a/include/windows.h b/include/windows.h
index 5cd9e11..83d4603 100644
--- a/include/windows.h
+++ b/include/windows.h
@@ -1120,6 +1120,15 @@
   FONTSIGNATURE	fs;
 } CHARSETINFO,*LPCHARSETINFO;
 
+typedef struct
+{
+    FLOAT  eM11;
+    FLOAT  eM12;
+    FLOAT  eM21;
+    FLOAT  eM22;
+    FLOAT  eDx;
+    FLOAT  eDy;
+} XFORM, *LPXFORM;
 
 typedef struct 
 {
@@ -1432,14 +1441,16 @@
 DECL_WINELIB_TYPE_AW(LPNEWTEXTMETRICEX);
 
 
-typedef INT16 (*FONTENUMPROC16)(SEGPTR,SEGPTR,UINT16,LPARAM);
-typedef INT32 (*FONTENUMPROC32A)(LPENUMLOGFONT32A,LPNEWTEXTMETRIC32A,UINT32,LPARAM);
-typedef INT32 (*FONTENUMPROC32W)(LPENUMLOGFONT32W,LPNEWTEXTMETRIC32W,UINT32,LPARAM);
+typedef INT16 (CALLBACK *FONTENUMPROC16)(SEGPTR,SEGPTR,UINT16,LPARAM);
+typedef INT32 (CALLBACK *FONTENUMPROC32A)(LPENUMLOGFONT32A,LPNEWTEXTMETRIC32A,
+                                          UINT32,LPARAM);
+typedef INT32 (CALLBACK *FONTENUMPROC32W)(LPENUMLOGFONT32W,LPNEWTEXTMETRIC32W,
+                                          UINT32,LPARAM);
 DECL_WINELIB_TYPE_AW(FONTENUMPROC);
 
-typedef INT16 (*FONTENUMPROCEX16)(SEGPTR,SEGPTR,UINT16,LPARAM);
-typedef INT32 (*FONTENUMPROCEX32A)(LPENUMLOGFONTEX32A,LPNEWTEXTMETRICEX32A,UINT32,LPARAM);
-typedef INT32 (*FONTENUMPROCEX32W)(LPENUMLOGFONTEX32W,LPNEWTEXTMETRICEX32W,UINT32,LPARAM);
+typedef INT16 (CALLBACK *FONTENUMPROCEX16)(SEGPTR,SEGPTR,UINT16,LPARAM);
+typedef INT32 (CALLBACK *FONTENUMPROCEX32A)(LPENUMLOGFONTEX32A,LPNEWTEXTMETRICEX32A,UINT32,LPARAM);
+typedef INT32 (CALLBACK *FONTENUMPROCEX32W)(LPENUMLOGFONTEX32W,LPNEWTEXTMETRICEX32W,UINT32,LPARAM);
 DECL_WINELIB_TYPE_AW(FONTENUMPROCEX);
 
   /* tmPitchAndFamily bits */
@@ -1616,6 +1627,12 @@
 #define TRANSPARENT       1
 #define OPAQUE            2
 
+
+  /* Graphics Modes */
+#define GM_COMPATIBLE     1
+#define GM_ADVANCED       2
+#define GM_LAST           2
+
   /* Map modes */
 #define MM_TEXT		  1
 #define MM_LOMETRIC	  2
@@ -4274,8 +4291,10 @@
 #define META_CREATEBITMAP            0x06FE
 #define META_CREATEREGION            0x06FF
 
-typedef INT16 (*MFENUMPROC16)(HDC16,HANDLETABLE16*,METARECORD*,INT16,LPARAM);
-typedef INT32 (*MFENUMPROC32)(HDC32,HANDLETABLE32*,METARECORD*,INT32,LPARAM);
+typedef INT16 (CALLBACK *MFENUMPROC16)(HDC16,HANDLETABLE16*,METARECORD*,
+                                       INT16,LPARAM);
+typedef INT32 (CALLBACK *MFENUMPROC32)(HDC32,HANDLETABLE32*,METARECORD*,
+                                       INT32,LPARAM);
 DECL_WINELIB_TYPE(MFENUMPROC);
 
 #ifndef NOLOGERROR
@@ -4844,14 +4863,13 @@
     DWORD    Type;
 } MEMORY_BASIC_INFORMATION,*LPMEMORY_BASIC_INFORMATION;
 
-typedef DWORD (*LPTHREAD_START_ROUTINE)(LPVOID);
+typedef DWORD (CALLBACK *LPTHREAD_START_ROUTINE)(LPVOID);
 
-typedef BOOL32 (*CODEPAGE_ENUMPROC32A)(LPSTR);
-typedef BOOL32 (*CODEPAGE_ENUMPROC32W)(LPWSTR);
+typedef BOOL32 (CALLBACK *CODEPAGE_ENUMPROC32A)(LPSTR);
+typedef BOOL32 (CALLBACK *CODEPAGE_ENUMPROC32W)(LPWSTR);
 DECL_WINELIB_TYPE_AW(CODEPAGE_ENUMPROC);
-
-typedef BOOL32 (*LOCALE_ENUMPROC32A)(LPSTR);
-typedef BOOL32 (*LOCALE_ENUMPROC32W)(LPWSTR);
+typedef BOOL32 (CALLBACK *LOCALE_ENUMPROC32A)(LPSTR);
+typedef BOOL32 (CALLBACK *LOCALE_ENUMPROC32W)(LPWSTR);
 DECL_WINELIB_TYPE_AW(LOCALE_ENUMPROC);
 
 typedef struct tagSYSTEM_INFO
@@ -4889,8 +4907,8 @@
 #define	PROCESSOR_ALPHA_21064	21064
 
 /* service main function prototype */
-typedef VOID (*LPSERVICE_MAIN_FUNCTION32A)(DWORD,LPSTR);
-typedef VOID (*LPSERVICE_MAIN_FUNCTION32W)(DWORD,LPWSTR);
+typedef VOID (CALLBACK *LPSERVICE_MAIN_FUNCTION32A)(DWORD,LPSTR);
+typedef VOID (CALLBACK *LPSERVICE_MAIN_FUNCTION32W)(DWORD,LPWSTR);
 DECL_WINELIB_TYPE_AW(LPSERVICE_MAIN_FUNCTION);
 
 /* service start table */
@@ -5011,16 +5029,12 @@
 
 #define PR_JOBSTATUS	0x0000
 
-typedef BOOL32 (*ENUMRESTYPEPROC32A)(HMODULE32 hModule, LPSTR type,LONG lParam);
-typedef BOOL32 (*ENUMRESTYPEPROC32W)(HMODULE32 hModule, LPWSTR type,LONG lParam);
-typedef BOOL32 (*ENUMRESNAMEPROC32A)(HMODULE32 hModule, LPCSTR type,
-				LPSTR name,LONG lParam);
-typedef BOOL32 (*ENUMRESNAMEPROC32W)(HMODULE32 hModule, LPCWSTR type,
-				LPWSTR name,LONG lParam);
-typedef BOOL32 (*ENUMRESLANGPROC32A)(HMODULE32 hModule, LPCSTR type,
-				LPCSTR name,WORD lang,LONG lParam);
-typedef BOOL32 (*ENUMRESLANGPROC32W)(HMODULE32 hModule, LPCWSTR type,
-				LPCWSTR name,WORD lang,LONG lParam);
+typedef BOOL32 (CALLBACK *ENUMRESTYPEPROC32A)(HMODULE32,LPSTR,LONG);
+typedef BOOL32 (CALLBACK *ENUMRESTYPEPROC32W)(HMODULE32,LPWSTR,LONG);
+typedef BOOL32 (CALLBACK *ENUMRESNAMEPROC32A)(HMODULE32,LPCSTR,LPSTR,LONG);
+typedef BOOL32 (CALLBACK *ENUMRESNAMEPROC32W)(HMODULE32,LPCWSTR,LPWSTR,LONG);
+typedef BOOL32 (CALLBACK *ENUMRESLANGPROC32A)(HMODULE32,LPCSTR,LPCSTR,WORD,LONG);
+typedef BOOL32 (CALLBACK *ENUMRESLANGPROC32W)(HMODULE32,LPCWSTR,LPCWSTR,WORD,LONG);
 
 DECL_WINELIB_TYPE_AW(ENUMRESTYPEPROC);
 DECL_WINELIB_TYPE_AW(ENUMRESNAMEPROC);
@@ -5496,6 +5510,9 @@
 #define     GetMenuItemInfo WINELIB_NAME_AW(GetMenuItemInfo)
 UINT32      WINAPI GetOEMCP(void);
 DWORD       WINAPI GetPriorityClass(HANDLE32);
+INT32       WINAPI GetPrivateProfileSection32A(LPCSTR,LPSTR,INT32,LPCSTR);
+INT32       WINAPI GetPrivateProfileSection32W(LPCWSTR,LPWSTR,INT32,LPCWSTR);
+#define     GetPrivateProfileSection WINELIB_NAME_AW(GetPrivateProfileSection)
 HANDLE32    WINAPI GetProcessHeap(void);
 DWORD       WINAPI GetShortPathName32A(LPCSTR,LPSTR,DWORD);
 DWORD       WINAPI GetShortPathName32W(LPCWSTR,LPWSTR,DWORD);
@@ -5529,7 +5546,7 @@
 LPVOID      WINAPI HeapReAlloc(HANDLE32,DWORD,LPVOID,DWORD);
 DWORD       WINAPI HeapSize(HANDLE32,DWORD,LPVOID);
 BOOL32      WINAPI HeapUnlock(HANDLE32);
-BOOL32      WINAPI HeapValidate(HANDLE32,DWORD,LPVOID);
+BOOL32      WINAPI HeapValidate(HANDLE32,DWORD,LPCVOID);
 BOOL32      WINAPI IsDBCSLeadByteEx(UINT32,BYTE);
 BOOL32      WINAPI IsWindowUnicode(HWND32);
 BOOL32      WINAPI IsValidLocale(DWORD,DWORD);
@@ -6482,6 +6499,9 @@
 HWND16      WINAPI GetFocus16(void);
 HWND32      WINAPI GetFocus32(void);
 #define     GetFocus WINELIB_NAME(GetFocus)
+HWND16      WINAPI GetForegroundWindow16(void);
+HWND32      WINAPI GetForegroundWindow32(void);
+#define     GetForegroundWindow WINELIB_NAME(GetForegroundWindow)
 DWORD       WINAPI GetFreeSpace16(UINT16);
 #define     GetFreeSpace32(w) (0x100000L)
 #define     GetFreeSpace WINELIB_NAME(GetFreeSpace)
@@ -6641,6 +6661,9 @@
 BOOL16      WINAPI GetScrollRange16(HWND16,INT16,LPINT16,LPINT16);
 BOOL32      WINAPI GetScrollRange32(HWND32,INT32,LPINT32,LPINT32);
 #define     GetScrollRange WINELIB_NAME(GetScrollRange)
+HWND16      WINAPI GetShellWindow16(void);
+HWND32      WINAPI GetShellWindow32(void);
+#define     GetShellWindow WINELIB_NAME(GetShellWindow)
 HGDIOBJ16   WINAPI GetStockObject16(INT16);
 HGDIOBJ32   WINAPI GetStockObject32(INT32);
 #define     GetStockObject WINELIB_NAME(GetStockObject)
@@ -7428,6 +7451,9 @@
 HWND16      WINAPI SetFocus16(HWND16);
 HWND32      WINAPI SetFocus32(HWND32);
 #define     SetFocus WINELIB_NAME(SetFocus)
+BOOL16      WINAPI SetForegroundWindow16(HWND16);
+BOOL32      WINAPI SetForegroundWindow32(HWND32);
+#define     SetForegroundWindow WINELIB_NAME(SetForegroundWindow)
 UINT16      WINAPI SetHandleCount16(UINT16);
 UINT32      WINAPI SetHandleCount32(UINT32);
 #define     SetHandleCount WINELIB_NAME(SetHandleCount)
diff --git a/include/wintypes.h b/include/wintypes.h
index f420b39..afbf781 100644
--- a/include/wintypes.h
+++ b/include/wintypes.h
@@ -126,6 +126,7 @@
 typedef DWORD           LCID;
 typedef WORD            LANGID;
 typedef DWORD           LCTYPE;
+typedef float           FLOAT;
 
 /* Pointers types. These are the same for emulator and library. */
 
@@ -145,6 +146,7 @@
 typedef UINT32         *LPUINT32;
 typedef HKEY           *LPHKEY;
 typedef HMIXEROBJ      *LPHMIXEROBJ;
+typedef FLOAT          *LPFLOAT;
 
 /* Special case: a segmented pointer is just a pointer in the user's code. */