From 435e2e63f402fcb55c1957c04e5c12d5554ce412 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 10 Dec 2002 22:56:43 +0000 Subject: [PATCH] winnt.h should not be self-contained, it must depend on windef.h so that STRICT works correctly; moved some definitions back to windef.h where they belong, and removed a couple of definitions that don't exist on Windows. --- dlls/dplayx/dplobby.c | 3 +- dlls/msvcrt/locale.c | 1 - dlls/ntdll/exception.c | 2 +- dlls/ntdll/large_int.c | 2 +- dlls/ntdll/signal_i386.c | 2 +- dlls/ntdll/signal_powerpc.c | 2 +- dlls/oleaut32/parsedt.h | 2 +- dlls/shlwapi/ordinal.c | 2 +- dlls/twain/twain.h | 2 +- dlls/winedos/int17.c | 2 +- dlls/winedos/int29.c | 2 +- dlls/winedos/int31.c | 8 +- dlls/winedos/interrupts.c | 2 +- dlls/wineps/ppd.c | 2 +- dlls/wineps/truetype.c | 2 +- dlls/wineps/type1afm.c | 2 +- dlls/x11drv/xrender.c | 2 +- graphics/x11drv/init.c | 2 +- if1632/relay.c | 2 +- include/miscemu.h | 2 +- include/msacm.h | 4 + include/msvcrt/stdlib.h | 2 +- include/windef.h | 148 +++++++++++++++++++++++++++++--- include/wine/exception.h | 2 +- include/wine/rpcss_shared.h | 2 +- include/winnt.h | 162 ++---------------------------------- library/loader.c | 2 +- memory/instr.c | 5 ++ misc/registry.c | 2 +- relay32/relay386.c | 2 +- server/change.c | 2 +- server/event.c | 2 +- server/mapping.c | 1 - server/mutex.c | 2 +- server/registry.c | 1 - server/request.c | 2 +- server/semaphore.c | 2 +- server/timer.c | 2 +- server/trace.c | 2 +- tools/winedump/debug.c | 2 +- tools/winedump/ne.c | 2 +- tools/winedump/pe.c | 2 +- 42 files changed, 190 insertions(+), 209 deletions(-) diff --git a/dlls/dplayx/dplobby.c b/dlls/dplayx/dplobby.c index b3200cccb7a..1f291d58b1b 100644 --- a/dlls/dplayx/dplobby.c +++ b/dlls/dplayx/dplobby.c @@ -19,8 +19,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include + +#include "windef.h" #include "winerror.h" -#include "winnt.h" #include "winreg.h" #include "winnls.h" #include "wine/debug.h" diff --git a/dlls/msvcrt/locale.c b/dlls/msvcrt/locale.c index 134865d8932..c6d51663ad0 100644 --- a/dlls/msvcrt/locale.c +++ b/dlls/msvcrt/locale.c @@ -21,7 +21,6 @@ #include "config.h" #include "wine/port.h" -#include "winnt.h" #include "winbase.h" #include "winuser.h" diff --git a/dlls/ntdll/exception.c b/dlls/ntdll/exception.c index 3a12fd00755..5a9d859773c 100644 --- a/dlls/ntdll/exception.c +++ b/dlls/ntdll/exception.c @@ -25,7 +25,7 @@ #include #include -#include "winnt.h" +#include "windef.h" #include "winternl.h" #include "global.h" #include "wine/exception.h" diff --git a/dlls/ntdll/large_int.c b/dlls/ntdll/large_int.c index 9f50de70f89..24d686d325a 100644 --- a/dlls/ntdll/large_int.c +++ b/dlls/ntdll/large_int.c @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "winnt.h" +#include "windef.h" #include "winternl.h" /* diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index 3663a9f7e99..2e10060f514 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -50,8 +50,8 @@ # include #endif +#include "windef.h" #include "winternl.h" -#include "winnt.h" #include "wine/library.h" #include "selectors.h" diff --git a/dlls/ntdll/signal_powerpc.c b/dlls/ntdll/signal_powerpc.c index 7b0df2a457c..5e6c51a3b1e 100644 --- a/dlls/ntdll/signal_powerpc.c +++ b/dlls/ntdll/signal_powerpc.c @@ -50,8 +50,8 @@ # include #endif +#include "windef.h" #include "winternl.h" -#include "winnt.h" #include "wine/library.h" #include "wine/exception.h" #include "selectors.h" diff --git a/dlls/oleaut32/parsedt.h b/dlls/oleaut32/parsedt.h index 426708f517a..01b614ab077 100644 --- a/dlls/oleaut32/parsedt.h +++ b/dlls/oleaut32/parsedt.h @@ -45,7 +45,7 @@ PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. */ #include -#include /* DateToTm use */ +#include "windef.h" /* DateToTm use */ /* ---------------------------------------------------------------- * Section 1: bool, true, false, TRUE, FALSE diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c index 588d789e8ef..a9f183bb125 100644 --- a/dlls/shlwapi/ordinal.c +++ b/dlls/shlwapi/ordinal.c @@ -1127,7 +1127,7 @@ BOOL WINAPI SHLWAPI_171(LPVOID x, LPVOID y) * IInternetSecurityMgrSite * IShellView */ -HRESULT WINAPI SHLWAPI_172(IUnknown *lpUnknown, PHWND lphWnd) +HRESULT WINAPI SHLWAPI_172(IUnknown *lpUnknown, HWND *lphWnd) { /* FIXME: Wine has no header for this object */ static const GUID IID_IInternetSecurityMgrSite = { 0x79eac9ed, diff --git a/dlls/twain/twain.h b/dlls/twain/twain.h index 212c106b49a..08c31ffcb8c 100644 --- a/dlls/twain/twain.h +++ b/dlls/twain/twain.h @@ -52,7 +52,7 @@ #ifndef TWAIN #define TWAIN -#include "winnt.h" +#include "windef.h" #define FAR #define huge diff --git a/dlls/winedos/int17.c b/dlls/winedos/int17.c index e9e87b831a0..4be7b50639a 100644 --- a/dlls/winedos/int17.c +++ b/dlls/winedos/int17.c @@ -20,10 +20,10 @@ #include +#include "windef.h" #include "miscemu.h" #include "wine/debug.h" #include "msdos.h" -#include "winnt.h" WINE_DEFAULT_DEBUG_CHANNEL(int); diff --git a/dlls/winedos/int29.c b/dlls/winedos/int29.c index fa6f408e799..2167c8b8153 100644 --- a/dlls/winedos/int29.c +++ b/dlls/winedos/int29.c @@ -20,7 +20,7 @@ #include "config.h" -#include "winnt.h" +#include "windef.h" #include "miscemu.h" #include "dosexe.h" diff --git a/dlls/winedos/int31.c b/dlls/winedos/int31.c index 42a586d5556..50d8d93641d 100644 --- a/dlls/winedos/int31.c +++ b/dlls/winedos/int31.c @@ -697,12 +697,12 @@ void WINAPI DOSVM_AllocRMCB( CONTEXT86 *context ) NewRMCB->proc_sel = context->SegDs; NewRMCB->regs_ofs = DOSVM_IsDos32() ? context->Edi : LOWORD(context->Edi); NewRMCB->regs_sel = context->SegEs; - SET_LOWORD( context->Ecx, HIWORD(NewRMCB->address) ); - SET_LOWORD( context->Edx, LOWORD(NewRMCB->address) ); + SET_CX( context, HIWORD(NewRMCB->address) ); + SET_DX( context, LOWORD(NewRMCB->address) ); } else { - SET_LOWORD( context->Eax, 0x8015 ); /* callback unavailable */ + SET_AX( context, 0x8015 ); /* callback unavailable */ SET_CFLAG(context); } } @@ -717,7 +717,7 @@ void WINAPI DOSVM_FreeRMCB( CONTEXT86 *context ) CX_reg(context), DX_reg(context)); if (DPMI_FreeRMCB(MAKELONG(DX_reg(context), CX_reg(context)))) { - SET_LOWORD( context->Eax, 0x8024 ); /* invalid callback address */ + SET_AX( context, 0x8024 ); /* invalid callback address */ SET_CFLAG(context); } } diff --git a/dlls/winedos/interrupts.c b/dlls/winedos/interrupts.c index 8013f0f2dd4..4b50905c8f5 100644 --- a/dlls/winedos/interrupts.c +++ b/dlls/winedos/interrupts.c @@ -122,7 +122,7 @@ void WINAPI DOSVM_EmulateInterruptPM( CONTEXT86 *context, BYTE intnum ) if (IS_SELECTOR_32BIT(context->SegSs)) context->Esp += islong ? -12 : -6; else - ADD_LOWORD( context->Esp, islong ? -12 : -6 ); + context->Esp = (context->Esp & ~0xffff) | (WORD)((context->Esp & 0xffff) + (islong ? -12 : -6)); } /********************************************************************** diff --git a/dlls/wineps/ppd.c b/dlls/wineps/ppd.c index d0b0919d6dc..64ec6aee8e7 100644 --- a/dlls/wineps/ppd.c +++ b/dlls/wineps/ppd.c @@ -22,7 +22,7 @@ #include #include #include -#include "winnt.h" /* HEAP_ZERO_MEMORY */ +#include "windef.h" /* HEAP_ZERO_MEMORY */ #include "wine/debug.h" #include "psdrv.h" #include "winspool.h" diff --git a/dlls/wineps/truetype.c b/dlls/wineps/truetype.c index 9448e8853ca..573c7eeda5e 100644 --- a/dlls/wineps/truetype.c +++ b/dlls/wineps/truetype.c @@ -61,7 +61,7 @@ #include #include -#include "winnt.h" +#include "windef.h" #include "winerror.h" #include "winreg.h" #include "psdrv.h" diff --git a/dlls/wineps/type1afm.c b/dlls/wineps/type1afm.c index 803bfdf8172..df8a6085efa 100644 --- a/dlls/wineps/type1afm.c +++ b/dlls/wineps/type1afm.c @@ -39,7 +39,7 @@ #include /* FLT_MAX */ #endif -#include "winnt.h" +#include "windef.h" #include "winerror.h" #include "winreg.h" #include "psdrv.h" diff --git a/dlls/x11drv/xrender.c b/dlls/x11drv/xrender.c index dde45eca0f9..1b7b33fc02f 100644 --- a/dlls/x11drv/xrender.c +++ b/dlls/x11drv/xrender.c @@ -27,7 +27,7 @@ #include #include -#include "winnt.h" +#include "windef.h" #include "wownt32.h" #include "x11drv.h" #include "bitmap.h" diff --git a/graphics/x11drv/init.c b/graphics/x11drv/init.c index fe1ffc0826b..75775822053 100644 --- a/graphics/x11drv/init.c +++ b/graphics/x11drv/init.c @@ -24,8 +24,8 @@ #include +#include "windef.h" #include "bitmap.h" -#include "winnt.h" #include "x11drv.h" #include "x11font.h" #include "ddrawi.h" diff --git a/if1632/relay.c b/if1632/relay.c index d94ec7a67f7..f038f5da8e9 100644 --- a/if1632/relay.c +++ b/if1632/relay.c @@ -25,8 +25,8 @@ #include #include +#include "windef.h" #include "wine/winbase16.h" -#include "winnt.h" #include "module.h" #include "stackframe.h" #include "selectors.h" diff --git a/include/miscemu.h b/include/miscemu.h index 311163dfa33..ce3abc370c9 100644 --- a/include/miscemu.h +++ b/include/miscemu.h @@ -21,7 +21,7 @@ #ifndef __WINE_MISCEMU_H #define __WINE_MISCEMU_H -#include "winnt.h" +#include "windef.h" #include "selectors.h" #include "wine/windef16.h" diff --git a/include/msacm.h b/include/msacm.h index 1fb7a05eabe..a688a024211 100644 --- a/include/msacm.h +++ b/include/msacm.h @@ -233,6 +233,10 @@ DECLARE_HANDLE(HACMDRIVERID); DECLARE_HANDLE(HACMDRIVER); DECLARE_HANDLE(HACMSTREAM); DECLARE_HANDLE(HACMOBJ); +typedef HACMDRIVERID *PHACMDRIVERID, *LPHACMDRIVERID; +typedef HACMDRIVER *PHACMDRIVER, *LPHACMDRIVER; +typedef HACMSTREAM *PHACMSTREAM, *LPHACMSTREAM; +typedef HACMOBJ *PHACMOBJ, *LPHACMOBJ; /*********************************************************************** * Callbacks diff --git a/include/msvcrt/stdlib.h b/include/msvcrt/stdlib.h index d71c742347d..8658071c994 100644 --- a/include/msvcrt/stdlib.h +++ b/include/msvcrt/stdlib.h @@ -9,7 +9,7 @@ #define __WINE_STDLIB_H #define __WINE_USE_MSVCRT -#include "winnt.h" +#include "basetsd.h" #include "msvcrt/malloc.h" /* For size_t, malloc & co */ #include "msvcrt/search.h" /* For bsearch and qsort */ diff --git a/include/windef.h b/include/windef.h index 834ad3857aa..e53d014ff7b 100644 --- a/include/windef.h +++ b/include/windef.h @@ -35,13 +35,144 @@ # endif /* STRICT */ #endif /* NO_STRICT */ -#include "winnt.h" - - #ifdef __cplusplus extern "C" { #endif +/* Calling conventions definitions */ + +#ifdef __i386__ +# ifndef _X86_ +# define _X86_ +# endif +# if defined(__GNUC__) && ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7))) +# define __stdcall __attribute__((__stdcall__)) +# define __cdecl __attribute__((__cdecl__)) +# elif defined(_MSC_VER) +/* Nothing needs to be done. __cdecl/__stdcall already exists */ +# else +# error You need gcc >= 2.7 to build Wine on a 386 +# endif /* __GNUC__ */ +#else /* __i386__ */ +# define __stdcall +# define __cdecl +#endif /* __i386__ */ + +#ifndef __WINE__ + +#ifndef pascal +#define pascal __stdcall +#endif +#ifndef _pascal +#define _pascal __stdcall +#endif +#ifndef _stdcall +#define _stdcall __stdcall +#endif +#ifndef _fastcall +#define _fastcall __stdcall +#endif +#ifndef __fastcall +#define __fastcall __stdcall +#endif +#ifndef __export +#define __export __stdcall +#endif +#ifndef cdecl +#define cdecl __cdecl +#endif +#ifndef _cdecl +#define _cdecl __cdecl +#endif + +#ifndef near +#define near +#endif +#ifndef far +#define far +#endif +#ifndef _near +#define _near +#endif +#ifndef _far +#define _far +#endif +#ifndef NEAR +#define NEAR +#endif +#ifndef FAR +#define FAR +#endif + +#ifndef _declspec +#define _declspec(x) +#endif +#ifndef __declspec +#define __declspec(x) +#endif + +#endif /* __WINE__ */ + +#define CALLBACK __stdcall +#define WINAPI __stdcall +#define APIPRIVATE __stdcall +#define PASCAL __stdcall +#define CDECL __cdecl +#define _CDECL __cdecl +#define WINAPIV __cdecl +#define APIENTRY WINAPI +#define CONST const + +/* Misc. constants. */ + +#undef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void*)0) +#endif + +#ifdef FALSE +#undef FALSE +#endif +#define FALSE 0 + +#ifdef TRUE +#undef TRUE +#endif +#define TRUE 1 + +#ifndef IN +#define IN +#endif + +#ifndef OUT +#define OUT +#endif + +#ifndef OPTIONAL +#define OPTIONAL +#endif + +/* Standard data types */ + +typedef void *LPVOID; +typedef const void *LPCVOID; +typedef int BOOL, *PBOOL, *LPBOOL; +typedef unsigned char BYTE, *PBYTE, *LPBYTE; +typedef unsigned char UCHAR, *PUCHAR; +typedef unsigned short WORD, *PWORD, *LPWORD; +typedef unsigned short USHORT, *PUSHORT; +typedef int INT, *PINT, *LPINT; +typedef unsigned int UINT, *PUINT; +typedef long *LPLONG; +typedef unsigned long DWORD, *PDWORD, *LPDWORD; +typedef unsigned long ULONG, *PULONG; +typedef float FLOAT, *PFLOAT; +typedef double DOUBLE; +typedef double DATE; + +#include "winnt.h" /* Macros to map Winelib names to the correct implementation name */ /* depending on __WINE__ and UNICODE macros. */ @@ -76,7 +207,7 @@ typedef WORD *LPCATCHBUF; typedef DWORD COLORREF, *LPCOLORREF; -/* Handle types that exist both in Win16 and Win32. */ +/* Handle types */ typedef int HFILE; DECLARE_HANDLE(HACCEL); @@ -91,6 +222,7 @@ DECLARE_HANDLE(HHOOK); DECLARE_HANDLE(HICON); DECLARE_HANDLE(HINSTANCE); DECLARE_HANDLE(HKEY); +typedef HKEY *PHKEY; DECLARE_HANDLE(HKL); DECLARE_HANDLE(HMENU); DECLARE_HANDLE(HMETAFILE); @@ -140,14 +272,6 @@ typedef INT (CALLBACK *PROC)(); #define SELECTOROF(ptr) (HIWORD(ptr)) #define OFFSETOF(ptr) (LOWORD(ptr)) -#ifdef __WINE__ -/* macros to set parts of a DWORD (not in the Windows API) */ -#define SET_LOWORD(dw,val) ((dw) = ((dw) & 0xffff0000) | LOWORD(val)) -#define SET_LOBYTE(dw,val) ((dw) = ((dw) & 0xffffff00) | LOBYTE(val)) -#define SET_HIBYTE(dw,val) ((dw) = ((dw) & 0xffff00ff) | (LOBYTE(val) << 8)) -#define ADD_LOWORD(dw,val) ((dw) = ((dw) & 0xffff0000) | LOWORD((DWORD)(dw)+(val))) -#endif - /* min and max macros */ #ifndef NOMINMAX #ifndef max diff --git a/include/wine/exception.h b/include/wine/exception.h index 8d1421a2f89..49540fa33b6 100644 --- a/include/wine/exception.h +++ b/include/wine/exception.h @@ -22,7 +22,7 @@ #define __WINE_WINE_EXCEPTION_H #include -#include "winnt.h" +#include "windef.h" /* The following definitions allow using exceptions in Wine and Winelib code * diff --git a/include/wine/rpcss_shared.h b/include/wine/rpcss_shared.h index 11b82f6cc15..2bbb0e8b27b 100644 --- a/include/wine/rpcss_shared.h +++ b/include/wine/rpcss_shared.h @@ -22,7 +22,7 @@ #define __WINE_RPCSS_SHARED_H #include "basetsd.h" -#include "winnt.h" +#include "windef.h" #include "rpcdcep.h" diff --git a/include/winnt.h b/include/winnt.h index ca0da52bc18..96301779580 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -29,102 +29,7 @@ #include #endif - -/* On Windows winnt.h depends on a few windef.h types and macros and thus - * is not self-contained. Furthermore windef.h includes winnt.h so that it - * would be pointless to try to use winnt.h directly. - * But for Wine and Winelib I decided to make winnt.h self-contained by - * moving these definitions to winnt.h. It makes no difference to Winelib - * programs since they are not using winnt.h directly anyway, and it allows - * us to use winnt.h and get a minimal set of definitions. - */ - -/**** Some Wine specific definitions *****/ - -/* Calling conventions definitions */ - -#ifdef __i386__ -# ifndef _X86_ -# define _X86_ -# endif -# if defined(__GNUC__) && ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7))) -# define __stdcall __attribute__((__stdcall__)) -# define __cdecl __attribute__((__cdecl__)) -# elif defined(_MSC_VER) -/* Nothing needs to be done. __cdecl/__stdcall already exists */ -# else -# error You need gcc >= 2.7 to build Wine on a 386 -# endif /* __GNUC__ */ -#else /* __i386__ */ -# define __stdcall -# define __cdecl -#endif /* __i386__ */ - -#ifndef __WINE__ - -#ifndef pascal -#define pascal __stdcall -#endif -#ifndef _pascal -#define _pascal __stdcall -#endif -#ifndef _stdcall -#define _stdcall __stdcall -#endif -#ifndef _fastcall -#define _fastcall __stdcall -#endif -#ifndef __fastcall -#define __fastcall __stdcall -#endif -#ifndef __export -#define __export __stdcall -#endif -#ifndef cdecl -#define cdecl __cdecl -#endif -#ifndef _cdecl -#define _cdecl __cdecl -#endif - -#ifndef near -#define near -#endif -#ifndef far -#define far -#endif -#ifndef _near -#define _near -#endif -#ifndef _far -#define _far -#endif -#ifndef NEAR -#define NEAR -#endif -#ifndef FAR -#define FAR -#endif - -#ifndef _declspec -#define _declspec(x) -#endif -#ifndef __declspec -#define __declspec(x) -#endif - -#endif /* __WINE__ */ - -#define CALLBACK __stdcall -#define WINAPI __stdcall -#define NTAPI __stdcall -#define APIPRIVATE __stdcall -#define PASCAL __stdcall -#define CDECL __cdecl -#define _CDECL __cdecl -#define WINAPIV __cdecl -#define APIENTRY WINAPI -#define CONST const +#define NTAPI __stdcall /* Macro for structure packing and more. */ @@ -346,39 +251,6 @@ # define C_ASSERT(e) extern char __C_ASSERT__[(e)?1:-1] #endif -/**** Parts of windef.h that are needed here *****/ - -/* Misc. constants. */ - -#undef NULL -#ifdef __cplusplus -#define NULL 0 -#else -#define NULL ((void*)0) -#endif - -#ifdef FALSE -#undef FALSE -#endif -#define FALSE 0 - -#ifdef TRUE -#undef TRUE -#endif -#define TRUE 1 - -#ifndef IN -#define IN -#endif - -#ifndef OUT -#define OUT -#endif - -#ifndef OPTIONAL -#define OPTIONAL -#endif - /* Error Masks */ #define APPLICATION_ERROR_MASK 0x20000000 #define ERROR_SEVERITY_SUCCESS 0x00000000 @@ -386,24 +258,6 @@ #define ERROR_SEVERITY_WARNING 0x80000000 #define ERROR_SEVERITY_ERROR 0xC0000000 -/* Standard data types */ -typedef const void *LPCVOID; -typedef int BOOL, *PBOOL, *LPBOOL; -typedef unsigned char BYTE, *PBYTE, *LPBYTE; -typedef unsigned char UCHAR, *PUCHAR; -typedef unsigned short USHORT, *PUSHORT; -typedef unsigned short WORD, *PWORD, *LPWORD; -typedef int INT, *PINT, *LPINT; -typedef unsigned int UINT, *PUINT; -typedef unsigned long DWORD, *PDWORD, *LPDWORD; -typedef unsigned long ULONG, *PULONG; -typedef float FLOAT, *PFLOAT; -typedef double DOUBLE; -typedef double DATE; - - -/**** winnt.h proper *****/ - /* Microsoft's macros for declaring functions */ #ifdef __cplusplus @@ -432,11 +286,11 @@ typedef double DATE; #ifndef VOID #define VOID void #endif -typedef VOID *PVOID, *LPVOID; +typedef VOID *PVOID; typedef BYTE BOOLEAN, *PBOOLEAN; typedef char CHAR, *PCHAR; typedef short SHORT, *PSHORT; -typedef long LONG, *PLONG, *LPLONG; +typedef long LONG, *PLONG; /* Some systems might have wchar_t, but we really need 16 bit characters */ #ifndef WINE_WCHAR_DEFINED @@ -542,14 +396,10 @@ typedef DWORD EXECUTION_STATE; typedef void *HANDLE; typedef HANDLE *PHANDLE, *LPHANDLE; -#if (defined(STRICT) || defined(__WINE__)) -#define DECLARE_HANDLE(a) \ - typedef struct a##__ { int unused; } *a; \ - typedef a *P##a +#ifdef STRICT +#define DECLARE_HANDLE(a) typedef struct a##__ { int unused; } *a; #else /*STRICT*/ -#define DECLARE_HANDLE(a) \ - typedef HANDLE a; \ - typedef a *P##a +#define DECLARE_HANDLE(a) typedef HANDLE a; #endif /*STRICT*/ /* Defines */ diff --git a/library/loader.c b/library/loader.c index 54e01fba831..1f808279fcc 100644 --- a/library/loader.c +++ b/library/loader.c @@ -30,7 +30,7 @@ #include #endif -#include "winnt.h" +#include "windef.h" #include "wine/library.h" /* argc/argv for the Windows application */ diff --git a/memory/instr.c b/memory/instr.c index d2c93e9447e..f56c4885a69 100644 --- a/memory/instr.c +++ b/memory/instr.c @@ -32,6 +32,11 @@ WINE_DECLARE_DEBUG_CHANNEL(io); #ifdef __i386__ +/* macros to set parts of a DWORD */ +#define SET_LOWORD(dw,val) ((dw) = ((dw) & 0xffff0000) | LOWORD(val)) +#define SET_LOBYTE(dw,val) ((dw) = ((dw) & 0xffffff00) | LOBYTE(val)) +#define ADD_LOWORD(dw,val) ((dw) = ((dw) & 0xffff0000) | LOWORD((DWORD)(dw)+(val))) + inline static void add_stack( CONTEXT86 *context, int offset ) { if (ISV86(context) || !IS_SELECTOR_32BIT(context->SegSs)) diff --git a/misc/registry.c b/misc/registry.c index a9868327a9e..60607fc3d1e 100644 --- a/misc/registry.c +++ b/misc/registry.c @@ -50,8 +50,8 @@ # include #endif +#include "windef.h" #include "winerror.h" -#include "winnt.h" #include "winreg.h" #include "wine/winbase16.h" diff --git a/relay32/relay386.c b/relay32/relay386.c index 1024bedd2ea..18523c643f0 100644 --- a/relay32/relay386.c +++ b/relay32/relay386.c @@ -25,7 +25,7 @@ #include #include -#include "winnt.h" +#include "windef.h" #include "winternl.h" #include "stackframe.h" #include "module.h" diff --git a/server/change.c b/server/change.c index daa0cadb3ba..a6316426472 100644 --- a/server/change.c +++ b/server/change.c @@ -22,7 +22,7 @@ #include #include -#include "winnt.h" +#include "windef.h" #include "handle.h" #include "thread.h" diff --git a/server/event.c b/server/event.c index da833d97118..b223487f073 100644 --- a/server/event.c +++ b/server/event.c @@ -25,7 +25,7 @@ #include #include -#include "winnt.h" +#include "windef.h" #include "handle.h" #include "thread.h" diff --git a/server/mapping.c b/server/mapping.c index 190e4aee0be..b7b055c6922 100644 --- a/server/mapping.c +++ b/server/mapping.c @@ -26,7 +26,6 @@ #include #include -#include "winnt.h" #include "winbase.h" #include "handle.h" diff --git a/server/mutex.c b/server/mutex.c index f38fd8db332..fe765534156 100644 --- a/server/mutex.c +++ b/server/mutex.c @@ -25,7 +25,7 @@ #include #include -#include "winnt.h" +#include "windef.h" #include "handle.h" #include "thread.h" diff --git a/server/registry.c b/server/registry.c index 77ddf9f5d4d..5c23906b22e 100644 --- a/server/registry.c +++ b/server/registry.c @@ -44,7 +44,6 @@ #include "winbase.h" #include "winreg.h" -#include "winnt.h" /* registry definitions */ #include "winternl.h" #include "wine/library.h" diff --git a/server/request.c b/server/request.c index 66c1b11e556..ff1450b0120 100644 --- a/server/request.c +++ b/server/request.c @@ -43,7 +43,7 @@ #include #include -#include "winnt.h" +#include "windef.h" #include "winbase.h" #include "wincon.h" #include "wine/library.h" diff --git a/server/semaphore.c b/server/semaphore.c index 4e7e6b6aa0d..ee9098855ef 100644 --- a/server/semaphore.c +++ b/server/semaphore.c @@ -25,7 +25,7 @@ #include #include -#include "winnt.h" +#include "windef.h" #include "handle.h" #include "thread.h" diff --git a/server/timer.c b/server/timer.c index 8b7eb8fdf02..ddc137d4fc2 100644 --- a/server/timer.c +++ b/server/timer.c @@ -27,7 +27,7 @@ #include #include -#include "winnt.h" +#include "windef.h" #include "handle.h" #include "request.h" diff --git a/server/trace.c b/server/trace.c index 64122129722..322aeb4d505 100644 --- a/server/trace.c +++ b/server/trace.c @@ -26,7 +26,7 @@ #include #include -#include "winnt.h" +#include "windef.h" #include "winbase.h" #include "wincon.h" #include "request.h" diff --git a/tools/winedump/debug.c b/tools/winedump/debug.c index 988a8b30d0e..2ead49b742e 100644 --- a/tools/winedump/debug.c +++ b/tools/winedump/debug.c @@ -40,7 +40,7 @@ #endif #include -#include "winnt.h" +#include "windef.h" #include "winedump.h" #include "pe.h" #include "cvinclude.h" diff --git a/tools/winedump/ne.c b/tools/winedump/ne.c index e2352cee6a0..147fa29b6c2 100644 --- a/tools/winedump/ne.c +++ b/tools/winedump/ne.c @@ -22,7 +22,7 @@ #include #include -#include "winnt.h" +#include "windef.h" #include "winbase.h" #include "wine/winbase16.h" #include "winedump.h" diff --git a/tools/winedump/pe.c b/tools/winedump/pe.c index f4e926419b0..e890620ef96 100644 --- a/tools/winedump/pe.c +++ b/tools/winedump/pe.c @@ -38,7 +38,7 @@ #endif #include -#include "winnt.h" +#include "windef.h" #include "winedump.h" #include "pe.h"