Renamed wintypes.h to windef.h.

diff --git a/console/tty.c b/console/tty.c
index 7898caa..2ae49dd 100644
--- a/console/tty.c
+++ b/console/tty.c
@@ -13,7 +13,7 @@
 #include <stdio.h>
 #include "console.h"
 #include "config.h"
-#include "wintypes.h" /* FALSE */
+#include "windef.h"
 void TTY_Start()
 {
    /* This should be the root driver so we can ignore anything
diff --git a/debugger/editline.c b/debugger/editline.c
index 24c76ce..de6f90a 100644
--- a/debugger/editline.c
+++ b/debugger/editline.c
@@ -33,7 +33,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#include "wintypes.h"
+#include "windef.h"
 
 /*
 **  Manifest constants.
diff --git a/dlls/advapi32/advapi.c b/dlls/advapi32/advapi.c
index f48f9f1..da84723 100644
--- a/dlls/advapi32/advapi.c
+++ b/dlls/advapi32/advapi.c
@@ -7,7 +7,7 @@
 #include <unistd.h>
 #include <string.h>
 
-#include "wintypes.h"
+#include "windef.h"
 #include "winerror.h"
 #include "wine/winestring.h"
 #include "heap.h"
diff --git a/dlls/advapi32/crypt.c b/dlls/advapi32/crypt.c
index 9174c1f..11c25385 100644
--- a/dlls/advapi32/crypt.c
+++ b/dlls/advapi32/crypt.c
@@ -1,7 +1,7 @@
 /*
  * dlls/advapi32/crypt.c
  */
-#include "wintypes.h"
+#include "windef.h"
 #include "winerror.h"
 #include "wincrypt.h"
 #include "debug.h"
diff --git a/dlls/advapi32/eventlog.c b/dlls/advapi32/eventlog.c
index e313ed5..f0205de 100644
--- a/dlls/advapi32/eventlog.c
+++ b/dlls/advapi32/eventlog.c
@@ -4,7 +4,7 @@
  * Copyright 1995 Sven Verdoolaege, 1998 Juergen Schmied
  */
 
-#include "wintypes.h"
+#include "windef.h"
 #include "winreg.h"
 #include "winerror.h"
 #include "heap.h"
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
index ac41c5e..d8501fe 100644
--- a/dlls/advapi32/security.c
+++ b/dlls/advapi32/security.c
@@ -4,7 +4,7 @@
  */
 #include <string.h>
 
-#include "wintypes.h"
+#include "windef.h"
 #include "winreg.h"
 #include "winerror.h"
 #include "heap.h"
diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c
index 1d5c373..849522b 100644
--- a/dlls/advapi32/service.c
+++ b/dlls/advapi32/service.c
@@ -5,7 +5,7 @@
  */
 
 #include <time.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "winreg.h"
 #include "winerror.h"
 #include "heap.h"
diff --git a/dlls/imagehlp/access.c b/dlls/imagehlp/access.c
index 30c44fa..73ca4d7 100644
--- a/dlls/imagehlp/access.c
+++ b/dlls/imagehlp/access.c
@@ -7,7 +7,7 @@
 #include "winbase.h"
 #include "winnt.h"
 #include "winerror.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "heap.h"
 #include "debug.h"
 #include "imagehlp.h"
diff --git a/dlls/imagehlp/debug.c b/dlls/imagehlp/debug.c
index 5e7a5ed..5d7e829 100644
--- a/dlls/imagehlp/debug.c
+++ b/dlls/imagehlp/debug.c
@@ -6,7 +6,7 @@
 
 #include "winerror.h"
 #include "winbase.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "debug.h"
 #include "imagehlp.h"
 
diff --git a/dlls/imagehlp/imagehlp_main.c b/dlls/imagehlp/imagehlp_main.c
index 2542e84..387028f 100644
--- a/dlls/imagehlp/imagehlp_main.c
+++ b/dlls/imagehlp/imagehlp_main.c
@@ -7,7 +7,7 @@
 #include "imagehlp.h"
 #include "winerror.h"
 #include "winbase.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "debug.h"
 
 /**********************************************************************/
diff --git a/dlls/imagehlp/integrity.c b/dlls/imagehlp/integrity.c
index ef5126f..d92d3f9 100644
--- a/dlls/imagehlp/integrity.c
+++ b/dlls/imagehlp/integrity.c
@@ -4,7 +4,7 @@
  *	Copyright 1998	Patrik Stridvall
  */
 
-#include "wintypes.h"
+#include "windef.h"
 #include "winbase.h"
 #include "winerror.h"
 #include "imagehlp.h"
diff --git a/dlls/imagehlp/internal.c b/dlls/imagehlp/internal.c
index 4ac428d..0cfa33c 100644
--- a/dlls/imagehlp/internal.c
+++ b/dlls/imagehlp/internal.c
@@ -6,7 +6,7 @@
 
 #include "winbase.h"
 #include "winerror.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "debug.h"
 #include "imagehlp.h"
 
diff --git a/dlls/imagehlp/modify.c b/dlls/imagehlp/modify.c
index 8c87d39..4e21a41 100644
--- a/dlls/imagehlp/modify.c
+++ b/dlls/imagehlp/modify.c
@@ -6,7 +6,7 @@
 
 #include "winbase.h"
 #include "winerror.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "debug.h"
 #include "imagehlp.h"
 
diff --git a/dlls/imagehlp/symbol.c b/dlls/imagehlp/symbol.c
index 80d79a7..ddcb0ea 100644
--- a/dlls/imagehlp/symbol.c
+++ b/dlls/imagehlp/symbol.c
@@ -6,7 +6,7 @@
 
 #include "winbase.h"
 #include "winerror.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "debug.h"
 #include "imagehlp.h"
 
diff --git a/dlls/msacm32/builtin.c b/dlls/msacm32/builtin.c
index 0981ef7..defe2ce 100644
--- a/dlls/msacm32/builtin.c
+++ b/dlls/msacm32/builtin.c
@@ -6,7 +6,7 @@
 
 #include "winbase.h"
 #include "winerror.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "debug.h"
 #include "driver.h"
 #include "heap.h"
diff --git a/dlls/msacm32/driver.c b/dlls/msacm32/driver.c
index 9917314..0843a05 100644
--- a/dlls/msacm32/driver.c
+++ b/dlls/msacm32/driver.c
@@ -6,7 +6,7 @@
 
 #include "winbase.h"
 #include "winerror.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "winuser.h"
 #include "debug.h"
 #include "driver.h"
diff --git a/dlls/msacm32/format.c b/dlls/msacm32/format.c
index 74e0a1a..1dc04ab 100644
--- a/dlls/msacm32/format.c
+++ b/dlls/msacm32/format.c
@@ -6,7 +6,7 @@
 
 #include "winbase.h"
 #include "winerror.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "debug.h"
 #include "mmsystem.h"
 #include "msacm.h"
diff --git a/dlls/msacm32/msacm32_main.c b/dlls/msacm32/msacm32_main.c
index 7d9a818..739f3ca 100644
--- a/dlls/msacm32/msacm32_main.c
+++ b/dlls/msacm32/msacm32_main.c
@@ -6,7 +6,7 @@
 
 #include "winbase.h"
 #include "winerror.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "debug.h"
 #include "msacm.h"
 #include "msacmdrv.h"
diff --git a/dlls/msacm32/stream.c b/dlls/msacm32/stream.c
index 760e3a8..125882f 100644
--- a/dlls/msacm32/stream.c
+++ b/dlls/msacm32/stream.c
@@ -6,7 +6,7 @@
 
 #include "winbase.h"
 #include "winerror.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "debug.h"
 #include "mmsystem.h"
 #include "msacm.h"
diff --git a/dlls/psapi/psapi_main.c b/dlls/psapi/psapi_main.c
index e2c4152..5deae7c 100644
--- a/dlls/psapi/psapi_main.c
+++ b/dlls/psapi/psapi_main.c
@@ -5,7 +5,7 @@
  */
 
 #include "winbase.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "winerror.h"
 #include "debug.h"
 #include "psapi.h"
diff --git a/dlls/rasapi32/rasapi.c b/dlls/rasapi32/rasapi.c
index df89ef6..5e01c8a 100644
--- a/dlls/rasapi32/rasapi.c
+++ b/dlls/rasapi32/rasapi.c
@@ -4,7 +4,7 @@
  * Copyright 1998 Marcus Meissner
  */
 
-#include "wintypes.h"
+#include "windef.h"
 #include "ras.h"
 #include "debug.h"
 
diff --git a/dlls/tapi32/assisted.c b/dlls/tapi32/assisted.c
index 429e4a3..dd7d8d2 100644
--- a/dlls/tapi32/assisted.c
+++ b/dlls/tapi32/assisted.c
@@ -5,7 +5,7 @@
  */
 
 #include "winbase.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "tapi.h"
 #include "debug.h"
 
diff --git a/dlls/tapi32/line.c b/dlls/tapi32/line.c
index 8219052..fd6d4b8 100644
--- a/dlls/tapi32/line.c
+++ b/dlls/tapi32/line.c
@@ -8,7 +8,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include "winbase.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "tapi.h"
 #include "debug.h"
 
diff --git a/dlls/tapi32/phone.c b/dlls/tapi32/phone.c
index 0a92cbf..64a5946 100644
--- a/dlls/tapi32/phone.c
+++ b/dlls/tapi32/phone.c
@@ -5,7 +5,7 @@
  */
 
 #include "winbase.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "tapi.h"
 #include "debug.h"
 
diff --git a/files/async.c b/files/async.c
index 9a6d7ba..0a7c06c 100644
--- a/files/async.c
+++ b/files/async.c
@@ -35,7 +35,7 @@
 #endif
 
 #include "xmalloc.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "miscemu.h"
 #include "selectors.h"
 #include "sig_context.h"
diff --git a/graphics/d3dcommon.c b/graphics/d3dcommon.c
index 47cbb1c..007b53e 100644
--- a/graphics/d3dcommon.c
+++ b/graphics/d3dcommon.c
@@ -4,7 +4,7 @@
    This file contains all common miscellaneous code that spans
    different 'objects' */
 
-#include "wintypes.h"
+#include "windef.h"
 #include "wine/obj_base.h"
 #include "ddraw.h"
 #include "d3d.h"
diff --git a/graphics/d3ddevices.c b/graphics/d3ddevices.c
index 355cfb3..4626a17 100644
--- a/graphics/d3ddevices.c
+++ b/graphics/d3ddevices.c
@@ -6,7 +6,7 @@
 
 #include <string.h>
 #include "config.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "winerror.h"
 #include "wine/obj_base.h"
 #include "heap.h"
diff --git a/graphics/d3dexecutebuffer.c b/graphics/d3dexecutebuffer.c
index a175ae5..0b3d21e 100644
--- a/graphics/d3dexecutebuffer.c
+++ b/graphics/d3dexecutebuffer.c
@@ -6,7 +6,7 @@
 
 #include <string.h>
 #include "config.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "winerror.h"
 #include "wine/obj_base.h"
 #include "heap.h"
diff --git a/graphics/d3dlight.c b/graphics/d3dlight.c
index e3099b8..7b19e25 100644
--- a/graphics/d3dlight.c
+++ b/graphics/d3dlight.c
@@ -5,7 +5,7 @@
 
 
 #include "config.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "winerror.h"
 #include "wine/obj_base.h"
 #include "heap.h"
diff --git a/graphics/d3dmaterial.c b/graphics/d3dmaterial.c
index b757fba..50f9b2a 100644
--- a/graphics/d3dmaterial.c
+++ b/graphics/d3dmaterial.c
@@ -4,7 +4,7 @@
    This files contains the implementation of Direct3DMaterial2. */
 
 #include "config.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "winerror.h"
 #include "wine/obj_base.h"
 #include "heap.h"
diff --git a/graphics/d3dtexture.c b/graphics/d3dtexture.c
index c5ca901..ee22e11 100644
--- a/graphics/d3dtexture.c
+++ b/graphics/d3dtexture.c
@@ -6,7 +6,7 @@
 
 #include <string.h>
 #include "config.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "winerror.h"
 #include "wine/obj_base.h"
 #include "heap.h"
diff --git a/graphics/d3dviewport.c b/graphics/d3dviewport.c
index 5582e4f..393cdd7 100644
--- a/graphics/d3dviewport.c
+++ b/graphics/d3dviewport.c
@@ -4,7 +4,7 @@
    This files contains the implementation of Direct3DViewport2. */
 
 #include "config.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "winerror.h"
 #include "wine/obj_base.h"
 #include "heap.h"
diff --git a/graphics/ddraw.c b/graphics/ddraw.c
index 625cd8b..531019d 100644
--- a/graphics/ddraw.c
+++ b/graphics/ddraw.c
@@ -4253,7 +4253,7 @@
 
 #else /* !defined(X_DISPLAY_MISSING) */
 
-#include "wintypes.h"
+#include "windef.h"
 
 #define DD_OK 0
 
diff --git a/graphics/wing.c b/graphics/wing.c
index f044cd9..b6e1404 100644
--- a/graphics/wing.c
+++ b/graphics/wing.c
@@ -25,7 +25,7 @@
 #include "heap.h"
 #include "selectors.h"
 #include "monitor.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "xmalloc.h"
 
 typedef enum WING_DITHER_TYPE
diff --git a/graphics/x11drv/dib.c b/graphics/x11drv/dib.c
index c639f56..53d72d9 100644
--- a/graphics/x11drv/dib.c
+++ b/graphics/x11drv/dib.c
@@ -11,7 +11,7 @@
 #include "ts_xlib.h"
 #include "ts_xutil.h"
 
-#include "wintypes.h"
+#include "windef.h"
 #include "bitmap.h"
 #include "x11drv.h"
 #include "debug.h"
diff --git a/graphics/x11drv/text.c b/graphics/x11drv/text.c
index 7c3f7db..9120fcc 100644
--- a/graphics/x11drv/text.c
+++ b/graphics/x11drv/text.c
@@ -12,7 +12,7 @@
 #include "ts_xlib.h"
 
 #include <stdlib.h>
-#include "wintypes.h"
+#include "windef.h"
 #include <math.h>
 #include "dc.h"
 #include "gdi.h"
diff --git a/if1632/dummy.c b/if1632/dummy.c
index 8b0818b..dd200d0 100644
--- a/if1632/dummy.c
+++ b/if1632/dummy.c
@@ -2,7 +2,7 @@
  * Dummy function definitions
  */
 
-#include "wintypes.h"
+#include "windef.h"
 #include "debug.h"
 
 long WINAPI stub_GDI_379(HDC16 hdc) { FIXME(relay, "STARTPAGE: stub\n"); return 1; }
diff --git a/include/cache.h b/include/cache.h
index 32d52dd..d8537e5 100644
--- a/include/cache.h
+++ b/include/cache.h
@@ -9,7 +9,7 @@
 #ifndef __WINE_CACHE_H
 #define __WINE_CACHE_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 HBRUSH  CACHE_GetPattern55AABrush(void);
 HBITMAP CACHE_GetPattern55AABitmap(void);
diff --git a/include/callback.h b/include/callback.h
index 066e3edb..af0b4e7 100644
--- a/include/callback.h
+++ b/include/callback.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_CALLBACK_H
 #define __WINE_CALLBACK_H
 
-#include "wintypes.h"
+#include "windef.h"
 #include "winnt.h"
 #include "wine/winuser16.h"
 
diff --git a/include/cdrom.h b/include/cdrom.h
index dcec85b..3374f2f 100644
--- a/include/cdrom.h
+++ b/include/cdrom.h
@@ -11,7 +11,7 @@
 
 #include <stdlib.h>
 #include <unistd.h>
-#include "wintypes.h"
+#include "windef.h"
 
 #ifdef HAVE_LINUX_CDROM_H
 # include <linux/cdrom.h>
diff --git a/include/class.h b/include/class.h
index 8fac41c..ca6bb48 100644
--- a/include/class.h
+++ b/include/class.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_CLASS_H
 #define __WINE_CLASS_H
 
-#include "wintypes.h"
+#include "windef.h"
 #include "winproc.h"
 
 #define CLASS_MAGIC   ('C' | ('L' << 8) | ('A' << 16) | ('S' << 24))
diff --git a/include/clipboard.h b/include/clipboard.h
index f17b467..7d0c282 100644
--- a/include/clipboard.h
+++ b/include/clipboard.h
@@ -2,7 +2,7 @@
 #define __WINE_CLIPBOARD_H
 
 #include "win.h"
-#include "wintypes.h"
+#include "windef.h"
 
 typedef struct tagWINE_CLIPFORMAT {
     WORD	wFormatID;
diff --git a/include/commctrl.h b/include/commctrl.h
index cb78489..ce6e65e 100644
--- a/include/commctrl.h
+++ b/include/commctrl.h
@@ -5,7 +5,7 @@
 #ifndef __WINE_COMMCTRL_H
 #define __WINE_COMMCTRL_H
 
-#include "wintypes.h"
+#include "windef.h"
 #include "winuser.h"
 #include "imagelist.h"
 
diff --git a/include/commdlg.h b/include/commdlg.h
index 6a89c71..4d1b162 100644
--- a/include/commdlg.h
+++ b/include/commdlg.h
@@ -9,7 +9,7 @@
 extern "C" {
 #endif
 
-#include "wintypes.h"		/* needed for CHOOSEFONT structure */
+#include "windef.h"		/* needed for CHOOSEFONT structure */
 #include "winuser.h"
 
 #define OFN_READONLY                 0x00000001
diff --git a/include/cursoricon.h b/include/cursoricon.h
index 2373295..b594df4 100644
--- a/include/cursoricon.h
+++ b/include/cursoricon.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_CURSORICON_H
 #define __WINE_CURSORICON_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 #pragma pack(1)
 
diff --git a/include/dde.h b/include/dde.h
index 72d250c..5e0d7aa 100644
--- a/include/dde.h
+++ b/include/dde.h
@@ -11,7 +11,7 @@
 #ifndef __WINE_DDE_H
 #define __WINE_DDE_H
 
-#include "wintypes.h"
+#include "windef.h"
 #include "dde_proc.h"
 
 #define WM_DDE_INITIATE   0x3E0
diff --git a/include/dde_atom.h b/include/dde_atom.h
index 243dae4..3c6075f 100644
--- a/include/dde_atom.h
+++ b/include/dde_atom.h
@@ -12,7 +12,7 @@
 
 #ifdef CONFIG_IPC
 
-#include "wintypes.h"
+#include "windef.h"
 
 #define DDE_ATOMS 157		   /* a prime number for hashing */
 
diff --git a/include/dde_mem.h b/include/dde_mem.h
index 09b382a..5a16237 100644
--- a/include/dde_mem.h
+++ b/include/dde_mem.h
@@ -12,7 +12,7 @@
 
 #ifdef CONFIG_IPC
 
-#include "wintypes.h"
+#include "windef.h"
 #include "global.h"
 #include "shm_block.h"
 
diff --git a/include/dde_proc.h b/include/dde_proc.h
index 84697cf..827298a 100644
--- a/include/dde_proc.h
+++ b/include/dde_proc.h
@@ -13,7 +13,7 @@
 #ifdef CONFIG_IPC
 
 #include <setjmp.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "windows.h"
 #define DDE_PROCS 64
 #define DDE_WINDOWS 64
diff --git a/include/ddeml.h b/include/ddeml.h
index 0de1c6c..091bdc1 100644
--- a/include/ddeml.h
+++ b/include/ddeml.h
@@ -8,7 +8,7 @@
 #ifndef __WINE__DDEML_H
 #define __WINE__DDEML_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 /* Codepage Constants
  */
diff --git a/include/debugger.h b/include/debugger.h
index 602f25c..82c7531 100644
--- a/include/debugger.h
+++ b/include/debugger.h
@@ -8,7 +8,7 @@
 #define __WINE_DEBUGGER_H
 
 #include <sys/types.h> /* u_long ... */
-#include "wintypes.h"
+#include "windef.h"
 #include "sig_context.h"
 #include "miscemu.h"
 
diff --git a/include/debugstr.h b/include/debugstr.h
index 4483283..599d8ca 100644
--- a/include/debugstr.h
+++ b/include/debugstr.h
@@ -1,7 +1,7 @@
 #ifndef __WINE_DEBUGSTR_H
 #define __WINE_DEBUGSTR_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 /* These function return a printable version of a string, including
    quotes.  The string will be valid for some time, but not indefinitely
diff --git a/include/desktop.h b/include/desktop.h
index 09acd3d..e049562 100644
--- a/include/desktop.h
+++ b/include/desktop.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_DESKTOP_H
 #define __WINE_DESKTOP_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 struct tagMONITOR;
 
diff --git a/include/dinput.h b/include/dinput.h
index ebfb470..b1bfb44 100644
--- a/include/dinput.h
+++ b/include/dinput.h
@@ -2,7 +2,6 @@
 #define _WINE_DINPUT_H
 
 #include "windef.h" /* for MAX_PATH */
-#include "wintypes.h"
 #include "unknwn.h"
 #include "mouse.h"
 
diff --git a/include/drive.h b/include/drive.h
index f392c7d..891ae7e 100644
--- a/include/drive.h
+++ b/include/drive.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_DRIVE_H
 #define __WINE_DRIVE_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 #define MAX_DOS_DRIVES  26
 
diff --git a/include/gdi.h b/include/gdi.h
index 5ec178d..7406a32 100644
--- a/include/gdi.h
+++ b/include/gdi.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_GDI_H
 #define __WINE_GDI_H
 
-#include "wintypes.h"
+#include "windef.h"
 #include "wingdi.h"
 #include "ldt.h"
 #include "local.h"
diff --git a/include/global.h b/include/global.h
index 1a9ee66..aa93047 100644
--- a/include/global.h
+++ b/include/global.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_GLOBAL_H
 #define __WINE_GLOBAL_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 typedef struct
 {
diff --git a/include/hook.h b/include/hook.h
index b98786a..c31fbee 100644
--- a/include/hook.h
+++ b/include/hook.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_HOOK_H
 #define __WINE_HOOK_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 #define HOOK_WIN16	0x00
 #define HOOK_WIN32A	0x01
diff --git a/include/imagehlp.h b/include/imagehlp.h
index fc404b2..4f6077a 100644
--- a/include/imagehlp.h
+++ b/include/imagehlp.h
@@ -5,7 +5,6 @@
 #ifndef __WINE_IMAGEHLP_H
 #define __WINE_IMAGEHLP_H
 
-#include "wintypes.h"
 #include "windef.h"
 #include "winbase.h"
 
diff --git a/include/imm.h b/include/imm.h
index 187834c..5dba721 100644
--- a/include/imm.h
+++ b/include/imm.h
@@ -5,7 +5,7 @@
 #ifndef __WINE_IMM_H
 #define __WINE_IMM_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/include/instance.h b/include/instance.h
index 8eda721..324cbf2 100644
--- a/include/instance.h
+++ b/include/instance.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_INSTANCE_H
 #define __WINE_INSTANCE_H
 
-#include "wintypes.h"
+#include "windef.h"
 
   /* This structure is always located at offset 0 of the DGROUP segment */
 
diff --git a/include/keyboard.h b/include/keyboard.h
index 32891c9..8c249bc 100644
--- a/include/keyboard.h
+++ b/include/keyboard.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_KEYBOARD_H
 #define __WINE_KEYBOARD_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 #pragma pack(1)
 typedef struct _KBINFO
diff --git a/include/ldt.h b/include/ldt.h
index 1e9d7db..c6ae65c 100644
--- a/include/ldt.h
+++ b/include/ldt.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_LDT_H
 #define __WINE_LDT_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 enum seg_type
 {
diff --git a/include/libres.h b/include/libres.h
index 593b044..cc36ef5 100644
--- a/include/libres.h
+++ b/include/libres.h
@@ -4,7 +4,7 @@
 #ifndef __WINE_LIBRES_H
 #define __WINE_LIBRES_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 extern HRSRC LIBRES_FindResource( HINSTANCE hModule, LPCWSTR name, LPCWSTR type );
 extern HGLOBAL LIBRES_LoadResource( HINSTANCE hModule, HRSRC hRsrc );
diff --git a/include/local.h b/include/local.h
index 9073f8f..8aebd08 100644
--- a/include/local.h
+++ b/include/local.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_LOCAL_H
 #define __WINE_LOCAL_H
 
-#include "wintypes.h"
+#include "windef.h"
 
   /* These function are equivalent to the Local* API functions, */
   /* excepted that they need DS as the first parameter. This    */
diff --git a/include/lzexpand.h b/include/lzexpand.h
index 95b0a3e..3fbb284 100644
--- a/include/lzexpand.h
+++ b/include/lzexpand.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_LZEXPAND_H
 #define __WINE_LZEXPAND_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 #define LZERROR_BADINHANDLE	-1	/* -1 */
 #define LZERROR_BADOUTHANDLE	-2	/* -2 */
diff --git a/include/mapidefs.h b/include/mapidefs.h
index 082f5d6..b7c205c 100644
--- a/include/mapidefs.h
+++ b/include/mapidefs.h
@@ -1,7 +1,7 @@
 #ifndef __WINE_MAPIDEFS_H
 #define __WINE_MAPIDEFS_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 #ifndef _tagCY_DEFINED
 #define _tagCY_DEFINED
diff --git a/include/mdi.h b/include/mdi.h
index ee872cd..2ced23a 100644
--- a/include/mdi.h
+++ b/include/mdi.h
@@ -9,7 +9,7 @@
 #ifndef __WINE_MDI_H
 #define __WINE_MDI_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 #define MDI_MAXLISTLENGTH	0x40
 #define MDI_MAXTITLELENGTH	0xA1
diff --git a/include/mmreg.h b/include/mmreg.h
index d39bfd8..f6f6726 100644
--- a/include/mmreg.h
+++ b/include/mmreg.h
@@ -10,7 +10,7 @@
 #ifndef _ACM_WAVEFILTER
 #define _ACM_WAVEFILTER
 
-#include "wintypes.h"
+#include "windef.h"
 
 #define WAVE_FILTER_UNKNOWN     0x0000
 #define WAVE_FILTER_DEVELOPMENT 0xFFFF
diff --git a/include/mmsystem.h b/include/mmsystem.h
index c8e7f4d..0d89426 100644
--- a/include/mmsystem.h
+++ b/include/mmsystem.h
@@ -8,7 +8,7 @@
 #ifdef __cplusplus
 extern "C" {
 #endif 
-#include "wintypes.h"
+#include "windef.h"
 
 typedef LPSTR		    HPSTR;          /* a huge version of LPSTR */
 typedef LPCSTR			HPCSTR;         /* a huge version of LPCSTR */
diff --git a/include/module.h b/include/module.h
index f9719f4..f730cd7 100644
--- a/include/module.h
+++ b/include/module.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_MODULE_H
 #define __WINE_MODULE_H
 
-#include "wintypes.h"
+#include "windef.h"
 #include "dosexe.h"
 #include "pe_image.h"
 
diff --git a/include/msacm.h b/include/msacm.h
index f0fc2aa..5958a17 100644
--- a/include/msacm.h
+++ b/include/msacm.h
@@ -5,7 +5,7 @@
 #ifndef __WINE_MSACM_H
 #define __WINE_MSACM_H
 
-#include "wintypes.h"
+#include "windef.h"
 #include "driver.h"
 #include "mmsystem.h"
 #include "mmreg.h"
@@ -14,7 +14,7 @@
  * Types
  */
 
-/* FIXME: Move to wintypes.h */
+/* FIXME: Move to windef.h */
 #define DECLARE_HANDLE(a) \
 typedef HANDLE16 a##16; \
 typedef HANDLE a; \
@@ -28,7 +28,7 @@
 DECLARE_HANDLE(HACMSTREAM)
 DECLARE_HANDLE(HACMOBJ)
 
-/* FIXME: Remove when define moved to wintypes.h */
+/* FIXME: Remove when define moved to windef.h */
 #undef DECLARE_HANDLE
 
 /***********************************************************************
diff --git a/include/msacmdrv.h b/include/msacmdrv.h
index a756717..2e23a17 100644
--- a/include/msacmdrv.h
+++ b/include/msacmdrv.h
@@ -5,7 +5,7 @@
 #ifndef __WINE_MSACMDRV_H
 #define __WINE_MSACMDRV_H
 
-#include "wintypes.h"
+#include "windef.h"
 #include "msacm.h"
 
 /***********************************************************************
diff --git a/include/neexe.h b/include/neexe.h
index effdc5a..b90515b 100644
--- a/include/neexe.h
+++ b/include/neexe.h
@@ -4,7 +4,7 @@
 #ifndef __WINE_NEEXE_H
 #define __WINE_NEEXE_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 /*
  * Old MZ header for DOS programs.
diff --git a/include/ntdef.h b/include/ntdef.h
index 6a4a610..c42e4b7 100644
--- a/include/ntdef.h
+++ b/include/ntdef.h
@@ -2,7 +2,7 @@
 #define __WINE_NTDEF_H
 
 /* fixme: include basestd.h instead */
-#include "wintypes.h"
+#include "windef.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/include/ole2.h b/include/ole2.h
index e52fe3c..b7da0a2 100644
--- a/include/ole2.h
+++ b/include/ole2.h
@@ -5,7 +5,7 @@
 #ifndef __WINE_OLE2_H
 #define __WINE_OLE2_H
 
-#include "wintypes.h"
+#include "windef.h"
 #include "winerror.h"
 #include "oleidl.h"
 #include "oleauto.h"
diff --git a/include/olectl.h b/include/olectl.h
index 2196f8b..562b331 100644
--- a/include/olectl.h
+++ b/include/olectl.h
@@ -1,7 +1,7 @@
 #ifndef __WINE_OLECTL_H
 #define __WINE_OLECTL_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 #define WINOLECTLAPI INT WINAPI
 
diff --git a/include/options.h b/include/options.h
index 0ea2b95..ecb599d 100644
--- a/include/options.h
+++ b/include/options.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_OPTIONS_H
 #define __WINE_OPTIONS_H
 
-#include "wintypes.h"
+#include "windef.h"
 
   /* Supported languages */
   /* When adding a new language look at ole/ole2nls.c 
diff --git a/include/path.h b/include/path.h
index 3782f52..b1b31fb 100644
--- a/include/path.h
+++ b/include/path.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_PATH_H
 #define __WINE_PATH_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 /* It should not be necessary to access the contents of the GdiPath
  * structure directly; if you find that the exported functions don't
diff --git a/include/pe_image.h b/include/pe_image.h
index 1189421..2362792 100644
--- a/include/pe_image.h
+++ b/include/pe_image.h
@@ -1,7 +1,7 @@
 #ifndef __WINE_PE_IMAGE_H
 #define __WINE_PE_IMAGE_H
 
-#include "wintypes.h"
+#include "windef.h"
 #include "winbase.h"
 #include "peexe.h"
 /* modreference used for attached processes
diff --git a/include/peexe.h b/include/peexe.h
index a5bd2e3..422ccad 100644
--- a/include/peexe.h
+++ b/include/peexe.h
@@ -4,7 +4,7 @@
 #ifndef __WINE_PEEXE_H
 #define __WINE_PEEXE_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 typedef struct _IMAGE_FILE_HEADER {
 	WORD	Machine;			/* 00 */
diff --git a/include/process.h b/include/process.h
index d203810..c1834b7 100644
--- a/include/process.h
+++ b/include/process.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_PROCESS_H
 #define __WINE_PROCESS_H
 
-#include "wintypes.h"
+#include "windef.h"
 #include "module.h"
 
 struct _NE_MODULE;
diff --git a/include/progress.h b/include/progress.h
index 7a1a721..804541a 100644
--- a/include/progress.h
+++ b/include/progress.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_PROGRESS_H
 #define __WINE_PROGRESS_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 typedef struct
 {
diff --git a/include/queue.h b/include/queue.h
index 6cbdaad..ca04b7a 100644
--- a/include/queue.h
+++ b/include/queue.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_QUEUE_H
 #define __WINE_QUEUE_H
 
-#include "wintypes.h"
+#include "windef.h"
 #include "winuser.h"
 #include "thread.h"
 
diff --git a/include/ras.h b/include/ras.h
index c988984..cbd3e99 100644
--- a/include/ras.h
+++ b/include/ras.h
@@ -1,7 +1,7 @@
 #ifndef __WINE_RAS_H
 #define __WINE_RAS_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 #define RAS_MaxEntryName	256
 
diff --git a/include/resource.h b/include/resource.h
index e3bc00f..17e2256 100644
--- a/include/resource.h
+++ b/include/resource.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_RESOURCE_H
 #define __WINE_RESOURCE_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 #ifndef __WRC_RSC_H
 #include "wrc_rsc.h"
diff --git a/include/scroll.h b/include/scroll.h
index 0912ee8..9c7f88e 100644
--- a/include/scroll.h
+++ b/include/scroll.h
@@ -8,7 +8,7 @@
 #ifndef __WINE_SCROLL_H
 #define __WINE_SCROLL_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 typedef struct
 {
diff --git a/include/selectors.h b/include/selectors.h
index deb72ee..39a4ba4 100644
--- a/include/selectors.h
+++ b/include/selectors.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_SELECTORS_H
 #define __WINE_SELECTORS_H
 
-#include "wintypes.h"
+#include "windef.h"
 #include "ldt.h"
 
 extern WORD SELECTOR_AllocBlock( const void *base, DWORD size,
diff --git a/include/shell.h b/include/shell.h
index a18704e..6a1c18a 100644
--- a/include/shell.h
+++ b/include/shell.h
@@ -4,7 +4,6 @@
 #ifndef __WINE_SHELL_H
 #define __WINE_SHELL_H
 
-#include "wintypes.h"
 #include "windef.h"
 
 
diff --git a/include/shellapi.h b/include/shellapi.h
index e4d3caf..2f112b7 100644
--- a/include/shellapi.h
+++ b/include/shellapi.h
@@ -1,7 +1,7 @@
 #ifndef _WINE_SHELLAPI_H
 #define _WINE_SHELLAPI_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 HICON16     WINAPI ExtractIcon16(HINSTANCE16,LPCSTR,UINT16);
 HICON     WINAPI ExtractIconA(HINSTANCE,LPCSTR,UINT);
diff --git a/include/shlobj.h b/include/shlobj.h
index e5a61f4..217d278 100644
--- a/include/shlobj.h
+++ b/include/shlobj.h
@@ -1,7 +1,7 @@
 #ifndef __WINE_SHLOBJ_H
 #define __WINE_SHLOBJ_H
 
-#include "wintypes.h"
+#include "windef.h"
 #include "winbase.h"	/* WIN32_FIND_* */
 #include "wine/obj_base.h"
 #include "wine/obj_shelllink.h"
diff --git a/include/shm_block.h b/include/shm_block.h
index e8612d2..598c776 100644
--- a/include/shm_block.h
+++ b/include/shm_block.h
@@ -13,7 +13,7 @@
 #ifdef CONFIG_IPC
 
 #include <sys/shm.h>
-#include "wintypes.h"
+#include "windef.h"
 #define SEGSIZE                 0x10000 /* 64 */ 
 #define SHM_GRANULARITY         SEGSIZE
 #define SHM_MINBLOCK            SHM_GRANULARITY
diff --git a/include/spy.h b/include/spy.h
index b0bb7ee..6c71abd 100644
--- a/include/spy.h
+++ b/include/spy.h
@@ -5,7 +5,7 @@
 #ifndef __WINE_SPY_H
 #define __WINE_SPY_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 #define SPY_DISPATCHMESSAGE16     0x0100
 #define SPY_DISPATCHMESSAGE     0x0101
diff --git a/include/static.h b/include/static.h
index 817b5cb..2f5332e 100644
--- a/include/static.h
+++ b/include/static.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_STATIC_H
 #define __WINE_STATIC_H
 
-#include "wintypes.h"
+#include "windef.h"
 
   /* Extra info for STATIC windows */
 typedef struct
diff --git a/include/stress.h b/include/stress.h
index 6f955b6..e51f010 100644
--- a/include/stress.h
+++ b/include/stress.h
@@ -1,7 +1,7 @@
 #ifndef __WINE_STRESS_H
 #define __WINE_STRESS_H
 
-#include <wintypes.h>
+#include "windef.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/include/syslevel.h b/include/syslevel.h
index 3030183..e0fa1d7 100644
--- a/include/syslevel.h
+++ b/include/syslevel.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_SYSLEVEL_H
 #define __WINE_SYSLEVEL_H
 
-#include "wintypes.h"
+#include "windef.h"
 #include "winbase.h"
 
 extern WORD SYSLEVEL_Win16CurrentTeb;
diff --git a/include/sysmetrics.h b/include/sysmetrics.h
index e6265fa..376528a 100644
--- a/include/sysmetrics.h
+++ b/include/sysmetrics.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_SYSMETRICS_H
 #define __WINE_SYSMETRICS_H
 
-#include "wintypes.h"
+#include "windef.h"
   /* Constant system metrics */
 #if 0
 #ifdef WIN_95_LOOK
diff --git a/include/task.h b/include/task.h
index 906e03c..53bf161 100644
--- a/include/task.h
+++ b/include/task.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_TASK_H
 #define __WINE_TASK_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 #pragma pack(1)
 
diff --git a/include/tchar.h b/include/tchar.h
index d4472e1..35e0ee6 100644
--- a/include/tchar.h
+++ b/include/tchar.h
@@ -1,7 +1,7 @@
 #ifndef __WINE_TCHAR_H
 #define __WINE_TCHAR_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/include/tlhelp32.h b/include/tlhelp32.h
index b28d4cc..7c488d5 100644
--- a/include/tlhelp32.h
+++ b/include/tlhelp32.h
@@ -1,7 +1,7 @@
 #ifndef __WINE_TLHELP32_H
 #define __WINE_TLHELP32_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/include/ts_xf86vmode.h b/include/ts_xf86vmode.h
index 825c84f..0531d4c 100644
--- a/include/ts_xf86vmode.h
+++ b/include/ts_xf86vmode.h
@@ -13,7 +13,7 @@
 
 #ifndef X_DISPLAY_MISSING
 
-#include "wintypes.h"
+#include "windef.h"
 #ifdef HAVE_LIBXXF86VM
 #define XMD_H
 
diff --git a/include/ttydrv.h b/include/ttydrv.h
index 3a5e32b..5d47474 100644
--- a/include/ttydrv.h
+++ b/include/ttydrv.h
@@ -5,7 +5,7 @@
 #ifndef __WINE_TTYDRV_H
 #define __WINE_TTYDRV_H
 
-#include "wintypes.h"
+#include "windef.h"
 #include "wine/winuser16.h"
 
 struct tagCLASS;
diff --git a/include/tweak.h b/include/tweak.h
index b9c39c7..57528e0 100644
--- a/include/tweak.h
+++ b/include/tweak.h
@@ -9,7 +9,7 @@
 #if !defined(__WINE_TWEAK_H)
 #define __WINE_TWEAK_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 typedef enum
 {
diff --git a/include/updown.h b/include/updown.h
index 54444fd..ca042a1 100644
--- a/include/updown.h
+++ b/include/updown.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_UPDOWN_H
 #define __WINE_UPDOWN_H
 
-#include "wintypes.h"
+#include "windef.h"
 #include "commctrl.h"
 
 typedef struct
diff --git a/include/ver.h b/include/ver.h
index e09ec48..5d06dc6 100644
--- a/include/ver.h
+++ b/include/ver.h
@@ -5,7 +5,7 @@
 #ifndef __WINE_VER_H
 #define __WINE_VER_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 /* resource ids for different version infos */
 /* These are internal resources for win16, but simple numbers in win32 */
diff --git a/include/vfw.h b/include/vfw.h
index 83f1e4e..4138bac 100644
--- a/include/vfw.h
+++ b/include/vfw.h
@@ -1,7 +1,7 @@
 #ifndef __WINE_VFW_H
 #define __WINE_VFW_H
 
-#include "wintypes.h"
+#include "windef.h"
 #include "mmsystem.h"
 #include "wingdi.h"
 #include "wine/obj_base.h"
diff --git a/include/windef.h b/include/windef.h
index b9372ea..1b318ca 100644
--- a/include/windef.h
+++ b/include/windef.h
@@ -1,41 +1,500 @@
-#ifndef __INCLUDE_WINDEF_H
-#define __INCLUDE_WINDEF_H
-
-#include "wintypes.h"
-
-#pragma pack(1)
-
-#ifndef IN
-#define IN
-#endif
-
-#ifndef OUT
-#define OUT
-#endif
-
-#ifndef OPTIONAL
-#define OPTIONAL
-#endif
-
-/* FIXME: _MAX_PATH should be defined in stdlib.h and MAX_PATH in windef.h 
- * and mapiwin.h
+/*
+ * Basic types definitions
+ *
+ * Copyright 1996 Alexandre Julliard
  */
-#define MAX_PATH 260
+
+#ifndef __WINE_WINDEF_H
+#define __WINE_WINDEF_H
+
+#ifdef __WINE__
+# include "config.h"
+# undef UNICODE
+#endif  /* __WINE__ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Misc. constants. */
+
+#ifdef FALSE
+#undef FALSE
+#endif
+#define FALSE 0
+
+#ifdef TRUE
+#undef TRUE
+#endif
+#define TRUE  1
+
+#ifdef NULL
+#undef NULL
+#endif
+#define NULL  0
+
+/* Macros to map Winelib names to the correct implementation name */
+/* depending on __WINE__ and UNICODE macros.                      */
+/* Note that Winelib is purely Win32.                             */
+
+#ifdef __WINE__
+# define WINELIB_NAME_AW(func)   this_is_a_syntax_error this_is_a_syntax_error
+#else  /* __WINE__ */
+# ifdef UNICODE
+#  define WINELIB_NAME_AW(func) func##W
+# else
+#  define WINELIB_NAME_AW(func) func##A
+# endif  /* UNICODE */
+#endif  /* __WINE__ */
+
+#ifdef __WINE__
+# define DECL_WINELIB_TYPE_AW(type)  /* nothing */
+#else   /* __WINE__ */
+# define DECL_WINELIB_TYPE_AW(type)  typedef WINELIB_NAME_AW(type) type;
+#endif  /* __WINE__ */
+
+
+/* Calling conventions definitions */
+
+#ifdef __i386__
+# if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)
+#  define __stdcall __attribute__((__stdcall__))
+#  define __cdecl   __attribute__((__cdecl__))
+#  define __RESTORE_ES  __asm__ __volatile__("pushl %ds\n\tpopl %es")
+# else
+#  error You need gcc >= 2.7 to build Wine on a 386
+# endif  /* __GNUC__ */
+#else  /* __i386__ */
+# define __stdcall
+# define __cdecl
+# define __RESTORE_ES
+#endif  /* __i386__ */
+
+#define CALLBACK    __stdcall
+#define WINAPI      __stdcall
+#define APIPRIVATE  __stdcall
+#define PASCAL      __stdcall
+#define _pascal     __stdcall
+#define __export    __stdcall
+#define WINAPIV     __cdecl
+#define APIENTRY    WINAPI
+
+#define CONST       const
+
+/* Standard data types. These are the same for emulator and library. */
+
+typedef void            VOID;
+typedef short           INT16;
+typedef unsigned short  UINT16;
+typedef int             INT;
+typedef unsigned int    UINT;
+typedef unsigned short  WORD;
+typedef unsigned long   DWORD;
+typedef unsigned long   ULONG;
+typedef unsigned char   BYTE;
+typedef long            LONG;
+typedef short           SHORT;
+typedef unsigned short  USHORT;
+typedef char            CHAR;
+typedef unsigned char   UCHAR;
+/* Some systems might have wchar_t, but we really need 16 bit characters */
+typedef unsigned short  WCHAR;
+typedef unsigned short  BOOL16;
+typedef int             BOOL;
+typedef double          DATE;
+typedef long            LONG_PTR;
+typedef unsigned long   ULONG_PTR;
+typedef double          DOUBLE;
+typedef double          LONGLONG;
+typedef double          ULONGLONG;
+
+/* Integer types. These are the same for emulator and library. */
+
+typedef UINT16          HANDLE16;
+typedef UINT            HANDLE;
+typedef UINT16         *LPHANDLE16;
+typedef UINT           *LPHANDLE;
+typedef UINT16          WPARAM16;
+typedef UINT            WPARAM;
+typedef LONG            LPARAM;
+typedef LONG            HRESULT;
+typedef LONG            LRESULT;
+typedef WORD            ATOM;
+typedef WORD            CATCHBUF[9];
+typedef WORD           *LPCATCHBUF;
+typedef DWORD           ACCESS_MASK;
+typedef ACCESS_MASK     REGSAM;
+typedef HANDLE          HHOOK;
+typedef HANDLE          HKEY;
+typedef HANDLE          HMONITOR;
+typedef DWORD           LCID;
+typedef WORD            LANGID;
+typedef DWORD           LCTYPE;
+typedef float           FLOAT;
+typedef long long       __int64;
+
+/* Pointers types. These are the same for emulator and library. */
+/* winnt types */
+typedef VOID           *PVOID;
+typedef const void     *PCVOID;
+typedef CHAR           *PCHAR;
+typedef UCHAR          *PUCHAR;
+typedef BYTE           *PBYTE;
+typedef ULONG          *PULONG;
+typedef LONG           *PLONG;
+typedef DWORD          *PDWORD;
+/* common win32 types */
+typedef CHAR           *LPSTR;
+typedef CHAR           *PSTR;
+typedef const CHAR     *LPCSTR;
+typedef const CHAR     *PCSTR;
+typedef WCHAR          *LPWSTR;
+typedef WCHAR          *PWSTR;
+typedef const WCHAR    *LPCWSTR;
+typedef const WCHAR    *PCWSTR;
+typedef BYTE           *LPBYTE;
+typedef WORD           *LPWORD;
+typedef DWORD          *LPDWORD;
+typedef LONG           *LPLONG;
+typedef VOID           *LPVOID;
+typedef const VOID     *LPCVOID;
+typedef INT16          *LPINT16;
+typedef UINT16         *LPUINT16;
+typedef INT            *PINT;
+typedef INT            *LPINT;
+typedef UINT           *PUINT;
+typedef UINT           *LPUINT;
+typedef HKEY           *LPHKEY;
+typedef HKEY           *PHKEY;
+typedef FLOAT          *PFLOAT;
+typedef FLOAT          *LPFLOAT;
+typedef BOOL           *PBOOL;
+typedef BOOL           *LPBOOL;
+
+/* Special case: a segmented pointer is just a pointer in the user's code. */
+
+#ifdef __WINE__
+typedef DWORD SEGPTR;
+#else
+typedef void* SEGPTR;
+#endif /* __WINE__ */
+
+/* Handle types that exist both in Win16 and Win32. */
+
+#define DECLARE_HANDLE(a)  typedef HANDLE16 a##16; typedef HANDLE a
+DECLARE_HANDLE(HACCEL);
+DECLARE_HANDLE(HBITMAP);
+DECLARE_HANDLE(HBRUSH);
+DECLARE_HANDLE(HCOLORSPACE);
+DECLARE_HANDLE(HCURSOR);
+DECLARE_HANDLE(HDC);
+DECLARE_HANDLE(HDROP);
+DECLARE_HANDLE(HDRVR);
+DECLARE_HANDLE(HDWP);
+DECLARE_HANDLE(HENHMETAFILE);
+DECLARE_HANDLE(HFILE);
+DECLARE_HANDLE(HFONT);
+DECLARE_HANDLE(HGDIOBJ);
+DECLARE_HANDLE(HGLOBAL);
+DECLARE_HANDLE(HICON);
+DECLARE_HANDLE(HINSTANCE);
+DECLARE_HANDLE(HLOCAL);
+DECLARE_HANDLE(HMENU);
+DECLARE_HANDLE(HMETAFILE);
+DECLARE_HANDLE(HMIDI);
+DECLARE_HANDLE(HMIDIIN);
+DECLARE_HANDLE(HMIDIOUT);
+DECLARE_HANDLE(HMIDISTRM);
+DECLARE_HANDLE(HMIXER);
+DECLARE_HANDLE(HMIXEROBJ);
+DECLARE_HANDLE(HMMIO);
+DECLARE_HANDLE(HMODULE);
+DECLARE_HANDLE(HPALETTE);
+DECLARE_HANDLE(HPEN);
+DECLARE_HANDLE(HQUEUE);
+DECLARE_HANDLE(HRGN);
+DECLARE_HANDLE(HRSRC);
+DECLARE_HANDLE(HTASK);
+DECLARE_HANDLE(HWAVE);
+DECLARE_HANDLE(HWAVEIN);
+DECLARE_HANDLE(HWAVEOUT);
+DECLARE_HANDLE(HWINSTA);
+DECLARE_HANDLE(HDESK);
+DECLARE_HANDLE(HWND);
+DECLARE_HANDLE(HKL);
+DECLARE_HANDLE(HIC);
+DECLARE_HANDLE(HRASCONN);
+#undef DECLARE_HANDLE
+
+/* Callback function pointers types */
+
+typedef BOOL    (CALLBACK* DATEFMT_ENUMPROCA)(LPSTR);
+typedef BOOL    (CALLBACK* DATEFMT_ENUMPROCW)(LPWSTR);
+DECL_WINELIB_TYPE_AW(DATEFMT_ENUMPROC)
+typedef BOOL16  (CALLBACK *DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
+typedef BOOL    (CALLBACK *DLGPROC)(HWND,UINT,WPARAM,LPARAM);
+typedef LRESULT (CALLBACK *DRIVERPROC16)(DWORD,HDRVR16,UINT16,LPARAM,LPARAM);
+typedef LRESULT (CALLBACK *DRIVERPROC)(DWORD,HDRVR,UINT,LPARAM,LPARAM);
+typedef INT16   (CALLBACK *EDITWORDBREAKPROC16)(LPSTR,INT16,INT16,INT16);
+typedef INT     (CALLBACK *EDITWORDBREAKPROCA)(LPSTR,INT,INT,INT);
+typedef INT     (CALLBACK *EDITWORDBREAKPROCW)(LPWSTR,INT,INT,INT);
+DECL_WINELIB_TYPE_AW(EDITWORDBREAKPROC)
+typedef LRESULT (CALLBACK *FARPROC16)();
+typedef LRESULT (CALLBACK *FARPROC)();
+typedef INT16   (CALLBACK *PROC16)();
+typedef INT     (CALLBACK *PROC)();
+typedef INT16   (CALLBACK *GOBJENUMPROC16)(SEGPTR,LPARAM);
+typedef INT     (CALLBACK *GOBJENUMPROC)(LPVOID,LPARAM);
+typedef BOOL16  (CALLBACK *GRAYSTRINGPROC16)(HDC16,LPARAM,INT16);
+typedef BOOL    (CALLBACK *GRAYSTRINGPROC)(HDC,LPARAM,INT);
+typedef LRESULT (CALLBACK *HOOKPROC16)(INT16,WPARAM16,LPARAM);
+typedef LRESULT (CALLBACK *HOOKPROC)(INT,WPARAM,LPARAM);
+typedef VOID    (CALLBACK *LINEDDAPROC16)(INT16,INT16,LPARAM);
+typedef VOID    (CALLBACK *LINEDDAPROC)(INT,INT,LPARAM);
+typedef BOOL16  (CALLBACK *PROPENUMPROC16)(HWND16,SEGPTR,HANDLE16);
+typedef BOOL    (CALLBACK *PROPENUMPROCA)(HWND,LPCSTR,HANDLE);
+typedef BOOL    (CALLBACK *PROPENUMPROCW)(HWND,LPCWSTR,HANDLE);
+DECL_WINELIB_TYPE_AW(PROPENUMPROC)
+typedef BOOL    (CALLBACK *PROPENUMPROCEXA)(HWND,LPCSTR,HANDLE,LPARAM);
+typedef BOOL    (CALLBACK *PROPENUMPROCEXW)(HWND,LPCWSTR,HANDLE,LPARAM);
+DECL_WINELIB_TYPE_AW(PROPENUMPROCEX)
+typedef BOOL    (CALLBACK* TIMEFMT_ENUMPROCA)(LPSTR);
+typedef BOOL    (CALLBACK* TIMEFMT_ENUMPROCW)(LPWSTR);
+DECL_WINELIB_TYPE_AW(TIMEFMT_ENUMPROC)
+typedef VOID    (CALLBACK *TIMERPROC16)(HWND16,UINT16,UINT16,DWORD);
+typedef VOID    (CALLBACK *TIMERPROC)(HWND,UINT,UINT,DWORD);
+typedef LRESULT (CALLBACK *WNDENUMPROC16)(HWND16,LPARAM);
+typedef LRESULT (CALLBACK *WNDENUMPROC)(HWND,LPARAM);
+typedef LRESULT (CALLBACK *WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
+typedef LRESULT (CALLBACK *WNDPROC)(HWND,UINT,WPARAM,LPARAM);
+
+/* TCHAR data types definitions for Winelib. */
+/* These types are _not_ defined for the emulator, because they */
+/* depend on the UNICODE macro that only exists in user's code. */
+
+#ifndef __WINE__
+# ifdef UNICODE
+typedef WCHAR TCHAR;
+typedef LPWSTR LPTSTR;
+typedef LPCWSTR LPCTSTR;
+#define __TEXT(string) L##string /*probably wrong */
+# else  /* UNICODE */
+typedef CHAR TCHAR;
+typedef LPSTR LPTSTR;
+typedef LPCSTR LPCTSTR;
+#define __TEXT(string) string
+# endif /* UNICODE */
+#endif   /* __WINE__ */
+#define TEXT(quote) __TEXT(quote)
+
+/* Data types specific to the library. These do _not_ exist in the emulator. */
+
+
+
+/* Define some empty macros for compatibility with Windows code. */
+
+#ifndef __WINE__
+#define NEAR
+#define FAR
+#define _far
+#define _near
+#define IN
+#define OUT
+#define OPTIONAL
+#endif  /* __WINE__ */
+
+/* Macro for structure packing. */
+
+#ifdef __GNUC__
+#define WINE_PACKED __attribute__ ((packed))
+#define WINE_UNUSED __attribute__ ((unused))
+#else
+#define WINE_PACKED  /* nothing */
+#define WINE_UNUSED  /* nothing */
+#endif
+
+/* Macros to split words and longs. */
+
+#define LOBYTE(w)              ((BYTE)(WORD)(w))
+#define HIBYTE(w)              ((BYTE)((WORD)(w) >> 8))
+
+#define LOWORD(l)              ((WORD)(DWORD)(l))
+#define HIWORD(l)              ((WORD)((DWORD)(l) >> 16))
+
+#define SLOWORD(l)             ((INT16)(LONG)(l))
+#define SHIWORD(l)             ((INT16)((LONG)(l) >> 16))
+
+#define MAKEWORD(low,high)     ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8))
+#define MAKELONG(low,high)     ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))
+#define MAKELPARAM(low,high)   ((LPARAM)MAKELONG(low,high))
+#define MAKEWPARAM(low,high)   ((WPARAM)MAKELONG(low,high))
+#define MAKELRESULT(low,high)  ((LRESULT)MAKELONG(low,high))
+#define MAKEINTATOM(atom)      ((LPCSTR)MAKELONG((atom),0))
+
+#define SELECTOROF(ptr)     (HIWORD(ptr))
+#define OFFSETOF(ptr)       (LOWORD(ptr))
+
+/* Macros to access unaligned or wrong-endian WORDs and DWORDs. */
+/* Note: These macros are semantically broken, at least for wrc.  wrc
+   spits out data in the platform's current binary format, *not* in 
+   little-endian format.  These macros are used throughout the resource
+   code to load and store data to the resources.  Since it is unlikely 
+   that we'll ever be dealing with little-endian resource data, the 
+   byte-swapping nature of these macros has been disabled.  Rather than 
+   remove the use of these macros from the resource loading code, the
+   macros have simply been disabled.  In the future, someone may want 
+   to reactivate these macros for other purposes.  In that case, the
+   resource code will have to be modified to use different macros. */ 
+
+#if 1
+#define PUT_WORD(ptr,w)   (*(WORD *)(ptr) = (w))
+#define GET_WORD(ptr)     (*(WORD *)(ptr))
+#define PUT_DWORD(ptr,dw) (*(DWORD *)(ptr) = (dw))
+#define GET_DWORD(ptr)    (*(DWORD *)(ptr))
+#else
+#define PUT_WORD(ptr,w)   (*(BYTE *)(ptr) = LOBYTE(w), \
+                           *((BYTE *)(ptr) + 1) = HIBYTE(w))
+#define GET_WORD(ptr)     ((WORD)(*(BYTE *)(ptr) | \
+                                  (WORD)(*((BYTE *)(ptr)+1) << 8)))
+#define PUT_DWORD(ptr,dw) (PUT_WORD((ptr),LOWORD(dw)), \
+                           PUT_WORD((WORD *)(ptr)+1,HIWORD(dw)))
+#define GET_DWORD(ptr)    ((DWORD)(GET_WORD(ptr) | \
+                                   ((DWORD)GET_WORD((WORD *)(ptr)+1) << 16)))
+#endif  /* 1 */
+
+/* MIN and MAX macros */
+
+#ifdef MAX
+#undef MAX
+#endif
+#define MAX(a,b) (((a) > (b)) ? (a) : (b))
+
+#ifdef MIN
+#undef MIN
+#endif
+#define MIN(a,b) (((a) < (b)) ? (a) : (b))
+
+#define __max(a,b) MAX(a,b)
+#define __min(a,b) MIN(a,b)
+#define max(a,b)   MAX(a,b)
+#define min(a,b)   MIN(a,b)
+
+#define _MAX_PATH  260
+#define MAX_PATH   260
+#define _MAX_DRIVE 3
+#define _MAX_DIR   256
+#define _MAX_FNAME 255
+#define _MAX_EXT   256
 
 #define HFILE_ERROR16   ((HFILE16)-1)
-#define HFILE_ERROR   ((HFILE)-1)
+#define HFILE_ERROR     ((HFILE)-1)
 
-#pragma pack(4)
+/* Winelib run-time flag */
+
+#ifdef __WINE__
+extern int __winelib;
+#endif  /* __WINE__ */
+
+/* The SIZE structure */
+
+typedef struct
+{
+    INT16  cx;
+    INT16  cy;
+} SIZE16, *PSIZE16, *LPSIZE16;
+
+typedef struct tagSIZE
+{
+    INT  cx;
+    INT  cy;
+} SIZE, *PSIZE, *LPSIZE;
 
 
-/*
- * POINTL structure. Used in some OLE calls.
- */
+typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;
+
+#define CONV_SIZE16TO32(s16,s32) \
+            ((s32)->cx = (INT)(s16)->cx, (s32)->cy = (INT)(s16)->cy)
+#define CONV_SIZE32TO16(s32,s16) \
+            ((s16)->cx = (INT16)(s32)->cx, (s16)->cy = (INT16)(s32)->cy)
+
+/* The POINT structure */
+
+typedef struct
+{
+    INT16  x;
+    INT16  y;
+} POINT16, *PPOINT16, *LPPOINT16;
+
+typedef struct tagPOINT
+{
+    LONG  x;
+    LONG  y;
+} POINT, *PPOINT, *LPPOINT;
+
 typedef struct _POINTL
 {
-  LONG x;
-  LONG y;
+    LONG x;
+    LONG y;
 } POINTL;
 
+#define CONV_POINT16TO32(p16,p32) \
+            ((p32)->x = (INT)(p16)->x, (p32)->y = (INT)(p16)->y)
+#define CONV_POINT32TO16(p32,p16) \
+            ((p16)->x = (INT16)(p32)->x, (p16)->y = (INT16)(p32)->y)
 
-#endif /* __INCLUDE_WINDEF_H */
+#define MAKEPOINT16(l) (*((POINT16 *)&(l)))
+
+/* The POINTS structure */
+
+typedef struct tagPOINTS
+{
+	SHORT x;
+	SHORT y;
+} POINTS, *PPOINTS, *LPPOINTS;
+
+
+#define MAKEPOINTS(l)  (*((POINTS *)&(l)))
+
+
+/* The RECT structure */
+
+typedef struct
+{
+    INT16  left;
+    INT16  top;
+    INT16  right;
+    INT16  bottom;
+} RECT16, *LPRECT16;
+
+typedef struct tagRECT
+{
+    INT  left;
+    INT  top;
+    INT  right;
+    INT  bottom;
+} RECT, *PRECT, *LPRECT;
+typedef const RECT *LPCRECT;
+
+
+typedef struct tagRECTL
+{
+    LONG left;
+    LONG top;  
+    LONG right;
+    LONG bottom;
+} RECTL, *PRECTL, *LPRECTL;
+
+typedef const RECTL *LPCRECTL;
+
+#define CONV_RECT16TO32(r16,r32) \
+    ((r32)->left  = (INT)(r16)->left,  (r32)->top    = (INT)(r16)->top, \
+     (r32)->right = (INT)(r16)->right, (r32)->bottom = (INT)(r16)->bottom)
+#define CONV_RECT32TO16(r32,r16) \
+    ((r16)->left  = (INT16)(r32)->left,  (r16)->top    = (INT16)(r32)->top, \
+     (r16)->right = (INT16)(r32)->right, (r16)->bottom = (INT16)(r32)->bottom)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __WINE_WINTYPES_H */
diff --git a/include/wine/obj_picture.h b/include/wine/obj_picture.h
index 6ff1b24..5a03a4e 100644
--- a/include/wine/obj_picture.h
+++ b/include/wine/obj_picture.h
@@ -8,7 +8,7 @@
 #define __WINE_WINE_OBJ_PICTURE_H
 
 #include "windows.h"
-#include "wintypes.h"
+#include "windef.h"
 
 /*****************************************************************************
  * Predeclare the structures
diff --git a/include/wine/w32skrnl.h b/include/wine/w32skrnl.h
index 5bc98ba..c98d178 100644
--- a/include/wine/w32skrnl.h
+++ b/include/wine/w32skrnl.h
@@ -1,6 +1,6 @@
 #ifndef _W32SKRNL_H
 #define _W32SKRNL_H
-#include "wintypes.h"
+#include "windef.h"
 LPSTR WINAPI GetWin32sDirectory(void);
 DWORD WINAPI RtlNtStatusToDosError(DWORD error);
 #endif /* _W32SKRNL_H */
diff --git a/include/wine/winbase16.h b/include/wine/winbase16.h
index 3d44d1f..a472a69 100644
--- a/include/wine/winbase16.h
+++ b/include/wine/winbase16.h
@@ -1,7 +1,7 @@
 #ifndef _INCLUDE_WINE_WINBASE16_H
 #define _INCLUDE_WINE_WINBASE16_H
 
-#include "wintypes.h"
+#include "windef.h"
 #pragma pack(1)
 typedef struct _SEGINFO {
     UINT16    offSegment;
diff --git a/include/wine/winesound.h b/include/wine/winesound.h
index 78ea085..f70792a 100644
--- a/include/wine/winesound.h
+++ b/include/wine/winesound.h
@@ -1,7 +1,7 @@
 #ifndef _WINE_SOUND_H
 #define _WINE_SOUND_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 VOID        WINAPI CloseSound16(VOID);
 INT16       WINAPI CountVoiceNotes16(INT16);
diff --git a/include/wine/winestring.h b/include/wine/winestring.h
index 4207588..fe6802b 100644
--- a/include/wine/winestring.h
+++ b/include/wine/winestring.h
@@ -1,7 +1,7 @@
 #ifndef _INCLUDE_WINE_STRINGS_H
 #define _INCLUDE_WINE_STRINGS_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 INT16       WINAPI WideCharToLocal16(LPSTR,LPWSTR,INT16);
 INT       WINAPI WideCharToLocal(LPSTR,LPWSTR,INT);
diff --git a/include/wine/winuser16.h b/include/wine/winuser16.h
index c2008cb..df7f27f 100644
--- a/include/wine/winuser16.h
+++ b/include/wine/winuser16.h
@@ -1,7 +1,7 @@
 #ifndef __WINE_WINUSER16_H
 #define __WINE_WINUSER16_H
 
-#include "wintypes.h"
+#include "windef.h"
 #include "winbase.h"
 #include "winuser.h"
 
diff --git a/include/wingdi.h b/include/wingdi.h
index 1492913..acbb87a 100644
--- a/include/wingdi.h
+++ b/include/wingdi.h
@@ -1,7 +1,7 @@
 #ifndef __WINE_WINGDI_H
 #define __WINE_WINGDI_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/include/winnetwk.h b/include/winnetwk.h
index 55515b4..41ad01a 100644
--- a/include/winnetwk.h
+++ b/include/winnetwk.h
@@ -1,7 +1,7 @@
 #ifndef _WINNETWK_H_
 #define _WINNETWK_H_
 
-#include "wintypes.h"
+#include "windef.h"
 
 
 typedef struct {
diff --git a/include/winnls.h b/include/winnls.h
index 4f96837..63b4a53 100644
--- a/include/winnls.h
+++ b/include/winnls.h
@@ -9,7 +9,7 @@
 #endif
 #include <wctype.h> /* needed for towupper */
 #endif
-#include "wintypes.h"
+#include "windef.h"
 
 /* flags to GetLocaleInfo */
 #define	LOCALE_NOUSEROVERRIDE	    0x80000000
diff --git a/include/winnt.h b/include/winnt.h
index 35e02c3..a97a187 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_WINNT_H
 #define __WINE_WINNT_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 #pragma pack(1)
 /* Defines */
diff --git a/include/winproc.h b/include/winproc.h
index bc92894..be52fc1 100644
--- a/include/winproc.h
+++ b/include/winproc.h
@@ -7,7 +7,7 @@
 #ifndef __WINE_WINPROC_H
 #define __WINE_WINPROC_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 typedef enum
 {
diff --git a/include/winsock.h b/include/winsock.h
index 38b88a5..6f10b09 100644
--- a/include/winsock.h
+++ b/include/winsock.h
@@ -26,7 +26,7 @@
 # define HAVE_IPX
 #endif
 
-#include "wintypes.h"
+#include "windef.h"
 #include "task.h"
 
 #pragma pack(1)
diff --git a/include/winspool.h b/include/winspool.h
index 821ad33..e370a23 100644
--- a/include/winspool.h
+++ b/include/winspool.h
@@ -8,7 +8,7 @@
 #ifndef __WINE_WINSPOOL_H
 #define __WINE_WINSPOOL_H
 
-#include "wintypes.h"
+#include "windef.h"
 #include "winbase.h"
 #include "wingdi.h"
 
diff --git a/include/wintypes.h b/include/wintypes.h
deleted file mode 100644
index 95845b7..0000000
--- a/include/wintypes.h
+++ /dev/null
@@ -1,491 +0,0 @@
-/*
- * Basic types definitions
- *
- * Copyright 1996 Alexandre Julliard
- */
-
-/* Misc. constants. */
-
-#ifdef FALSE
-#undef FALSE
-#endif
-#define FALSE 0
-
-#ifdef TRUE
-#undef TRUE
-#endif
-#define TRUE  1
-
-#ifdef NULL
-#undef NULL
-#endif
-#define NULL  0
-
-#ifndef __WINE_WINTYPES_H
-#define __WINE_WINTYPES_H
-
-#ifdef __WINE__
-# include "config.h"
-# undef UNICODE
-#endif  /* __WINE__ */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Macros to map Winelib names to the correct implementation name */
-/* depending on __WINE__ and UNICODE macros.                      */
-/* Note that Winelib is purely Win32.                             */
-
-#ifdef __WINE__
-# define WINELIB_NAME_AW(func)   this_is_a_syntax_error this_is_a_syntax_error
-#else  /* __WINE__ */
-# ifdef UNICODE
-#  define WINELIB_NAME_AW(func) func##W
-# else
-#  define WINELIB_NAME_AW(func) func##A
-# endif  /* UNICODE */
-#endif  /* __WINE__ */
-
-#ifdef __WINE__
-# define DECL_WINELIB_TYPE_AW(type)  /* nothing */
-#else   /* __WINE__ */
-# define DECL_WINELIB_TYPE_AW(type)  typedef WINELIB_NAME_AW(type) type;
-#endif  /* __WINE__ */
-
-
-/* Calling conventions definitions */
-
-#ifdef __i386__
-# if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)
-#  define __stdcall __attribute__((__stdcall__))
-#  define __cdecl   __attribute__((__cdecl__))
-#  define __RESTORE_ES  __asm__ __volatile__("pushl %ds\n\tpopl %es")
-# else
-#  error You need gcc >= 2.7 to build Wine on a 386
-# endif  /* __GNUC__ */
-#else  /* __i386__ */
-# define __stdcall
-# define __cdecl
-# define __RESTORE_ES
-#endif  /* __i386__ */
-
-#define CALLBACK    __stdcall
-#define WINAPI      __stdcall
-#define APIPRIVATE  __stdcall
-#define PASCAL      __stdcall
-#define _pascal     __stdcall
-#define __export    __stdcall
-#define WINAPIV     __cdecl
-#define APIENTRY    WINAPI
-
-#define CONST       const
-
-/* Standard data types. These are the same for emulator and library. */
-
-typedef void            VOID;
-typedef short           INT16;
-typedef unsigned short  UINT16;
-typedef int             INT;
-typedef unsigned int    UINT;
-typedef unsigned short  WORD;
-typedef unsigned long   DWORD;
-typedef unsigned long   ULONG;
-typedef unsigned char   BYTE;
-typedef long            LONG;
-typedef short           SHORT;
-typedef unsigned short  USHORT;
-typedef char            CHAR;
-typedef unsigned char   UCHAR;
-/* Some systems might have wchar_t, but we really need 16 bit characters */
-typedef unsigned short  WCHAR;
-typedef unsigned short  BOOL16;
-typedef int             BOOL;
-typedef double          DATE;
-typedef long            LONG_PTR;
-typedef unsigned long   ULONG_PTR;
-typedef double          DOUBLE;
-typedef double          LONGLONG;
-typedef double          ULONGLONG;
-
-/* Integer types. These are the same for emulator and library. */
-
-typedef UINT16          HANDLE16;
-typedef UINT            HANDLE;
-typedef UINT16         *LPHANDLE16;
-typedef UINT           *LPHANDLE;
-typedef UINT16          WPARAM16;
-typedef UINT            WPARAM;
-typedef LONG            LPARAM;
-typedef LONG            HRESULT;
-typedef LONG            LRESULT;
-typedef WORD            ATOM;
-typedef WORD            CATCHBUF[9];
-typedef WORD           *LPCATCHBUF;
-typedef DWORD           ACCESS_MASK;
-typedef ACCESS_MASK     REGSAM;
-typedef HANDLE          HHOOK;
-typedef HANDLE          HKEY;
-typedef HANDLE          HMONITOR;
-typedef DWORD           LCID;
-typedef WORD            LANGID;
-typedef DWORD           LCTYPE;
-typedef float           FLOAT;
-typedef long long       __int64;
-
-/* Pointers types. These are the same for emulator and library. */
-/* winnt types */
-typedef VOID           *PVOID;
-typedef const void     *PCVOID;
-typedef CHAR           *PCHAR;
-typedef UCHAR          *PUCHAR;
-typedef BYTE           *PBYTE;
-typedef ULONG          *PULONG;
-typedef LONG           *PLONG;
-typedef DWORD          *PDWORD;
-/* common win32 types */
-typedef CHAR           *LPSTR;
-typedef CHAR           *PSTR;
-typedef const CHAR     *LPCSTR;
-typedef const CHAR     *PCSTR;
-typedef WCHAR          *LPWSTR;
-typedef WCHAR          *PWSTR;
-typedef const WCHAR    *LPCWSTR;
-typedef const WCHAR    *PCWSTR;
-typedef BYTE           *LPBYTE;
-typedef WORD           *LPWORD;
-typedef DWORD          *LPDWORD;
-typedef LONG           *LPLONG;
-typedef VOID           *LPVOID;
-typedef const VOID     *LPCVOID;
-typedef INT16          *LPINT16;
-typedef UINT16         *LPUINT16;
-typedef INT            *PINT;
-typedef INT            *LPINT;
-typedef UINT           *PUINT;
-typedef UINT           *LPUINT;
-typedef HKEY           *LPHKEY;
-typedef HKEY           *PHKEY;
-typedef FLOAT          *PFLOAT;
-typedef FLOAT          *LPFLOAT;
-typedef BOOL           *PBOOL;
-typedef BOOL           *LPBOOL;
-
-/* Special case: a segmented pointer is just a pointer in the user's code. */
-
-#ifdef __WINE__
-typedef DWORD SEGPTR;
-#else
-typedef void* SEGPTR;
-#endif /* __WINE__ */
-
-/* Handle types that exist both in Win16 and Win32. */
-
-#define DECLARE_HANDLE(a)  typedef HANDLE16 a##16; typedef HANDLE a
-DECLARE_HANDLE(HACCEL);
-DECLARE_HANDLE(HBITMAP);
-DECLARE_HANDLE(HBRUSH);
-DECLARE_HANDLE(HCOLORSPACE);
-DECLARE_HANDLE(HCURSOR);
-DECLARE_HANDLE(HDC);
-DECLARE_HANDLE(HDROP);
-DECLARE_HANDLE(HDRVR);
-DECLARE_HANDLE(HDWP);
-DECLARE_HANDLE(HENHMETAFILE);
-DECLARE_HANDLE(HFILE);
-DECLARE_HANDLE(HFONT);
-DECLARE_HANDLE(HGDIOBJ);
-DECLARE_HANDLE(HGLOBAL);
-DECLARE_HANDLE(HICON);
-DECLARE_HANDLE(HINSTANCE);
-DECLARE_HANDLE(HLOCAL);
-DECLARE_HANDLE(HMENU);
-DECLARE_HANDLE(HMETAFILE);
-DECLARE_HANDLE(HMIDI);
-DECLARE_HANDLE(HMIDIIN);
-DECLARE_HANDLE(HMIDIOUT);
-DECLARE_HANDLE(HMIDISTRM);
-DECLARE_HANDLE(HMIXER);
-DECLARE_HANDLE(HMIXEROBJ);
-DECLARE_HANDLE(HMMIO);
-DECLARE_HANDLE(HMODULE);
-DECLARE_HANDLE(HPALETTE);
-DECLARE_HANDLE(HPEN);
-DECLARE_HANDLE(HQUEUE);
-DECLARE_HANDLE(HRGN);
-DECLARE_HANDLE(HRSRC);
-DECLARE_HANDLE(HTASK);
-DECLARE_HANDLE(HWAVE);
-DECLARE_HANDLE(HWAVEIN);
-DECLARE_HANDLE(HWAVEOUT);
-DECLARE_HANDLE(HWINSTA);
-DECLARE_HANDLE(HDESK);
-DECLARE_HANDLE(HWND);
-DECLARE_HANDLE(HKL);
-DECLARE_HANDLE(HIC);
-DECLARE_HANDLE(HRASCONN);
-#undef DECLARE_HANDLE
-
-/* Callback function pointers types */
-
-typedef BOOL    (CALLBACK* DATEFMT_ENUMPROCA)(LPSTR);
-typedef BOOL    (CALLBACK* DATEFMT_ENUMPROCW)(LPWSTR);
-DECL_WINELIB_TYPE_AW(DATEFMT_ENUMPROC)
-typedef BOOL16  (CALLBACK *DLGPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
-typedef BOOL    (CALLBACK *DLGPROC)(HWND,UINT,WPARAM,LPARAM);
-typedef LRESULT (CALLBACK *DRIVERPROC16)(DWORD,HDRVR16,UINT16,LPARAM,LPARAM);
-typedef LRESULT (CALLBACK *DRIVERPROC)(DWORD,HDRVR,UINT,LPARAM,LPARAM);
-typedef INT16   (CALLBACK *EDITWORDBREAKPROC16)(LPSTR,INT16,INT16,INT16);
-typedef INT     (CALLBACK *EDITWORDBREAKPROCA)(LPSTR,INT,INT,INT);
-typedef INT     (CALLBACK *EDITWORDBREAKPROCW)(LPWSTR,INT,INT,INT);
-DECL_WINELIB_TYPE_AW(EDITWORDBREAKPROC)
-typedef LRESULT (CALLBACK *FARPROC16)();
-typedef LRESULT (CALLBACK *FARPROC)();
-typedef INT16   (CALLBACK *PROC16)();
-typedef INT     (CALLBACK *PROC)();
-typedef INT16   (CALLBACK *GOBJENUMPROC16)(SEGPTR,LPARAM);
-typedef INT     (CALLBACK *GOBJENUMPROC)(LPVOID,LPARAM);
-typedef BOOL16  (CALLBACK *GRAYSTRINGPROC16)(HDC16,LPARAM,INT16);
-typedef BOOL    (CALLBACK *GRAYSTRINGPROC)(HDC,LPARAM,INT);
-typedef LRESULT (CALLBACK *HOOKPROC16)(INT16,WPARAM16,LPARAM);
-typedef LRESULT (CALLBACK *HOOKPROC)(INT,WPARAM,LPARAM);
-typedef VOID    (CALLBACK *LINEDDAPROC16)(INT16,INT16,LPARAM);
-typedef VOID    (CALLBACK *LINEDDAPROC)(INT,INT,LPARAM);
-typedef BOOL16  (CALLBACK *PROPENUMPROC16)(HWND16,SEGPTR,HANDLE16);
-typedef BOOL    (CALLBACK *PROPENUMPROCA)(HWND,LPCSTR,HANDLE);
-typedef BOOL    (CALLBACK *PROPENUMPROCW)(HWND,LPCWSTR,HANDLE);
-DECL_WINELIB_TYPE_AW(PROPENUMPROC)
-typedef BOOL    (CALLBACK *PROPENUMPROCEXA)(HWND,LPCSTR,HANDLE,LPARAM);
-typedef BOOL    (CALLBACK *PROPENUMPROCEXW)(HWND,LPCWSTR,HANDLE,LPARAM);
-DECL_WINELIB_TYPE_AW(PROPENUMPROCEX)
-typedef BOOL    (CALLBACK* TIMEFMT_ENUMPROCA)(LPSTR);
-typedef BOOL    (CALLBACK* TIMEFMT_ENUMPROCW)(LPWSTR);
-DECL_WINELIB_TYPE_AW(TIMEFMT_ENUMPROC)
-typedef VOID    (CALLBACK *TIMERPROC16)(HWND16,UINT16,UINT16,DWORD);
-typedef VOID    (CALLBACK *TIMERPROC)(HWND,UINT,UINT,DWORD);
-typedef LRESULT (CALLBACK *WNDENUMPROC16)(HWND16,LPARAM);
-typedef LRESULT (CALLBACK *WNDENUMPROC)(HWND,LPARAM);
-typedef LRESULT (CALLBACK *WNDPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
-typedef LRESULT (CALLBACK *WNDPROC)(HWND,UINT,WPARAM,LPARAM);
-
-/* TCHAR data types definitions for Winelib. */
-/* These types are _not_ defined for the emulator, because they */
-/* depend on the UNICODE macro that only exists in user's code. */
-
-#ifndef __WINE__
-# ifdef UNICODE
-typedef WCHAR TCHAR;
-typedef LPWSTR LPTSTR;
-typedef LPCWSTR LPCTSTR;
-#define __TEXT(string) L##string /*probably wrong */
-# else  /* UNICODE */
-typedef CHAR TCHAR;
-typedef LPSTR LPTSTR;
-typedef LPCSTR LPCTSTR;
-#define __TEXT(string) string
-# endif /* UNICODE */
-#endif   /* __WINE__ */
-#define TEXT(quote) __TEXT(quote)
-
-/* Data types specific to the library. These do _not_ exist in the emulator. */
-
-
-
-/* Define some empty macros for compatibility with Windows code. */
-
-#ifndef __WINE__
-#define NEAR
-#define FAR
-#define _far
-#define _near
-#define IN
-#define OUT
-#define OPTIONAL
-#endif  /* __WINE__ */
-
-/* Macro for structure packing. */
-
-#ifdef __GNUC__
-#define WINE_PACKED __attribute__ ((packed))
-#define WINE_UNUSED __attribute__ ((unused))
-#else
-#define WINE_PACKED  /* nothing */
-#define WINE_UNUSED  /* nothing */
-#endif
-
-/* Macros to split words and longs. */
-
-#define LOBYTE(w)              ((BYTE)(WORD)(w))
-#define HIBYTE(w)              ((BYTE)((WORD)(w) >> 8))
-
-#define LOWORD(l)              ((WORD)(DWORD)(l))
-#define HIWORD(l)              ((WORD)((DWORD)(l) >> 16))
-
-#define SLOWORD(l)             ((INT16)(LONG)(l))
-#define SHIWORD(l)             ((INT16)((LONG)(l) >> 16))
-
-#define MAKEWORD(low,high)     ((WORD)(((BYTE)(low)) | ((WORD)((BYTE)(high))) << 8))
-#define MAKELONG(low,high)     ((LONG)(((WORD)(low)) | (((DWORD)((WORD)(high))) << 16)))
-#define MAKELPARAM(low,high)   ((LPARAM)MAKELONG(low,high))
-#define MAKEWPARAM(low,high)   ((WPARAM)MAKELONG(low,high))
-#define MAKELRESULT(low,high)  ((LRESULT)MAKELONG(low,high))
-#define MAKEINTATOM(atom)      ((LPCSTR)MAKELONG((atom),0))
-
-#define SELECTOROF(ptr)     (HIWORD(ptr))
-#define OFFSETOF(ptr)       (LOWORD(ptr))
-
-/* Macros to access unaligned or wrong-endian WORDs and DWORDs. */
-/* Note: These macros are semantically broken, at least for wrc.  wrc
-   spits out data in the platform's current binary format, *not* in 
-   little-endian format.  These macros are used throughout the resource
-   code to load and store data to the resources.  Since it is unlikely 
-   that we'll ever be dealing with little-endian resource data, the 
-   byte-swapping nature of these macros has been disabled.  Rather than 
-   remove the use of these macros from the resource loading code, the
-   macros have simply been disabled.  In the future, someone may want 
-   to reactivate these macros for other purposes.  In that case, the
-   resource code will have to be modified to use different macros. */ 
-
-#if 1
-#define PUT_WORD(ptr,w)   (*(WORD *)(ptr) = (w))
-#define GET_WORD(ptr)     (*(WORD *)(ptr))
-#define PUT_DWORD(ptr,dw) (*(DWORD *)(ptr) = (dw))
-#define GET_DWORD(ptr)    (*(DWORD *)(ptr))
-#else
-#define PUT_WORD(ptr,w)   (*(BYTE *)(ptr) = LOBYTE(w), \
-                           *((BYTE *)(ptr) + 1) = HIBYTE(w))
-#define GET_WORD(ptr)     ((WORD)(*(BYTE *)(ptr) | \
-                                  (WORD)(*((BYTE *)(ptr)+1) << 8)))
-#define PUT_DWORD(ptr,dw) (PUT_WORD((ptr),LOWORD(dw)), \
-                           PUT_WORD((WORD *)(ptr)+1,HIWORD(dw)))
-#define GET_DWORD(ptr)    ((DWORD)(GET_WORD(ptr) | \
-                                   ((DWORD)GET_WORD((WORD *)(ptr)+1) << 16)))
-#endif  /* 1 */
-
-/* MIN and MAX macros */
-
-#ifdef MAX
-#undef MAX
-#endif
-#define MAX(a,b) (((a) > (b)) ? (a) : (b))
-
-#ifdef MIN
-#undef MIN
-#endif
-#define MIN(a,b) (((a) < (b)) ? (a) : (b))
-
-#define __max(a,b) MAX(a,b)
-#define __min(a,b) MIN(a,b)
-#define max(a,b)   MAX(a,b)
-#define min(a,b)   MIN(a,b)
-
-#define _MAX_PATH  260
-#define _MAX_DRIVE 3
-#define _MAX_DIR   256
-#define _MAX_FNAME 255
-#define _MAX_EXT   256
-
-/* Winelib run-time flag */
-
-#ifdef __WINE__
-extern int __winelib;
-#endif  /* __WINE__ */
-
-/* The SIZE structure */
-
-typedef struct
-{
-    INT16  cx;
-    INT16  cy;
-} SIZE16, *PSIZE16, *LPSIZE16;
-
-typedef struct tagSIZE
-{
-    INT  cx;
-    INT  cy;
-} SIZE, *PSIZE, *LPSIZE;
-
-
-typedef SIZE SIZEL, *PSIZEL, *LPSIZEL;
-
-#define CONV_SIZE16TO32(s16,s32) \
-            ((s32)->cx = (INT)(s16)->cx, (s32)->cy = (INT)(s16)->cy)
-#define CONV_SIZE32TO16(s32,s16) \
-            ((s16)->cx = (INT16)(s32)->cx, (s16)->cy = (INT16)(s32)->cy)
-
-/* The POINT structure */
-
-typedef struct
-{
-    INT16  x;
-    INT16  y;
-} POINT16, *PPOINT16, *LPPOINT16;
-
-typedef struct tagPOINT
-{
-    LONG  x;
-    LONG  y;
-} POINT, *PPOINT, *LPPOINT;
-
-
-#define CONV_POINT16TO32(p16,p32) \
-            ((p32)->x = (INT)(p16)->x, (p32)->y = (INT)(p16)->y)
-#define CONV_POINT32TO16(p32,p16) \
-            ((p16)->x = (INT16)(p32)->x, (p16)->y = (INT16)(p32)->y)
-
-#define MAKEPOINT16(l) (*((POINT16 *)&(l)))
-
-/* The POINTS structure */
-
-typedef struct tagPOINTS
-{
-	SHORT x;
-	SHORT y;
-} POINTS, *PPOINTS, *LPPOINTS;
-
-
-#define MAKEPOINTS(l)  (*((POINTS *)&(l)))
-
-
-/* The RECT structure */
-
-typedef struct
-{
-    INT16  left;
-    INT16  top;
-    INT16  right;
-    INT16  bottom;
-} RECT16, *LPRECT16;
-
-typedef struct tagRECT
-{
-    INT  left;
-    INT  top;
-    INT  right;
-    INT  bottom;
-} RECT, *PRECT, *LPRECT;
-typedef const RECT *LPCRECT;
-
-
-typedef struct tagRECTL
-{
-    LONG left;
-    LONG top;  
-    LONG right;
-    LONG bottom;
-} RECTL, *PRECTL, *LPRECTL;
-
-typedef const RECTL *LPCRECTL;
-
-#define CONV_RECT16TO32(r16,r32) \
-    ((r32)->left  = (INT)(r16)->left,  (r32)->top    = (INT)(r16)->top, \
-     (r32)->right = (INT)(r16)->right, (r32)->bottom = (INT)(r16)->bottom)
-#define CONV_RECT32TO16(r32,r16) \
-    ((r16)->left  = (INT16)(r32)->left,  (r16)->top    = (INT16)(r32)->top, \
-     (r16)->right = (INT16)(r32)->right, (r16)->bottom = (INT16)(r32)->bottom)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __WINE_WINTYPES_H */
diff --git a/include/winuser.h b/include/winuser.h
index 6078ff0..7b540bc 100644
--- a/include/winuser.h
+++ b/include/winuser.h
@@ -4,7 +4,7 @@
 #ifndef RC_INVOKED
 #include <stdarg.h>
 #endif
-#include "wintypes.h"
+#include "windef.h"
 #include "wingdi.h"
 #include "wine/winestring.h"
 
diff --git a/include/winver.h b/include/winver.h
index 4374967..c78da06 100644
--- a/include/winver.h
+++ b/include/winver.h
@@ -1,7 +1,7 @@
 #ifndef __WINE_WINVER_H
 #define __WINE_WINVER_H
 
-#include "wintypes.h"
+#include "windef.h"
 
 DWORD       WINAPI VerFindFile16(UINT16,LPCSTR,LPCSTR,LPCSTR,LPSTR,UINT16*,LPSTR,UINT16*);
 DWORD       WINAPI VerFindFileA(UINT,LPCSTR,LPCSTR,LPCSTR,LPSTR,UINT*,LPSTR,UINT*);
diff --git a/include/wrc_rsc.h b/include/wrc_rsc.h
index 2ceaad1..949f6e3 100644
--- a/include/wrc_rsc.h
+++ b/include/wrc_rsc.h
@@ -9,9 +9,7 @@
 #define __WRC_RSC_H
 #define __WINE_WRC_RSC_H
 
-#ifndef __WINE_WINTYPES_H
-#include <wintypes.h>		/* For types in structure */
-#endif
+#include "windef.h"		/* For types in structure */
 
 /*
  * Note on the resource and type names:
diff --git a/include/wtypes.h b/include/wtypes.h
index 537e92b..fd1949f 100644
--- a/include/wtypes.h
+++ b/include/wtypes.h
@@ -6,7 +6,7 @@
 #define __WINE_WTYPES_H
 
 
-#include "wintypes.h"
+#include "windef.h"
 
 /* FIXME: this line should be in rpcndr.h */
 typedef unsigned char byte;
diff --git a/include/x11drv.h b/include/x11drv.h
index 9b70a81..a2d2c18 100644
--- a/include/x11drv.h
+++ b/include/x11drv.h
@@ -15,7 +15,7 @@
 #endif /* !defined(X_DISPLAY_MISSING) */
 
 #include "gdi.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "wine/winuser16.h"
 
 struct tagCLASS;
diff --git a/ipc/dde_proc.c b/ipc/dde_proc.c
index 76232c9..9081039 100644
--- a/ipc/dde_proc.c
+++ b/ipc/dde_proc.c
@@ -19,7 +19,7 @@
 #include <signal.h>
 #include <errno.h>
 #include <sys/msg.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "win.h"
 #include "shm_semaph.h"
 #include "shm_main_blk.h"
diff --git a/ipc/generic_hash.h b/ipc/generic_hash.h
index 67f0975..2879782 100644
--- a/ipc/generic_hash.h
+++ b/ipc/generic_hash.h
@@ -8,7 +8,7 @@
 #ifndef _GENERIC_HASH_H_
 #define _GENERIC_HASH_H_
 
-#include "wintypes.h"
+#include "windef.h"
 #include "shm_block.h"
 #include "win.h"
 /* default hash values */
diff --git a/ipc/wine_test_stub.c b/ipc/wine_test_stub.c
index 109a440..8a3a203 100644
--- a/ipc/wine_test_stub.c
+++ b/ipc/wine_test_stub.c
@@ -1,6 +1,6 @@
 #include <stdlib.h>
 #include "dde.h"
-#include <wintypes.h>
+#include "windef.h"
 #include "global.h"
 #include <win.h>
 #define DEBUG_DEFINE_VARIABLES
diff --git a/libtest/vartest.c b/libtest/vartest.c
index 38abc67..be5fed2 100644
--- a/libtest/vartest.c
+++ b/libtest/vartest.c
@@ -57,7 +57,7 @@
 #if WINDOWS
 #include <wtypes.h>
 #else
-#include <wintypes.h>
+#include <windef.h>
 #endif
 
 
diff --git a/loader/pe_resource.c b/loader/pe_resource.c
index 1b4c58a..b6c7754 100644
--- a/loader/pe_resource.c
+++ b/loader/pe_resource.c
@@ -13,7 +13,7 @@
 #include <stdlib.h>
 #include <sys/types.h>
 #include "wine/winestring.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "pe_image.h"
 #include "module.h"
 #include "heap.h"
diff --git a/misc/error.c b/misc/error.c
index f30b34e..9fed9d0 100644
--- a/misc/error.c
+++ b/misc/error.c
@@ -7,7 +7,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "wintypes.h"
+#include "windef.h"
 #include "stackframe.h"
 #include "debug.h"
 
diff --git a/misc/imm.c b/misc/imm.c
index 52a0651..c0de86b 100644
--- a/misc/imm.c
+++ b/misc/imm.c
@@ -7,7 +7,7 @@
 #include "winbase.h"
 #include "winuser.h"
 #include "winerror.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "debug.h"
 #include "winversion.h"
 #include "imm.h"
diff --git a/misc/network.c b/misc/network.c
index d2ffb2a..efa1f14 100644
--- a/misc/network.c
+++ b/misc/network.c
@@ -12,7 +12,7 @@
 #include <pwd.h>
 #include <unistd.h>
 
-#include "wintypes.h"
+#include "windef.h"
 #include "winnetwk.h"
 #include "winuser.h"
 #include "winerror.h"
diff --git a/misc/sound.c b/misc/sound.c
index 40f11ad..3fd2bc1 100644
--- a/misc/sound.c
+++ b/misc/sound.c
@@ -3,7 +3,7 @@
  */
 
 #include <stdlib.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "wine/winesound.h"
 #include "debug.h"
 
diff --git a/misc/w32scomb.c b/misc/w32scomb.c
index 024769e..a98ebd5 100644
--- a/misc/w32scomb.c
+++ b/misc/w32scomb.c
@@ -8,7 +8,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "wine/winbase16.h"
 #include "module.h"
 #include "ldt.h"
diff --git a/misc/w32sys.c b/misc/w32sys.c
index 0220d2e..43e6386 100644
--- a/misc/w32sys.c
+++ b/misc/w32sys.c
@@ -5,7 +5,7 @@
  * Copyright (c) 1996 Anand Kumria
  */
 
-#include "wintypes.h"
+#include "windef.h"
 #include "w32sys.h"
 
 /***********************************************************************
diff --git a/misc/win32s16.c b/misc/win32s16.c
index 3c055d9..8cc147d 100644
--- a/misc/win32s16.c
+++ b/misc/win32s16.c
@@ -7,7 +7,7 @@
 
 #include <string.h>
 #include <stdlib.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "debug.h"
 
 void WINAPI BootTask16()
diff --git a/misc/windebug.c b/misc/windebug.c
index 26826ca..a4ac9a8 100644
--- a/misc/windebug.c
+++ b/misc/windebug.c
@@ -6,7 +6,7 @@
 
 #include <string.h>
 #include <stdlib.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "module.h"
 #include "debug.h"
 
diff --git a/msdos/dpmi.c b/msdos/dpmi.c
index d377788..70fa650 100644
--- a/msdos/dpmi.c
+++ b/msdos/dpmi.c
@@ -6,7 +6,7 @@
 
 #include <unistd.h>
 #include <string.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "wine/winbase16.h"
 #include "ldt.h"
 #include "global.h"
diff --git a/msdos/int29.c b/msdos/int29.c
index 2ae572c..688b646 100644
--- a/msdos/int29.c
+++ b/msdos/int29.c
@@ -3,7 +3,7 @@
  */
 
 #include "config.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "winnt.h"
 #include "console.h"
 
diff --git a/msdos/interrupts.c b/msdos/interrupts.c
index 740e009..819a6ce 100644
--- a/msdos/interrupts.c
+++ b/msdos/interrupts.c
@@ -5,7 +5,7 @@
  */
 
 #include <sys/types.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "miscemu.h"
 #include "msdos.h"
 #include "debug.h"
diff --git a/msdos/ioports.c b/msdos/ioports.c
index f9f4801..76a198b 100644
--- a/msdos/ioports.c
+++ b/msdos/ioports.c
@@ -16,7 +16,7 @@
 #include <string.h>
 #include <time.h>
 #include <unistd.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "vga.h"
 #include "dosexe.h"
 #include "options.h"
diff --git a/multimedia/mcianim.c b/multimedia/mcianim.c
index 435423f..e5fd2b1 100644
--- a/multimedia/mcianim.c
+++ b/multimedia/mcianim.c
@@ -10,7 +10,7 @@
 #include <string.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "wine/winuser16.h"
 #include "driver.h"
 #include "mmsystem.h"
diff --git a/multimedia/mixer.c b/multimedia/mixer.c
index d538aee..fcb6256 100644
--- a/multimedia/mixer.c
+++ b/multimedia/mixer.c
@@ -9,7 +9,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "user.h"
 #include "driver.h"
 #include "multimedia.h"
diff --git a/multimedia/mmaux.c b/multimedia/mmaux.c
index de6fc94..88b27ee 100644
--- a/multimedia/mmaux.c
+++ b/multimedia/mmaux.c
@@ -11,7 +11,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "driver.h"
 #include "multimedia.h"
 #include "debug.h"
diff --git a/multimedia/mmio.c b/multimedia/mmio.c
index 882f610..2f506ea 100644
--- a/multimedia/mmio.c
+++ b/multimedia/mmio.c
@@ -10,7 +10,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "wine/winbase16.h"
 #include "heap.h"
 #include "file.h"
diff --git a/multimedia/time.c b/multimedia/time.c
index addd5c4..3201fc5 100644
--- a/multimedia/time.c
+++ b/multimedia/time.c
@@ -9,7 +9,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "wine/winbase16.h" /* GetTaskDS */
 #include "callback.h"
 #include "mmsystem.h"
diff --git a/objects/color.c b/objects/color.c
index 9658f91..3a47a38 100644
--- a/objects/color.c
+++ b/objects/color.c
@@ -10,7 +10,7 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "options.h"
 #include "gdi.h"
 #include "color.h"
diff --git a/ole/oledlg.c b/ole/oledlg.c
index 99e346e..960fa14 100644
--- a/ole/oledlg.c
+++ b/ole/oledlg.c
@@ -4,7 +4,7 @@
  *	Copyright 1998	Patrik Stridvall
  */
 
-#include "wintypes.h"
+#include "windef.h"
 #include "winbase.h"
 #include "winerror.h"
 #include "oledlg.h"
diff --git a/ole/safearray.c b/ole/safearray.c
index 4131422..6b3e62a 100644
--- a/ole/safearray.c
+++ b/ole/safearray.c
@@ -9,7 +9,7 @@
 
 #include <stdio.h>
 #include <strings.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "winerror.h"
 #include "winbase.h"
 #include "oleauto.h"
diff --git a/ole/typelib.c b/ole/typelib.c
index 62bd118..504a5c8 100644
--- a/ole/typelib.c
+++ b/ole/typelib.c
@@ -7,7 +7,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <assert.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "winerror.h"
 #include "winreg.h"
 #include "oleauto.h"
diff --git a/ole/variant.c b/ole/variant.c
index 8dd46b8..5490d22 100644
--- a/ole/variant.c
+++ b/ole/variant.c
@@ -20,7 +20,7 @@
  *   - The parsing does not accept has many formats has the Windows implementation.
  */
  
-#include "wintypes.h"
+#include "windef.h"
 #include "oleauto.h"
 #include "heap.h"
 #include "debug.h"
diff --git a/programs/avitools/aviinfo.c b/programs/avitools/aviinfo.c
index 58235c5..a6832e0 100644
--- a/programs/avitools/aviinfo.c
+++ b/programs/avitools/aviinfo.c
@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include <assert.h>
 #include <strings.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "windows.h"
 #include "mmsystem.h"
 #include "vfw.h"
diff --git a/programs/avitools/aviplay.c b/programs/avitools/aviplay.c
index 6300b48..8fb2a25 100644
--- a/programs/avitools/aviplay.c
+++ b/programs/avitools/aviplay.c
@@ -21,7 +21,6 @@
 #include <time.h>
 #include <assert.h>
 #include <strings.h>
-#include "wintypes.h"
 #include "windows.h"
 #include "wingdi.h"
 #include "mmsystem.h"
diff --git a/programs/avitools/icinfo.c b/programs/avitools/icinfo.c
index 48720ff..5e7f531 100644
--- a/programs/avitools/icinfo.c
+++ b/programs/avitools/icinfo.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
 #include <strings.h>
-#include "wintypes.h"
 #include "windows.h"
 #include "driver.h"
 #include "mmsystem.h"
diff --git a/relay32/utthunk.c b/relay32/utthunk.c
index cc747b8..4a034d5 100644
--- a/relay32/utthunk.c
+++ b/relay32/utthunk.c
@@ -4,7 +4,7 @@
  * Copyright 1999 Ulrich Weigand 
  */
 
-#include "wintypes.h"
+#include "windef.h"
 #include "heap.h"
 #include "module.h"
 #include "selectors.h"
diff --git a/tools/wrc/wrctypes.h b/tools/wrc/wrctypes.h
index b3b02a4..139b5e1 100644
--- a/tools/wrc/wrctypes.h
+++ b/tools/wrc/wrctypes.h
@@ -8,10 +8,7 @@
 #ifndef __WRC_WRCTYPES_H
 #define __WRC_WRCTYPES_H
 
-/* First is MS style, second wine style */
-#ifndef __WINE_WINTYPES_H
-#include "wintypes.h"
-#endif
+#include "windef.h"
 
 #ifndef MAKELANGID
 #include "winnls.h"
diff --git a/tsx11/ts_xf86vmode.c b/tsx11/ts_xf86vmode.c
index 7106301..89e8dc9 100644
--- a/tsx11/ts_xf86vmode.c
+++ b/tsx11/ts_xf86vmode.c
@@ -8,7 +8,7 @@
 
 #ifndef X_DISPLAY_MISSING
 
-#include "wintypes.h"
+#include "windef.h"
 #ifdef HAVE_LIBXXF86VM
 #define XMD_H
 typedef int INT32;
diff --git a/win32/newfns.c b/win32/newfns.c
index 902a79b..03224b9 100644
--- a/win32/newfns.c
+++ b/win32/newfns.c
@@ -10,7 +10,7 @@
 #include <string.h>
 #include <sys/time.h>
 #include <unistd.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "winerror.h"
 #include "heap.h"
 #include "debug.h"
diff --git a/win32/thread.c b/win32/thread.c
index 87855c8..04efba5 100644
--- a/win32/thread.c
+++ b/win32/thread.c
@@ -7,7 +7,7 @@
 
 #include <unistd.h>
 #include <string.h>
-#include "wintypes.h"
+#include "windef.h"
 #include "winerror.h"
 #include "debug.h"
 
diff --git a/windows/display.c b/windows/display.c
index a96a0a6..7909a69 100644
--- a/windows/display.c
+++ b/windows/display.c
@@ -9,7 +9,7 @@
 
 #include "display.h"
 #include "debug.h"
-#include "wintypes.h"
+#include "windef.h"
 
 #ifndef X_DISPLAY_MISSING
 extern MOUSE_DRIVER X11DRV_MOUSE_Driver;
diff --git a/windows/ttydrv/monitor.c b/windows/ttydrv/monitor.c
index 52a05a4..469330a 100644
--- a/windows/ttydrv/monitor.c
+++ b/windows/ttydrv/monitor.c
@@ -7,7 +7,7 @@
 
 #include "heap.h"
 #include "monitor.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "ttydrv.h"
 
 /***********************************************************************
diff --git a/windows/x11drv/clipboard.c b/windows/x11drv/clipboard.c
index e1a6499..884bd67 100644
--- a/windows/x11drv/clipboard.c
+++ b/windows/x11drv/clipboard.c
@@ -16,7 +16,7 @@
 #include "debug.h"
 #include "message.h"
 #include "win.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "x11drv.h"
 
 extern HWND hWndClipOwner;
diff --git a/windows/x11drv/desktop.c b/windows/x11drv/desktop.c
index 395d1a3..6e8e2dd 100644
--- a/windows/x11drv/desktop.c
+++ b/windows/x11drv/desktop.c
@@ -14,7 +14,7 @@
 #include "monitor.h"
 #include "options.h"
 #include "win.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "x11drv.h"
 
 /***********************************************************************
diff --git a/windows/x11drv/event.c b/windows/x11drv/event.c
index db5e7e9..46d9607 100644
--- a/windows/x11drv/event.c
+++ b/windows/x11drv/event.c
@@ -33,7 +33,7 @@
 #include "shell.h"
 #include "winpos.h"
 #include "winsock.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "x11drv.h"
   
 /* X context to associate a hwnd to an X window */
diff --git a/windows/x11drv/keyboard.c b/windows/x11drv/keyboard.c
index 2234ac8..76b8c0f 100644
--- a/windows/x11drv/keyboard.c
+++ b/windows/x11drv/keyboard.c
@@ -22,7 +22,7 @@
 #include "debug.h"
 #include "keyboard.h"
 #include "message.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "x11drv.h"
 #include "winnls.h"
 
diff --git a/windows/x11drv/main.c b/windows/x11drv/main.c
index 244e54e..9d2a74e 100644
--- a/windows/x11drv/main.c
+++ b/windows/x11drv/main.c
@@ -25,7 +25,7 @@
 #include "monitor.h"
 #include "options.h"
 #include "win.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "x11drv.h"
 #include "xmalloc.h"
 #include "version.h"
diff --git a/windows/x11drv/monitor.c b/windows/x11drv/monitor.c
index 291502d..97e3080 100644
--- a/windows/x11drv/monitor.c
+++ b/windows/x11drv/monitor.c
@@ -18,7 +18,7 @@
 #include "heap.h"
 #include "monitor.h"
 #include "options.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "x11drv.h"
 
 /**********************************************************************/
diff --git a/windows/x11drv/mouse.c b/windows/x11drv/mouse.c
index 26c08d2..66c55eb 100644
--- a/windows/x11drv/mouse.c
+++ b/windows/x11drv/mouse.c
@@ -14,7 +14,7 @@
 #include "debug.h"
 #include "display.h"
 #include "win.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "x11drv.h"
 
 /**********************************************************************/
diff --git a/windows/x11drv/wnd.c b/windows/x11drv/wnd.c
index 0c6e1af..a1d9d0d 100644
--- a/windows/x11drv/wnd.c
+++ b/windows/x11drv/wnd.c
@@ -24,7 +24,7 @@
 #include "message.h"
 #include "heap.h"
 #include "win.h"
-#include "wintypes.h"
+#include "windef.h"
 #include "class.h"
 #include "x11drv.h"