diff --git a/include/ddeml.h b/include/ddeml.h index 058ae502d90..b66aed8e282 100644 --- a/include/ddeml.h +++ b/include/ddeml.h @@ -205,10 +205,10 @@ extern "C" { -DECLARE_HANDLE(HCONVLIST); -DECLARE_HANDLE(HCONV); -DECLARE_HANDLE(HSZ); -DECLARE_HANDLE(HDDEDATA); +DECLARE_OLD_HANDLE(HCONVLIST); +DECLARE_OLD_HANDLE(HCONV); +DECLARE_OLD_HANDLE(HSZ); +DECLARE_OLD_HANDLE(HDDEDATA); diff --git a/include/vfw.h b/include/vfw.h index cb5ccfdeba1..879a208c69c 100644 --- a/include/vfw.h +++ b/include/vfw.h @@ -44,7 +44,7 @@ typedef struct IGetFrame IGetFrame,*PGETFRAME; /* Installable Compressor Manager */ -DECLARE_HANDLE(HIC); +DECLARE_OLD_HANDLE(HIC); #ifdef __WINE__ /* HIC struct (same layout as Win95 one) */ diff --git a/include/windef.h b/include/windef.h index 430d1da80c2..ab98867c76d 100644 --- a/include/windef.h +++ b/include/windef.h @@ -56,48 +56,48 @@ typedef HANDLE HMONITOR; /* Handle types that exist both in Win16 and Win32. */ -DECLARE_HANDLE(HACMDRIVERID); -DECLARE_HANDLE(HACMDRIVER); -DECLARE_HANDLE(HACMOBJ); -DECLARE_HANDLE(HACMSTREAM); -DECLARE_HANDLE(HMETAFILEPICT); +DECLARE_OLD_HANDLE(HACMDRIVERID); +DECLARE_OLD_HANDLE(HACMDRIVER); +DECLARE_OLD_HANDLE(HACMOBJ); +DECLARE_OLD_HANDLE(HACMSTREAM); +DECLARE_OLD_HANDLE(HMETAFILEPICT); -DECLARE_HANDLE(HACCEL); -DECLARE_HANDLE(HBITMAP); -DECLARE_HANDLE(HBRUSH); -DECLARE_HANDLE(HCOLORSPACE); -DECLARE_HANDLE(HDC); -DECLARE_HANDLE(HDROP); -DECLARE_HANDLE(HDRVR); -DECLARE_HANDLE(HDWP); -DECLARE_HANDLE(HENHMETAFILE); +DECLARE_OLD_HANDLE(HACCEL); +DECLARE_OLD_HANDLE(HBITMAP); +DECLARE_OLD_HANDLE(HBRUSH); +DECLARE_OLD_HANDLE(HCOLORSPACE); +DECLARE_OLD_HANDLE(HDC); +DECLARE_OLD_HANDLE(HDROP); +DECLARE_OLD_HANDLE(HDRVR); +DECLARE_OLD_HANDLE(HDWP); +DECLARE_OLD_HANDLE(HENHMETAFILE); typedef int HFILE; -DECLARE_HANDLE(HFONT); -DECLARE_HANDLE(HICON); -DECLARE_HANDLE(HINSTANCE); -DECLARE_HANDLE(HKEY); -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(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_OLD_HANDLE(HFONT); +DECLARE_OLD_HANDLE(HICON); +DECLARE_OLD_HANDLE(HINSTANCE); +DECLARE_OLD_HANDLE(HKEY); +DECLARE_OLD_HANDLE(HMENU); +DECLARE_OLD_HANDLE(HMETAFILE); +DECLARE_OLD_HANDLE(HMIDI); +DECLARE_OLD_HANDLE(HMIDIIN); +DECLARE_OLD_HANDLE(HMIDIOUT); +DECLARE_OLD_HANDLE(HMIDISTRM); +DECLARE_OLD_HANDLE(HMIXER); +DECLARE_OLD_HANDLE(HMIXEROBJ); +DECLARE_OLD_HANDLE(HMMIO); +DECLARE_OLD_HANDLE(HPALETTE); +DECLARE_OLD_HANDLE(HPEN); +DECLARE_OLD_HANDLE(HQUEUE); +DECLARE_OLD_HANDLE(HRGN); +DECLARE_OLD_HANDLE(HRSRC); +DECLARE_OLD_HANDLE(HTASK); +DECLARE_OLD_HANDLE(HWAVE); +DECLARE_OLD_HANDLE(HWAVEIN); +DECLARE_OLD_HANDLE(HWAVEOUT); +DECLARE_OLD_HANDLE(HWINSTA); +DECLARE_OLD_HANDLE(HDESK); +DECLARE_OLD_HANDLE(HWND); +DECLARE_OLD_HANDLE(HKL); /* Handle types that must remain interchangeable even with strict on */ diff --git a/include/winnt.h b/include/winnt.h index 38e622bd64d..2d1f14e4070 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -317,24 +317,44 @@ typedef WORD LANGID; * of WINE code operates on HANDLES as if they are UINTs. So to WINE * they exist as UINTs but to the Winelib user who turns on strict, * they exist as void*. If there is a size difference between UINT and - * void* then things get ugly. */ -#ifdef STRICT + * void* then things get ugly. + * + * Here is the plan to convert Wine to STRICT: + * + * Types will be converted one at a time by volunteers who will compile + * Wine with STRICT turned on. Handles that have not been converted yet + * will be declared with DECLARE_OLD_HANDLE. Converted handles are + * declared with DECLARE_HANDLE. + * See the bug report 90 for more details: + * http://wine.codeweavers.com/bugzilla/show_bug.cgi?id=90 + */ +/* + * when compiling Wine we always treat HANDLE as an UINT. Then when + * we're ready we'll remove the '!defined(__WINE__)' (the equivalent + * of converting it from DECLARE_OLD_HANDLE to DECLARE_HANDLE). + */ +#if defined(STRICT) && !defined(__WINE__) typedef VOID* HANDLE; +#define DECLARE_OLD_HANDLE(a) \ + typedef struct a##__ { int unused; } *a; \ + typedef a *P##a, *LP##a + #else typedef UINT HANDLE; +#define DECLARE_OLD_HANDLE(a) \ + typedef HANDLE a; \ + typedef a *P##a, *LP##a #endif -typedef HANDLE *LPHANDLE; +typedef HANDLE *PHANDLE, *LPHANDLE; #ifdef STRICT #define DECLARE_HANDLE(a) \ - typedef struct a##__ { int unused; } *a; \ - typedef a *P##a; \ - typedef a *LP##a + typedef struct a##__ { int unused; } *a; \ + typedef a *P##a, *LP##a #else /*STRICT*/ #define DECLARE_HANDLE(a) \ - typedef HANDLE a; \ - typedef a *P##a; \ - typedef a *LP##a + typedef HANDLE a; \ + typedef a *P##a, *LP##a #endif /*STRICT*/ @@ -971,7 +991,6 @@ typedef struct _CONTEXT #endif typedef CONTEXT *PCONTEXT; -typedef HANDLE *PHANDLE; #ifdef __WINE__ diff --git a/include/winsvc.h b/include/winsvc.h index 9254484f82c..e5f8da5c1f8 100644 --- a/include/winsvc.h +++ b/include/winsvc.h @@ -80,9 +80,8 @@ extern "C" { /* Handle types */ -DECLARE_HANDLE(SC_HANDLE); - -DECLARE_HANDLE(SERVICE_STATUS_HANDLE); +DECLARE_OLD_HANDLE(SC_HANDLE); +DECLARE_OLD_HANDLE(SERVICE_STATUS_HANDLE); /* Service status structure */