[YAROTOWS] Reintegrate the branch. For a brighter future.
[reactos.git] / reactos / 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 LONG timeLast;
79 ULONG_PTR idLast;
80 INT exitCode;
81 HDESK hdesk;
82 UINT cPaintsReady; /* Count of paints pending. */
83 UINT cTimersReady; /* Count of timers pending. */
84 DWORD dwExpWinVer;
85 DWORD dwCompatFlags;
86 DWORD dwCompatFlags2;
87 struct _USER_MESSAGE_QUEUE* pqAttach;
88 PTHREADINFO ptiSibling;
89 ULONG fsHooks;
90 PHOOK sphkCurrent;
91 LPARAM lParamHkCurrent;
92 WPARAM wParamHkCurrent;
93 struct tagSBTRACK* pSBTrack;
94 HANDLE hEventQueueClient;
95 PKEVENT pEventQueueServer;
96 LIST_ENTRY PtiLink;
97 POINT ptLast;
98
99 LIST_ENTRY aphkStart[NB_HOOKS];
100 CLIENTTHREADINFO cti; // Used only when no Desktop or pcti NULL.
101 /* ReactOS */
102 LIST_ENTRY WindowListHead;
103 LIST_ENTRY W32CallbackListHead;
104 SINGLE_LIST_ENTRY ReferencesList;
105 } THREADINFO;
106
107 #include <poppack.h>
108
109 typedef struct _W32HEAP_USER_MAPPING
110 {
111 struct _W32HEAP_USER_MAPPING *Next;
112 PVOID KernelMapping;
113 PVOID UserMapping;
114 ULONG_PTR Limit;
115 ULONG Count;
116 } W32HEAP_USER_MAPPING, *PW32HEAP_USER_MAPPING;
117
118
119 /*
120 Information from STARTUPINFOW, psdk/winbase.h.
121 Set from PsGetCurrentProcess()->Peb->ProcessParameters.
122 */
123 typedef struct tagUSERSTARTUPINFO
124 {
125 ULONG cb;
126 DWORD dwX; // STARTF_USEPOSITION StartupInfo->dwX/Y
127 DWORD dwY;
128 DWORD dwXSize; // STARTF_USESIZE StartupInfo->dwX/YSize
129 DWORD dwYSize;
130 DWORD dwFlags; // STARTF_ StartupInfo->dwFlags
131 WORD wShowWindow; // StartupInfo->wShowWindow
132 USHORT cbReserved2;
133 } USERSTARTUPINFO, *PUSERSTARTUPINFO;
134
135 typedef struct _W32PROCESS
136 {
137 PEPROCESS peProcess;
138 DWORD RefCount;
139 ULONG W32PF_flags;
140 PKEVENT InputIdleEvent;
141 DWORD StartCursorHideTime;
142 struct _W32PROCESS * NextStart;
143 PVOID pDCAttrList;
144 PVOID pBrushAttrList;
145 DWORD W32Pid;
146 LONG GDIHandleCount;
147 LONG UserHandleCount;
148 PEX_PUSH_LOCK GDIPushLock; /* Locking Process during access to structure. */
149 RTL_AVL_TABLE GDIEngUserMemAllocTable; /* Process AVL Table. */
150 LIST_ENTRY GDIDcAttrFreeList;
151 LIST_ENTRY GDIBrushAttrFreeList;
152 } W32PROCESS, *PW32PROCESS;
153
154 #define CLIBS 32
155
156 typedef struct _PROCESSINFO
157 {
158 W32PROCESS;
159 PTHREADINFO ptiList;
160 PTHREADINFO ptiMainThread;
161 struct _DESKTOP* rpdeskStartup;
162 PCLS pclsPrivateList;
163 PCLS pclsPublicList;
164 DWORD dwhmodLibLoadedMask;
165 HANDLE ahmodLibLoaded[CLIBS];
166 struct _WINSTATION_OBJECT *prpwinsta;
167 HWINSTA hwinsta;
168 ACCESS_MASK amwinsta;
169 DWORD dwHotkey;
170 HMONITOR hMonitor;
171 LUID luidSession;
172 USERSTARTUPINFO usi;
173 DWORD dwLayout;
174 DWORD dwRegisteredClasses;
175 /* ReactOS */
176 LIST_ENTRY ClassList;
177 LIST_ENTRY MenuListHead;
178 FAST_MUTEX PrivateFontListLock;
179 LIST_ENTRY PrivateFontListHead;
180 FAST_MUTEX DriverObjListLock;
181 LIST_ENTRY DriverObjListHead;
182 struct _KBL* KeyboardLayout; // THREADINFO only
183 W32HEAP_USER_MAPPING HeapMappings;
184 } PROCESSINFO;