4 #define W32PF_CONSOLEAPPLICATION 0x00000001
5 #define W32PF_FORCEOFFFEEDBACK 0x00000002
6 #define W32PF_STARTGLASS 0x00000004
7 #define W32PF_WOW 0x00000008
8 #define W32PF_READSCREENACCESSGRANTED 0x00000010
9 #define W32PF_INITIALIZED 0x00000020
10 #define W32PF_APPSTARTING 0x00000040
11 #define W32PF_WOW64 0x00000080
12 #define W32PF_ALLOWFOREGROUNDACTIVATE 0x00000100
13 #define W32PF_OWNDCCLEANUP 0x00000200
14 #define W32PF_SHOWSTARTGLASSCALLED 0x00000400
15 #define W32PF_FORCEBACKGROUNDPRIORITY 0x00000800
16 #define W32PF_TERMINATED 0x00001000
17 #define W32PF_CLASSESREGISTERED 0x00002000
18 #define W32PF_THREADCONNECTED 0x00004000
19 #define W32PF_PROCESSCONNECTED 0x00008000
20 #define W32PF_SETFOREGROUNDALLOWED 0x00008000
21 #define W32PF_WAKEWOWEXEC 0x00010000
22 #define W32PF_WAITFORINPUTIDLE 0x00020000
23 #define W32PF_IOWINSTA 0x00040000
24 #define W32PF_CONSOLEFOREGROUND 0x00080000
25 #define W32PF_OLELOADED 0x00100000
26 #define W32PF_SCREENSAVER 0x00200000
27 #define W32PF_IDLESCREENSAVER 0x00400000
28 #define W32PF_ICONTITLEREGISTERED 0x10000000
29 #define W32PF_DPIAWARE 0x20000000
31 #define W32PF_NOWINDOWGHOSTING (0x01000000)
32 #define W32PF_MANUALGUICHECK (0x02000000)
33 #define W32PF_CREATEDWINORDC (0x04000000)
34 #define W32PF_APIHOOKLOADED (0x08000000)
38 typedef enum _QS_ROS_TYPES
47 } QS_ROS_TYPES
, *PQS_ROS_TYPES
;
49 extern BOOL ClientPfnInit
;
50 extern HINSTANCE hModClient
;
51 extern HANDLE hModuleWin
; // This Win32k Instance.
52 extern struct _CLS
*SystemClassList
;
53 extern BOOL RegisteredSysClasses
;
56 // FIXME: Move to ntuser.h
64 typedef struct _W32THREAD
73 DWORD dwEngAcquireCount
;
76 } W32THREAD
, *PW32THREAD
;
79 typedef struct _THREADINFO
: _W32THREAD
82 typedef struct _THREADINFO
88 struct _USER_MESSAGE_QUEUE
* MessageQueue
;
89 struct tagKL
* KeyboardLayout
;
90 struct _CLIENTTHREADINFO
* pcti
;
91 struct _DESKTOP
* rpdesk
;
92 struct _DESKTOPINFO
* pDeskInfo
;
93 struct _CLIENTINFO
* pClientInfo
;
95 PUNICODE_STRING pstrAppName
;
96 /* Messages that are currently dispatched to other threads */
97 LIST_ENTRY DispatchingMessagesHead
; // psmsSent
98 struct _USER_SENT_MESSAGE
*pusmCurrent
;
99 /* Queue of messages sent to the queue. */
100 LIST_ENTRY SentMessagesListHead
; // psmsReceiveList
101 /* Last time PeekMessage() was called. */
104 /* True if a WM_QUIT message is pending. */
106 /* The quit exit code. */
109 UINT cPaintsReady
; /* Count of paints pending. */
110 UINT cTimersReady
; /* Count of timers pending. */
111 struct tagMENUSTATE
* pMenuState
;
114 DWORD dwCompatFlags2
;
115 struct _USER_MESSAGE_QUEUE
* pqAttach
;
116 PTHREADINFO ptiSibling
;
118 struct tagHOOK
* sphkCurrent
;
119 LPARAM lParamHkCurrent
;
120 WPARAM wParamHkCurrent
;
121 struct tagSBTRACK
* pSBTrack
;
122 /* Set if there are new messages specified by WakeMask in any of the queues. */
123 HANDLE hEventQueueClient
;
124 /* Handle for the above event (in the context of the process owning the queue). */
125 PKEVENT pEventQueueServer
;
130 /* Queue of messages posted to the queue. */
131 LIST_ENTRY PostedMessagesListHead
; // mlPost
132 WORD fsChangeBitsRemoved
;
136 #ifndef __cplusplus /// FIXME!
137 LIST_ENTRY aphkStart
[NB_HOOKS
];
138 CLIENTTHREADINFO cti
; // Used only when no Desktop or pcti NULL.
142 /* Thread Queue state tracking */
143 // Send list QS_SENDMESSAGE
144 // Post list QS_POSTMESSAGE|QS_HOTKEY|QS_PAINT|QS_TIMER|QS_KEY
145 // Hard list QS_MOUSE|QS_KEY only
146 // Accounting of queue bit sets, the rest are flags. QS_TIMER QS_PAINT counts are handled in thread information.
147 DWORD nCntsQBits
[QSIDCOUNTS
]; // QS_KEY QS_MOUSEMOVE QS_MOUSEBUTTON QS_POSTMESSAGE QS_SENDMESSAGE QS_HOTKEY
149 /* Messages that are currently dispatched by this message queue, required for cleanup */
150 LIST_ENTRY LocalDispatchingMessagesHead
;
151 LIST_ENTRY WindowListHead
;
152 LIST_ENTRY W32CallbackListHead
;
153 SINGLE_LIST_ENTRY ReferencesList
;
154 ULONG cExclusiveLocks
;
156 USHORT acExclusiveLockCount
[GDIObjTypeTotal
+ 1];
158 #endif // __cplusplus
164 #define IntReferenceThreadInfo(pti) \
165 InterlockedIncrement(&(pti)->RefCount)
167 VOID
UserDeleteW32Thread(PTHREADINFO
);
169 #define IntDereferenceThreadInfo(pti) \
171 if (InterlockedDecrement(&(pti)->RefCount) == 0) \
173 ASSERT(((pti)->TIF_flags & (TIF_INCLEANUP|TIF_DONTATTACHQUEUE)) == (TIF_INCLEANUP|TIF_DONTATTACHQUEUE)); \
174 UserDeleteW32Thread(pti); \
179 #define IntReferenceProcessInfo(ppi) \
180 InterlockedIncrement((volatile LONG*)(&(ppi)->RefCount))
182 VOID
UserDeleteW32Process(_Pre_notnull_
__drv_freesMem(Mem
) PPROCESSINFO
);
184 #define IntDereferenceProcessInfo(ppi) \
186 if (InterlockedDecrement((volatile LONG*)(&(ppi)->RefCount)) == 0) \
188 ASSERT(((ppi)->W32PF_flags & W32PF_TERMINATED) != 0); \
189 UserDeleteW32Process(ppi); \
194 typedef struct _W32HEAP_USER_MAPPING
196 struct _W32HEAP_USER_MAPPING
* Next
;
201 } W32HEAP_USER_MAPPING
, *PW32HEAP_USER_MAPPING
;
205 Information from STARTUPINFOW, psdk/winbase.h.
206 Set from PsGetCurrentProcess()->Peb->ProcessParameters.
208 typedef struct tagUSERSTARTUPINFO
211 DWORD dwX
; // STARTF_USEPOSITION StartupInfo->dwX/Y
213 DWORD dwXSize
; // STARTF_USESIZE StartupInfo->dwX/YSize
215 DWORD dwFlags
; // STARTF_ StartupInfo->dwFlags
216 WORD wShowWindow
; // StartupInfo->wShowWindow
218 } USERSTARTUPINFO
, *PUSERSTARTUPINFO
;
220 typedef struct _W32PROCESS
225 PKEVENT InputIdleEvent
;
226 DWORD StartCursorHideTime
;
227 struct _W32PROCESS
* NextStart
;
229 PVOID pBrushAttrList
;
232 LONG UserHandleCount
;
233 PEX_PUSH_LOCK GDIPushLock
; /* Locking Process during access to structure. */
234 RTL_AVL_TABLE GDIEngUserMemAllocTable
; /* Process AVL Table. */
235 LIST_ENTRY GDIDcAttrFreeList
;
236 LIST_ENTRY GDIBrushAttrFreeList
;
237 } W32PROCESS
, *PW32PROCESS
;
242 typedef struct _PROCESSINFO
: _W32PROCESS
245 typedef struct _PROCESSINFO
250 PTHREADINFO ptiMainThread
;
251 struct _DESKTOP
* rpdeskStartup
;
252 struct _CLS
*pclsPrivateList
;
253 struct _CLS
*pclsPublicList
;
254 PPROCESSINFO ppiNext
;
257 DWORD dwhmodLibLoadedMask
;
258 HANDLE ahmodLibLoaded
[CLIBS
];
259 struct _WINSTATION_OBJECT
* prpwinsta
;
261 ACCESS_MASK amwinsta
;
264 UINT iClipSerialNumber
;
265 struct _CURICON_OBJECT
* pCursorCache
;
267 DWORD dwLpkEntryPoints
;
269 DWORD dwImeCompatFlags
;
273 DWORD dwRegisteredClasses
;
276 FAST_MUTEX PrivateFontListLock
;
277 LIST_ENTRY PrivateFontListHead
;
278 FAST_MUTEX DriverObjListLock
;
279 LIST_ENTRY DriverObjListHead
;
280 struct tagKL
* KeyboardLayout
; // THREADINFO only
281 W32HEAP_USER_MAPPING HeapMappings
;
282 struct _GDI_POOL
* pPoolDcAttr
;
283 struct _GDI_POOL
* pPoolBrushAttr
;
284 struct _GDI_POOL
* pPoolRgnAttr
;
287 BYTE DbgChannelLevel
[DbgChCount
];
289 DWORD DbgHandleCount
[TYPE_CTYPES
];
290 #endif // __cplusplus
295 void NTAPI
UserDbgPreServiceHook(ULONG ulSyscallId
, PULONG_PTR pulArguments
);
296 ULONG_PTR NTAPI
UserDbgPostServiceHook(ULONG ulSyscallId
, ULONG_PTR ulResult
);