Release 0.4.7

Mon Nov  1 14:40:21 1993  julliard@di.epfl.ch (Alexandre Julliard)

	* [if1632/user.spec]
	Removed some duplicate entries.

	* [include/dialog.h] [windows/dialog.c]
	Implemented dialog units and fonts.
	Added preliminary loading of dialog resources.
	Preliminary implementation of DialogBox().
	Implemented Get/SetDlgItem* functions.

	* [windows/win.c]
	Implemented WM_PARENTNOTIFY message.
	Implemented CreateWindowEx() and GetWindow().
	Completed DestroyWindow().

Mon Nov  1 18:19:34 1993  Erik Bos

	* [loader/signal.c]
	Added support for int 0x11 & 0x12.

        * [loader/int21.c]
	Improved function handling.

Sun Oct 31 12:38:09 1993  David Metcalfe <david@prism.demon.co.uk>

	* [objects/font.c]
	Implemented GetCharWidth().

Wed Oct 27 09:56:06 1993  John Brezak <brezak@ch.hp.com>

	* [Makefile]
        Use GNU malloc.

	* [include/int21.h include/wine.h]
        Change sc_eflags to sc_efl .

	* [include/wine.h]
        Fix misplaced #endif
        Include <signal.h> for NetBSD

	* [loader/int21.c]
        Don't include <sys/vfs.h> in NetBSD
        Do include <sys/mount.h> in NetBSD
        Cleanup some lint.

Mon Oct 26 17:59:01 1993  Erik Bos

        * [include/int21.h]
        Added.

        * [loader/int21.c]
        Added support for many dos ints.

        * [misc/file.c] [include/files.h]
        Moved OPEN_MAX and DosDriveStruct to files.h.

Sun Oct 24 13:36:50 1993  David Metcalfe <david@prism.demon.co.uk>

	* [controls/button.c]
	Implemented CHECKBOX, AUTOCHECKBOX, 3STATE, AUTO3STATE,
	RADIOBUTTON, AUTORADIOBUTTON, GROUPBOX controls, together with
	a preliminary USERBUTTON control.

	* [objects/text.c]
	Corrected bugs in TEXT_NextLine() and added handling of prefix
	character.

	* [controls/button.c]
	Disabled focus handling by commenting out SetFocus() calls until
	serious bug can be found.

Oct  20, 93 martin2@trgcorp.solucorp.qc.ca (Martin Ayotte)

	* [controls/listbox.c]
	Listbox control window
		Painting cleanup, new messages processed.

	* [controls/scroll.c]
	Scroll bar control window
		Painting cleanup.

	* [controls/combo.c]
	Combo box control window
		Painting cleanup.

Tue Oct 12 17:50:11 1993  julliard@di.epfl.ch (Alexandre Julliard)

	* [objects/color.c] [objects/palette.c] [windows/syscolor.c]
	Better support for the private color map.
	Using a private map is now the default.

	* [windows/win.c]
	Bug fix.

	* [include/dialog.h] [windows/dialog.c]
	Implemented CreateDialog*() and IsDialogMessage().

	* [misc/xt.c] [windows/defwnd.c]
	Moved DefWindowProc() to defwnd.c.
	Added WM_NCCREATE, WM_NCDESTROY and WM_CTLCOLOR handling.

	* [windows/defdlg.c]
	Started the implementation of DefDlgProc().

	* [windows/win.c]
	Added WM_NCCREATE and WM_NCDESTROY messages.
	Implemented IsChild().

Tue Oct 12 17:50:20 1993  David Metcalfe <david@prism.demon.co.uk>

	* [windows/focus.c]
	Implemented GetFocus() and SetFocus().

	* [windows/event.c]
	Added processing of FocusIn and FocusOut events.

	* [windows/graphics.c]
	Added DrawFocusRect().

Sat Oct  9 14:36:57 1993  Erik Bos

	* [loader/int1a.c]
	Added more function handling.

Wed Oct  6 12:21:22 1993  Erik Bos

	* [loader/signal.c]
	Split signal.c into int1a.c, int21.c and signal.c.

Tue Oct  5 22:12:40 1993  David Metcalfe

	* [controls/static.c] [control/widgets.c]
	Static control class.

	* [objects/text.c]
	Added processing of additional DT_ flags to DrawText().

	* [windows/win.c] [misc/xt.c]
	Added SetWindowText() and WM_SETTEXT processing.

Tue Oct  5 22:12:40 1993  Martin Ayotte

	* [controls/listbox.c]
	Listbox control window

	* [controls/scroll.c]
	Scroll bar control window

	* [controls/combo.c]
	Combo box control window

	* [include/combo.h]
	Combo box definitions

	* [include/listbox.h]
	Listbox definitions

	* [include/scroll.h]
	Scroll bar definitions

Sat Oct  2 09:35:54 1993  Bob Amstadt  (bob at pooh)

	* [if1632/callback.c]
	Fixed bug in MakeProcInstance().

	* [debugger/info.c]
	Changed x/w and x/b to display in hex.

	* [debugger/i386-pinsn.c]
	Added code to properly unassemble 16-bit indexing.

Fri Oct  1 08:29:05 1993  Bob Amstadt  (bob at pooh)

	* [loader/files.c] [misc/profile.c]
	System initialization file is now called "wine.ini" and can
	be located in the current directory, the user's home directory,
	or any directories specified in the WINEPATH environment variable.

	* [tools/build.c] [if1632/call.S] [include/regfunc.h]
	Changed register function stack to match sigcontext structure.

Thu Sep 30 22:30:21 1993  Bob Amstadt  (bob at pooh)

	* [loader/files.c]
	Created function to search a path for files to load.

	* [loader/wine.c]
	Modified exe and dll file loading to search through path
	specified by the environment variable WINEPATH.

Thu Sep 30 22:30:21 1993  Eric Youngdale

	* [loader/signal.c]
	Bug fix.

Thu Sep 30 22:30:21 1993  John Brezak

	* [debugger/dbg.y] [debugger/debug.l] [debugger/dtest.c] 
	  [debugger/obstack.h]
	Updates to allow debugger to function under NetBSD.
diff --git a/include/combo.h b/include/combo.h
new file mode 100644
index 0000000..b6ea1d8
--- /dev/null
+++ b/include/combo.h
@@ -0,0 +1,15 @@
+/*
+ * Combo box definitions
+ */
+
+
+typedef struct tagHEADCOMBO {
+    DWORD	dwStyle;
+    DWORD	dwState;
+    HWND	hWndDrop;
+    HWND	hWndEdit;
+    HWND	hWndLBox;
+} HEADCOMBO;
+typedef HEADCOMBO FAR* LPHEADCOMBO;
+
+
diff --git a/include/dialog.h b/include/dialog.h
new file mode 100644
index 0000000..190c8c9
--- /dev/null
+++ b/include/dialog.h
@@ -0,0 +1,79 @@
+/*
+ * Dialog definitions
+ *
+ * Copyright 1993 Alexandre Julliard
+ */
+
+#ifndef DIALOG_H
+#define DIALOG_H
+
+#include "windows.h"
+
+#define DIALOG_CLASS_NAME    "#32770"  /* Integer atom */
+
+
+  /* Dialog info structure.
+   * This structure is stored into the window extra bytes (cbWndExtra).
+   * sizeof(DIALOGINFO) must be <= DLGWINDOWEXTRA (=30).
+   */
+typedef struct
+{
+    LONG      msgResult;
+    FARPROC   dlgProc;
+    LONG      userInfo;
+    HWND      hwndFocus;
+    HFONT     hUserFont;
+    HMENU     hMenu;
+    WORD      xBaseUnit;
+    WORD      yBaseUnit;
+    WORD      fEnd;
+} DIALOGINFO;
+
+
+  /* Dialog template header */
+typedef struct
+{
+    DWORD     style;    
+    BYTE      nbItems __attribute__ ((packed));
+    WORD      x __attribute__ ((packed));
+    WORD      y __attribute__ ((packed));
+    WORD      cx __attribute__ ((packed));
+    WORD      cy __attribute__ ((packed));
+} DLGTEMPLATEHEADER;
+
+
+  /* Dialog control header */
+typedef struct
+{
+    WORD       x;
+    WORD       y;
+    WORD       cx;
+    WORD       cy;
+    WORD       id;
+    DWORD      style __attribute__ ((packed));
+} DLGCONTROLHEADER;
+
+
+  /* Dialog control data */
+typedef struct
+{
+    DLGCONTROLHEADER * header;
+    LPSTR              class;
+    LPSTR              text;
+} DLGCONTROL;
+
+
+  /* Dialog template */
+typedef struct
+{
+    DLGTEMPLATEHEADER * header;
+    unsigned char *     menuName;
+    LPSTR               className;
+    LPSTR               caption;
+    WORD                pointSize;
+    LPSTR               faceName;
+    DLGCONTROL *        controls;
+} DLGTEMPLATE;
+
+
+#endif  /* DIALOG_H */
diff --git a/include/files.h b/include/files.h
new file mode 100644
index 0000000..1b628a2
--- /dev/null
+++ b/include/files.h
@@ -0,0 +1,17 @@
+#ifndef _FILES_H
+#define _FILES_H
+
+#define OPEN_MAX 256
+
+/***************************************************************************
+ This structure stores the infomation needed for a single DOS drive
+ ***************************************************************************/
+struct DosDriveStruct
+{
+  char RootDirectory [256];    /* Unix base for this drive letter */
+  char CurrentDirectory [256]; /* Current directory for this drive */
+  char VolumeLabel [11];
+  unsigned long	serialnumber;
+};
+
+#endif /*_FILES_H*/
diff --git a/include/int21.h b/include/int21.h
new file mode 100644
index 0000000..92cabc5
--- /dev/null
+++ b/include/int21.h
@@ -0,0 +1,93 @@
+#ifndef INT21_H
+#define INT21_H
+
+#define DosVersion 	  0x0303;
+
+#define SectorSize 	  0x200;
+#define SectorsPerCluster 0x04;
+
+#define AX context->sc_eax
+#define BX context->sc_ebx
+#define CX context->sc_ecx
+#define DX context->sc_edx
+#define ES context->sc_es
+#define DS context->sc_ds
+#define DI context->sc_edi
+#define SI context->sc_esi
+
+#define pointer(a,b) 	(((unsigned int) a << 16) | b)
+#define segment(a) 	(a >> 16)
+#define offset(a)	(a & 0xffff)
+
+#define SetCflag	(context->sc_efl |= 0x00000001L)
+#define ResetCflag	(context->sc_efl &= 0xfffffffeL)
+
+struct diskinfo {
+	WORD	infolevel;
+	DWORD	serialnumber;
+	char	label[11];
+	char	fstype[8];
+};
+
+/* extended error codes */
+
+#define NoError		0x00
+#define InvalidFunction 0x01
+#define FileNotFound	0x02
+#define PathNotFound	0x03
+#define AccessDenied	0x05
+#define InvalidHandle	0x06
+#define MCBDestroyed	0x07
+#define	OutOfMemory	0x08
+#define MCBInvalid	0x09
+#define DataInvalid	0x0d
+#define InvalidDrive	0x0f
+#define CanNotRemoveCwd	0x10
+#define	NotSameDevice	0x11
+#define NoMoreFiles	0x12
+#define WriteProtected  0x13
+#define	UnknownUnit	0x14
+#define DriveNotReady	0x15
+#define UnknownCommand	0x16
+#define CRCError	0x17
+#define	BadRqLength	0x18
+#define SeekError	0x19
+#define	UnknownMedia	0x1a
+#define	SectorNotFound	0x1b
+#define OutOfPaper	0x1c
+#define WriteFault	0x1d
+#define ReadFault	0x1e
+#define	GeneralFailure	0x1f
+#define ShareViolation	0x20
+#define LockViolation	0x21
+#define DiskFull	0x27
+#define NoNetwork	0x49
+#define FileExists	0x50
+#define CanNotMakeDir	0x52
+
+/* Error classes */
+
+#define EC_Temporary	0x02
+#define EC_AccessDenied	0x03
+#define EC_AppError	0x04
+#define EC_SystemFailure 0x06
+#define EC_NotFound	0x08
+#define	EC_MediaError	0x0b
+#define EC_Exists	0x0c
+#define	EC_Unknown	0x0d
+
+/* Suggested actions */
+
+#define	SA_Retry	0x01
+#define SA_Abort	0x04
+#define SA_Ignore	0x06
+#define SA_Ask4Retry	0x07
+
+/* Error locus */
+
+#define EL_Unknown	0x01
+#define EL_Disk		0x02
+#define EL_Network	0x03
+#define EL_Memory	0x05
+
+#endif /* INT21_H */
diff --git a/include/listbox.h b/include/listbox.h
new file mode 100644
index 0000000..f44cf8c
--- /dev/null
+++ b/include/listbox.h
@@ -0,0 +1,31 @@
+/*
+ *   List Box definitions
+ */
+
+
+typedef struct tagLISTSTRUCT {
+    DRAWITEMSTRUCT 	dis;
+    HANDLE		hMem;
+    HANDLE		hData;
+    void		*lpNext;
+} LISTSTRUCT;
+typedef LISTSTRUCT FAR* LPLISTSTRUCT;
+
+
+typedef struct tagHEADLIST {
+    short	FirstVisible;
+    short	ItemSelect;
+    short	ItemsCount;
+    short	ItemsVisible;
+    short	ItemSelected;
+    short	PrevSelected;
+    short 	StdItemHeight;
+    short	DrawCtlType;
+    void	*lpFirst; 
+    DWORD	dwStyle;
+    HWND	hWndScroll;
+    HWND	hWndLogicParent;
+} HEADLIST;
+typedef HEADLIST FAR* LPHEADLIST;
+
+
diff --git a/include/prototypes.h b/include/prototypes.h
index 39560dd..c1c7bf9 100644
--- a/include/prototypes.h
+++ b/include/prototypes.h
@@ -30,5 +30,8 @@
 extern struct mz_header_s *CurrentMZHeader;
 extern struct ne_header_s *CurrentNEHeader;
 extern int CurrentNEFile;
+extern do_int1A(struct sigcontext_struct * context);
+extern do_int21(struct sigcontext_struct * context);
 
 #endif /* PROTOTYPES_H */
+
diff --git a/include/regfunc.h b/include/regfunc.h
index 263675f..e31e9aa 100644
--- a/include/regfunc.h
+++ b/include/regfunc.h
@@ -6,16 +6,16 @@
 
 extern unsigned short *Stack16Frame;
 
-#define _AX	Stack16Frame[21]
-#define _BX	Stack16Frame[18]
-#define _CX	Stack16Frame[20]
-#define _DX	Stack16Frame[19]
-#define _SP	Stack16Frame[17]
-#define _BP	Stack16Frame[16]
-#define _SI	Stack16Frame[15]
-#define _DI	Stack16Frame[14]
-#define _DS	Stack16Frame[13]
-#define _ES	Stack16Frame[12]
+#define _AX	Stack16Frame[34]
+#define _BX	Stack16Frame[28]
+#define _CX	Stack16Frame[32]
+#define _DX	Stack16Frame[30]
+#define _SP	Stack16Frame[26]
+#define _BP	Stack16Frame[24]
+#define _SI	Stack16Frame[22]
+#define _DI	Stack16Frame[20]
+#define _DS	Stack16Frame[18]
+#define _ES	Stack16Frame[16]
 
 extern void ReturnFromRegisterFunc(void);
 
diff --git a/include/scroll.h b/include/scroll.h
new file mode 100644
index 0000000..4dd4e7d
--- /dev/null
+++ b/include/scroll.h
@@ -0,0 +1,20 @@
+/*
+ *   Scroll Bar definitions
+ */
+
+
+typedef struct tagHEADSSCROLL {
+    short	CurVal;
+    short	MinVal;
+    short	MaxVal;
+    short	MaxPix;
+    short	CurPix;
+    BOOL	ThumbActive;
+    WORD	Direction;
+    DWORD	dwStyle;
+    HWND	hWndUp;
+    HWND	hWndDown;
+} HEADSCROLL;
+typedef HEADSCROLL FAR* LPHEADSCROLL;
+
+
diff --git a/include/windows.h b/include/windows.h
index 9c8e0d2..dd937c5 100644
--- a/include/windows.h
+++ b/include/windows.h
@@ -5,6 +5,7 @@
 
 #ifndef _WINARGS
 
+typedef unsigned short UINT;
 typedef unsigned short WORD;
 typedef unsigned long DWORD;
 #ifndef _WINMAIN
@@ -12,6 +13,61 @@
 typedef unsigned char BYTE;
 #endif
 typedef long LONG;
+typedef UINT WPARAM;
+typedef LONG LPARAM;
+typedef LONG LRESULT;
+typedef WORD HANDLE;
+#define DECLARE_HANDLE(a) typedef HANDLE a;
+
+DECLARE_HANDLE(HTASK);
+DECLARE_HANDLE(HDRVR);
+DECLARE_HANDLE(HWND);
+DECLARE_HANDLE(HDC);
+DECLARE_HANDLE(HCLASS);
+DECLARE_HANDLE(HCURSOR);
+DECLARE_HANDLE(HFONT);
+DECLARE_HANDLE(HPEN);
+DECLARE_HANDLE(HRGN);
+DECLARE_HANDLE(HPALETTE);
+DECLARE_HANDLE(HICON);
+DECLARE_HANDLE(HINSTANCE);
+DECLARE_HANDLE(HMENU);
+DECLARE_HANDLE(HBITMAP);
+DECLARE_HANDLE(HBRUSH);
+DECLARE_HANDLE(LOCALHANDLE);
+
+typedef char *LPSTR;
+typedef const char *LPCSTR;
+typedef char *NPSTR;
+typedef short *LPINT;
+typedef void *LPVOID;
+typedef long (*FARPROC)();
+typedef int CATCHBUF[9];
+typedef int *LPCATCHBUF;
+
+#define TRUE 1
+#define FALSE 0
+#define CW_USEDEFAULT ((short)0x8000)
+#define FAR
+#define NEAR
+#define PASCAL
+#define VOID                void
+#define WINAPI              PASCAL
+#define CALLBACK            PASCAL
+#ifndef NULL
+#define NULL (void *)0
+#endif
+
+#define LOBYTE(w)           ((BYTE)(w))
+#define HIBYTE(w)           ((BYTE)((UINT)(w) >> 8))
+
+#define LOWORD(l)           ((WORD)(l))
+#define HIWORD(l)           ((WORD)((DWORD)(l) >> 16))
+
+#define MAKELONG(low, high) ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))
+
+/*
+typedef long LONG;
 typedef WORD HANDLE;
 typedef HANDLE HWND;
 typedef HANDLE HDC;
@@ -44,6 +100,7 @@
 #ifndef NULL
 #define NULL (void *)0
 #endif
+*/
 
 #define MAKELPARAM(low, high) ((LONG)(((WORD)(low)) | \
 			      (((DWORD)((WORD)(high))) << 16)))
@@ -133,6 +190,46 @@
 #define DWL_DLGPROC	    4
 #define DWL_USER	    8
 
+  /* GetWindow() constants */
+#define GW_HWNDFIRST	0
+#define GW_HWNDLAST	1
+#define GW_HWNDNEXT	2
+#define GW_HWNDPREV	3
+#define GW_OWNER	4
+#define GW_CHILD	5
+
+  /* Dialogs */
+
+  /* cbWndExtra bytes for dialog class */
+#define DLGWINDOWEXTRA      30
+
+  /* Dialog styles */
+#define DS_ABSALIGN         0x001
+#define DS_SYSMODAL         0x002
+#define DS_LOCALEDIT        0x020
+#define DS_SETFONT          0x040
+#define DS_MODALFRAME       0x080
+#define DS_NOIDLEMSG        0x100
+
+  /* Dialog messages */
+#define DM_GETDEFID         (WM_USER+0)
+#define DM_SETDEFID         (WM_USER+1)
+
+#define DC_HASDEFID         0x534b
+
+  /* WM_GETDLGCODE values */
+#define DLGC_WANTARROWS      0x0001
+#define DLGC_WANTTAB         0x0002
+#define DLGC_WANTALLKEYS     0x0004
+#define DLGC_WANTMESSAGE     0x0004
+#define DLGC_HASSETSEL       0x0008
+#define DLGC_DEFPUSHBUTTON   0x0010
+#define DLGC_UNDEFPUSHBUTTON 0x0020
+#define DLGC_RADIOBUTTON     0x0040
+#define DLGC_WANTCHARS       0x0080
+#define DLGC_STATIC          0x0100
+#define DLGC_BUTTON          0x2000
+
 
 typedef struct { short x, y; } POINT;
 typedef POINT *PPOINT;
@@ -787,6 +884,11 @@
 	WM_DELETEITEM, WM_VKEYTOITEM,
 	WM_CHARTOITEM, WM_SETFONT, WM_GETFONT };
 
+#define WM_NCCREATE         0x0081
+#define WM_NCDESTROY        0x0082
+
+#define WM_GETDLGCODE	    0x0087
+
   /* Keyboard messages */
 #define WM_KEYDOWN          0x0100
 #define WM_KEYUP            0x0101
@@ -798,11 +900,16 @@
 #define WM_SYSDEADCHAR      0x0107
 #define WM_KEYFIRST         WM_KEYDOWN
 #define WM_KEYLAST          0x0108
- 
+
+#define WM_INITDIALOG       0x0110 
 #define WM_COMMAND          0x0111
 #define WM_TIMER	    0x0113
 #define WM_SYSTIMER	    0x0118
 
+  /* scroll messages */
+#define WM_HSCROLL          0x0114
+#define WM_VSCROLL          0x0115
+
   /* Mouse messages */
 #define WM_MOUSEMOVE	    0x0200
 #define WM_LBUTTONDOWN	    0x0201
@@ -817,6 +924,13 @@
 #define WM_MOUSEFIRST	    WM_MOUSEMOVE
 #define WM_MOUSELAST	    WM_MBUTTONDBLCLK
 
+#define WM_PARENTNOTIFY     0x0210
+
+  /* misc messages */
+#define WM_NULL             0x0000
+#define WM_USER             0x0400
+
+
   /* Key status flags for mouse events */
 #define MK_LBUTTON	    0x0001
 #define MK_RBUTTON	    0x0002
@@ -851,6 +965,30 @@
 #define SIZE_MAXSHOW         3
 #define SIZE_MAXHIDE         4
 
+/* SetWindowPos() and WINDOWPOS flags */
+#define SWP_NOSIZE          0x0001
+#define SWP_NOMOVE          0x0002
+#define SWP_NOZORDER        0x0004
+#define SWP_NOREDRAW        0x0008
+#define SWP_NOACTIVATE      0x0010
+#define SWP_FRAMECHANGED    0x0020  /* The frame changed: send WM_NCCALCSIZE */
+#define SWP_SHOWWINDOW      0x0040
+#define SWP_HIDEWINDOW      0x0080
+#define SWP_NOCOPYBITS      0x0100
+#define SWP_NOOWNERZORDER   0x0200  /* Don't do owner Z ordering */
+
+#define SWP_DRAWFRAME       SWP_FRAMECHANGED
+#define SWP_NOREPOSITION    SWP_NOOWNERZORDER
+
+#define SWP_NOSENDCHANGING  0x0400
+#define SWP_DEFERERASE      0x2000
+
+/* SetWindowPos() hwndInsertAfter field values */
+#define HWND_TOP            ((HWND)0)
+#define HWND_BOTTOM         ((HWND)1)
+#define HWND_TOPMOST        ((HWND)-1)
+#define HWND_NOTOPMOST      ((HWND)-2)
+
 
 #define MF_INSERT 0
 #define MF_CHANGE 0x0080
@@ -934,6 +1072,13 @@
 #define WS_CHILDWINDOW (WS_CHILD)
 #define WS_TILEDWINDOW (WS_OVERLAPPEDWINDOW)
 
+/* Window extended styles */
+#define WS_EX_DLGMODALFRAME    0x00000001L
+#define WS_EX_NOPARENTNOTIFY   0x00000004L
+#define WS_EX_TOPMOST          0x00000008L
+#define WS_EX_ACCEPTFILES      0x00000010L
+#define WS_EX_TRANSPARENT      0x00000020L
+
 /* Button control styles */
 #define BS_PUSHBUTTON          0x00000000L
 #define BS_DEFPUSHBUTTON       0x00000001L
@@ -948,16 +1093,310 @@
 #define BS_OWNERDRAW           0x0000000BL
 #define BS_LEFTTEXT            0x00000020L
 
+/* Button control messages */
+#define BM_GETCHECK            (WM_USER+0)
+#define BM_SETCHECK            (WM_USER+1)
+#define BM_GETSTATE            (WM_USER+2)
+#define BM_SETSTATE            (WM_USER+3)
+#define BM_SETSTYLE            (WM_USER+4)
+
 /* Button notification codes */
 #define BN_CLICKED             0
 #define BN_PAINT               1
 #define BN_HILITE              2
-#define BN_UNLITE              3
+#define BN_UNHILITE            3
 #define BN_DISABLE             4
 #define BN_DOUBLECLICKED       5
 
+/* Static Control Styles */
+#define SS_LEFT             0x00000000L
+#define SS_CENTER           0x00000001L
+#define SS_RIGHT            0x00000002L
+#define SS_ICON             0x00000003L
+#define SS_BLACKRECT        0x00000004L
+#define SS_GRAYRECT         0x00000005L
+#define SS_WHITERECT        0x00000006L
+#define SS_BLACKFRAME       0x00000007L
+#define SS_GRAYFRAME        0x00000008L
+#define SS_WHITEFRAME       0x00000009L
+#define SS_SIMPLE           0x0000000BL
+#define SS_LEFTNOWORDWRAP   0x0000000CL
+#define SS_NOPREFIX         0x00000080L
 
-#define GMEM_MOVEABLE	0x0002
+/* Static Control Mesages */
+#define STM_SETICON         (WM_USER+0)
+#define STM_GETICON         (WM_USER+1)
+
+/* WM_H/VSCROLL commands */
+#define SB_LINEUP           0
+#define SB_LINELEFT         0
+#define SB_LINEDOWN         1
+#define SB_LINERIGHT        1
+#define SB_PAGEUP           2
+#define SB_PAGELEFT         2
+#define SB_PAGEDOWN         3
+#define SB_PAGERIGHT        3
+#define SB_THUMBPOSITION    4
+#define SB_THUMBTRACK       5
+#define SB_TOP              6
+#define SB_LEFT             6
+#define SB_BOTTOM           7
+#define SB_RIGHT            7
+#define SB_ENDSCROLL        8
+
+/* Scroll bar selection constants */
+#define SB_HORZ             0
+#define SB_VERT             1
+#define SB_CTL              2
+#define SB_BOTH             3
+
+/* Scrollbar styles */
+#define SBS_HORZ                    0x0000L
+#define SBS_VERT                    0x0001L
+#define SBS_TOPALIGN                0x0002L
+#define SBS_LEFTALIGN               0x0002L
+#define SBS_BOTTOMALIGN             0x0004L
+#define SBS_RIGHTALIGN              0x0004L
+#define SBS_SIZEBOXTOPLEFTALIGN     0x0002L
+#define SBS_SIZEBOXBOTTOMRIGHTALIGN 0x0004L
+#define SBS_SIZEBOX                 0x0008L
+
+/* EnableScrollBar() flags */
+#define ESB_ENABLE_BOTH     0x0000
+#define ESB_DISABLE_BOTH    0x0003
+
+#define ESB_DISABLE_LEFT    0x0001
+#define ESB_DISABLE_RIGHT   0x0002
+
+#define ESB_DISABLE_UP      0x0001
+#define ESB_DISABLE_DOWN    0x0002
+
+#define ESB_DISABLE_LTUP    ESB_DISABLE_LEFT
+#define ESB_DISABLE_RTDN    ESB_DISABLE_RIGHT
+
+/* Listbox styles */
+#define LBS_NOTIFY            0x0001L
+#define LBS_SORT              0x0002L
+#define LBS_NOREDRAW          0x0004L
+#define LBS_MULTIPLESEL       0x0008L
+#define LBS_OWNERDRAWFIXED    0x0010L
+#define LBS_OWNERDRAWVARIABLE 0x0020L
+#define LBS_HASSTRINGS        0x0040L
+#define LBS_USETABSTOPS       0x0080L
+#define LBS_NOINTEGRALHEIGHT  0x0100L
+#define LBS_MULTICOLUMN       0x0200L
+#define LBS_WANTKEYBOARDINPUT 0x0400L
+#define LBS_EXTENDEDSEL       0x0800L
+#define LBS_DISABLENOSCROLL   0x1000L
+#define LBS_STANDARD          (LBS_NOTIFY | LBS_SORT | WS_VSCROLL | WS_BORDER)
+
+/* Listbox messages */
+#define LB_ADDSTRING           (WM_USER+1)
+#define LB_INSERTSTRING        (WM_USER+2)
+#define LB_DELETESTRING        (WM_USER+3)
+#define LB_RESETCONTENT        (WM_USER+5)
+#define LB_SETSEL              (WM_USER+6)
+#define LB_SETCURSEL           (WM_USER+7)
+#define LB_GETSEL              (WM_USER+8)
+#define LB_GETCURSEL           (WM_USER+9)
+#define LB_GETTEXT             (WM_USER+10)
+#define LB_GETTEXTLEN          (WM_USER+11)
+#define LB_GETCOUNT            (WM_USER+12)
+#define LB_SELECTSTRING        (WM_USER+13)
+#define LB_DIR                 (WM_USER+14)
+#define LB_GETTOPINDEX         (WM_USER+15)
+#define LB_FINDSTRING          (WM_USER+16)
+#define LB_GETSELCOUNT         (WM_USER+17)
+#define LB_GETSELITEMS         (WM_USER+18)
+#define LB_SETTABSTOPS         (WM_USER+19)
+#define LB_GETHORIZONTALEXTENT (WM_USER+20)
+#define LB_SETHORIZONTALEXTENT (WM_USER+21)
+#define LB_SETCOLUMNWIDTH      (WM_USER+22)
+#define LB_SETTOPINDEX         (WM_USER+24)
+#define LB_GETITEMRECT         (WM_USER+25)
+#define LB_GETITEMDATA         (WM_USER+26)
+#define LB_SETITEMDATA         (WM_USER+27)
+#define LB_SELITEMRANGE        (WM_USER+28)
+#define LB_SETCARETINDEX       (WM_USER+31)
+#define LB_GETCARETINDEX       (WM_USER+32)
+#define LB_SETITEMHEIGHT       (WM_USER+33)
+#define LB_GETITEMHEIGHT       (WM_USER+34)
+#define LB_FINDSTRINGEXACT     (WM_USER+35)
+
+/* Listbox notification codes */
+#define LBN_ERRSPACE        (-2)
+#define LBN_SELCHANGE       1
+#define LBN_DBLCLK          2
+#define LBN_SELCANCEL       3
+#define LBN_SETFOCUS        4
+#define LBN_KILLFOCUS       5
+
+/* Listbox notification messages */
+#define WM_VKEYTOITEM       0x002E
+#define WM_CHARTOITEM       0x002F
+
+/* Listbox message return values */
+#define LB_OKAY             0
+#define LB_ERR              (-1)
+#define LB_ERRSPACE         (-2)
+
+#define LB_CTLCODE          0L
+
+/* Combo box styles */
+#define CBS_SIMPLE            0x0001L
+#define CBS_DROPDOWN          0x0002L
+#define CBS_DROPDOWNLIST      0x0003L
+#define CBS_OWNERDRAWFIXED    0x0010L
+#define CBS_OWNERDRAWVARIABLE 0x0020L
+#define CBS_AUTOHSCROLL       0x0040L
+#define CBS_OEMCONVERT        0x0080L
+#define CBS_SORT              0x0100L
+#define CBS_HASSTRINGS        0x0200L
+#define CBS_NOINTEGRALHEIGHT  0x0400L
+#define CBS_DISABLENOSCROLL   0x0800L
+
+/* Combo box messages */
+#define CB_GETEDITSEL            (WM_USER+0)
+#define CB_LIMITTEXT             (WM_USER+1)
+#define CB_SETEDITSEL            (WM_USER+2)
+#define CB_ADDSTRING             (WM_USER+3)
+#define CB_DELETESTRING          (WM_USER+4)
+#define CB_DIR                   (WM_USER+5)
+#define CB_GETCOUNT              (WM_USER+6)
+#define CB_GETCURSEL             (WM_USER+7)
+#define CB_GETLBTEXT             (WM_USER+8)
+#define CB_GETLBTEXTLEN          (WM_USER+9)
+#define CB_INSERTSTRING          (WM_USER+10)
+#define CB_RESETCONTENT          (WM_USER+11)
+#define CB_FINDSTRING            (WM_USER+12)
+#define CB_SELECTSTRING          (WM_USER+13)
+#define CB_SETCURSEL             (WM_USER+14)
+#define CB_SHOWDROPDOWN          (WM_USER+15)
+#define CB_GETITEMDATA           (WM_USER+16)
+#define CB_SETITEMDATA           (WM_USER+17)
+#define CB_GETDROPPEDCONTROLRECT (WM_USER+18)
+#define CB_SETITEMHEIGHT         (WM_USER+19)
+#define CB_GETITEMHEIGHT         (WM_USER+20)
+#define CB_SETEXTENDEDUI         (WM_USER+21)
+#define CB_GETEXTENDEDUI         (WM_USER+22)
+#define CB_GETDROPPEDSTATE       (WM_USER+23)
+#define CB_FINDSTRINGEXACT       (WM_USER+24)
+
+/* Combo box notification codes */
+#define CBN_ERRSPACE        (-1)
+#define CBN_SELCHANGE       1
+#define CBN_DBLCLK          2
+#define CBN_SETFOCUS        3
+#define CBN_KILLFOCUS       4
+#define CBN_EDITCHANGE      5
+#define CBN_EDITUPDATE      6
+#define CBN_DROPDOWN        7
+#define CBN_CLOSEUP         8
+#define CBN_SELENDOK        9
+#define CBN_SELENDCANCEL    10
+
+/* Combo box message return values */
+#define CB_OKAY             0
+#define CB_ERR              (-1)
+#define CB_ERRSPACE         (-2)
+
+
+/* Owner draw control types */
+#define ODT_MENU        1
+#define ODT_LISTBOX     2
+#define ODT_COMBOBOX    3
+#define ODT_BUTTON      4
+
+/* Owner draw actions */
+#define ODA_DRAWENTIRE  0x0001
+#define ODA_SELECT      0x0002
+#define ODA_FOCUS       0x0004
+
+/* Owner draw state */
+#define ODS_SELECTED    0x0001
+#define ODS_GRAYED      0x0002
+#define ODS_DISABLED    0x0004
+#define ODS_CHECKED     0x0008
+#define ODS_FOCUS       0x0010
+
+#define WM_DRAWITEM         0x002B
+
+typedef struct tagDRAWITEMSTRUCT
+{
+    UINT        CtlType;
+    UINT        CtlID;
+    UINT        itemID;
+    UINT        itemAction;
+    UINT        itemState;
+    HWND        hwndItem;
+    HDC         hDC;
+    RECT        rcItem;
+    DWORD       itemData;
+} DRAWITEMSTRUCT;
+typedef DRAWITEMSTRUCT NEAR* PDRAWITEMSTRUCT;
+typedef DRAWITEMSTRUCT FAR* LPDRAWITEMSTRUCT;
+
+#define WM_MEASUREITEM      0x002C
+
+typedef struct tagMEASUREITEMSTRUCT
+{
+    UINT        CtlType;
+    UINT        CtlID;
+    UINT        itemID;
+    UINT        itemWidth;
+    UINT        itemHeight;
+    DWORD       itemData;
+} MEASUREITEMSTRUCT;
+typedef MEASUREITEMSTRUCT NEAR* PMEASUREITEMSTRUCT;
+typedef MEASUREITEMSTRUCT FAR* LPMEASUREITEMSTRUCT;
+
+#define WM_DELETEITEM       0x002D
+
+typedef struct tagDELETEITEMSTRUCT
+{
+    UINT       CtlType;
+    UINT       CtlID;
+    UINT       itemID;
+    HWND       hwndItem;
+    DWORD      itemData;
+} DELETEITEMSTRUCT;
+typedef DELETEITEMSTRUCT NEAR* PDELETEITEMSTRUCT;
+typedef DELETEITEMSTRUCT FAR* LPDELETEITEMSTRUCT;
+
+#define WM_COMPAREITEM      0x0039
+
+typedef struct tagCOMPAREITEMSTRUCT
+{
+    UINT        CtlType;
+    UINT        CtlID;
+    HWND        hwndItem;
+    UINT        itemID1;
+    DWORD       itemData1;
+    UINT        itemID2;
+    DWORD       itemData2;
+} COMPAREITEMSTRUCT;
+typedef COMPAREITEMSTRUCT NEAR* PCOMPAREITEMSTRUCT;
+typedef COMPAREITEMSTRUCT FAR* LPCOMPAREITEMSTRUCT;
+
+  
+#define LMEM_MOVEABLE   0x0002
+
+#define GMEM_FIXED          0x0000
+#define GMEM_MOVEABLE       0x0002
+#define GMEM_NOCOMPACT      0x0010
+#define GMEM_NODISCARD      0x0020
+#define GMEM_ZEROINIT       0x0040
+#define GMEM_MODIFY         0x0080
+#define GMEM_DISCARDABLE    0x0100
+#define GMEM_NOT_BANKED     0x1000
+#define GMEM_SHARE          0x2000
+#define GMEM_DDESHARE       0x2000
+#define GMEM_NOTIFY         0x4000
+#define GMEM_LOWER          GMEM_NOT_BANKED
+
+#define GHND                (GMEM_MOVEABLE | GMEM_ZEROINIT)
+#define GPTR                (GMEM_FIXED | GMEM_ZEROINIT)
+
 
 #define F(ret,name) ret name(void);
 #define Fa(ret,name,t1,a1) ret name(t1 a1);
@@ -991,6 +1430,7 @@
 F(BOOL,EmptyClipboard)
 F(BOOL,InSendMessage)
 F(DWORD,GetCurrentTime)
+F(DWORD,GetDialogBaseUnits)
 F(DWORD,GetTickCount)
 F(HANDLE,GetCurrentTask)
 F(HMENU,CreatePopupMenu)
@@ -1020,7 +1460,6 @@
 F(int,StartSound)
 F(int,StopSound)
 F(int,SyncAllVoices)
-F(long,GetDialogBaseUnits)
 F(void,CloseSound)
 F(void,DebugBreak)
 F(void,DestroyCaret)
@@ -1043,7 +1482,7 @@
 Fa(BOOL,SetMessageQueue,int,a)
 Fa(int,_lclose,int,a)
 Fb(int,_lopen,LPSTR,a,int,b)
-Fa(int,lstrlen,LPSTR,a)
+Fa(int,lstrlen,LPCSTR,a)
 Fa(LONG,DispatchMessage,LPMSG,msg)
 Fa(void,UpdateWindow,HWND,a)
 Fa(ATOM,AddAtom,LPSTR,a)
@@ -1230,11 +1669,11 @@
 Fb(BOOL,GetBitmapDimensionEx,HBITMAP,a,LPSIZE,b)
 Fb(BOOL,ShowWindow,HWND,a,int,b) 
 Fb(HDC,BeginPaint,HWND,a,LPPAINTSTRUCT,b) 
-Fb(LPSTR,lstrcat,LPSTR,a,LPSTR,b )
-Fb(LPSTR,lstrcpy,LPSTR,a,LPSTR,b )
+Fb(LPSTR,lstrcat,LPSTR,a,LPCSTR,b )
+Fb(LPSTR,lstrcpy,LPSTR,a,LPCSTR,b )
 Fb(int,_lcreat,LPSTR,a,int,b)
-Fb(int,lstrcmp,LPSTR,a,LPSTR,b )
-Fb(int,lstrcmpi,LPSTR,a,LPSTR,b )
+Fb(int,lstrcmp,LPCSTR,a,LPCSTR,b )
+Fb(int,lstrcmpi,LPCSTR,a,LPCSTR,b )
 Fb(void,EndPaint,HWND,a,LPPAINTSTRUCT,b)
 Fb(void,GetClientRect,HWND,a,LPRECT,b)
 Fb(void,SetDCState,HDC,a,HDC,b)
@@ -1291,7 +1730,7 @@
 Fb(HMENU,LoadMenu,HANDLE,a,LPSTR,b)
 Fb(HWND,ChildWindowFromPoint,HWND,a,POINT,b)
 Fb(HWND,FindWindow,LPSTR,a,LPSTR,b)
-Fb(HWND,GetDlgItem,HWND,a,int,b)
+Fb(HWND,GetDlgItem,HWND,a,WORD,b)
 Fb(HWND,GetNextWindow,HWND,a,WORD,b)
 Fb(HWND,GetWindow,HWND,a,WORD,b)
 Fb(BOOL,GetCurrentPositionEx,HDC,a,LPPOINT,b)
@@ -1315,7 +1754,7 @@
 Fb(WORD,GetSystemPaletteUse,HDC,a,WORD,b)
 Fb(WORD,GetWindowWord,HWND,a,short,b)
 Fb(WORD,GetWindowsDirectory,LPSTR,a,WORD,b)
-Fb(WORD,IsDlgButtonChecked,HWND,a,int,b)
+Fb(WORD,IsDlgButtonChecked,HWND,a,WORD,b)
 Fb(WORD,LocalShrink,HANDLE,a,WORD,b)
 Fb(WORD,MapVirtualKey,WORD,a,WORD,b)
 Fb(WORD,SetSystemPaletteUse,HDC,a,WORD,b)
@@ -1349,7 +1788,7 @@
 Fb(short,SetTextCharacterExtra,HDC,a,short,b)
 Fb(void,ClientToScreen,HWND,a,LPPOINT,b)
 Fb(void,DrawFocusRect,HDC,a,LPRECT,b)
-Fb(void,EndDialog,HWND,a,int,b)
+Fb(void,EndDialog,HWND,a,short,b)
 Fb(void,GetCodeInfo,FARPROC,lpProc,LPVOID,lpSegInfo)
 Fb(void,GetWindowRect,HWND,a,LPRECT,b)
 Fb(void,InvertRect,HDC,a,LPRECT,b)
@@ -1457,13 +1896,13 @@
 Fc(short,SetTextJustification,HDC,a,short,b,short,c)
 Fc(void,AdjustWindowRect,LPRECT,a,DWORD,b,BOOL,c)
 Fc(void,AnsiToOemBuff,LPSTR,a,LPSTR,b,int,c)
-Fc(void,CheckDlgButton,HWND,a,int,b,WORD,c)
+Fc(void,CheckDlgButton,HWND,a,WORD,b,WORD,c)
 Fc(void,InflateRect,LPRECT,a,short,b,short,c)
 Fc(void,InvalidateRect,HWND,a,LPRECT,b,BOOL,c)
 Fc(void,InvalidateRgn,HWND,a,HRGN,b,BOOL,c)
 Fc(void,OemToAnsiBuff,LPSTR,a,LPSTR,b,int,c)
 Fc(void,OffsetRect,LPRECT,a,short,b,short,c)
-Fc(void,SetDlgItemText,HWND,a,int,b,LPSTR,c)
+Fc(void,SetDlgItemText,HWND,a,WORD,b,LPSTR,c)
 Fc(void,SetSysColors,int,a,LPINT,b,COLORREF*,c)
 Fc(void,ShowScrollBar,HWND,a,WORD,b,BOOL,c)
 Fc(void,SwitchStackTo,WORD,a,WORD,b,WORD,c)
@@ -1490,12 +1929,12 @@
 Fd(HRGN,CreateEllipticRgn,short,a,short,b,short,c,short,d)
 Fd(HRGN,CreatePolyPolygonRgn,LPPOINT,a,LPINT,b,short,c,short,d)
 Fd(HRGN,CreateRectRgn,short,a,short,b,short,c,short,d)
-Fd(HWND,CreateDialog,HANDLE,a,LPSTR,b,HWND,c,FARPROC,d)
-Fd(HWND,CreateDialogIndirect,HANDLE,a,LPSTR,b,HWND,c,FARPROC,d)
+Fd(HWND,CreateDialog,HANDLE,a,LPCSTR,b,HWND,c,FARPROC,d)
+Fd(HWND,CreateDialogIndirect,HANDLE,a,LPCSTR,b,HWND,c,FARPROC,d)
 Fd(LONG,DefDlgProc,HWND,a,WORD,b,WORD,c,LONG,d)
 Fd(LONG,DefMDIChildProc,HWND,a,WORD,b,WORD,c,LONG,d)
 Fd(LONG,DefWindowProc,HWND,a,WORD,b,WORD,c,LONG,d)
-Fd(WORD,GetDlgItemInt,HWND,a,int,b,BOOL FAR*,c,BOOL,d)
+Fd(WORD,GetDlgItemInt,HWND,a,WORD,b,BOOL FAR*,c,BOOL,d)
 Fd(WORD,GetPaletteEntries,HPALETTE,a,WORD,b,WORD,c,LPPALETTEENTRY,d)
 Fd(WORD,GetPrivateProfileInt,LPSTR,a,LPSTR,b,short,c,LPSTR,d)
 Fd(WORD,GetSystemPaletteEntries,HDC,a,WORD,b,WORD,c,LPPALETTEENTRY,d)
@@ -1508,11 +1947,11 @@
 Fd(BOOL,OffsetViewportOrgEx,HDC,a,short,b,short,c,LPPOINT,d)
 Fd(BOOL,OffsetWindowOrgEx,HDC,a,short,b,short,c,LPPOINT,d)
 Fd(int,CombineRgn,HRGN,a,HRGN,b,HRGN,c,short,d)
-Fd(int,DialogBox,HANDLE,a,LPSTR,b,HWND,c,FARPROC,d)
+Fd(int,DialogBox,HINSTANCE,a,LPCSTR,b,HWND,c,FARPROC,d)
 Fd(int,DialogBoxIndirect,HANDLE,a,HANDLE,b,HWND,c,FARPROC,d)
 Fd(int,EnumFonts,HDC,a,LPSTR,b,FARPROC,c,LPSTR,d)
 Fd(int,EnumObjects,HDC,a,int,b,FARPROC,c,LPSTR,d)
-Fd(int,GetDlgItemText,HWND,a,int,b,LPSTR,c,int,d)
+Fd(int,GetDlgItemText,HWND,a,WORD,b,LPSTR,c,WORD,d)
 Fd(int,GetTempFileName,BYTE,a,LPSTR,b,WORD,c,LPSTR,d)
 Fd(int,LoadString,HANDLE,a,WORD,b,LPSTR,c,int,d)
 Fd(int,MessageBox,HWND,a,LPSTR,b,LPSTR,c,WORD,d)
@@ -1520,12 +1959,12 @@
 Fd(int,SetVoiceNote,int,a,int,b,int,c,int,d)
 Fd(void,AdjustWindowRectEx,LPRECT,a,LONG,b,BOOL,c,DWORD,d)
 Fd(void,AnimatePalette,HPALETTE,a,WORD,b,WORD,c,LPPALETTEENTRY,d)
-Fd(void,CheckRadioButton,HWND,a,int,b,int,c,int,d)
+Fd(void,CheckRadioButton,HWND,a,WORD,b,WORD,c,WORD,d)
 Fd(void,CreateCaret,HWND,a,HBITMAP,b,int,c,int,d)
 Fd(void,FillWindow,HWND,a,HWND,b,HDC,c,HBRUSH,d)
 Fd(void,GetScrollRange,HWND,a,int,b,LPINT,c,LPINT,d)
 Fd(void,PlayMetaFileRecord,HDC,a,LPHANDLETABLE,b,LPMETARECORD,c,WORD,d)
-Fd(void,SetDlgItemInt,HWND,a,int,b,WORD,c,BOOL,d)
+Fd(void,SetDlgItemInt,HWND,a,WORD,b,WORD,c,BOOL,d)
 Fe(BOOL,Rectangle,HDC,a,int,xLeft,int,yTop,int,xRight,int,yBottom)
 Fe(int,DrawText,HDC,a,LPSTR,str,int,c,LPRECT,d,WORD,flag)
 Fe(BOOL,PeekMessage,LPMSG,a,HWND,b,WORD,c,WORD,d,WORD,e)
@@ -1542,10 +1981,10 @@
 Fe(DWORD,ScaleViewportExt,HDC,a,short,b,short,c,short,d,short,e)
 Fe(DWORD,ScaleWindowExt,HDC,a,short,b,short,c,short,d,short,e)
 Fe(HBITMAP,CreateBitmap,short,a,short,b,BYTE,c,BYTE,d,LPSTR,e)
-Fe(HWND,CreateDialogIndirectParam,HANDLE,a,LPSTR,b,HWND,c,FARPROC,d,LONG,e)
-Fe(HWND,CreateDialogParam,HANDLE,a,LPSTR,b,HWND,c,FARPROC,d,LONG,e)
+Fe(HWND,CreateDialogIndirectParam,HANDLE,a,LPCSTR,b,HWND,c,FARPROC,d,LPARAM,e)
+Fe(HWND,CreateDialogParam,HANDLE,a,LPCSTR,b,HWND,c,FARPROC,d,LPARAM,e)
 Fe(LONG,DefFrameProc,HWND,a,HWND,b,WORD,c,WORD,d,LONG,e)
-Fe(LONG,SendDlgItemMessage,HWND,a,int,b,WORD,c,WORD,d,LONG,e)
+Fe(LONG,SendDlgItemMessage,HWND,a,WORD,b,WORD,c,WORD,d,LONG,e)
 Fe(int,DialogBoxIndirectParam,HANDLE,a,HANDLE,b,HWND,c,FARPROC,d,LONG,e)
 Fe(int,DialogBoxParam,HANDLE,a,LPSTR,b,HWND,c,FARPROC,d,LONG,e)
 Fe(int,DlgDirList,HWND,a,LPSTR,b,int,c,int,d,WORD,e)
@@ -1579,7 +2018,7 @@
 Fg(HICON,CreateIcon,HANDLE,a,int,b,int,c,BYTE,d,BYTE,e,LPSTR,f,LPSTR,g)
 Fg(int,GetDIBits,HDC,a,HANDLE,a2,WORD,b,WORD,c,LPSTR,d,LPBITMAPINFO,e,WORD,f)
 Fg(int,SetDIBits,HDC,a,HANDLE,a2,WORD,b,WORD,c,LPSTR,d,LPBITMAPINFO,e,WORD,f)
-Fg(void,SetWindowPos,HWND,a,HWND,b,int,c,int,d,int,e,int,f,WORD,g)
+Fg(void,SetWindowPos,HWND,a,HWND,b,short,c,short,d,short,e,short,f,WORD,g)
 Fh(BOOL,ExtTextOut,HDC,a,int,b,int,c,WORD,d,LPRECT,e,LPSTR,f,WORD,g,LPINT,h)
 Fh(HANDLE,DeferWindowPos,HANDLE,hWinPosInfo,HWND,hWnd,HWND,hWndInsertAfter,int,x,int,y,int,cx,int,cy,WORD,wFlags)
 Fh(LONG,TabbedTextOut,HDC,a,int,b,int,c,LPSTR,d,int,e,int,f,LPINT,g,int,h)
diff --git a/include/wine.h b/include/wine.h
index afe11d6..6a602e9 100644
--- a/include/wine.h
+++ b/include/wine.h
@@ -22,5 +22,40 @@
 
 extern char *GetFilenameFromInstance(unsigned short instance);
 extern struct w_files *GetFileInfo(unsigned short instance);
-
+extern char *FindFileInPath(char *buffer, int buflen, char *rootname, 
+			    char **extensions, char *path);
+extern char *GetSystemIniFilename(void);
+#ifdef linux
+struct sigcontext_struct {
+	unsigned short sc_gs, __gsh;
+	unsigned short sc_fs, __fsh;
+	unsigned short sc_es, __esh;
+	unsigned short sc_ds, __dsh;
+	unsigned long sc_edi;
+	unsigned long sc_esi;
+	unsigned long sc_ebp;
+	unsigned long sc_esp;
+	unsigned long sc_ebx;
+	unsigned long sc_edx;
+	unsigned long sc_ecx;
+	unsigned long sc_eax;
+	unsigned long sc_trapno;
+	unsigned long sc_err;
+	unsigned long sc_eip;
+	unsigned short sc_cs, __csh;
+	unsigned long sc_efl;
+	unsigned long esp_at_signal;
+	unsigned short sc_ss, __ssh;
+	unsigned long i387;
+	unsigned long oldmask;
+	unsigned long cr2;
+};
 #endif
+
+#ifdef __NetBSD__
+#include <signal.h>
+#define sigcontext_struct sigcontext
+#define HZ 100
+#endif
+
+#endif /* WINE_H */