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
;
55 typedef struct tagMENUSTATE MENUSTATE
, *PMENUSTATE
;
58 // FIXME: Move to ntuser.h
66 typedef struct _W32THREAD
75 DWORD dwEngAcquireCount
;
78 } W32THREAD
, *PW32THREAD
;
81 typedef struct _THREADINFO
: _W32THREAD
84 typedef struct _THREADINFO
90 struct _USER_MESSAGE_QUEUE
* MessageQueue
;
91 struct tagKL
* KeyboardLayout
;
92 struct _CLIENTTHREADINFO
* pcti
;
93 struct _DESKTOP
* rpdesk
;
94 struct _DESKTOPINFO
* pDeskInfo
;
95 struct _CLIENTINFO
* pClientInfo
;
97 PUNICODE_STRING pstrAppName
;
98 /* Messages that are currently dispatched to other threads */
99 LIST_ENTRY DispatchingMessagesHead
; // psmsSent
100 struct _USER_SENT_MESSAGE
*pusmCurrent
;
101 /* Queue of messages sent to the queue. */
102 LIST_ENTRY SentMessagesListHead
; // psmsReceiveList
103 /* Last time PeekMessage() was called. */
106 /* True if a WM_QUIT message is pending. */
108 /* The quit exit code. */
111 UINT cPaintsReady
; /* Count of paints pending. */
112 UINT cTimersReady
; /* Count of timers pending. */
113 PMENUSTATE pMenuState
;
116 DWORD dwCompatFlags2
;
117 struct _USER_MESSAGE_QUEUE
* pqAttach
;
118 PTHREADINFO ptiSibling
;
120 struct tagHOOK
* sphkCurrent
;
121 LPARAM lParamHkCurrent
;
122 WPARAM wParamHkCurrent
;
123 struct tagSBTRACK
* pSBTrack
;
124 /* Set if there are new messages specified by WakeMask in any of the queues. */
125 HANDLE hEventQueueClient
;
126 /* Handle for the above event (in the context of the process owning the queue). */
127 PKEVENT pEventQueueServer
;
132 /* Queue of messages posted to the queue. */
133 LIST_ENTRY PostedMessagesListHead
; // mlPost
134 WORD fsChangeBitsRemoved
;
138 #ifndef __cplusplus /// FIXME!
139 LIST_ENTRY aphkStart
[NB_HOOKS
];
140 CLIENTTHREADINFO cti
; // Used only when no Desktop or pcti NULL.
144 /* Thread Queue state tracking */
145 // Send list QS_SENDMESSAGE
146 // Post list QS_POSTMESSAGE|QS_HOTKEY|QS_PAINT|QS_TIMER|QS_KEY
147 // Hard list QS_MOUSE|QS_KEY only
148 // Accounting of queue bit sets, the rest are flags. QS_TIMER QS_PAINT counts are handled in thread information.
149 DWORD nCntsQBits
[QSIDCOUNTS
]; // QS_KEY QS_MOUSEMOVE QS_MOUSEBUTTON QS_POSTMESSAGE QS_SENDMESSAGE QS_HOTKEY
151 /* Messages that are currently dispatched by this message queue, required for cleanup */
152 LIST_ENTRY LocalDispatchingMessagesHead
;
153 LIST_ENTRY WindowListHead
;
154 LIST_ENTRY W32CallbackListHead
;
155 SINGLE_LIST_ENTRY ReferencesList
;
156 ULONG cExclusiveLocks
;
158 USHORT acExclusiveLockCount
[GDIObjTypeTotal
+ 1];
160 #endif // __cplusplus
166 #define IntReferenceThreadInfo(pti) \
167 InterlockedIncrement(&(pti)->RefCount)
169 VOID
UserDeleteW32Thread(PTHREADINFO
);
171 #define IntDereferenceThreadInfo(pti) \
173 if (InterlockedDecrement(&(pti)->RefCount) == 0) \
175 ASSERT(((pti)->TIF_flags & (TIF_INCLEANUP|TIF_DONTATTACHQUEUE)) == (TIF_INCLEANUP|TIF_DONTATTACHQUEUE)); \
176 UserDeleteW32Thread(pti); \
181 #define IntReferenceProcessInfo(ppi) \
182 InterlockedIncrement((volatile LONG*)(&(ppi)->RefCount))
184 VOID
UserDeleteW32Process(_Pre_notnull_
__drv_freesMem(Mem
) PPROCESSINFO
);
186 #define IntDereferenceProcessInfo(ppi) \
188 if (InterlockedDecrement((volatile LONG*)(&(ppi)->RefCount)) == 0) \
190 ASSERT(((ppi)->W32PF_flags & W32PF_TERMINATED) != 0); \
191 UserDeleteW32Process(ppi); \
196 typedef struct _W32HEAP_USER_MAPPING
198 struct _W32HEAP_USER_MAPPING
* Next
;
203 } W32HEAP_USER_MAPPING
, *PW32HEAP_USER_MAPPING
;
207 Information from STARTUPINFOW, psdk/winbase.h.
208 Set from PsGetCurrentProcess()->Peb->ProcessParameters.
210 typedef struct tagUSERSTARTUPINFO
213 DWORD dwX
; // STARTF_USEPOSITION StartupInfo->dwX/Y
215 DWORD dwXSize
; // STARTF_USESIZE StartupInfo->dwX/YSize
217 DWORD dwFlags
; // STARTF_ StartupInfo->dwFlags
218 WORD wShowWindow
; // StartupInfo->wShowWindow
220 } USERSTARTUPINFO
, *PUSERSTARTUPINFO
;
222 typedef struct _W32PROCESS
227 PKEVENT InputIdleEvent
;
228 DWORD StartCursorHideTime
;
229 struct _W32PROCESS
* NextStart
;
231 PVOID pBrushAttrList
;
234 LONG UserHandleCount
;
235 PEX_PUSH_LOCK GDIPushLock
; /* Locking Process during access to structure. */
236 RTL_AVL_TABLE GDIEngUserMemAllocTable
; /* Process AVL Table. */
237 LIST_ENTRY GDIDcAttrFreeList
;
238 LIST_ENTRY GDIBrushAttrFreeList
;
239 } W32PROCESS
, *PW32PROCESS
;
244 typedef struct _PROCESSINFO
: _W32PROCESS
247 typedef struct _PROCESSINFO
252 PTHREADINFO ptiMainThread
;
253 struct _DESKTOP
* rpdeskStartup
;
254 struct _CLS
*pclsPrivateList
;
255 struct _CLS
*pclsPublicList
;
256 PPROCESSINFO ppiNext
;
259 DWORD dwhmodLibLoadedMask
;
260 HANDLE ahmodLibLoaded
[CLIBS
];
261 struct _WINSTATION_OBJECT
* prpwinsta
;
263 ACCESS_MASK amwinsta
;
266 UINT iClipSerialNumber
;
267 struct _CURICON_OBJECT
* pCursorCache
;
269 DWORD dwLpkEntryPoints
;
271 DWORD dwImeCompatFlags
;
275 DWORD dwRegisteredClasses
;
278 FAST_MUTEX PrivateFontListLock
;
279 LIST_ENTRY PrivateFontListHead
;
280 FAST_MUTEX DriverObjListLock
;
281 LIST_ENTRY DriverObjListHead
;
282 struct tagKL
* KeyboardLayout
; // THREADINFO only
283 W32HEAP_USER_MAPPING HeapMappings
;
284 struct _GDI_POOL
* pPoolDcAttr
;
285 struct _GDI_POOL
* pPoolBrushAttr
;
286 struct _GDI_POOL
* pPoolRgnAttr
;
289 BYTE DbgChannelLevel
[DbgChCount
];
291 DWORD DbgHandleCount
[TYPE_CTYPES
];
292 #endif // __cplusplus
297 void NTAPI
UserDbgPreServiceHook(ULONG ulSyscallId
, PULONG_PTR pulArguments
);
298 ULONG_PTR NTAPI
UserDbgPostServiceHook(ULONG ulSyscallId
, ULONG_PTR ulResult
);