From 20d7540340ad86f0cb1764a84a248561d7cc40ed Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 25 Mar 2015 22:32:35 +0000 Subject: [PATCH] [WIN32K] - Add InterlockedIn/DecrementUL - Define NULL to nullptr for C++ code - Reorder includes a bit. First GDI then USER. Don't include most USER headers for C++ for now. svn path=/trunk/; revision=66890 --- reactos/win32ss/pch.h | 16 ++++++++++----- reactos/win32ss/user/ntuser/win32.h | 31 ++++++++++++++++++++--------- reactos/win32ss/win32k.h | 5 +++++ reactos/win32ss/win32kp.h | 21 +++++++++---------- 4 files changed, 49 insertions(+), 24 deletions(-) diff --git a/reactos/win32ss/pch.h b/reactos/win32ss/pch.h index cd09813411a..9c22f009267 100644 --- a/reactos/win32ss/pch.h +++ b/reactos/win32ss/pch.h @@ -67,13 +67,16 @@ typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES; #include /* Public Win32K headers */ -#include +#include +#include +#include +#include + +#ifndef __cplusplus #include #include -#include -#include -#include -#include +#include +#endif // __cplusplus /* Undocumented user definitions */ #include @@ -82,6 +85,9 @@ typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES, *LPSECURITY_ATTRIBUTES; #include #include FT_FREETYPE_H +#define InterlockedIncrementUL(Value) InterlockedIncrement((PLONG)Value) +#define InterlockedDecrementUL(Value) InterlockedDecrement((PLONG)Value) + /* Internal Win32K header */ #include "win32kp.h" diff --git a/reactos/win32ss/user/ntuser/win32.h b/reactos/win32ss/user/ntuser/win32.h index ed8908a84b9..2dad834bbaa 100644 --- a/reactos/win32ss/user/ntuser/win32.h +++ b/reactos/win32ss/user/ntuser/win32.h @@ -49,7 +49,7 @@ typedef enum _QS_ROS_TYPES extern BOOL ClientPfnInit; extern HINSTANCE hModClient; extern HANDLE hModuleWin; // This Win32k Instance. -extern PCLS SystemClassList; +extern struct _CLS *SystemClassList; extern BOOL RegisteredSysClasses; typedef struct tagMENUSTATE MENUSTATE, *PMENUSTATE; @@ -77,17 +77,22 @@ typedef struct _W32THREAD PVOID pUMPDObj; } W32THREAD, *PW32THREAD; +#ifdef __cplusplus +typedef struct _THREADINFO : _W32THREAD +{ +#else typedef struct _THREADINFO { W32THREAD; +#endif PTL ptl; PPROCESSINFO ppi; struct _USER_MESSAGE_QUEUE* MessageQueue; struct tagKL* KeyboardLayout; - PCLIENTTHREADINFO pcti; + struct _CLIENTTHREADINFO * pcti; struct _DESKTOP* rpdesk; - PDESKTOPINFO pDeskInfo; - PCLIENTINFO pClientInfo; + struct _DESKTOPINFO * pDeskInfo; + struct _CLIENTINFO * pClientInfo; FLONG TIF_flags; PUNICODE_STRING pstrAppName; /* Messages that are currently dispatched to other threads */ @@ -112,7 +117,7 @@ typedef struct _THREADINFO struct _USER_MESSAGE_QUEUE* pqAttach; PTHREADINFO ptiSibling; ULONG fsHooks; - PHOOK sphkCurrent; + struct tagHOOK * sphkCurrent; LPARAM lParamHkCurrent; WPARAM wParamHkCurrent; struct tagSBTRACK* pSBTrack; @@ -130,6 +135,7 @@ typedef struct _THREADINFO WCHAR wchInjected; UINT cWindows; UINT cVisWindows; +#ifndef __cplusplus /// FIXME! LIST_ENTRY aphkStart[NB_HOOKS]; CLIENTTHREADINFO cti; // Used only when no Desktop or pcti NULL. @@ -151,7 +157,7 @@ typedef struct _THREADINFO #if DBG USHORT acExclusiveLockCount[GDIObjTypeTotal + 1]; #endif - +#endif // __cplusplus } THREADINFO; #include @@ -234,14 +240,19 @@ typedef struct _W32PROCESS #define CLIBS 32 +#ifdef __cplusplus +typedef struct _PROCESSINFO : _W32PROCESS +{ +#else typedef struct _PROCESSINFO { W32PROCESS; +#endif PTHREADINFO ptiList; PTHREADINFO ptiMainThread; struct _DESKTOP* rpdeskStartup; - PCLS pclsPrivateList; - PCLS pclsPublicList; + struct _CLS *pclsPrivateList; + struct _CLS *pclsPublicList; PPROCESSINFO ppiNext; INT cThreads; HDESK hdeskStartup; @@ -276,8 +287,10 @@ typedef struct _PROCESSINFO #if DBG BYTE DbgChannelLevel[DbgChCount]; +#ifndef __cplusplus DWORD DbgHandleCount[TYPE_CTYPES]; -#endif +#endif // __cplusplus +#endif // DBG } PROCESSINFO; #if DBG diff --git a/reactos/win32ss/win32k.h b/reactos/win32ss/win32k.h index 72f41f09f1c..2f6dc78db9a 100644 --- a/reactos/win32ss/win32k.h +++ b/reactos/win32ss/win32k.h @@ -3,3 +3,8 @@ /* Headers that shouldn't be precompiled due to GCC bugs */ /* Probe and capture */ #include + +#ifdef __cplusplus +#undef NULL +#define NULL nullptr +#endif diff --git a/reactos/win32ss/win32kp.h b/reactos/win32ss/win32kp.h index d711f857836..3748da46e9f 100644 --- a/reactos/win32ss/win32kp.h +++ b/reactos/win32ss/win32kp.h @@ -27,18 +27,10 @@ #define DBG_ENABLE_EVENT_LOGGING 0 #define DBG_ENABLE_SERVICE_HOOKS 0 -/* CSRSS Interface */ -#include "user/ntuser/csr.h" - -/* Misc headers */ -#include "user/ntuser/win32kdebug.h" -#include "user/ntuser/mmcopy.h" -#include "user/ntuser/tags.h" -#include "gdi/ntgdi/rect.h" -#include "gdi/ntgdi/misc.h" - /* Internal NtGdi Headers */ typedef struct _DC *PDC; +#include "gdi/ntgdi/rect.h" +#include "gdi/ntgdi/misc.h" #include "gdi/ntgdi/gdiobj.h" #include "gdi/ntgdi/palette.h" #include "gdi/eng/surface.h" @@ -74,7 +66,10 @@ typedef struct _DC *PDC; #include "reactx/ntddraw/intddraw.h" /* Internal NtUser Headers */ +#include "user/ntuser/win32kdebug.h" #include "user/ntuser/win32.h" +#include "user/ntuser/tags.h" +#ifndef __cplusplus #include "user/ntuser/usrheap.h" #include "user/ntuser/object.h" #include "user/ntuser/ntuser.h" @@ -106,5 +101,11 @@ typedef struct _DC *PDC; #include "user/ntuser/scroll.h" #include "user/ntuser/winpos.h" #include "user/ntuser/callback.h" +#include "user/ntuser/mmcopy.h" + +/* CSRSS Interface */ +#include "user/ntuser/csr.h" + +#endif // __cplusplus #include "gdi/ntgdi/gdidebug.h"