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 PCLS SystemClassList
;
53 extern BOOL RegisteredSysClasses
;
55 typedef struct _WIN32HEAP WIN32HEAP
, *PWIN32HEAP
;
58 // FIXME: Move to ntuser.h
66 typedef struct _W32THREAD
75 DWORD dwEngAcquireCount
;
78 } W32THREAD
, *PW32THREAD
;
80 typedef struct _THREADINFO
85 struct _USER_MESSAGE_QUEUE
* MessageQueue
;
86 struct tagKL
* KeyboardLayout
;
87 PCLIENTTHREADINFO pcti
;
88 struct _DESKTOP
* rpdesk
;
89 PDESKTOPINFO pDeskInfo
;
90 PCLIENTINFO pClientInfo
;
92 PUNICODE_STRING pstrAppName
;
93 /* Messages that are currently dispatched to other threads */
94 LIST_ENTRY DispatchingMessagesHead
; // psmsSent
95 struct _USER_SENT_MESSAGE
*pusmCurrent
;
96 /* Queue of messages sent to the queue. */
97 LIST_ENTRY SentMessagesListHead
; // psmsReceiveList
98 /* Last time PeekMessage() was called. */
101 /* True if a WM_QUIT message is pending. */
103 /* The quit exit code. */
106 UINT cPaintsReady
; /* Count of paints pending. */
107 UINT cTimersReady
; /* Count of timers pending. */
110 DWORD dwCompatFlags2
;
111 struct _USER_MESSAGE_QUEUE
* pqAttach
;
112 PTHREADINFO ptiSibling
;
115 LPARAM lParamHkCurrent
;
116 WPARAM wParamHkCurrent
;
117 struct tagSBTRACK
* pSBTrack
;
118 /* Set if there are new messages specified by WakeMask in any of the queues. */
119 HANDLE hEventQueueClient
;
120 /* Handle for the above event (in the context of the process owning the queue). */
121 PKEVENT pEventQueueServer
;
126 /* Queue of messages posted to the queue. */
127 LIST_ENTRY PostedMessagesListHead
; // mlPost
128 UINT fsChangeBitsRemoved
;
131 LIST_ENTRY aphkStart
[NB_HOOKS
];
132 CLIENTTHREADINFO cti
; // Used only when no Desktop or pcti NULL.
136 /* Thread Queue state tracking */
137 // Send list QS_SENDMESSAGE
138 // Post list QS_POSTMESSAGE|QS_HOTKEY|QS_PAINT|QS_TIMER|QS_KEY
139 // Hard list QS_MOUSE|QS_KEY only
140 // Accounting of queue bit sets, the rest are flags. QS_TIMER QS_PAINT counts are handled in thread information.
141 DWORD nCntsQBits
[QSIDCOUNTS
]; // QS_KEY QS_MOUSEMOVE QS_MOUSEBUTTON QS_POSTMESSAGE QS_SENDMESSAGE QS_HOTKEY
143 /* Messages that are currently dispatched by this message queue, required for cleanup */
144 LIST_ENTRY LocalDispatchingMessagesHead
;
145 LIST_ENTRY WindowListHead
;
146 LIST_ENTRY W32CallbackListHead
;
147 SINGLE_LIST_ENTRY ReferencesList
;
148 ULONG cExclusiveLocks
;
150 USHORT acExclusiveLockCount
[GDIObjTypeTotal
+ 1];
158 #define IntReferenceThreadInfo(pti) \
159 InterlockedIncrement(&(pti)->RefCount)
161 VOID
UserDeleteW32Thread(PTHREADINFO
);
163 #define IntDereferenceThreadInfo(pti) \
165 if(InterlockedDecrement(&(pti)->RefCount) == 0) \
167 ASSERT(((pti)->TIF_flags & (TIF_INCLEANUP|TIF_DONTATTACHQUEUE)) == (TIF_INCLEANUP|TIF_DONTATTACHQUEUE)); \
168 UserDeleteW32Thread(pti); \
172 #define IntReferenceProcessInfo(ppi) \
173 InterlockedIncrement((volatile LONG*)(&(ppi)->RefCount))
175 VOID
UserDeleteW32Process(PPROCESSINFO
);
177 #define IntDereferenceProcessInfo(ppi) \
179 if(InterlockedDecrement((volatile LONG*)(&(ppi)->RefCount)) == 0) \
181 ASSERT(((ppi)->W32PF_flags & W32PF_TERMINATED) != 0); \
182 UserDeleteW32Process(ppi); \
187 typedef struct _W32HEAP_USER_MAPPING
189 struct _W32HEAP_USER_MAPPING
*Next
;
194 } W32HEAP_USER_MAPPING
, *PW32HEAP_USER_MAPPING
;
198 Information from STARTUPINFOW, psdk/winbase.h.
199 Set from PsGetCurrentProcess()->Peb->ProcessParameters.
201 typedef struct tagUSERSTARTUPINFO
204 DWORD dwX
; // STARTF_USEPOSITION StartupInfo->dwX/Y
206 DWORD dwXSize
; // STARTF_USESIZE StartupInfo->dwX/YSize
208 DWORD dwFlags
; // STARTF_ StartupInfo->dwFlags
209 WORD wShowWindow
; // StartupInfo->wShowWindow
211 } USERSTARTUPINFO
, *PUSERSTARTUPINFO
;
213 typedef struct _W32PROCESS
218 PKEVENT InputIdleEvent
;
219 DWORD StartCursorHideTime
;
220 struct _W32PROCESS
* NextStart
;
222 PVOID pBrushAttrList
;
225 LONG UserHandleCount
;
226 PEX_PUSH_LOCK GDIPushLock
; /* Locking Process during access to structure. */
227 RTL_AVL_TABLE GDIEngUserMemAllocTable
; /* Process AVL Table. */
228 LIST_ENTRY GDIDcAttrFreeList
;
229 LIST_ENTRY GDIBrushAttrFreeList
;
230 } W32PROCESS
, *PW32PROCESS
;
234 typedef struct _PROCESSINFO
238 PTHREADINFO ptiMainThread
;
239 struct _DESKTOP
* rpdeskStartup
;
240 PCLS pclsPrivateList
;
242 PPROCESSINFO ppiNext
;
245 DWORD dwhmodLibLoadedMask
;
246 HANDLE ahmodLibLoaded
[CLIBS
];
247 struct _WINSTATION_OBJECT
*prpwinsta
;
249 ACCESS_MASK amwinsta
;
252 struct _CURICON_OBJECT
* pCursorCache
;
257 DWORD dwRegisteredClasses
;
259 FAST_MUTEX PrivateFontListLock
;
260 LIST_ENTRY PrivateFontListHead
;
261 FAST_MUTEX DriverObjListLock
;
262 LIST_ENTRY DriverObjListHead
;
263 struct tagKL
* KeyboardLayout
; // THREADINFO only
264 W32HEAP_USER_MAPPING HeapMappings
;
265 struct _GDI_POOL
*pPoolDcAttr
;
266 struct _GDI_POOL
*pPoolBrushAttr
;
267 struct _GDI_POOL
*pPoolRgnAttr
;
270 BYTE DbgChannelLevel
[DbgChCount
];
271 DWORD DbgHandleCount
[TYPE_CTYPES
];
276 void NTAPI
UserDbgPreServiceHook(ULONG ulSyscallId
, PULONG_PTR pulArguments
);
277 ULONG_PTR NTAPI
UserDbgPostServiceHook(ULONG ulSyscallId
, ULONG_PTR ulResult
);