[CMAKE]
[reactos.git] / subsystems / win32 / win32k / include / win32.h
1 #pragma once
2
3 /* W32PROCESS flags */
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_WAKEWOWEXEC 0x00010000
21 #define W32PF_WAITFORINPUTIDLE 0x00020000
22 #define W32PF_IOWINSTA 0x00040000
23 #define W32PF_CONSOLEFOREGROUND 0x00080000
24 #define W32PF_OLELOADED 0x00100000
25 #define W32PF_SCREENSAVER 0x00200000
26 #define W32PF_IDLESCREENSAVER 0x00400000
27 #define W32PF_ICONTITLEREGISTERED 0x10000000
28 #define W32PF_DPIAWARE 0x20000000
29 // ReactOS
30 #define W32PF_NOWINDOWGHOSTING (0x01000000)
31 #define W32PF_MANUALGUICHECK (0x02000000)
32 #define W32PF_CREATEDWINORDC (0x04000000)
33
34 extern BOOL ClientPfnInit;
35 extern HINSTANCE hModClient;
36 extern HANDLE hModuleWin; // This Win32k Instance.
37 extern PCLS SystemClassList;
38 extern BOOL RegisteredSysClasses;
39
40 typedef struct _WIN32HEAP WIN32HEAP, *PWIN32HEAP;
41
42 #include <pshpack1.h>
43 // FIXME! Move to ntuser.h
44 typedef struct _TL
45 {
46 struct _TL* next;
47 PVOID pobj;
48 PVOID pfnFree;
49 } TL, *PTL;
50
51 typedef struct _W32THREAD
52 {
53 PETHREAD pEThread;
54 ULONG RefCount;
55 PTL ptlW32;
56 PVOID pgdiDcattr;
57 PVOID pgdiBrushAttr;
58 PVOID pUMPDObjs;
59 PVOID pUMPDHeap;
60 DWORD dwEngAcquireCount;
61 PVOID pSemTable;
62 PVOID pUMPDObj;
63 } W32THREAD, *PW32THREAD;
64
65 typedef struct _THREADINFO
66 {
67 W32THREAD;
68 PTL ptl;
69 PPROCESSINFO ppi;
70 struct _USER_MESSAGE_QUEUE* MessageQueue;
71 struct _KBL* KeyboardLayout;
72 PCLIENTTHREADINFO pcti;
73 struct _DESKTOP* rpdesk;
74 PDESKTOPINFO pDeskInfo;
75 PCLIENTINFO pClientInfo;
76 FLONG TIF_flags;
77 PUNICODE_STRING pstrAppName;
78 struct _USER_SENT_MESSAGE *pusmCurrent;
79 LONG timeLast;
80 ULONG_PTR idLast;
81 INT exitCode;
82 HDESK hdesk;
83 UINT cPaintsReady; /* Count of paints pending. */
84 UINT cTimersReady; /* Count of timers pending. */
85 DWORD dwExpWinVer;
86 DWORD dwCompatFlags;
87 DWORD dwCompatFlags2;
88 struct _USER_MESSAGE_QUEUE* pqAttach;
89 PTHREADINFO ptiSibling;
90 ULONG fsHooks;
91 PHOOK sphkCurrent;
92 LPARAM lParamHkCurrent;
93 WPARAM wParamHkCurrent;
94 struct tagSBTRACK* pSBTrack;
95 HANDLE hEventQueueClient;
96 PKEVENT pEventQueueServer;
97 LIST_ENTRY PtiLink;
98 POINT ptLast;
99
100 LIST_ENTRY aphkStart[NB_HOOKS];
101 CLIENTTHREADINFO cti; // Used only when no Desktop or pcti NULL.
102
103 /* ReactOS */
104 LIST_ENTRY WindowListHead;
105 LIST_ENTRY W32CallbackListHead;
106 SINGLE_LIST_ENTRY ReferencesList;
107 ULONG cExclusiveLocks;
108 #if DBG
109 USHORT acExclusiveLockCount[GDIObjTypeTotal];
110 #endif
111
112 } THREADINFO;
113
114 #include <poppack.h>
115
116 typedef struct _W32HEAP_USER_MAPPING
117 {
118 struct _W32HEAP_USER_MAPPING *Next;
119 PVOID KernelMapping;
120 PVOID UserMapping;
121 ULONG_PTR Limit;
122 ULONG Count;
123 } W32HEAP_USER_MAPPING, *PW32HEAP_USER_MAPPING;
124
125
126 /*
127 Information from STARTUPINFOW, psdk/winbase.h.
128 Set from PsGetCurrentProcess()->Peb->ProcessParameters.
129 */
130 typedef struct tagUSERSTARTUPINFO
131 {
132 ULONG cb;
133 DWORD dwX; // STARTF_USEPOSITION StartupInfo->dwX/Y
134 DWORD dwY;
135 DWORD dwXSize; // STARTF_USESIZE StartupInfo->dwX/YSize
136 DWORD dwYSize;
137 DWORD dwFlags; // STARTF_ StartupInfo->dwFlags
138 WORD wShowWindow; // StartupInfo->wShowWindow
139 USHORT cbReserved2;
140 } USERSTARTUPINFO, *PUSERSTARTUPINFO;
141
142 typedef struct _W32PROCESS
143 {
144 PEPROCESS peProcess;
145 DWORD RefCount;
146 ULONG W32PF_flags;
147 PKEVENT InputIdleEvent;
148 DWORD StartCursorHideTime;
149 struct _W32PROCESS * NextStart;
150 PVOID pDCAttrList;
151 PVOID pBrushAttrList;
152 DWORD W32Pid;
153 LONG GDIHandleCount;
154 LONG UserHandleCount;
155 PEX_PUSH_LOCK GDIPushLock; /* Locking Process during access to structure. */
156 RTL_AVL_TABLE GDIEngUserMemAllocTable; /* Process AVL Table. */
157 LIST_ENTRY GDIDcAttrFreeList;
158 LIST_ENTRY GDIBrushAttrFreeList;
159 } W32PROCESS, *PW32PROCESS;
160
161 #define CLIBS 32
162
163 typedef struct _PROCESSINFO
164 {
165 W32PROCESS;
166 PTHREADINFO ptiList;
167 PTHREADINFO ptiMainThread;
168 struct _DESKTOP* rpdeskStartup;
169 PCLS pclsPrivateList;
170 PCLS pclsPublicList;
171 INT cThreads;
172 HDESK hdeskStartup;
173 DWORD dwhmodLibLoadedMask;
174 HANDLE ahmodLibLoaded[CLIBS];
175 struct _WINSTATION_OBJECT *prpwinsta;
176 HWINSTA hwinsta;
177 ACCESS_MASK amwinsta;
178 DWORD dwHotkey;
179 HMONITOR hMonitor;
180 LUID luidSession;
181 USERSTARTUPINFO usi;
182 DWORD dwLayout;
183 DWORD dwRegisteredClasses;
184 /* ReactOS */
185 LIST_ENTRY MenuListHead;
186 FAST_MUTEX PrivateFontListLock;
187 LIST_ENTRY PrivateFontListHead;
188 FAST_MUTEX DriverObjListLock;
189 LIST_ENTRY DriverObjListHead;
190 struct _KBL* KeyboardLayout; // THREADINFO only
191 W32HEAP_USER_MAPPING HeapMappings;
192 struct _GDI_POOL *pPoolDcAttr;
193 struct _GDI_POOL *pPoolBrushAttr;
194 struct _GDI_POOL *pPoolRgnAttr;
195 } PROCESSINFO;