xref: /reactos/win32ss/include/ntuser.h (revision 5efb6e3d)
1 #ifndef __WIN32K_NTUSER_H
2 #define __WIN32K_NTUSER_H
3 
4 struct _PROCESSINFO;
5 struct _THREADINFO;
6 struct _DESKTOP;
7 struct _WND;
8 struct tagPOPUPMENU;
9 
10 #define FIRST_USER_HANDLE 0x0020 /* first possible value for low word of user handle */
11 #define LAST_USER_HANDLE 0xffef /* last possible value for low word of user handle */
12 
13 #define HANDLEENTRY_DESTROY 1
14 #define HANDLEENTRY_INDESTROY 2
15 
16 typedef struct _USER_HANDLE_ENTRY
17 {
18     void *ptr; /* pointer to object */
19     union
20     {
21         PVOID pi;
22         struct _THREADINFO *pti; /* pointer to Win32ThreadInfo */
23         struct _PROCESSINFO *ppi; /* pointer to W32ProcessInfo */
24     };
25     unsigned char type; /* object type (0 if free) */
26     unsigned char flags;
27     unsigned short generation; /* generation counter */
28 } USER_HANDLE_ENTRY, *PUSER_HANDLE_ENTRY;
29 
30 typedef struct _USER_HANDLE_TABLE
31 {
32     PUSER_HANDLE_ENTRY handles;
33     PUSER_HANDLE_ENTRY freelist;
34     int nb_handles;
35     int allocated_handles;
36 } USER_HANDLE_TABLE, *PUSER_HANDLE_TABLE;
37 
38 typedef enum _HANDLE_TYPE
39 {
40     TYPE_FREE = 0,
41     TYPE_WINDOW = 1,
42     TYPE_MENU = 2,
43     TYPE_CURSOR = 3,
44     TYPE_SETWINDOWPOS = 4,
45     TYPE_HOOK = 5,
46     TYPE_CLIPDATA = 6,
47     TYPE_CALLPROC = 7,
48     TYPE_ACCELTABLE = 8,
49     TYPE_DDEACCESS = 9,
50     TYPE_DDECONV = 10,
51     TYPE_DDEXACT = 11,
52     TYPE_MONITOR = 12,
53     TYPE_KBDLAYOUT = 13,
54     TYPE_KBDFILE = 14,
55     TYPE_WINEVENTHOOK = 15,
56     TYPE_TIMER = 16,
57     TYPE_INPUTCONTEXT = 17,
58     TYPE_HIDDATA = 18,
59     TYPE_DEVICEINFO = 19,
60     TYPE_TOUCHINPUTINFO = 20,
61     TYPE_GESTUREINFOOBJ = 21,
62     TYPE_CTYPES,
63     TYPE_GENERIC = 255
64 } HANDLE_TYPE, *PHANDLE_TYPE;
65 
66 typedef enum _USERTHREADINFOCLASS
67 {
68     UserThreadShutdownInformation,
69     UserThreadFlags,
70     UserThreadTaskName,
71     UserThreadWOWInformation,
72     UserThreadHungStatus,
73     UserThreadInitiateShutdown,
74     UserThreadEndShutdown,
75     UserThreadUseActiveDesktop,
76     UserThreadUseDesktop,
77     UserThreadRestoreDesktop,
78     UserThreadCsrApiPort,
79 } USERTHREADINFOCLASS;
80 
81 typedef struct _LARGE_UNICODE_STRING
82 {
83     ULONG Length;
84     ULONG MaximumLength:31;
85     ULONG bAnsi:1;
86     PWSTR Buffer;
87 } LARGE_UNICODE_STRING, *PLARGE_UNICODE_STRING;
88 
89 typedef struct _LARGE_STRING
90 {
91     ULONG Length;
92     ULONG MaximumLength:31;
93     ULONG bAnsi:1;
94     PVOID Buffer;
95 } LARGE_STRING, *PLARGE_STRING;
96 
97 
98 /* Based on ANSI_STRING */
99 typedef struct _LARGE_ANSI_STRING
100 {
101     ULONG Length;
102     ULONG MaximumLength:31;
103     ULONG bAnsi:1;
104     PCHAR Buffer;
105 } LARGE_ANSI_STRING, *PLARGE_ANSI_STRING;
106 
107 VOID
108 NTAPI
109 RtlInitLargeAnsiString(
110     IN OUT PLARGE_ANSI_STRING,
111     IN PCSZ,
112     IN INT);
113 
114 VOID
115 NTAPI
116 RtlInitLargeUnicodeString(
117     IN OUT PLARGE_UNICODE_STRING,
118     IN PCWSTR,
119     IN INT);
120 
121 BOOL
122 NTAPI
123 RtlLargeStringToUnicodeString(
124     PUNICODE_STRING,
125     PLARGE_STRING);
126 
127 #define NB_HOOKS (WH_MAXHOOK - WH_MINHOOK + 1)
128 
129 /*
130  * DESKTOPINFO structure.
131  * See also: https://reactos.org/wiki/Techwiki:Win32k/DESKTOP
132  */
133 typedef struct _DESKTOPINFO
134 {
135     PVOID pvDesktopBase;
136     PVOID pvDesktopLimit;
137     struct _WND *spwnd;
138     DWORD fsHooks;
139     LIST_ENTRY aphkStart[NB_HOOKS];
140 
141     HWND hTaskManWindow;
142     HWND hProgmanWindow;
143     HWND hShellWindow;
144     struct _WND *spwndShell;
145     struct _WND *spwndBkGnd;
146 
147     struct _PROCESSINFO *ppiShellProcess;
148 
149     union
150     {
151         UINT Dummy;
152         struct
153         {
154             UINT LastInputWasKbd:1;
155         };
156     };
157 
158     WCHAR szDesktopName[1];
159 } DESKTOPINFO, *PDESKTOPINFO;
160 
161 #define CTI_THREADSYSLOCK 0x0001
162 #define CTI_INSENDMESSAGE 0x0002
163 
164 /*
165  * CLIENTTHREADINFO structure.
166  * See also: https://reactos.org/wiki/Techwiki:Win32k/CLIENTTHREADINFO
167  */
168 typedef struct _CLIENTTHREADINFO
169 {
170     DWORD CTI_flags;
171     WORD fsChangeBits;
172     WORD fsWakeBits;
173     WORD fsWakeBitsJournal;
174     WORD fsWakeMask;
175     ULONG timeLastRead; // Last time the message queue was read.
176     DWORD dwcPumpHook;
177 } CLIENTTHREADINFO, *PCLIENTTHREADINFO;
178 
179 typedef struct _HEAD
180 {
181     HANDLE h;
182     DWORD cLockObj;
183 } HEAD, *PHEAD;
184 
185 typedef struct _THROBJHEAD
186 {
187     HEAD;
188     struct _THREADINFO *pti;
189 } THROBJHEAD, *PTHROBJHEAD;
190 
191 typedef struct _THRDESKHEAD
192 {
193     THROBJHEAD;
194     struct _DESKTOP *rpdesk;
195     PVOID pSelf;
196 } THRDESKHEAD, *PTHRDESKHEAD;
197 
198 typedef struct tagIMC
199 {
200     THRDESKHEAD    head;
201     struct tagIMC *pImcNext;
202     ULONG_PTR      dwClientImcData;
203     HWND           hImeWnd;
204 } IMC, *PIMC;
205 
206 #ifndef _WIN64
207 C_ASSERT(offsetof(IMC, head.h) == 0x0);
208 C_ASSERT(offsetof(IMC, head.cLockObj) == 0x4);
209 C_ASSERT(offsetof(IMC, head.pti) == 0x8);
210 C_ASSERT(offsetof(IMC, pImcNext) == 0x14);
211 C_ASSERT(offsetof(IMC, dwClientImcData) == 0x18);
212 C_ASSERT(offsetof(IMC, hImeWnd) == 0x1c);
213 #endif
214 
215 typedef struct _PROCDESKHEAD
216 {
217     HEAD;
218     DWORD_PTR hTaskWow;
219     struct _DESKTOP *rpdesk;
220     PVOID pSelf;
221 } PROCDESKHEAD, *PPROCDESKHEAD;
222 
223 typedef struct _PROCMARKHEAD
224 {
225     HEAD;
226     ULONG hTaskWow;
227     struct _PROCESSINFO *ppi;
228 } PROCMARKHEAD, *PPROCMARKHEAD;
229 
230 #define UserHMGetHandle(obj) ((obj)->head.h)
231 
232 /* Window Client Information structure */
233 struct _ETHREAD;
234 
235 #define WEF_SETBYWNDPTI 0x0001
236 
237 typedef struct tagHOOK
238 {
239     THRDESKHEAD head;
240     struct tagHOOK *phkNext; /* This is for user space. */
241     int HookId; /* Hook table index */
242     ULONG_PTR offPfn;
243     ULONG flags; /* Some internal flags */
244     INT_PTR ihmod;
245     struct _THREADINFO *ptiHooked;
246     struct _DESKTOP *rpdesk;
247     /* ReactOS */
248     LIST_ENTRY Chain; /* Hook chain entry */
249     HOOKPROC Proc; /* Hook function */
250     BOOLEAN Ansi; /* Is it an Ansi hook? */
251     UNICODE_STRING ModuleName; /* Module name for global hooks */
252 } HOOK, *PHOOK;
253 
254 typedef struct tagCLIPBOARDDATA
255 {
256     HEAD head;
257     DWORD cbData;
258     BYTE Data[0];
259 } CLIPBOARDDATA, *PCLIPBOARDDATA;
260 
261 /* THREADINFO Flags */
262 #define TIF_INCLEANUP               0x00000001
263 #define TIF_16BIT                   0x00000002
264 #define TIF_SYSTEMTHREAD            0x00000004
265 #define TIF_CSRSSTHREAD             0x00000008
266 #define TIF_TRACKRECTVISIBLE        0x00000010
267 #define TIF_ALLOWFOREGROUNDACTIVATE 0x00000020
268 #define TIF_DONTATTACHQUEUE         0x00000040
269 #define TIF_DONTJOURNALATTACH       0x00000080
270 #define TIF_WOW64                   0x00000100
271 #define TIF_INACTIVATEAPPMSG        0x00000200
272 #define TIF_SPINNING                0x00000400
273 #define TIF_PALETTEAWARE            0x00000800
274 #define TIF_SHAREDWOW               0x00001000
275 #define TIF_FIRSTIDLE               0x00002000
276 #define TIF_WAITFORINPUTIDLE        0x00004000
277 #define TIF_MOVESIZETRACKING        0x00008000
278 #define TIF_VDMAPP                  0x00010000
279 #define TIF_DOSEMULATOR             0x00020000
280 #define TIF_GLOBALHOOKER            0x00040000
281 #define TIF_DELAYEDEVENT            0x00080000
282 #define TIF_MSGPOSCHANGED           0x00100000
283 #define TIF_SHUTDOWNCOMPLETE        0x00200000
284 #define TIF_IGNOREPLAYBACKDELAY     0x00400000
285 #define TIF_ALLOWOTHERACCOUNTHOOK   0x00800000
286 #define TIF_GUITHREADINITIALIZED    0x02000000
287 #define TIF_DISABLEIME              0x04000000
288 #define TIF_INGETTEXTLENGTH         0x08000000
289 #define TIF_ANSILENGTH              0x10000000
290 #define TIF_DISABLEHOOKS            0x20000000
291 
292 typedef struct _CALLBACKWND
293 {
294     HWND hWnd;
295     struct _WND *pWnd;
296     PVOID pActCtx;
297 } CALLBACKWND, *PCALLBACKWND;
298 
299 #define CI_TRANSACTION       0x00000001
300 #define CI_QUEUEMSG          0x00000002
301 #define CI_WOW               0x00000004
302 #define CI_INITTHREAD        0x00000008
303 #define CI_CURTHPRHOOK       0x00000010
304 #define CI_CLASSESREGISTERED 0x00000020
305 #define CI_IMMACTIVATE       0x00000040
306 #define CI_TFSDISABLED       0x00000400
307 
308 /*
309  * CLIENTINFO structure.
310  * See also: https://reactos.org/wiki/Techwiki:Win32k/CLIENTINFO
311  */
312 typedef struct _CLIENTINFO
313 {
314     ULONG_PTR CI_flags;
315     ULONG_PTR cSpins;
316     DWORD dwExpWinVer;
317     DWORD dwCompatFlags;
318     DWORD dwCompatFlags2;
319     DWORD dwTIFlags; /* ThreadInfo TIF_Xxx flags for User space. */
320     PDESKTOPINFO pDeskInfo;
321     ULONG_PTR ulClientDelta;
322     PHOOK phkCurrent;
323     ULONG fsHooks;
324     CALLBACKWND CallbackWnd;
325     DWORD dwHookCurrent;
326     INT cInDDEMLCallback;
327     PCLIENTTHREADINFO pClientThreadInfo;
328     ULONG_PTR dwHookData;
329     DWORD dwKeyCache;
330     BYTE afKeyState[8];
331     DWORD dwAsyncKeyCache;
332     BYTE afAsyncKeyState[8];
333     BYTE afAsyncKeyStateRecentDow[8];
334     HKL hKL;
335     USHORT CodePage;
336     UCHAR achDbcsCF[2];
337     MSG msgDbcsCB;
338     LPDWORD lpdwRegisteredClasses;
339     ULONG Win32ClientInfo3[26];
340 /* It's just a pointer reference not to be used w the structure in user space. */
341     struct _PROCESSINFO *ppi;
342 } CLIENTINFO, *PCLIENTINFO;
343 
344 /* Make sure it fits into the TEB */
345 C_ASSERT(sizeof(CLIENTINFO) <= sizeof(((PTEB)0)->Win32ClientInfo));
346 
347 #define GetWin32ClientInfo() ((PCLIENTINFO)(NtCurrentTeb()->Win32ClientInfo))
348 
349 typedef struct tagDDEPACK
350 {
351     UINT_PTR uiLo;
352     UINT_PTR uiHi;
353 } DDEPACK, *PDDEPACK;
354 
355 #define HRGN_NULL    ((HRGN)0) /* NULL empty region */
356 #define HRGN_WINDOW  ((HRGN)1) /* region from window rcWindow */
357 #define HRGN_MONITOR ((HRGN)2) /* region from monitor region. */
358 
359 /* Menu Item fType. */
360 #define MFT_RTOL 0x6000
361 
362 /* Menu Item fState. */
363 #define MFS_HBMMENUBMP 0x20000000
364 
365 typedef struct tagITEM
366 {
367     UINT fType;
368     UINT fState;
369     UINT wID;
370     struct tagMENU *spSubMenu; /* Pop-up menu. */
371     HANDLE hbmpChecked;
372     HANDLE hbmpUnchecked;
373     USHORT *Xlpstr; /* Item text pointer. */
374     ULONG cch;
375     DWORD_PTR dwItemData;
376     ULONG xItem; /* Item position. left */
377     ULONG yItem; /*     "          top */
378     ULONG cxItem; /* Item Size Width */
379     ULONG cyItem; /*     "     Height */
380     ULONG dxTab; /* X position of text after Tab */
381     ULONG ulX; /* underline.. start position */
382     ULONG ulWidth; /* underline.. width */
383     HBITMAP hbmp; /* bitmap */
384     INT cxBmp; /* Width Maximum size of the bitmap items in MIIM_BITMAP state */
385     INT cyBmp; /* Height " */
386     /* ReactOS */
387     UNICODE_STRING lpstr;
388 } ITEM, *PITEM;
389 
390 typedef struct tagMENULIST
391 {
392     struct tagMENULIST *pNext;
393     struct tagMENU *pMenu;
394 } MENULIST, *PMENULIST;
395 
396 /* Menu fFlags, upper byte is MNS_X style flags. */
397 #define MNF_POPUP      0x0001
398 #define MNF_UNDERLINE  0x0004
399 #define MNF_INACTIVE   0x0010
400 #define MNF_RTOL       0x0020
401 #define MNF_DESKTOPMN  0x0040
402 #define MNF_SYSDESKMN  0x0080
403 #define MNF_SYSSUBMENU 0x0100
404 /* Hack */
405 #define MNF_SYSMENU    0x0200
406 
407 /* (other FocusedItem values give the position of the focused item) */
408 #define NO_SELECTED_ITEM 0xffff
409 
410 typedef struct tagMENU
411 {
412     PROCDESKHEAD head;
413     ULONG fFlags; /* [Style flags | Menu flags] */
414     INT iItem; /* nPos of selected item, if -1 not selected. AKA focused item */
415     UINT cAlloced; /* Number of allocated items. Inc's of 8 */
416     UINT cItems; /* Number of items in the menu */
417     ULONG cxMenu; /* Width of the whole menu */
418     ULONG cyMenu; /* Height of the whole menu */
419     ULONG cxTextAlign; /* Offset of text when items have both bitmaps and text */
420     struct _WND *spwndNotify; /* window receiving the messages for ownerdraw */
421     PITEM rgItems; /* Array of menu items */
422     struct tagMENULIST *pParentMenus; /* If this is SubMenu, list of parents. */
423     DWORD dwContextHelpId;
424     ULONG cyMax; /* max height of the whole menu, 0 is screen height */
425     DWORD_PTR dwMenuData; /* application defined value */
426     HBRUSH hbrBack; /* brush for menu background */
427     INT iTop; /* Current scroll position Top */
428     INT iMaxTop; /* Current scroll position Max Top */
429     DWORD dwArrowsOn:2; /* Arrows: 0 off, 1 on, 2 to the top, 3 to the bottom. */
430     /* ReactOS */
431     LIST_ENTRY ListEntry;
432     HWND hWnd; /* Window containing the menu, use POPUPMENU */
433     BOOL TimeToHide;
434 } MENU, *PMENU;
435 
436 typedef struct tagPOPUPMENU
437 {
438     ULONG fIsMenuBar:1;
439     ULONG fHasMenuBar:1;
440     ULONG fIsSysMenu:1;
441     ULONG fIsTrackPopup:1;
442     ULONG fDroppedLeft:1;
443     ULONG fHierarchyDropped:1;
444     ULONG fRightButton:1;
445     ULONG fToggle:1;
446     ULONG fSynchronous:1;
447     ULONG fFirstClick:1;
448     ULONG fDropNextPopup:1;
449     ULONG fNoNotify:1;
450     ULONG fAboutToHide:1;
451     ULONG fShowTimer:1;
452     ULONG fHideTimer:1;
453     ULONG fDestroyed:1;
454     ULONG fDelayedFree:1;
455     ULONG fFlushDelayedFree:1;
456     ULONG fFreed:1;
457     ULONG fInCancel:1;
458     ULONG fTrackMouseEvent:1;
459     ULONG fSendUninit:1;
460     ULONG fRtoL:1;
461     // ULONG fDesktopMenu:1;
462     ULONG iDropDir:5;
463     ULONG fUseMonitorRect:1;
464     struct _WND *spwndNotify;
465     struct _WND *spwndPopupMenu;
466     struct _WND *spwndNextPopup;
467     struct _WND *spwndPrevPopup;
468     PMENU spmenu;
469     PMENU spmenuAlternate;
470     struct _WND *spwndActivePopup;
471     struct tagPOPUPMENU *ppopupmenuRoot;
472     struct tagPOPUPMENU *ppmDelayedFree;
473     UINT posSelectedItem;
474     UINT posDropped;
475 } POPUPMENU, *PPOPUPMENU;
476 
477 typedef struct _REGISTER_SYSCLASS
478 {
479     /* This is a reactos specific class used to initialize the
480        system window classes during user32 initialization */
481     PWSTR ClassName;
482     UINT Style;
483     WNDPROC ProcW;
484     UINT ExtraBytes;
485     HICON hCursor;
486     HBRUSH hBrush;
487     WORD fiId;
488     WORD iCls;
489 } REGISTER_SYSCLASS, *PREGISTER_SYSCLASS;
490 
491 typedef struct _CLSMENUNAME
492 {
493     LPSTR pszClientAnsiMenuName;
494     LPWSTR pwszClientUnicodeMenuName;
495     PUNICODE_STRING pusMenuName;
496 } CLSMENUNAME, *PCLSMENUNAME;
497 
498 typedef struct tagSBDATA
499 {
500     INT posMin;
501     INT posMax;
502     INT page;
503     INT pos;
504 } SBDATA, *PSBDATA;
505 
506 typedef struct tagSBINFO
507 {
508     INT WSBflags;
509     SBDATA Horz;
510     SBDATA Vert;
511 } SBINFO, *PSBINFO;
512 
513 typedef struct tagSBCALC
514 {
515     INT posMin;
516     INT posMax;
517     INT page;
518     INT pos;
519     INT pxTop;
520     INT pxBottom;
521     INT pxLeft;
522     INT pxRight;
523     INT cpxThumb;
524     INT pxUpArrow;
525     INT pxDownArrow;
526     INT pxStart;
527     INT pxThumbBottom;
528     INT pxThumbTop;
529     INT cpx;
530     INT pxMin;
531 } SBCALC, *PSBCALC;
532 
533 typedef enum _GETCPD
534 {
535     UserGetCPDA2U = 0x01, /* " Unicode " */
536     UserGetCPDU2A = 0X02, /* " Ansi " */
537     UserGetCPDClass = 0X10,
538     UserGetCPDWindow = 0X20,
539     UserGetCPDDialog = 0X40,
540     UserGetCPDWndtoCls = 0X80
541 } GETCPD, *PGETCPD;
542 
543 typedef struct _CALLPROCDATA
544 {
545     PROCDESKHEAD head;
546     struct _CALLPROCDATA *spcpdNext;
547     WNDPROC pfnClientPrevious;
548     GETCPD wType;
549 } CALLPROCDATA, *PCALLPROCDATA;
550 
551 #define CSF_SERVERSIDEPROC  0x0001
552 #define CSF_ANSIPROC        0x0002
553 #define CSF_WOWDEFERDESTROY 0x0004
554 #define CSF_SYSTEMCLASS     0x0008
555 #define CSF_WOWCLASS        0x0010
556 #define CSF_WOWEXTRA        0x0020
557 #define CSF_CACHEDSMICON    0x0040
558 #define CSF_WIN40COMPAT     0x0080
559 
560 typedef struct _CLS
561 {
562     struct _CLS *pclsNext;
563     RTL_ATOM atomClassName;
564     ATOM atomNVClassName;
565     DWORD fnid;
566     struct _DESKTOP *rpdeskParent;
567     PVOID pdce;
568     DWORD CSF_flags;
569     PSTR  lpszClientAnsiMenuName; /* For client use */
570     PWSTR lpszClientUnicodeMenuName; /* "   "      " */
571     PCALLPROCDATA spcpdFirst;
572     struct _CLS *pclsBase;
573     struct _CLS *pclsClone;
574     ULONG cWndReferenceCount;
575     UINT style;
576     WNDPROC lpfnWndProc;
577     INT cbclsExtra;
578     INT cbwndExtra;
579     HINSTANCE hModule;
580     struct _CURICON_OBJECT *spicn;
581     struct _CURICON_OBJECT *spcur;
582     HBRUSH hbrBackground;
583     PWSTR lpszMenuName; /* kernel use */
584     PSTR lpszAnsiClassName; /* " */
585     struct _CURICON_OBJECT *spicnSm;
586     ////
587     UINT Unicode:1; // !CSF_ANSIPROC
588     UINT Global:1; // CS_GLOBALCLASS or CSF_SERVERSIDEPROC
589     UINT MenuNameIsString:1;
590     UINT NotUsed:29;
591 } CLS, *PCLS;
592 
593 typedef struct _SBINFOEX
594 {
595     SCROLLBARINFO ScrollBarInfo;
596     SCROLLINFO ScrollInfo;
597 } SBINFOEX, *PSBINFOEX;
598 
599 /* State Flags !Not ALL Implemented! */
600 #define WNDS_HASMENU                 0X00000001
601 #define WNDS_HASVERTICALSCROOLLBAR   0X00000002
602 #define WNDS_HASHORIZONTALSCROLLBAR  0X00000004
603 #define WNDS_HASCAPTION              0X00000008
604 #define WNDS_SENDSIZEMOVEMSGS        0X00000010
605 #define WNDS_MSGBOX                  0X00000020
606 #define WNDS_ACTIVEFRAME             0X00000040
607 #define WNDS_HASSPB                  0X00000080
608 #define WNDS_NONCPAINT               0X00000100
609 #define WNDS_SENDERASEBACKGROUND     0X00000200
610 #define WNDS_ERASEBACKGROUND         0X00000400
611 #define WNDS_SENDNCPAINT             0X00000800
612 #define WNDS_INTERNALPAINT           0X00001000
613 #define WNDS_UPDATEDIRTY             0X00002000
614 #define WNDS_HIDDENPOPUP             0X00004000
615 #define WNDS_FORCEMENUDRAW           0X00008000
616 #define WNDS_DIALOGWINDOW            0X00010000
617 #define WNDS_HASCREATESTRUCTNAME     0X00020000
618 #define WNDS_SERVERSIDEWINDOWPROC    0x00040000 /* Call proc inside win32k. */
619 #define WNDS_ANSIWINDOWPROC          0x00080000
620 #define WNDS_BEINGACTIVATED          0x00100000
621 #define WNDS_HASPALETTE              0x00200000
622 #define WNDS_PAINTNOTPROCESSED       0x00400000
623 #define WNDS_SYNCPAINTPENDING        0x00800000
624 #define WNDS_RECEIVEDQUERYSUSPENDMSG 0x01000000
625 #define WNDS_RECEIVEDSUSPENDMSG      0x02000000
626 #define WNDS_TOGGLETOPMOST           0x04000000
627 #define WNDS_REDRAWIFHUNG            0x08000000
628 #define WNDS_REDRAWFRAMEIFHUNG       0x10000000
629 #define WNDS_ANSICREATOR             0x20000000
630 #define WNDS_MAXIMIZESTOMONITOR      0x40000000
631 #define WNDS_DESTROYED               0x80000000
632 
633 #define WNDSACTIVEFRAME              0x00000006
634 
635 /* State2 Flags !Not ALL Implemented! */
636 #define WNDS2_WMPAINTSENT               0X00000001
637 #define WNDS2_ENDPAINTINVALIDATE        0X00000002
638 #define WNDS2_STARTPAINT                0X00000004
639 #define WNDS2_OLDUI                     0X00000008
640 #define WNDS2_HASCLIENTEDGE             0X00000010
641 #define WNDS2_BOTTOMMOST                0X00000020
642 #define WNDS2_FULLSCREEN                0X00000040
643 #define WNDS2_INDESTROY                 0X00000080
644 #define WNDS2_WIN31COMPAT               0X00000100
645 #define WNDS2_WIN40COMPAT               0X00000200
646 #define WNDS2_WIN50COMPAT               0X00000400
647 #define WNDS2_MAXIMIZEDMONITORREGION    0X00000800
648 #define WNDS2_CLOSEBUTTONDOWN           0X00001000
649 #define WNDS2_MAXIMIZEBUTTONDOWN        0X00002000
650 #define WNDS2_MINIMIZEBUTTONDOWN        0X00004000
651 #define WNDS2_HELPBUTTONDOWN            0X00008000
652 #define WNDS2_SCROLLBARLINEUPBTNDOWN    0X00010000
653 #define WNDS2_SCROLLBARPAGEUPBTNDOWN    0X00020000
654 #define WNDS2_SCROLLBARPAGEDOWNBTNDOWN  0X00040000
655 #define WNDS2_SCROLLBARLINEDOWNBTNDOWN  0X00080000
656 #define WNDS2_ANYSCROLLBUTTONDOWN       0X00100000
657 #define WNDS2_SCROLLBARVERTICALTRACKING 0X00200000
658 #define WNDS2_FORCENCPAINT              0X00400000
659 #define WNDS2_FORCEFULLNCPAINTCLIPRGN   0X00800000
660 #define WNDS2_FULLSCREENMODE            0X01000000
661 #define WNDS2_CAPTIONTEXTTRUNCATED      0X08000000
662 #define WNDS2_NOMINMAXANIMATERECTS      0X10000000
663 #define WNDS2_SMALLICONFROMWMQUERYDRAG  0X20000000
664 #define WNDS2_SHELLHOOKREGISTERED       0X40000000
665 #define WNDS2_WMCREATEMSGPROCESSED      0X80000000
666 
667 /* ExStyles2 */
668 #define WS_EX2_CLIPBOARDLISTENER        0X00000001
669 #define WS_EX2_LAYEREDINVALIDATE        0X00000002
670 #define WS_EX2_REDIRECTEDFORPRINT       0X00000004
671 #define WS_EX2_LINKED                   0X00000008
672 #define WS_EX2_LAYEREDFORDWM            0X00000010
673 #define WS_EX2_LAYEREDLIMBO             0X00000020
674 #define WS_EX2_HIGHTDPI_UNAWAR          0X00000040
675 #define WS_EX2_VERTICALLYMAXIMIZEDLEFT  0X00000080
676 #define WS_EX2_VERTICALLYMAXIMIZEDRIGHT 0X00000100
677 #define WS_EX2_HASOVERLAY               0X00000200
678 #define WS_EX2_CONSOLEWINDOW            0X00000400
679 #define WS_EX2_CHILDNOACTIVATE          0X00000800
680 
681 #define WPF_MININIT 0x0008
682 #define WPF_MAXINIT 0x0010
683 
684 /*
685  * WND structure.
686  * See also: https://reactos.org/wiki/Techwiki:Win32k/WND
687  */
688 typedef struct _WND
689 {
690     THRDESKHEAD head;
691 #if 0
692     WW ww;
693 #else
694     /* These fields should be moved in the WW at some point. */
695     /* Plese do not change them to keep the same layout with WW. */
696     DWORD state;
697     DWORD state2;
698     /* Extended style. */
699     DWORD ExStyle;
700     /* Style. */
701     DWORD style;
702     /* Handle of the module that created the window. */
703     HINSTANCE hModule;
704     DWORD fnid;
705 #endif
706     struct _WND *spwndNext;
707     struct _WND *spwndPrev;
708     struct _WND *spwndParent;
709     struct _WND *spwndChild;
710     struct _WND *spwndOwner;
711     RECT rcWindow;
712     RECT rcClient;
713     WNDPROC lpfnWndProc;
714     /* Pointer to the window class. */
715     PCLS pcls;
716     HRGN hrgnUpdate;
717     /* Property list head.*/
718     LIST_ENTRY PropListHead;
719     ULONG PropListItems;
720     /* Scrollbar info */
721     PSBINFO pSBInfo;
722     /* system menu handle. */
723     HMENU SystemMenu;
724     //PMENU spmenuSys;
725     /* Window menu handle or window id */
726     UINT_PTR IDMenu; // Use spmenu
727     //PMENU spmenu;
728     HRGN hrgnClip;
729     HRGN hrgnNewFrame;
730     /* Window name. */
731     LARGE_UNICODE_STRING strName;
732     /* Size of the extra data associated with the window. */
733     ULONG cbwndExtra;
734     struct _WND *spwndLastActive;
735     HIMC hImc; // Input context associated with this window.
736     LONG_PTR dwUserData;
737     PVOID pActCtx;
738     //PD3DMATRIX pTransForm;
739     struct _WND *spwndClipboardListener;
740     DWORD ExStyle2;
741 
742     /* ReactOS */
743     struct
744     {
745         RECT NormalRect;
746         POINT IconPos;
747         POINT MaxPos;
748         UINT flags; /* WPF_ flags. */
749     } InternalPos;
750 
751     UINT Unicode:1; /* !(WNDS_ANSICREATOR|WNDS_ANSIWINDOWPROC) ? */
752     UINT InternalPosInitialized:1;
753     UINT HideFocus:1; /* WS_EX_UISTATEFOCUSRECTHIDDEN ? */
754     UINT HideAccel:1; /* WS_EX_UISTATEKBACCELHIDDEN ? */
755 
756     /* Scrollbar info */
757     PSBINFOEX pSBInfoex; // convert to PSBINFO
758     /* Entry in the list of thread windows. */
759     LIST_ENTRY ThreadListEntry;
760 
761     PVOID DialogPointer;
762 } WND, *PWND;
763 
764 #define PWND_BOTTOM ((PWND)1)
765 
766 typedef struct _SBWND
767 {
768     WND wnd;
769     BOOL fVert;
770     UINT wDisableFlags;
771     SBCALC SBCalc;
772 } SBWND, *PSBWND;
773 
774 typedef struct _MDIWND
775 {
776   WND wnd;
777   DWORD dwReserved;
778   PVOID pmdi;
779 } MDIWND, *PMDIWND;
780 
781 #define GWLP_MDIWND 4
782 
783 typedef struct _MENUWND
784 {
785     WND wnd;
786     PPOPUPMENU ppopupmenu;
787 } MENUWND, *PMENUWND;
788 
789 typedef struct _PFNCLIENT
790 {
791     WNDPROC pfnScrollBarWndProc;
792     WNDPROC pfnTitleWndProc;
793     WNDPROC pfnMenuWndProc;
794     WNDPROC pfnDesktopWndProc;
795     WNDPROC pfnDefWindowProc;
796     WNDPROC pfnMessageWindowProc;
797     WNDPROC pfnSwitchWindowProc;
798     WNDPROC pfnButtonWndProc;
799     WNDPROC pfnComboBoxWndProc;
800     WNDPROC pfnComboListBoxProc;
801     WNDPROC pfnDialogWndProc;
802     WNDPROC pfnEditWndProc;
803     WNDPROC pfnListBoxWndProc;
804     WNDPROC pfnMDIClientWndProc;
805     WNDPROC pfnStaticWndProc;
806     WNDPROC pfnImeWndProc;
807     WNDPROC pfnGhostWndProc;
808     WNDPROC pfnHkINLPCWPSTRUCT;
809     WNDPROC pfnHkINLPCWPRETSTRUCT;
810     WNDPROC pfnDispatchHook;
811     WNDPROC pfnDispatchDefWindowProc;
812     WNDPROC pfnDispatchMessage;
813     WNDPROC pfnMDIActivateDlgProc;
814 } PFNCLIENT, *PPFNCLIENT;
815 
816 /*
817   Wine Common proc ( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL Unicode );
818   Windows uses Ansi == TRUE, Wine uses Unicode == TRUE.
819  */
820 
821 typedef LRESULT
822 (CALLBACK *WNDPROC_EX)(
823     HWND,
824     UINT,
825     WPARAM,
826     LPARAM,
827     BOOL);
828 
829 typedef struct _PFNCLIENTWORKER
830 {
831     WNDPROC_EX pfnButtonWndProc;
832     WNDPROC_EX pfnComboBoxWndProc;
833     WNDPROC_EX pfnComboListBoxProc;
834     WNDPROC_EX pfnDialogWndProc;
835     WNDPROC_EX pfnEditWndProc;
836     WNDPROC_EX pfnListBoxWndProc;
837     WNDPROC_EX pfnMDIClientWndProc;
838     WNDPROC_EX pfnStaticWndProc;
839     WNDPROC_EX pfnImeWndProc;
840     WNDPROC_EX pfnGhostWndProc;
841     WNDPROC_EX pfnCtfHookProc;
842 } PFNCLIENTWORKER, *PPFNCLIENTWORKER;
843 
844 typedef LONG_PTR
845 (NTAPI *PFN_FNID)(
846     PWND,
847     UINT,
848     WPARAM,
849     LPARAM,
850     ULONG_PTR);
851 
852 /* FNID's for NtUserSetWindowFNID, NtUserMessageCall */
853 #define FNID_FIRST                  0x029A
854 #define FNID_SCROLLBAR              0x029A
855 #define FNID_ICONTITLE              0x029B
856 #define FNID_MENU                   0x029C
857 #define FNID_DESKTOP                0x029D
858 #define FNID_DEFWINDOWPROC          0x029E
859 #define FNID_MESSAGEWND             0x029F
860 #define FNID_SWITCH                 0x02A0
861 #define FNID_BUTTON                 0x02A1
862 #define FNID_COMBOBOX               0x02A2
863 #define FNID_COMBOLBOX              0x02A3
864 #define FNID_DIALOG                 0x02A4
865 #define FNID_EDIT                   0x02A5
866 #define FNID_LISTBOX                0x02A6
867 #define FNID_MDICLIENT              0x02A7
868 #define FNID_STATIC                 0x02A8
869 #define FNID_IME                    0x02A9
870 #define FNID_GHOST                  0x02AA
871 #define FNID_CALLWNDPROC            0x02AB
872 #define FNID_CALLWNDPROCRET         0x02AC
873 #define FNID_HKINLPCWPEXSTRUCT      0x02AD
874 #define FNID_HKINLPCWPRETEXSTRUCT   0x02AE
875 #define FNID_MB_DLGPROC             0x02AF
876 #define FNID_MDIACTIVATEDLGPROC     0x02B0
877 #define FNID_SENDMESSAGE            0x02B1
878 #define FNID_SENDMESSAGEFF          0x02B2
879 /* Kernel has option to use TimeOut or normal msg send, based on type of msg. */
880 #define FNID_SENDMESSAGEWTOOPTION   0x02B3
881 #define FNID_SENDMESSAGECALLPROC    0x02B4
882 #define FNID_BROADCASTSYSTEMMESSAGE 0x02B5
883 #define FNID_TOOLTIPS               0x02B6
884 #define FNID_SENDNOTIFYMESSAGE      0x02B7
885 #define FNID_SENDMESSAGECALLBACK    0x02B8
886 
887 #define FNID_LAST                   FNID_SENDMESSAGECALLBACK
888 
889 #define FNID_NUM                    (FNID_LAST - FNID_FIRST + 1)
890 #define FNID_NUMSERVERPROC          (FNID_SWITCH - FNID_FIRST + 1)
891 
892 #define FNID_DDEML   0x2000 /* Registers DDEML */
893 #define FNID_DESTROY 0x4000 /* This is sent when WM_NCDESTROY or in the support routine. */
894                             /* Seen during WM_CREATE on error exit too. */
895 #define FNID_FREED   0x8000 /* Window being Freed... */
896 
897 #define ICLASS_TO_MASK(iCls) (1 << ((iCls)))
898 
899 #define GETPFNCLIENTA(fnid) \
900  (WNDPROC)(*(((ULONG_PTR *)&gpsi->apfnClientA) + (fnid - FNID_FIRST)))
901 #define GETPFNCLIENTW(fnid) \
902  (WNDPROC)(*(((ULONG_PTR *)&gpsi->apfnClientW) + (fnid - FNID_FIRST)))
903 
904 #define GETPFNSERVER(fnid) gpsi->aStoCidPfn[fnid - FNID_FIRST]
905 
906 /* ICLS's for NtUserGetClassName FNID to ICLS, NtUserInitializeClientPfnArrays */
907 #define ICLS_BUTTON       0
908 #define ICLS_EDIT         1
909 #define ICLS_STATIC       2
910 #define ICLS_LISTBOX      3
911 #define ICLS_SCROLLBAR    4
912 #define ICLS_COMBOBOX     5
913 #define ICLS_MDICLIENT    6
914 #define ICLS_COMBOLBOX    7
915 #define ICLS_DDEMLEVENT   8
916 #define ICLS_DDEMLMOTHER  9
917 #define ICLS_DDEML16BIT   10
918 #define ICLS_DDEMLCLIENTA 11
919 #define ICLS_DDEMLCLIENTW 12
920 #define ICLS_DDEMLSERVERA 13
921 #define ICLS_DDEMLSERVERW 14
922 #define ICLS_IME          15
923 #define ICLS_GHOST        16
924 #define ICLS_DESKTOP      17
925 #define ICLS_DIALOG       18
926 #define ICLS_MENU         19
927 #define ICLS_SWITCH       20
928 #define ICLS_ICONTITLE    21
929 #define ICLS_TOOLTIPS     22
930 #if (_WIN32_WINNT <= 0x0501)
931 #define ICLS_UNKNOWN      22
932 #define ICLS_NOTUSED      23
933 #else
934 #define ICLS_SYSSHADOW    23
935 #define ICLS_HWNDMESSAGE  24
936 #define ICLS_NOTUSED      25
937 #endif
938 #define ICLS_END          31
939 
940 #define COLOR_LAST COLOR_MENUBAR
941 #define MAX_MB_STRINGS 11
942 
943 #define SRVINFO_DBCSENABLED 0x0002
944 #define SRVINFO_IMM32       0x0004
945 #define SRVINFO_APIHOOK     0x0010
946 #define SRVINFO_CICERO_ENABLED 0x0020
947 #define SRVINFO_KBDPREF     0x0080
948 
949 #define NUM_SYSCOLORS 31
950 
951 typedef struct tagOEMBITMAPINFO
952 {
953     INT x;
954     INT y;
955     INT cx;
956     INT cy;
957 } OEMBITMAPINFO, *POEMBITMAPINFO;
958 
959 typedef enum _OBI_TYPES
960 {
961     OBI_CLOSE = 0,
962     OBI_UPARROW = 46,
963     OBI_UPARROWI = 49,
964     OBI_DNARROW = 50,
965     OBI_DNARROWI = 53,
966     OBI_MNARROW = 62,
967     OBI_CTYPES = 93
968 } OBI_TYPES;
969 
970 typedef struct tagMBSTRING
971 {
972     WCHAR szName[16];
973     UINT uID;
974     UINT uStr;
975 } MBSTRING, *PMBSTRING;
976 
977 typedef struct tagDPISERVERINFO
978 {
979     INT gclBorder;      /* 000 */
980     HFONT hCaptionFont; /* 004 */
981     HFONT hMsgFont;     /* 008 */
982     INT cxMsgFontChar;  /* 00C */
983     INT cyMsgFontChar;  /* 010 */
984     UINT wMaxBtnSize;   /* 014 */
985 } DPISERVERINFO, *PDPISERVERINFO;
986 
987 /* PUSIFlags: */
988 #define PUSIF_PALETTEDISPLAY         0x01
989 #define PUSIF_SNAPTO                 0x02
990 #define PUSIF_COMBOBOXANIMATION      0x04
991 #define PUSIF_LISTBOXSMOOTHSCROLLING 0x08
992 #define PUSIF_KEYBOARDCUES           0x20
993 
994 /*
995  * PERUSERSERVERINFO structure.
996  * See also: https://reactos.org/wiki/Techwiki:Win32k/SERVERINFO
997  */
998 typedef struct _PERUSERSERVERINFO
999 {
1000     INT aiSysMet[SM_CMETRICS];
1001     ULONG argbSystemUnmatched[NUM_SYSCOLORS];
1002     COLORREF argbSystem[NUM_SYSCOLORS];
1003     HBRUSH ahbrSystem[NUM_SYSCOLORS];
1004     HBRUSH hbrGray;
1005     POINT ptCursor;
1006     POINT ptCursorReal;
1007     DWORD dwLastRITEventTickCount;
1008     INT nEvents;
1009     UINT dtScroll;
1010     UINT dtLBSearch;
1011     UINT dtCaretBlink;
1012     UINT ucWheelScrollLines;
1013     UINT ucWheelScrollChars;
1014     INT wMaxLeftOverlapChars;
1015     INT wMaxRightOverlapChars;
1016     INT cxSysFontChar;
1017     INT cySysFontChar;
1018     TEXTMETRICW tmSysFont;
1019     DPISERVERINFO dpiSystem;
1020     HICON hIconSmWindows;
1021     HICON hIconWindows;
1022     DWORD dwKeyCache;
1023     DWORD dwAsyncKeyCache;
1024     ULONG cCaptures;
1025     OEMBITMAPINFO oembmi[OBI_CTYPES];
1026     RECT rcScreenReal;
1027     USHORT BitCount;
1028     USHORT dmLogPixels;
1029     BYTE Planes;
1030     BYTE BitsPixel;
1031     ULONG PUSIFlags;
1032     UINT uCaretWidth;
1033     USHORT UILangID;
1034     DWORD dwLastSystemRITEventTickCountUpdate;
1035     ULONG adwDBGTAGFlags[35];
1036     DWORD dwTagCount;
1037     DWORD dwRIPFlags;
1038 } PERUSERSERVERINFO, *PPERUSERSERVERINFO;
1039 
1040 /*
1041  * SERVERINFO structure.
1042  * See also: https://reactos.org/wiki/Techwiki:Win32k/SERVERINFO
1043  */
1044 typedef struct tagSERVERINFO
1045 {
1046     DWORD dwSRVIFlags;
1047     ULONG_PTR cHandleEntries;
1048     PFN_FNID mpFnidPfn[FNID_NUM];
1049     WNDPROC aStoCidPfn[FNID_NUMSERVERPROC];
1050     USHORT mpFnid_serverCBWndProc[FNID_NUM];
1051     PFNCLIENT apfnClientA;
1052     PFNCLIENT apfnClientW;
1053     PFNCLIENTWORKER apfnClientWorker;
1054     ULONG cbHandleTable;
1055     ATOM atomSysClass[ICLS_NOTUSED+1];
1056     DWORD dwDefaultHeapBase;
1057     DWORD dwDefaultHeapSize;
1058     UINT uiShellMsg;
1059     MBSTRING MBStrings[MAX_MB_STRINGS];
1060     ATOM atomIconSmProp;
1061     ATOM atomIconProp;
1062     ATOM atomContextHelpIdProp;
1063     ATOM atomFrostedWindowProp;
1064     CHAR acOemToAnsi[256];
1065     CHAR acAnsiToOem[256];
1066     DWORD dwInstalledEventHooks;
1067     PERUSERSERVERINFO;
1068 } SERVERINFO, *PSERVERINFO;
1069 
1070 #ifdef _M_IX86
1071 C_ASSERT(sizeof(SERVERINFO) <= PAGE_SIZE);
1072 #endif
1073 
1074 
1075 /* Server event activity bits. */
1076 #define SRV_EVENT_MENU            0x0001
1077 #define SRV_EVENT_END_APPLICATION 0x0002
1078 #define SRV_EVENT_RUNNING         0x0004
1079 #define SRV_EVENT_NAMECHANGE      0x0008
1080 #define SRV_EVENT_VALUECHANGE     0x0010
1081 #define SRV_EVENT_STATECHANGE     0x0020
1082 #define SRV_EVENT_LOCATIONCHANGE  0x0040
1083 #define SRV_EVENT_CREATE          0x8000
1084 
1085 typedef struct _PROPLISTITEM
1086 {
1087     ATOM Atom;
1088     HANDLE Data;
1089 } PROPLISTITEM, *PPROPLISTITEM;
1090 
1091 #define PROPERTY_FLAG_SYSTEM 1
1092 
1093 typedef struct _PROPERTY
1094 {
1095     LIST_ENTRY PropListEntry;
1096     HANDLE Data;
1097     ATOM Atom;
1098     WORD fs;
1099 } PROPERTY, *PPROPERTY;
1100 
1101 typedef struct _BROADCASTPARM
1102 {
1103     DWORD flags;
1104     DWORD recipients;
1105     HDESK hDesk;
1106     HWND hWnd;
1107     LUID luid;
1108 } BROADCASTPARM, *PBROADCASTPARM;
1109 
1110 struct _THREADINFO *GetW32ThreadInfo(VOID);
1111 struct _PROCESSINFO *GetW32ProcessInfo(VOID);
1112 
1113 typedef struct _WNDMSG
1114 {
1115     DWORD maxMsgs;
1116     PINT abMsgs;
1117 } WNDMSG, *PWNDMSG;
1118 
1119 /*
1120  * SHAREDINFO structure.
1121  * See also: https://reactos.org/wiki/Techwiki:Win32k/SHAREDINFO
1122  */
1123 typedef struct _SHAREDINFO
1124 {
1125     PSERVERINFO psi;         /* Global Server Info */
1126     PVOID aheList;           /* Handle Entry List */
1127     PVOID pDispInfo;         /* Global PDISPLAYINFO pointer */
1128     ULONG_PTR ulSharedDelta; /* Shared USER mapped section delta */
1129     WNDMSG awmControl[FNID_NUM];
1130     WNDMSG DefWindowMsgs;
1131     WNDMSG DefWindowSpecMsgs;
1132 } SHAREDINFO, *PSHAREDINFO;
1133 
1134 /* See also the USERSRV_API_CONNECTINFO #define in include/reactos/subsys/win/winmsg.h */
1135 typedef struct _USERCONNECT
1136 {
1137     ULONG ulVersion;
1138     ULONG ulCurrentVersion;
1139     DWORD dwDispatchCount;
1140     SHAREDINFO siClient;
1141 } USERCONNECT, *PUSERCONNECT;
1142 
1143 /* WinNT 5.0 compatible user32 / win32k */
1144 #define USER_VERSION MAKELONG(0x0000, 0x0005)
1145 
1146 #if defined(_M_IX86)
1147 C_ASSERT(sizeof(USERCONNECT) == 0x124);
1148 #endif
1149 
1150 typedef struct tagGETCLIPBDATA
1151 {
1152     UINT uFmtRet;
1153     BOOL fGlobalHandle;
1154     union
1155     {
1156         HANDLE hLocale;
1157         HANDLE hPalette;
1158     };
1159 } GETCLIPBDATA, *PGETCLIPBDATA;
1160 
1161 typedef struct tagSETCLIPBDATA
1162 {
1163     BOOL fGlobalHandle;
1164     BOOL fIncSerialNumber;
1165 } SETCLIPBDATA, *PSETCLIPBDATA;
1166 
1167 /* Used with NtUserSetCursorIconData, last parameter. */
1168 typedef struct tagCURSORDATA
1169 {
1170     LPWSTR lpName;
1171     LPWSTR lpModName;
1172     USHORT rt;
1173     USHORT dummy;
1174     ULONG CURSORF_flags;
1175     SHORT xHotspot;
1176     SHORT yHotspot;
1177     HBITMAP hbmMask;
1178     HBITMAP hbmColor;
1179     HBITMAP hbmAlpha;
1180     RECT rcBounds;
1181     HBITMAP hbmUserAlpha; /* Could be in W7U, not in W2k */
1182     ULONG bpp;
1183     ULONG cx;
1184     ULONG cy;
1185     UINT cpcur;
1186     UINT cicur;
1187     struct tagCURSORDATA *aspcur;
1188     DWORD *aicur;
1189     INT *ajifRate;
1190     UINT iicur;
1191 } CURSORDATA, *PCURSORDATA; /* !dso CURSORDATA */
1192 
1193 /* CURSORF_flags: */
1194 #define CURSORF_FROMRESOURCE 0x0001
1195 #define CURSORF_GLOBAL       0x0002
1196 #define CURSORF_LRSHARED     0x0004
1197 #define CURSORF_ACON         0x0008
1198 #define CURSORF_WOWCLEANUP   0x0010
1199 #define CURSORF_ACONFRAME    0x0040
1200 #define CURSORF_SECRET       0x0080
1201 #define CURSORF_LINKED       0x0100
1202 #define CURSORF_CURRENT      0x0200
1203 
1204 typedef struct tagIMEINFOEX
1205 {
1206     HKL hkl;
1207     IMEINFO ImeInfo;
1208     WCHAR wszUIClass[16];
1209     ULONG fdwInitConvMode;
1210     INT fInitOpen;
1211     INT fLoadFlag;
1212     DWORD dwProdVersion;
1213     DWORD dwImeWinVersion;
1214     WCHAR wszImeDescription[50];
1215     WCHAR wszImeFile[80];
1216     struct
1217     {
1218         INT fSysWow64Only:1;
1219         INT fCUASLayer:1;
1220     };
1221 } IMEINFOEX, *PIMEINFOEX;
1222 
1223 typedef enum IMEINFOEXCLASS
1224 {
1225     ImeInfoExKeyboardLayout,
1226     ImeInfoExKeyboardLayoutTFS,
1227     ImeInfoExImeWindow,
1228     ImeInfoExImeFileName
1229 } IMEINFOEXCLASS;
1230 
1231 #define IS_IME_HKL(hkl) ((((ULONG_PTR)(hkl)) & 0xF0000000) == 0xE0000000)
1232 #define IS_IMM_MODE() (gpsi && (gpsi->dwSRVIFlags & SRVINFO_IMM32))
1233 #define IS_CICERO_MODE() (gpsi && (gpsi->dwSRVIFlags & SRVINFO_CICERO_ENABLED))
1234 
1235 typedef struct tagIMEUI
1236 {
1237     PWND spwnd;
1238     HIMC hIMC;
1239     HWND hwndIMC;
1240     HKL hKL;
1241     HWND hwndUI;
1242     LONG nCntInIMEProc;
1243     struct {
1244         UINT fShowStatus:1;
1245         UINT fActivate:1;
1246         UINT fDestroy:1;
1247         UINT fDefault:1;
1248         UINT fChildThreadDef:1;
1249         UINT fCtrlShowStatus:1;
1250         UINT fFreeActiveEvent:1;
1251     };
1252     DWORD dwLastStatus;
1253 } IMEUI, *PIMEUI;
1254 
1255 /* Window Extra data container. */
1256 typedef struct _IMEWND
1257 {
1258     WND wnd;
1259     PIMEUI pimeui;
1260 } IMEWND, *PIMEWND;
1261 
1262 typedef struct tagTRANSMSG
1263 {
1264     UINT message;
1265     WPARAM wParam;
1266     LPARAM lParam;
1267 } TRANSMSG, *PTRANSMSG, *LPTRANSMSG;
1268 
1269 typedef struct tagTRANSMSGLIST
1270 {
1271     UINT     uMsgCount;
1272     TRANSMSG TransMsg[ANYSIZE_ARRAY];
1273 } TRANSMSGLIST, *PTRANSMSGLIST, *LPTRANSMSGLIST;
1274 
1275 #define DEFINE_IME_ENTRY(type, name, params, extended) typedef type (WINAPI *FN_##name) params;
1276 #include "imetable.h"
1277 #undef DEFINE_IME_ENTRY
1278 
1279 typedef struct IMEDPI
1280 {
1281     struct IMEDPI *pNext;
1282     HINSTANCE      hInst;
1283     HKL            hKL;
1284     IMEINFO        ImeInfo;
1285     UINT           uCodePage;
1286     WCHAR          szUIClass[16];
1287     DWORD          cLockObj;
1288     DWORD          dwFlags;
1289 #define DEFINE_IME_ENTRY(type, name, params, extended) FN_##name name;
1290 #include "imetable.h"
1291 #undef DEFINE_IME_ENTRY
1292 } IMEDPI, *PIMEDPI;
1293 
1294 #ifndef _WIN64
1295 C_ASSERT(offsetof(IMEDPI, pNext) == 0x0);
1296 C_ASSERT(offsetof(IMEDPI, hInst) == 0x4);
1297 C_ASSERT(offsetof(IMEDPI, hKL) == 0x8);
1298 C_ASSERT(offsetof(IMEDPI, ImeInfo) == 0xc);
1299 C_ASSERT(offsetof(IMEDPI, uCodePage) == 0x28);
1300 C_ASSERT(offsetof(IMEDPI, szUIClass) == 0x2c);
1301 C_ASSERT(offsetof(IMEDPI, cLockObj) == 0x4c);
1302 C_ASSERT(offsetof(IMEDPI, dwFlags) == 0x50);
1303 C_ASSERT(offsetof(IMEDPI, ImeInquire) == 0x54);
1304 C_ASSERT(offsetof(IMEDPI, ImeConversionList) == 0x58);
1305 C_ASSERT(offsetof(IMEDPI, ImeRegisterWord) == 0x5c);
1306 C_ASSERT(offsetof(IMEDPI, ImeUnregisterWord) == 0x60);
1307 C_ASSERT(offsetof(IMEDPI, ImeGetRegisterWordStyle) == 0x64);
1308 C_ASSERT(offsetof(IMEDPI, ImeEnumRegisterWord) == 0x68);
1309 C_ASSERT(offsetof(IMEDPI, ImeConfigure) == 0x6c);
1310 C_ASSERT(offsetof(IMEDPI, ImeDestroy) == 0x70);
1311 C_ASSERT(offsetof(IMEDPI, ImeEscape) == 0x74);
1312 C_ASSERT(offsetof(IMEDPI, ImeProcessKey) == 0x78);
1313 C_ASSERT(offsetof(IMEDPI, ImeSelect) == 0x7c);
1314 C_ASSERT(offsetof(IMEDPI, ImeSetActiveContext) == 0x80);
1315 C_ASSERT(offsetof(IMEDPI, ImeToAsciiEx) == 0x84);
1316 C_ASSERT(offsetof(IMEDPI, NotifyIME) == 0x88);
1317 C_ASSERT(offsetof(IMEDPI, ImeSetCompositionString) == 0x8c);
1318 C_ASSERT(offsetof(IMEDPI, ImeGetImeMenuItems) == 0x90);
1319 C_ASSERT(offsetof(IMEDPI, CtfImeInquireExW) == 0x94);
1320 C_ASSERT(offsetof(IMEDPI, CtfImeSelectEx) == 0x98);
1321 C_ASSERT(offsetof(IMEDPI, CtfImeEscapeEx) == 0x9c);
1322 C_ASSERT(offsetof(IMEDPI, CtfImeGetGuidAtom) == 0xa0);
1323 C_ASSERT(offsetof(IMEDPI, CtfImeIsGuidMapEnable) == 0xa4);
1324 C_ASSERT(sizeof(IMEDPI) == 0xa8);
1325 #endif
1326 
1327 /* flags for IMEDPI.dwFlags */
1328 #define IMEDPI_FLAG_UNLOADED 0x1
1329 #define IMEDPI_FLAG_LOCKED 0x2
1330 
1331 /* unconfirmed */
1332 typedef struct tagCLIENTIMC
1333 {
1334     HANDLE hInputContext;   /* LocalAlloc'ed LHND */
1335     LONG cLockObj;
1336     DWORD dwFlags;
1337     DWORD dwCompatFlags;
1338     RTL_CRITICAL_SECTION cs;
1339     UINT uCodePage;
1340     HKL hKL;
1341     BOOL bUnknown4;
1342 } CLIENTIMC, *PCLIENTIMC;
1343 
1344 #ifndef _WIN64
1345 C_ASSERT(offsetof(CLIENTIMC, hInputContext) == 0x0);
1346 C_ASSERT(offsetof(CLIENTIMC, cLockObj) == 0x4);
1347 C_ASSERT(offsetof(CLIENTIMC, dwFlags) == 0x8);
1348 C_ASSERT(offsetof(CLIENTIMC, dwCompatFlags) == 0xc);
1349 C_ASSERT(offsetof(CLIENTIMC, cs) == 0x10);
1350 C_ASSERT(offsetof(CLIENTIMC, uCodePage) == 0x28);
1351 C_ASSERT(offsetof(CLIENTIMC, hKL) == 0x2c);
1352 C_ASSERT(sizeof(CLIENTIMC) == 0x34);
1353 #endif
1354 
1355 /* flags for CLIENTIMC */
1356 #define CLIENTIMC_WIDE 0x1
1357 #define CLIENTIMC_ACTIVE 0x2
1358 #define CLIENTIMC_UNKNOWN4 0x20
1359 #define CLIENTIMC_DESTROY 0x40
1360 #define CLIENTIMC_DISABLEIME 0x80
1361 #define CLIENTIMC_UNKNOWN2 0x100
1362 
1363 DWORD
1364 NTAPI
1365 NtUserAssociateInputContext(HWND hWnd, HIMC hIMC, DWORD dwFlags);
1366 
1367 NTSTATUS
1368 NTAPI
1369 NtUserBuildHimcList(DWORD dwThreadId, DWORD dwCount, HIMC *phList, LPDWORD pdwCount);
1370 
1371 DWORD
1372 NTAPI
1373 NtUserCalcMenuBar(
1374     HWND   hwnd,
1375     DWORD  x,
1376     DWORD  width,
1377     DWORD  y,
1378     LPRECT prc);
1379 
1380 DWORD
1381 NTAPI
1382 NtUserCheckMenuItem(
1383     HMENU hmenu,
1384     UINT uIDCheckItem,
1385     UINT uCheck);
1386 
1387 DWORD
1388 NTAPI
1389 NtUserCtxDisplayIOCtl(
1390     DWORD dwUnknown1,
1391     DWORD dwUnknown2,
1392     DWORD dwUnknown3);
1393 
1394 DWORD
1395 APIENTRY
1396 NtUserDbgWin32HeapFail(
1397     DWORD Unknown0,
1398     DWORD Unknown1);
1399 
1400 DWORD
1401 APIENTRY
1402 NtUserDbgWin32HeapStat(
1403     DWORD Unknown0,
1404     DWORD Unknown1);
1405 
1406 BOOL
1407 NTAPI
1408 NtUserDeleteMenu(
1409     HMENU hMenu,
1410     UINT uPosition,
1411     UINT uFlags);
1412 
1413 BOOL
1414 NTAPI
1415 NtUserDestroyMenu(
1416     HMENU hMenu);
1417 
1418 DWORD
1419 NTAPI
1420 NtUserDrawMenuBarTemp(
1421     HWND hWnd,
1422     HDC hDC,
1423     PRECT hRect,
1424     HMENU hMenu,
1425     HFONT hFont);
1426 
1427 UINT
1428 NTAPI
1429 NtUserEnableMenuItem(
1430     HMENU hMenu,
1431     UINT uIDEnableItem,
1432     UINT uEnable);
1433 
1434 BOOL
1435 NTAPI
1436 NtUserEndMenu(VOID);
1437 
1438 BOOL
1439 NTAPI
1440 NtUserGetMenuBarInfo(
1441     HWND hwnd,
1442     LONG idObject,
1443     LONG idItem,
1444     PMENUBARINFO pmbi);
1445 
1446 UINT
1447 NTAPI
1448 NtUserGetMenuIndex(
1449     HMENU hMenu,
1450     HMENU hSubMenu);
1451 
1452 BOOL
1453 NTAPI
1454 NtUserGetMenuItemRect(
1455     HWND hWnd,
1456     HMENU hMenu,
1457     UINT uItem,
1458     LPRECT lprcItem);
1459 
1460 HMENU
1461 NTAPI
1462 NtUserGetSystemMenu(
1463     HWND hWnd,
1464     BOOL bRevert);
1465 
1466 BOOL
1467 NTAPI
1468 NtUserHiliteMenuItem(
1469     HWND hWnd,
1470     HMENU hMenu,
1471     UINT uItemHilite,
1472     UINT uHilite);
1473 
1474 int
1475 NTAPI
1476 NtUserMenuItemFromPoint(
1477     HWND hWnd,
1478     HMENU hMenu,
1479     DWORD X,
1480     DWORD Y);
1481 
1482 BOOL
1483 NTAPI
1484 NtUserRemoveMenu(
1485     HMENU hMenu,
1486     UINT uPosition,
1487     UINT uFlags);
1488 
1489 BOOL
1490 NTAPI
1491 NtUserSetMenu(
1492     HWND hWnd,
1493     HMENU hMenu,
1494     BOOL bRepaint);
1495 
1496 BOOL
1497 NTAPI
1498 NtUserSetMenuContextHelpId(
1499     HMENU hmenu,
1500     DWORD dwContextHelpId);
1501 
1502 BOOL
1503 NTAPI
1504 NtUserSetMenuDefaultItem(
1505     HMENU hMenu,
1506     UINT uItem,
1507     UINT fByPos);
1508 
1509 BOOL
1510 NTAPI
1511 NtUserSetMenuFlagRtoL(
1512     HMENU hMenu);
1513 
1514 BOOL
1515 NTAPI
1516 NtUserSetSystemMenu(
1517     HWND hWnd,
1518     HMENU hMenu);
1519 
1520 BOOL
1521 NTAPI
1522 NtUserThunkedMenuInfo(
1523     HMENU hMenu,
1524     LPCMENUINFO lpcmi);
1525 
1526 BOOL
1527 NTAPI
1528 NtUserThunkedMenuItemInfo(
1529     HMENU hMenu,
1530     UINT uItem,
1531     BOOL fByPosition,
1532     BOOL bInsert,
1533     LPMENUITEMINFOW lpmii,
1534     PUNICODE_STRING lpszCaption);
1535 
1536 BOOL
1537 NTAPI
1538 NtUserTrackPopupMenuEx(
1539     HMENU hmenu,
1540     UINT fuFlags,
1541     int x,
1542     int y,
1543     HWND hwnd,
1544     LPTPMPARAMS lptpm);
1545 
1546 HKL
1547 NTAPI
1548 NtUserActivateKeyboardLayout(
1549     HKL hKL,
1550     ULONG Flags);
1551 
1552 DWORD
1553 NTAPI
1554 NtUserAlterWindowStyle(
1555     HWND hWnd,
1556     DWORD Index,
1557     LONG NewValue);
1558 
1559 BOOL
1560 NTAPI
1561 NtUserAttachThreadInput(
1562     IN DWORD idAttach,
1563     IN DWORD idAttachTo,
1564     IN BOOL fAttach);
1565 
1566 HDC NTAPI
1567 NtUserBeginPaint(
1568     HWND hWnd,
1569     PAINTSTRUCT *lPs);
1570 
1571 BOOL
1572 NTAPI
1573 NtUserBitBltSysBmp(
1574     HDC hdc,
1575     INT nXDest,
1576     INT nYDest,
1577     INT nWidth,
1578     INT nHeight,
1579     INT nXSrc,
1580     INT nYSrc,
1581     DWORD dwRop);
1582 
1583 BOOL
1584 NTAPI
1585 NtUserBlockInput(
1586     BOOL BlockIt);
1587 
1588 NTSTATUS
1589 NTAPI
1590 NtUserBuildHwndList(
1591     HDESK hDesktop,
1592     HWND hwndParent,
1593     BOOLEAN bChildren,
1594     ULONG dwThreadId,
1595     ULONG cHwnd,
1596     HWND *phwndList,
1597     ULONG *pcHwndNeeded);
1598 
1599 NTSTATUS
1600 NTAPI
1601 NtUserBuildNameList(
1602     HWINSTA hWinSta,
1603     ULONG dwSize,
1604     PVOID lpBuffer,
1605     PULONG pRequiredSize);
1606 
1607 NTSTATUS
1608 NTAPI
1609 NtUserBuildPropList(
1610     HWND hWnd,
1611     LPVOID Buffer,
1612     DWORD BufferSize,
1613     DWORD *Count);
1614 
1615 /* apfnSimpleCall indices from Windows XP SP 2 */
1616 /* TODO: Check for differences in Windows 2000, 2003 and 2008 */
1617 #define WIN32K_VERSION NTDDI_WINXPSP2 /* FIXME: this should go somewhere else */
1618 
1619 enum SimpleCallRoutines
1620 {
1621     NOPARAM_ROUTINE_CREATEMENU,
1622     NOPARAM_ROUTINE_CREATEMENUPOPUP,
1623 #if (WIN32K_VERSION >= NTDDI_VISTA)
1624     NOPARAM_ROUTINE_ALLOWFOREGNDACTIVATION,
1625     NOPARAM_ROUTINE_MSQCLEARWAKEMASK,
1626     NOPARAM_ROUTINE_CREATESYSTEMTHREADS,
1627     NOPARAM_ROUTINE_DESTROY_CARET,
1628 #endif
1629     NOPARAM_ROUTINE_ENABLEPROCWNDGHSTING,
1630 #if (WIN32K_VERSION < NTDDI_VISTA)
1631     NOPARAM_ROUTINE_MSQCLEARWAKEMASK,
1632     NOPARAM_ROUTINE_ALLOWFOREGNDACTIVATION,
1633     NOPARAM_ROUTINE_DESTROY_CARET,
1634 #endif
1635     NOPARAM_ROUTINE_GETDEVICECHANGEINFO,
1636     NOPARAM_ROUTINE_GETIMESHOWSTATUS,
1637     NOPARAM_ROUTINE_GETINPUTDESKTOP,
1638     NOPARAM_ROUTINE_GETMSESSAGEPOS,
1639 #if (WIN32K_VERSION >= NTDDI_VISTA)
1640     NOPARAM_ROUTINE_HANDLESYSTHRDCREATFAIL,
1641 #else
1642     NOPARAM_ROUTINE_GETREMOTEPROCESSID,
1643 #endif
1644     NOPARAM_ROUTINE_HIDECURSORNOCAPTURE,
1645     NOPARAM_ROUTINE_LOADCURSANDICOS,
1646 #if (WIN32K_VERSION >= NTDDI_VISTA)
1647     NOPARAM_ROUTINE_LOADUSERAPIHOOK,
1648     NOPARAM_ROUTINE_PREPAREFORLOGOFF, /* 0x0f */
1649 #endif
1650     NOPARAM_ROUTINE_RELEASECAPTURE,
1651     NOPARAM_ROUTINE_RESETDBLCLICK,
1652     NOPARAM_ROUTINE_ZAPACTIVEANDFOUS,
1653     NOPARAM_ROUTINE_REMOTECONSHDWSTOP,
1654     NOPARAM_ROUTINE_REMOTEDISCONNECT,
1655     NOPARAM_ROUTINE_REMOTELOGOFF,
1656     NOPARAM_ROUTINE_REMOTENTSECURITY,
1657     NOPARAM_ROUTINE_REMOTESHDWSETUP,
1658     NOPARAM_ROUTINE_REMOTESHDWSTOP,
1659     NOPARAM_ROUTINE_REMOTEPASSTHRUENABLE,
1660     NOPARAM_ROUTINE_REMOTEPASSTHRUDISABLE,
1661     NOPARAM_ROUTINE_REMOTECONNECTSTATE,
1662     NOPARAM_ROUTINE_UPDATEPERUSERIMMENABLING,
1663     NOPARAM_ROUTINE_USERPWRCALLOUTWORKER,
1664 #if (WIN32K_VERSION >= NTDDI_VISTA)
1665     NOPARAM_ROUTINE_WAKERITFORSHTDWN,
1666 #endif
1667     NOPARAM_ROUTINE_INIT_MESSAGE_PUMP,
1668     NOPARAM_ROUTINE_UNINIT_MESSAGE_PUMP,
1669 #if (WIN32K_VERSION < NTDDI_VISTA)
1670     NOPARAM_ROUTINE_LOADUSERAPIHOOK,
1671 #endif
1672     ONEPARAM_ROUTINE_BEGINDEFERWNDPOS,
1673 #if (WIN32K_VERSION >= NTDDI_VISTA)
1674     ONEPARAM_ROUTINE_GETSENDMSGRECVR,
1675 #endif
1676     ONEPARAM_ROUTINE_WINDOWFROMDC,
1677     ONEPARAM_ROUTINE_ALLOWSETFOREGND,
1678     ONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT,
1679 #if (WIN32K_VERSION < NTDDI_VISTA)
1680     ONEPARAM_ROUTINE_CREATESYSTEMTHREADS,
1681 #endif
1682     ONEPARAM_ROUTINE_CSDDEUNINITIALIZE,
1683     ONEPARAM_ROUTINE_DIRECTEDYIELD,
1684     ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMATS,
1685 #if (WIN32K_VERSION < NTDDI_VISTA)
1686     ONEPARAM_ROUTINE_GETCURSORPOS,
1687 #endif
1688     ONEPARAM_ROUTINE_GETINPUTEVENT,
1689     ONEPARAM_ROUTINE_GETKEYBOARDLAYOUT,
1690     ONEPARAM_ROUTINE_GETKEYBOARDTYPE,
1691     ONEPARAM_ROUTINE_GETPROCDEFLAYOUT,
1692     ONEPARAM_ROUTINE_GETQUEUESTATUS,
1693     ONEPARAM_ROUTINE_GETWINSTAINFO,
1694 #if (WIN32K_VERSION < NTDDI_VISTA)
1695     ONEPARAM_ROUTINE_HANDLESYSTHRDCREATFAIL,
1696 #endif
1697     ONEPARAM_ROUTINE_LOCKFOREGNDWINDOW,
1698     ONEPARAM_ROUTINE_LOADFONTS,
1699     ONEPARAM_ROUTINE_MAPDEKTOPOBJECT,
1700     ONEPARAM_ROUTINE_MESSAGEBEEP,
1701     ONEPARAM_ROUTINE_PLAYEVENTSOUND,
1702     ONEPARAM_ROUTINE_POSTQUITMESSAGE,
1703 #if (WIN32K_VERSION < NTDDI_VISTA)
1704     ONEPARAM_ROUTINE_PREPAREFORLOGOFF,
1705 #endif
1706     ONEPARAM_ROUTINE_REALIZEPALETTE,
1707     ONEPARAM_ROUTINE_REGISTERLPK,
1708 #if (WIN32K_VERSION >= NTDDI_VISTA)
1709     ONEPARAM_ROUTINE_REGISTERSYSTEMTHREAD,
1710 #endif
1711     ONEPARAM_ROUTINE_REMOTERECONNECT,
1712     ONEPARAM_ROUTINE_REMOTETHINWIRESTATUS,
1713     ONEPARAM_ROUTINE_RELEASEDC,
1714 #if (WIN32K_VERSION >= NTDDI_VISTA)
1715     ONEPARAM_ROUTINE_REMOTENOTIFY,
1716 #endif
1717     ONEPARAM_ROUTINE_REPLYMESSAGE,
1718     ONEPARAM_ROUTINE_SETCARETBLINKTIME,
1719     ONEPARAM_ROUTINE_SETDBLCLICKTIME,
1720 #if (WIN32K_VERSION < NTDDI_VISTA)
1721     ONEPARAM_ROUTINE_SETIMESHOWSTATUS,
1722 #endif
1723     ONEPARAM_ROUTINE_SETMESSAGEEXTRAINFO,
1724     ONEPARAM_ROUTINE_SETPROCDEFLAYOUT,
1725 #if (WIN32K_VERSION >= NTDDI_VISTA)
1726     ONEPARAM_ROUTINE_SETWATERMARKSTRINGS,
1727 #endif
1728     ONEPARAM_ROUTINE_SHOWCURSOR,
1729     ONEPARAM_ROUTINE_SHOWSTARTGLASS,
1730     ONEPARAM_ROUTINE_SWAPMOUSEBUTTON,
1731     X_ROUTINE_WOWMODULEUNLOAD,
1732 #if (WIN32K_VERSION < NTDDI_VISTA)
1733     X_ROUTINE_REMOTENOTIFY,
1734 #endif
1735     HWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW,
1736     HWND_ROUTINE_DWP_GETENABLEDPOPUP,
1737     HWND_ROUTINE_GETWNDCONTEXTHLPID,
1738     HWND_ROUTINE_REGISTERSHELLHOOKWINDOW,
1739     HWND_ROUTINE_SETMSGBOX,
1740     HWNDOPT_ROUTINE_SETPROGMANWINDOW,
1741     HWNDOPT_ROUTINE_SETTASKMANWINDOW,
1742     HWNDPARAM_ROUTINE_GETCLASSICOCUR,
1743     HWNDPARAM_ROUTINE_CLEARWINDOWSTATE,
1744     HWNDPARAM_ROUTINE_KILLSYSTEMTIMER,
1745     HWNDPARAM_ROUTINE_SETDIALOGPOINTER,
1746     HWNDPARAM_ROUTINE_SETVISIBLE,
1747     HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID,
1748     HWNDPARAM_ROUTINE_SETWINDOWSTATE,
1749     HWNDLOCK_ROUTINE_WINDOWHASSHADOW, /* correct prefix ? */
1750     HWNDLOCK_ROUTINE_ARRANGEICONICWINDOWS,
1751     HWNDLOCK_ROUTINE_DRAWMENUBAR,
1752     HWNDLOCK_ROUTINE_CHECKIMESHOWSTATUSINTHRD,
1753     HWNDLOCK_ROUTINE_GETSYSMENUHANDLE,
1754     HWNDLOCK_ROUTINE_REDRAWFRAME,
1755     HWNDLOCK_ROUTINE_REDRAWFRAMEANDHOOK,
1756     HWNDLOCK_ROUTINE_SETDLGSYSMENU,
1757     HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOW,
1758     HWNDLOCK_ROUTINE_SETSYSMENU,
1759     HWNDLOCK_ROUTINE_UPDATECKIENTRECT,
1760     HWNDLOCK_ROUTINE_UPDATEWINDOW,
1761     TWOPARAM_ROUTINE_IMESHOWSTATUSCHANGE,
1762     TWOPARAM_ROUTINE_ENABLEWINDOW,
1763     TWOPARAM_ROUTINE_REDRAWTITLE,
1764     TWOPARAM_ROUTINE_SHOWOWNEDPOPUPS,
1765     TWOPARAM_ROUTINE_SWITCHTOTHISWINDOW,
1766     TWOPARAM_ROUTINE_UPDATEWINDOWS,
1767     TWOPARAM_ROUTINE_VALIDATERGN,
1768 #if (WIN32K_VERSION >= NTDDI_VISTA)
1769     TWOPARAM_ROUTINE_CHANGEWNDMSGFILTER,
1770     TWOPARAM_ROUTINE_GETCURSORPOS,
1771 #endif
1772     TWOPARAM_ROUTINE_GETHDEVNAME,
1773     TWOPARAM_ROUTINE_INITANSIOEM,
1774     TWOPARAM_ROUTINE_NLSSENDIMENOTIFY,
1775 #if (WIN32K_VERSION >= NTDDI_VISTA)
1776     TWOPARAM_ROUTINE_REGISTERGHSTWND,
1777 #endif
1778     TWOPARAM_ROUTINE_REGISTERLOGONPROCESS,
1779 #if (WIN32K_VERSION >= NTDDI_VISTA)
1780     TWOPARAM_ROUTINE_REGISTERSBLFROSTWND,
1781 #else
1782     TWOPARAM_ROUTINE_REGISTERSYSTEMTHREAD,
1783 #endif
1784     TWOPARAM_ROUTINE_REGISTERUSERHUNGAPPHANDLERS,
1785     TWOPARAM_ROUTINE_SHADOWCLEANUP,
1786     TWOPARAM_ROUTINE_REMOTESHADOWSTART,
1787     TWOPARAM_ROUTINE_SETCARETPOS,
1788     TWOPARAM_ROUTINE_SETCURSORPOS,
1789 #if (WIN32K_VERSION >= NTDDI_VISTA)
1790     TWOPARAM_ROUTINE_SETPHYSCURSORPOS,
1791 #endif
1792     TWOPARAM_ROUTINE_UNHOOKWINDOWSHOOK,
1793     TWOPARAM_ROUTINE_WOWCLEANUP
1794 };
1795 
1796 DWORD
1797 NTAPI
1798 NtUserCallHwnd(
1799     HWND hWnd,
1800     DWORD Routine);
1801 
1802 BOOL
1803 NTAPI
1804 NtUserCallHwndLock(
1805     HWND hWnd,
1806     DWORD Routine);
1807 
1808 HWND
1809 NTAPI
1810 NtUserCallHwndOpt(
1811     HWND hWnd,
1812     DWORD Routine);
1813 
1814 DWORD
1815 NTAPI
1816 NtUserCallHwndParam(
1817     HWND hWnd,
1818     DWORD_PTR Param,
1819     DWORD Routine);
1820 
1821 DWORD
1822 NTAPI
1823 NtUserCallHwndParamLock(
1824     HWND hWnd,
1825     DWORD_PTR Param,
1826     DWORD Routine);
1827 
1828 BOOL
1829 NTAPI
1830 NtUserCallMsgFilter(
1831     LPMSG msg,
1832     INT code);
1833 
1834 LRESULT
1835 NTAPI
1836 NtUserCallNextHookEx(
1837     int Code,
1838     WPARAM wParam,
1839     LPARAM lParam,
1840     BOOL Ansi);
1841 
1842 DWORD_PTR
1843 NTAPI
1844 NtUserCallNoParam(
1845     DWORD Routine);
1846 
1847 DWORD_PTR
1848 NTAPI
1849 NtUserCallOneParam(
1850     DWORD_PTR Param,
1851     DWORD Routine);
1852 
1853 DWORD_PTR
1854 NTAPI
1855 NtUserCallTwoParam(
1856     DWORD_PTR Param1,
1857     DWORD_PTR Param2,
1858     DWORD Routine);
1859 
1860 BOOL
1861 NTAPI
1862 NtUserChangeClipboardChain(
1863     HWND hWndRemove,
1864     HWND hWndNewNext);
1865 
1866 LONG
1867 NTAPI
1868 NtUserChangeDisplaySettings(
1869     PUNICODE_STRING lpszDeviceName,
1870     LPDEVMODEW lpDevMode,
1871     DWORD dwflags,
1872     LPVOID lParam);
1873 
1874 BOOL
1875 NTAPI
1876 NtUserCheckDesktopByThreadId(
1877     DWORD dwThreadId);
1878 
1879 BOOL
1880 NTAPI
1881 NtUserCheckWindowThreadDesktop(
1882     HWND hwnd,
1883     DWORD dwThreadId,
1884     ULONG ReturnValue);
1885 
1886 DWORD
1887 NTAPI
1888 NtUserCheckImeHotKey(
1889     UINT uVirtualKey,
1890     LPARAM lParam);
1891 
1892 HWND NTAPI
1893 NtUserChildWindowFromPointEx(
1894     HWND Parent,
1895     LONG x,
1896     LONG y,
1897     UINT Flags);
1898 
1899 BOOL
1900 NTAPI
1901 NtUserClipCursor(
1902     RECT *lpRect);
1903 
1904 BOOL
1905 NTAPI
1906 NtUserCloseClipboard(VOID);
1907 
1908 BOOL
1909 NTAPI
1910 NtUserCloseDesktop(
1911     HDESK hDesktop);
1912 
1913 BOOL
1914 NTAPI
1915 NtUserCloseWindowStation(
1916     HWINSTA hWinSta);
1917 
1918 /* Console commands for NtUserConsoleControl */
1919 typedef enum _CONSOLECONTROL
1920 {
1921     ConsoleCtrlDesktopConsoleThread = 0,
1922     GuiConsoleWndClassAtom = 1,
1923     ConsoleMakePalettePublic = 5,
1924     ConsoleAcquireDisplayOwnership,
1925 } CONSOLECONTROL, *PCONSOLECONTROL;
1926 
1927 typedef struct _DESKTOP_CONSOLE_THREAD
1928 {
1929     HDESK DesktopHandle;
1930     ULONG_PTR ThreadId;
1931 } DESKTOP_CONSOLE_THREAD, *PDESKTOP_CONSOLE_THREAD;
1932 
1933 NTSTATUS
1934 APIENTRY
1935 NtUserConsoleControl(
1936     IN CONSOLECONTROL ConsoleCtrl,
1937     IN PVOID ConsoleCtrlInfo,
1938     IN ULONG ConsoleCtrlInfoLength);
1939 
1940 HANDLE
1941 NTAPI
1942 NtUserConvertMemHandle(
1943     PVOID pData,
1944     DWORD cbData);
1945 
1946 ULONG
1947 NTAPI
1948 NtUserCopyAcceleratorTable(
1949     HACCEL Table,
1950     LPACCEL Entries,
1951     ULONG EntriesCount);
1952 
1953 DWORD
1954 NTAPI
1955 NtUserCountClipboardFormats(VOID);
1956 
1957 HACCEL
1958 NTAPI
1959 NtUserCreateAcceleratorTable(
1960     LPACCEL Entries,
1961     ULONG EntriesCount);
1962 
1963 BOOL
1964 NTAPI
1965 NtUserCreateCaret(
1966     HWND hWnd,
1967     HBITMAP hBitmap,
1968     int nWidth,
1969     int nHeight);
1970 
1971 HDESK
1972 NTAPI
1973 NtUserCreateDesktop(
1974     POBJECT_ATTRIBUTES poa,
1975     PUNICODE_STRING lpszDesktopDevice,
1976     LPDEVMODEW lpdmw,
1977     DWORD dwFlags,
1978     ACCESS_MASK dwDesiredAccess);
1979 
1980 HIMC
1981 NTAPI
1982 NtUserCreateInputContext(ULONG_PTR dwClientImcData);
1983 
1984 NTSTATUS
1985 NTAPI
1986 NtUserCreateLocalMemHandle(
1987     HANDLE hMem,
1988     PVOID pData,
1989     DWORD cbData,
1990     DWORD *pcbData);
1991 
1992 HWND
1993 NTAPI
1994 NtUserCreateWindowEx(
1995     DWORD dwExStyle,
1996     PLARGE_STRING plstrClassName,
1997     PLARGE_STRING plstrClsVersion,
1998     PLARGE_STRING plstrWindowName,
1999     DWORD dwStyle,
2000     int x,
2001     int y,
2002     int nWidth,
2003     int nHeight,
2004     HWND hWndParent,
2005     HMENU hMenu,
2006     HINSTANCE hInstance,
2007     LPVOID lpParam,
2008     DWORD dwFlags,
2009     PVOID acbiBuffer);
2010 
2011 HWINSTA
2012 NTAPI
2013 NtUserCreateWindowStation(
2014     POBJECT_ATTRIBUTES ObjectAttributes,
2015     ACCESS_MASK dwDesiredAccess,
2016     DWORD Unknown2,
2017     DWORD Unknown3,
2018     DWORD Unknown4,
2019     DWORD Unknown5,
2020     DWORD Unknown6);
2021 
2022 BOOL
2023 NTAPI
2024 NtUserDdeGetQualityOfService(
2025     IN HWND hwndClient,
2026     IN HWND hWndServer,
2027     OUT PSECURITY_QUALITY_OF_SERVICE pqosPrev);
2028 
2029 DWORD
2030 NTAPI
2031 NtUserDdeInitialize(
2032     DWORD Unknown0,
2033     DWORD Unknown1,
2034     DWORD Unknown2,
2035     DWORD Unknown3,
2036     DWORD Unknown4);
2037 
2038 BOOL
2039 NTAPI
2040 NtUserDdeSetQualityOfService(
2041     IN HWND hwndClient,
2042     IN PSECURITY_QUALITY_OF_SERVICE pqosNew,
2043     OUT PSECURITY_QUALITY_OF_SERVICE pqosPrev);
2044 
2045 HDWP
2046 NTAPI
2047 NtUserDeferWindowPos(
2048     HDWP WinPosInfo,
2049     HWND Wnd,
2050     HWND WndInsertAfter,
2051     int x,
2052     int y,
2053     int cx,
2054     int cy,
2055     UINT Flags);
2056 
2057 BOOL
2058 NTAPI
2059 NtUserDefSetText(
2060     HWND WindowHandle,
2061     PLARGE_STRING WindowText);
2062 
2063 BOOLEAN
2064 NTAPI
2065 NtUserDestroyAcceleratorTable(
2066     HACCEL Table);
2067 
2068 BOOL
2069 NTAPI
2070 NtUserDestroyCursor(
2071   _In_ HANDLE Handle,
2072   _In_ BOOL bForce);
2073 
2074 BOOL
2075 NTAPI
2076 NtUserDestroyInputContext(HIMC hIMC);
2077 
2078 BOOLEAN
2079 NTAPI
2080 NtUserDestroyWindow(
2081     HWND Wnd);
2082 
2083 BOOL
2084 NTAPI
2085 NtUserDisableThreadIme(
2086     DWORD dwThreadID);
2087 
2088 LRESULT
2089 NTAPI
2090 NtUserDispatchMessage(
2091     PMSG pMsg);
2092 
2093 BOOL
2094 NTAPI
2095 NtUserDragDetect(
2096     HWND hWnd,
2097     POINT pt);
2098 
2099 DWORD
2100 NTAPI
2101 NtUserDragObject(
2102     HWND hwnd1,
2103     HWND hwnd2,
2104     UINT u1,
2105     DWORD dw1,
2106     HCURSOR hc1);
2107 
2108 BOOL
2109 NTAPI
2110 NtUserDrawAnimatedRects(
2111     HWND hwnd,
2112     INT idAni,
2113     RECT *lprcFrom,
2114     RECT *lprcTo);
2115 
2116 BOOL
2117 NTAPI
2118 NtUserDrawCaption(
2119     HWND hWnd,
2120     HDC hDc,
2121     LPCRECT lpRc,
2122     UINT uFlags);
2123 
2124 BOOL
2125 NTAPI
2126 NtUserDrawCaptionTemp(
2127     HWND hWnd,
2128     HDC hDC,
2129     LPCRECT lpRc,
2130     HFONT hFont,
2131     HICON hIcon,
2132     const PUNICODE_STRING str,
2133     UINT uFlags);
2134 
2135 /* Used with NtUserDrawIconEx, last parameter. */
2136 typedef struct _DRAWICONEXDATA
2137 {
2138     HBITMAP hbmMask;
2139     HBITMAP hbmColor;
2140     int cx;
2141     int cy;
2142 } DRAWICONEXDATA, *PDRAWICONEXDATA;
2143 
2144 BOOL
2145 NTAPI
2146 NtUserDrawIconEx(
2147     HDC hdc,
2148     int xLeft,
2149     int yTop,
2150     HICON hIcon,
2151     int cxWidth,
2152     int cyWidth,
2153     UINT istepIfAniCur,
2154     HBRUSH hbrFlickerFreeDraw,
2155     UINT diFlags,
2156     BOOL bMetaHDC,
2157     PVOID pDIXData);
2158 
2159 BOOL
2160 NTAPI
2161 NtUserEmptyClipboard(VOID);
2162 
2163 BOOL
2164 NTAPI
2165 NtUserEnableScrollBar(
2166     HWND hWnd,
2167     UINT wSBflags,
2168     UINT wArrows);
2169 
2170 BOOL
2171 NTAPI
2172 NtUserEndDeferWindowPosEx(
2173     HDWP WinPosInfo,
2174     BOOL bAsync);
2175 
2176 BOOL
2177 NTAPI
2178 NtUserEndPaint(
2179     HWND hWnd,
2180     CONST PAINTSTRUCT *lPs);
2181 
2182 BOOL
2183 NTAPI
2184 NtUserEnumDisplayDevices(
2185     PUNICODE_STRING lpDevice, /* device name */
2186     DWORD iDevNum, /* display device */
2187     PDISPLAY_DEVICEW lpDisplayDevice, /* device information */
2188     DWORD dwFlags); /* reserved */
2189 
2190 /*
2191 BOOL
2192 NTAPI
2193 NtUserEnumDisplayMonitors(
2194     HDC hdc,
2195     LPCRECT lprcClip,
2196     MONITORENUMPROC lpfnEnum,
2197     LPARAM dwData);
2198 */
2199 /* FIXME:  The call below is ros-specific and should be rewritten to use the same params as the correct call above. */
2200 INT
2201 NTAPI
2202 NtUserEnumDisplayMonitors(
2203     OPTIONAL IN HDC hDC,
2204     OPTIONAL IN LPCRECT pRect,
2205     OPTIONAL OUT HMONITOR *hMonitorList,
2206     OPTIONAL OUT LPRECT monitorRectList,
2207     OPTIONAL IN DWORD listSize);
2208 
2209 
2210 NTSTATUS
2211 NTAPI
2212 NtUserEnumDisplaySettings(
2213     PUNICODE_STRING lpszDeviceName,
2214     DWORD iModeNum,
2215     LPDEVMODEW lpDevMode, /* FIXME is this correct? */
2216     DWORD dwFlags);
2217 
2218 DWORD
2219 NTAPI
2220 NtUserEvent(
2221     DWORD Unknown0);
2222 
2223 INT
2224 NTAPI
2225 NtUserExcludeUpdateRgn(
2226     HDC hDC,
2227     HWND hWnd);
2228 
2229 BOOL
2230 NTAPI
2231 NtUserFillWindow(
2232     HWND hWndPaint,
2233     HWND hWndPaint1,
2234     HDC hDC,
2235     HBRUSH hBrush);
2236 
2237 HWND
2238 NTAPI
2239 NtUserFindWindowEx(
2240     HWND hwndParent,
2241     HWND hwndChildAfter,
2242     PUNICODE_STRING ucClassName,
2243     PUNICODE_STRING ucWindowName,
2244     DWORD dwUnknown);
2245 
2246 BOOL
2247 NTAPI
2248 NtUserFlashWindowEx(
2249     IN PFLASHWINFO pfwi);
2250 
2251 BOOL
2252 NTAPI
2253 NtUserGetAltTabInfo(
2254     HWND hwnd,
2255     INT iItem,
2256     PALTTABINFO pati,
2257     LPWSTR pszItemText,
2258     UINT cchItemText,
2259     BOOL Ansi);
2260 
2261 HWND
2262 NTAPI
2263 NtUserGetAncestor(
2264     HWND hWnd,
2265     UINT Flags);
2266 
2267 DWORD
2268 NTAPI
2269 NtUserGetAppImeLevel(HWND hWnd);
2270 
2271 SHORT
2272 NTAPI
2273 NtUserGetAsyncKeyState(
2274     INT Key);
2275 
2276 _Success_(return != 0)
2277 _At_(pustrName->Buffer, _Out_z_bytecap_post_bytecount_(pustrName->MaximumLength, return * 2 + 2))
2278 ULONG
2279 APIENTRY
2280 NtUserGetAtomName(
2281     _In_ ATOM atom,
2282     _Inout_ PUNICODE_STRING pustrName);
2283 
2284 UINT
2285 NTAPI
2286 NtUserGetCaretBlinkTime(VOID);
2287 
2288 BOOL
2289 NTAPI
2290 NtUserGetCaretPos(
2291     LPPOINT lpPoint);
2292 
2293 BOOL
2294 NTAPI
2295 NtUserGetClassInfo(
2296     HINSTANCE hInstance,
2297     PUNICODE_STRING ClassName,
2298     LPWNDCLASSEXW wcex,
2299     LPWSTR *ppszMenuName,
2300     BOOL Ansi);
2301 
2302 INT
2303 NTAPI
2304 NtUserGetClassName(
2305     HWND hWnd,
2306     BOOL Real, /* 0 GetClassNameW, 1 RealGetWindowClassA/W */
2307     PUNICODE_STRING ClassName);
2308 
2309 HANDLE
2310 NTAPI
2311 NtUserGetClipboardData(
2312     UINT fmt,
2313     PGETCLIPBDATA pgcd);
2314 
2315 INT
2316 NTAPI
2317 NtUserGetClipboardFormatName(
2318     UINT uFormat,
2319     LPWSTR lpszFormatName,
2320     INT cchMaxCount);
2321 
2322 HWND
2323 NTAPI
2324 NtUserGetClipboardOwner(VOID);
2325 
2326 DWORD
2327 NTAPI
2328 NtUserGetClipboardSequenceNumber(VOID);
2329 
2330 HWND
2331 NTAPI
2332 NtUserGetClipboardViewer(VOID);
2333 
2334 BOOL
2335 NTAPI
2336 NtUserGetClipCursor(
2337     RECT *lpRect);
2338 
2339 BOOL
2340 NTAPI
2341 NtUserGetComboBoxInfo(
2342     HWND hWnd,
2343     PCOMBOBOXINFO pcbi);
2344 
2345 HBRUSH
2346 NTAPI
2347 NtUserGetControlBrush(
2348     HWND hwnd,
2349     HDC  hdc,
2350     UINT ctlType);
2351 
2352 HBRUSH
2353 NTAPI
2354 NtUserGetControlColor(
2355     HWND hwndParent,
2356     HWND hwnd,
2357     HDC hdc,
2358     UINT CtlMsg);
2359 
2360 ULONG_PTR
2361 NTAPI
2362 NtUserGetCPD(
2363     HWND hWnd,
2364     GETCPD Flags,
2365     ULONG_PTR Proc);
2366 
2367 HCURSOR
2368 NTAPI
2369 NtUserGetCursorFrameInfo(
2370     HCURSOR hCursor,
2371     DWORD istep,
2372     INT *rate_jiffies,
2373     DWORD *num_steps);
2374 
2375 BOOL
2376 NTAPI
2377 NtUserGetCursorInfo(
2378     PCURSORINFO pci);
2379 
2380 HDC
2381 NTAPI
2382 NtUserGetDC(
2383     HWND hWnd);
2384 
2385 HDC
2386 NTAPI
2387 NtUserGetDCEx(
2388     HWND hWnd,
2389     HANDLE hRegion,
2390     ULONG Flags);
2391 
2392 UINT
2393 NTAPI
2394 NtUserGetDoubleClickTime(VOID);
2395 
2396 HWND
2397 NTAPI
2398 NtUserGetForegroundWindow(VOID);
2399 
2400 DWORD
2401 NTAPI
2402 NtUserGetGuiResources(
2403     HANDLE hProcess,
2404     DWORD uiFlags);
2405 
2406 BOOL
2407 NTAPI
2408 NtUserGetGUIThreadInfo(
2409     DWORD idThread,
2410     LPGUITHREADINFO lpgui);
2411 
2412 _Success_(return != FALSE)
2413 BOOL
2414 NTAPI
2415 NtUserGetIconInfo(
2416     _In_ HANDLE hCurIcon,
2417     _Out_opt_ PICONINFO IconInfo,
2418     _Inout_opt_ PUNICODE_STRING lpInstName,
2419     _Inout_opt_ PUNICODE_STRING lpResName,
2420     _Out_opt_ LPDWORD pbpp,
2421     _In_ BOOL bInternal);
2422 
2423 BOOL
2424 NTAPI
2425 NtUserGetIconSize(
2426     HANDLE Handle,
2427     UINT istepIfAniCur,
2428     LONG *plcx,
2429     LONG *plcy);
2430 
2431 BOOL
2432 NTAPI
2433 NtUserGetImeHotKey(DWORD dwHotKeyId,
2434                    LPUINT lpuModifiers,
2435                    LPUINT lpuVirtualKey,
2436                    LPHKL lphKL);
2437 
2438 BOOL
2439 NTAPI
2440 NtUserGetImeInfoEx(
2441     PIMEINFOEX pImeInfoEx,
2442     IMEINFOEXCLASS SearchType);
2443 
2444 DWORD
2445 NTAPI
2446 NtUserGetInternalWindowPos(
2447     HWND hwnd,
2448     LPRECT rectWnd,
2449     LPPOINT ptIcon);
2450 
2451 HKL
2452 NTAPI
2453 NtUserGetKeyboardLayout(
2454     DWORD dwThreadid);
2455 
2456 UINT
2457 NTAPI
2458 NtUserGetKeyboardLayoutList(
2459     ULONG nItems,
2460     HKL *pHklBuff);
2461 
2462 BOOL
2463 NTAPI
2464 NtUserGetKeyboardLayoutName(
2465     _Inout_ PUNICODE_STRING pustrName);
2466 
2467 DWORD
2468 NTAPI
2469 NtUserGetKeyboardState(
2470     LPBYTE Unknown0);
2471 
2472 DWORD
2473 NTAPI
2474 NtUserGetKeyboardType(
2475     DWORD TypeFlag);
2476 
2477 DWORD
2478 NTAPI
2479 NtUserGetKeyNameText(
2480     LONG lParam,
2481     LPWSTR lpString,
2482     int nSize);
2483 
2484 SHORT
2485 NTAPI
2486 NtUserGetKeyState(
2487     INT VirtKey);
2488 
2489 BOOL
2490 NTAPI
2491 NtUserGetLayeredWindowAttributes(
2492     HWND hwnd,
2493     COLORREF *pcrKey,
2494     BYTE *pbAlpha,
2495     DWORD *pdwFlags);
2496 
2497 DWORD
2498 NTAPI
2499 NtUserGetListBoxInfo(
2500     HWND hWnd);
2501 
2502 BOOL
2503 APIENTRY
2504 NtUserGetMessage(
2505     PMSG pMsg,
2506     HWND hWnd,
2507     UINT MsgFilterMin,
2508     UINT MsgFilterMax);
2509 
2510 DWORD
2511 NTAPI
2512 NtUserGetMouseMovePointsEx(
2513     UINT cbSize,
2514     LPMOUSEMOVEPOINT lppt,
2515     LPMOUSEMOVEPOINT lpptBuf,
2516     int nBufPoints,
2517     DWORD resolution);
2518 
2519 BOOL
2520 NTAPI
2521 NtUserGetObjectInformation(
2522     HANDLE hObject,
2523     DWORD nIndex,
2524     PVOID pvInformation,
2525     DWORD nLength,
2526     PDWORD nLengthNeeded);
2527 
2528 HWND
2529 NTAPI
2530 NtUserGetOpenClipboardWindow(VOID);
2531 
2532 INT
2533 NTAPI
2534 NtUserGetPriorityClipboardFormat(
2535     UINT *paFormatPriorityList,
2536     INT cFormats);
2537 
2538 HWINSTA
2539 NTAPI
2540 NtUserGetProcessWindowStation(VOID);
2541 
2542 DWORD
2543 NTAPI
2544 NtUserGetRawInputBuffer(
2545     PRAWINPUT pData,
2546     PUINT pcbSize,
2547     UINT cbSizeHeader);
2548 
2549 DWORD
2550 NTAPI
2551 NtUserGetRawInputData(
2552     HRAWINPUT hRawInput,
2553     UINT uiCommand,
2554     LPVOID pData,
2555     PUINT pcbSize,
2556     UINT cbSizeHeader);
2557 
2558 DWORD
2559 NTAPI
2560 NtUserGetRawInputDeviceInfo(
2561     HANDLE hDevice,
2562     UINT uiCommand,
2563     LPVOID pData,
2564     PUINT pcbSize);
2565 
2566 DWORD
2567 NTAPI
2568 NtUserGetRawInputDeviceList(
2569     PRAWINPUTDEVICELIST pRawInputDeviceList,
2570     PUINT puiNumDevices,
2571     UINT cbSize);
2572 
2573 DWORD
2574 NTAPI
2575 NtUserGetRegisteredRawInputDevices(
2576     PRAWINPUTDEVICE pRawInputDevices,
2577     PUINT puiNumDevices,
2578     UINT cbSize);
2579 
2580 BOOL
2581 NTAPI
2582 NtUserGetScrollBarInfo(
2583     HWND hWnd,
2584     LONG idObject,
2585     PSCROLLBARINFO psbi);
2586 
2587 HDESK
2588 NTAPI
2589 NtUserGetThreadDesktop(
2590     DWORD dwThreadId,
2591     HDESK hConsoleDesktop);
2592 
2593 enum ThreadStateRoutines
2594 {
2595     THREADSTATE_FOCUSWINDOW = 0,
2596     THREADSTATE_ACTIVEWINDOW,
2597     THREADSTATE_CAPTUREWINDOW,
2598     THREADSTATE_DEFAULTIMEWINDOW,
2599     THREADSTATE_DEFAULTINPUTCONTEXT,
2600     THREADSTATE_GETINPUTSTATE,
2601     THREADSTATE_GETCURSOR,
2602     THREADSTATE_CHANGEBITS,
2603     THREADSTATE_UPTIMELASTREAD,
2604     THREADSTATE_GETMESSAGEEXTRAINFO,
2605     THREADSTATE_INSENDMESSAGE,
2606     THREADSTATE_GETMESSAGETIME,
2607     THREADSTATE_FOREGROUNDTHREAD,
2608     THREADSTATE_IMECOMPATFLAGS,
2609     THREADSTATE_OLDKEYBOARDLAYOUT,
2610     THREADSTATE_ISWINLOGON,
2611     THREADSTATE_ISWINLOGON2,
2612     THREADSTATE_CHECKCONIME,
2613     THREADSTATE_GETTHREADINFO,
2614     THREADSTATE_PROGMANWINDOW, /* FIXME: Delete this HACK */
2615     THREADSTATE_TASKMANWINDOW, /* FIXME: Delete this HACK */
2616 };
2617 
2618 DWORD_PTR
2619 NTAPI
2620 NtUserGetThreadState(
2621     DWORD Routine);
2622 
2623 BOOLEAN
2624 NTAPI
2625 NtUserGetTitleBarInfo(
2626     HWND hwnd,
2627     PTITLEBARINFO pti);
2628 
2629 BOOL
2630 NTAPI
2631 NtUserGetUpdateRect(
2632     HWND hWnd,
2633     LPRECT lpRect,
2634     BOOL fErase);
2635 
2636 INT
2637 NTAPI
2638 NtUserGetUpdateRgn(
2639     HWND hWnd,
2640     HRGN hRgn,
2641     BOOL bErase);
2642 
2643 HDC
2644 NTAPI
2645 NtUserGetWindowDC(
2646     HWND hWnd);
2647 
2648 BOOL
2649 NTAPI
2650 NtUserGetWindowPlacement(
2651     HWND hWnd,
2652     WINDOWPLACEMENT *lpwndpl);
2653 
2654 PCLS
2655 NTAPI
2656 NtUserGetWOWClass(
2657     HINSTANCE hInstance,
2658     PUNICODE_STRING ClassName);
2659 
2660 DWORD
2661 NTAPI
2662 NtUserHardErrorControl(
2663     DWORD dwUnknown1,
2664     DWORD dwUnknown2,
2665     DWORD dwUnknown3);
2666 
2667 BOOL
2668 NTAPI
2669 NtUserImpersonateDdeClientWindow(
2670     HWND hWndClient,
2671     HWND hWndServer);
2672 
2673 NTSTATUS
2674 NTAPI
2675 NtUserInitialize(
2676     DWORD dwWinVersion,
2677     HANDLE hPowerRequestEvent,
2678     HANDLE hMediaRequestEvent);
2679 
2680 NTSTATUS
2681 NTAPI
2682 NtUserInitializeClientPfnArrays(
2683     PPFNCLIENT pfnClientA,
2684     PPFNCLIENT pfnClientW,
2685     PPFNCLIENTWORKER pfnClientWorker,
2686     HINSTANCE hmodUser);
2687 
2688 DWORD
2689 NTAPI
2690 NtUserInitTask(
2691     DWORD Unknown0,
2692     DWORD Unknown1,
2693     DWORD Unknown2,
2694     DWORD Unknown3,
2695     DWORD Unknown4,
2696     DWORD Unknown5,
2697     DWORD Unknown6,
2698     DWORD Unknown7,
2699     DWORD Unknown8,
2700     DWORD Unknown9,
2701     DWORD Unknown10,
2702     DWORD Unknown11);
2703 
2704 INT
2705 NTAPI
2706 NtUserInternalGetWindowText(
2707     HWND hWnd,
2708     LPWSTR lpString,
2709     INT nMaxCount);
2710 
2711 BOOL
2712 NTAPI
2713 NtUserInvalidateRect(
2714     HWND hWnd,
2715     CONST RECT *lpRect,
2716     BOOL bErase);
2717 
2718 BOOL
2719 NTAPI
2720 NtUserInvalidateRgn(
2721     HWND hWnd,
2722     HRGN hRgn,
2723     BOOL bErase);
2724 
2725 BOOL
2726 NTAPI
2727 NtUserIsClipboardFormatAvailable(
2728     UINT format);
2729 
2730 BOOL
2731 NTAPI
2732 NtUserKillTimer(
2733     HWND hWnd,
2734     UINT_PTR uIDEvent);
2735 
2736 HKL
2737 NTAPI
2738 NtUserLoadKeyboardLayoutEx(
2739     IN HANDLE Handle,
2740     IN DWORD offTable,
2741     IN PUNICODE_STRING puszKeyboardName,
2742     IN HKL hKL,
2743     IN PUNICODE_STRING puszKLID,
2744     IN DWORD dwKLID,
2745     IN UINT Flags);
2746 
2747 BOOL
2748 NTAPI
2749 NtUserLockWindowStation(
2750     HWINSTA hWindowStation);
2751 
2752 BOOL
2753 NTAPI
2754 NtUserLockWindowUpdate(
2755     HWND hWnd);
2756 
2757 BOOL
2758 NTAPI
2759 NtUserLockWorkStation(VOID);
2760 
2761 UINT
2762 NTAPI
2763 NtUserMapVirtualKeyEx(
2764     UINT keyCode,
2765     UINT transType,
2766     DWORD keyboardId,
2767     HKL dwhkl);
2768 
2769 typedef struct tagDOSENDMESSAGE
2770 {
2771     UINT uFlags;
2772     UINT uTimeout;
2773     ULONG_PTR Result;
2774 }
2775 DOSENDMESSAGE, *PDOSENDMESSAGE;
2776 
2777 BOOL
2778 NTAPI
2779 NtUserMessageCall(
2780     HWND hWnd,
2781     UINT Msg,
2782     WPARAM wParam,
2783     LPARAM lParam,
2784     ULONG_PTR ResultInfo,
2785     DWORD dwType, /* FNID_XX types */
2786     BOOL Ansi);
2787 
2788 DWORD
2789 NTAPI
2790 NtUserMinMaximize(
2791     HWND hWnd,
2792     UINT cmd, /* Wine SW_ commands */
2793     BOOL Hide);
2794 
2795 DWORD
2796 NTAPI
2797 NtUserMNDragLeave(VOID);
2798 
2799 DWORD
2800 NTAPI
2801 NtUserMNDragOver(
2802     DWORD Unknown0,
2803     DWORD Unknown1);
2804 
2805 DWORD
2806 NTAPI
2807 NtUserModifyUserStartupInfoFlags(
2808     DWORD Unknown0,
2809     DWORD Unknown1);
2810 
2811 BOOL
2812 NTAPI
2813 NtUserMoveWindow(
2814     HWND hWnd,
2815     int X,
2816     int Y,
2817     int nWidth,
2818     int nHeight,
2819     BOOL bRepaint
2820 );
2821 
2822 DWORD
2823 NTAPI
2824 NtUserNotifyIMEStatus(HWND hwnd, BOOL fOpen, DWORD dwConversion);
2825 
2826 BOOL
2827 NTAPI
2828 NtUserNotifyProcessCreate(
2829     HANDLE NewProcessId,
2830     HANDLE ParentThreadId,
2831     ULONG dwUnknown,
2832     ULONG CreateFlags);
2833 
2834 VOID
2835 NTAPI
2836 NtUserNotifyWinEvent(
2837     DWORD Event,
2838     HWND hWnd,
2839     LONG idObject,
2840     LONG idChild);
2841 
2842 BOOL
2843 NTAPI
2844 NtUserOpenClipboard(
2845     HWND hWnd,
2846     DWORD Unknown1);
2847 
2848 HDESK
2849 NTAPI
2850 NtUserOpenDesktop(
2851     POBJECT_ATTRIBUTES ObjectAttributes,
2852     DWORD dwFlags,
2853     ACCESS_MASK dwDesiredAccess);
2854 
2855 HDESK
2856 NTAPI
2857 NtUserOpenInputDesktop(
2858     DWORD dwFlags,
2859     BOOL fInherit,
2860     ACCESS_MASK dwDesiredAccess);
2861 
2862 HWINSTA
2863 NTAPI
2864 NtUserOpenWindowStation(
2865     POBJECT_ATTRIBUTES ObjectAttributes,
2866     ACCESS_MASK dwDesiredAccess);
2867 
2868 BOOL
2869 NTAPI
2870 NtUserPaintDesktop(
2871     HDC hDC);
2872 
2873 DWORD
2874 NTAPI
2875 NtUserPaintMenuBar(
2876     HWND hWnd,
2877     HDC hDC,
2878     ULONG left,    // x,
2879     ULONG right,   // width, // Scale the edge thickness, offset?
2880     ULONG top,     // y,
2881     BOOL bActive); // DWORD Flags); DC_ACTIVE or WS_ACTIVECAPTION, by checking WNDS_ACTIVEFRAME and foreground.
2882 
2883 BOOL
2884 APIENTRY
2885 NtUserPeekMessage(
2886     PMSG pMsg,
2887     HWND hWnd,
2888     UINT MsgFilterMin,
2889     UINT MsgFilterMax,
2890     UINT RemoveMsg);
2891 
2892 BOOL
2893 NTAPI
2894 NtUserPostMessage(
2895     HWND hWnd,
2896     UINT Msg,
2897     WPARAM wParam,
2898     LPARAM lParam);
2899 
2900 BOOL
2901 NTAPI
2902 NtUserPostThreadMessage(
2903     DWORD idThread,
2904     UINT Msg,
2905     WPARAM wParam,
2906     LPARAM lParam);
2907 
2908 BOOL
2909 NTAPI
2910 NtUserPrintWindow(
2911     HWND hwnd,
2912     HDC hdcBlt,
2913     UINT nFlags);
2914 
2915 NTSTATUS
2916 NTAPI
2917 NtUserProcessConnect(
2918     IN HANDLE ProcessHandle,
2919     OUT PUSERCONNECT pUserConnect,
2920     IN ULONG Size); /* sizeof(USERCONNECT) */
2921 
2922 NTSTATUS
2923 NTAPI
2924 NtUserQueryInformationThread(
2925     IN HANDLE ThreadHandle,
2926     IN USERTHREADINFOCLASS ThreadInformationClass,
2927     OUT PVOID ThreadInformation,
2928     IN ULONG ThreadInformationLength);
2929 
2930 DWORD_PTR
2931 NTAPI
2932 NtUserQueryInputContext(
2933     HIMC hIMC,
2934     DWORD dwType);
2935 
2936 DWORD
2937 NTAPI
2938 NtUserQuerySendMessage(
2939     DWORD Unknown0);
2940 
2941 DWORD
2942 NTAPI
2943 NtUserQueryUserCounters(
2944     DWORD Unknown0,
2945     DWORD Unknown1,
2946     DWORD Unknown2,
2947     DWORD Unknown3,
2948     DWORD Unknown4);
2949 
2950 #define QUERY_WINDOW_UNIQUE_PROCESS_ID 0x00
2951 #define QUERY_WINDOW_UNIQUE_THREAD_ID  0x01
2952 #define QUERY_WINDOW_ACTIVE            0x02
2953 #define QUERY_WINDOW_FOCUS             0x03
2954 #define QUERY_WINDOW_ISHUNG            0x04
2955 #define QUERY_WINDOW_REAL_ID           0x05
2956 #define QUERY_WINDOW_FOREGROUND        0x06
2957 #define QUERY_WINDOW_DEFAULT_IME       0x07
2958 #define QUERY_WINDOW_DEFAULT_ICONTEXT  0x08
2959 #define QUERY_WINDOW_ACTIVE_IME        0x09
2960 
2961 DWORD_PTR
2962 NTAPI
2963 NtUserQueryWindow(
2964     HWND hWnd,
2965     DWORD Index);
2966 
2967 BOOL
2968 NTAPI
2969 NtUserRealInternalGetMessage(
2970     LPMSG lpMsg,
2971     HWND hWnd,
2972     UINT wMsgFilterMin,
2973     UINT wMsgFilterMax,
2974     UINT wRemoveMsg,
2975     BOOL bGMSG);
2976 
2977 HWND
2978 NTAPI
2979 NtUserRealChildWindowFromPoint(
2980     HWND Parent,
2981     LONG x,
2982     LONG y);
2983 
2984 BOOL
2985 NTAPI
2986 NtUserRealWaitMessageEx(
2987     DWORD dwWakeMask,
2988     UINT uTimeout);
2989 
2990 BOOL
2991 NTAPI
2992 NtUserRedrawWindow(
2993     HWND hWnd,
2994     CONST RECT *lprcUpdate,
2995     HRGN hrgnUpdate,
2996     UINT flags);
2997 
2998 RTL_ATOM
2999 NTAPI
3000 NtUserRegisterClassExWOW(
3001     WNDCLASSEXW* lpwcx,
3002     PUNICODE_STRING pustrClassName,
3003     PUNICODE_STRING pustrCVersion,
3004     PCLSMENUNAME pClassMenuName,
3005     DWORD fnID,
3006     DWORD Flags,
3007     LPDWORD pWow);
3008 
3009 BOOL
3010 NTAPI
3011 NtUserRegisterRawInputDevices(
3012     IN PCRAWINPUTDEVICE pRawInputDevices,
3013     IN UINT uiNumDevices,
3014     IN UINT cbSize);
3015 
3016 BOOL
3017 NTAPI
3018 NtUserRegisterUserApiHook(
3019     PUNICODE_STRING m_dllname1,
3020     PUNICODE_STRING m_funname1,
3021     DWORD dwUnknown3,
3022     DWORD dwUnknown4);
3023 
3024 BOOL
3025 NTAPI
3026 NtUserRegisterHotKey(
3027     HWND hWnd,
3028     int id,
3029     UINT fsModifiers,
3030     UINT vk);
3031 
3032 DWORD
3033 NTAPI
3034 NtUserRegisterTasklist(
3035     DWORD Unknown0);
3036 
3037 UINT
3038 NTAPI
3039 NtUserRegisterWindowMessage(
3040     PUNICODE_STRING MessageName);
3041 
3042 DWORD
3043 NTAPI
3044 NtUserRemoteConnect(
3045     DWORD dwUnknown1,
3046     DWORD dwUnknown2,
3047     DWORD dwUnknown3);
3048 
3049 DWORD
3050 NTAPI
3051 NtUserRemoteRedrawRectangle(
3052     DWORD dwUnknown1,
3053     DWORD dwUnknown2,
3054     DWORD dwUnknown3,
3055     DWORD dwUnknown4);
3056 
3057 DWORD
3058 NTAPI
3059 NtUserRemoteRedrawScreen(VOID);
3060 
3061 DWORD
3062 NTAPI
3063 NtUserRemoteStopScreenUpdates(VOID);
3064 
3065 HANDLE
3066 NTAPI
3067 NtUserRemoveProp(
3068     HWND hWnd,
3069     ATOM Atom);
3070 
3071 HDESK
3072 NTAPI
3073 NtUserResolveDesktop(
3074     IN HANDLE ProcessHandle,
3075     IN PUNICODE_STRING DesktopPath,
3076     IN BOOL bInherit,
3077     OUT HWINSTA* phWinSta);
3078 
3079 DWORD
3080 NTAPI
3081 NtUserResolveDesktopForWOW(
3082     DWORD Unknown0);
3083 
3084 BOOL
3085 NTAPI
3086 NtUserSBGetParms(
3087     HWND hwnd,
3088     int fnBar,
3089     PSBDATA pSBData,
3090     LPSCROLLINFO lpsi);
3091 
3092 BOOL
3093 NTAPI
3094 NtUserScrollDC(
3095     HDC hDC,
3096     int dx,
3097     int dy,
3098     CONST RECT *lprcScroll,
3099     CONST RECT *lprcClip ,
3100     HRGN hrgnUpdate,
3101     LPRECT lprcUpdate);
3102 
3103 DWORD
3104 NTAPI
3105 NtUserScrollWindowEx(
3106     HWND hWnd,
3107     INT dx,
3108     INT dy,
3109     const RECT *rect,
3110     const RECT *clipRect,
3111     HRGN hrgnUpdate,
3112     LPRECT rcUpdate,
3113     UINT flags);
3114 
3115 UINT
3116 NTAPI
3117 NtUserSendInput(
3118     UINT nInputs,
3119     LPINPUT pInput,
3120     INT cbSize);
3121 
3122 HWND
3123 NTAPI
3124 NtUserSetActiveWindow(
3125     HWND Wnd);
3126 
3127 BOOL
3128 NTAPI
3129 NtUserSetAppImeLevel(
3130     HWND hWnd,
3131     DWORD dwLevel);
3132 
3133 HWND
3134 NTAPI
3135 NtUserSetCapture(
3136     HWND Wnd);
3137 
3138 ULONG_PTR
3139 NTAPI
3140 NtUserSetClassLong(
3141     HWND hWnd,
3142     INT Offset,
3143     ULONG_PTR dwNewLong,
3144     BOOL Ansi);
3145 
3146 WORD
3147 NTAPI
3148 NtUserSetClassWord(
3149     HWND hWnd,
3150     INT nIndex,
3151     WORD wNewWord);
3152 
3153 HANDLE
3154 NTAPI
3155 NtUserSetClipboardData(
3156     UINT fmt,
3157     HANDLE hMem,
3158     PSETCLIPBDATA scd);
3159 
3160 HWND
3161 NTAPI
3162 NtUserSetClipboardViewer(
3163     HWND hWndNewViewer);
3164 
3165 HPALETTE
3166 NTAPI
3167 NtUserSelectPalette(
3168     HDC hDC,
3169     HPALETTE hpal,
3170     BOOL ForceBackground);
3171 
3172 DWORD
3173 NTAPI
3174 NtUserSetConsoleReserveKeys(
3175     DWORD Unknown0,
3176     DWORD Unknown1);
3177 
3178 HCURSOR
3179 NTAPI
3180 NtUserSetCursor(
3181     HCURSOR hCursor);
3182 
3183 BOOL
3184 NTAPI
3185 NtUserSetCursorContents(
3186     HANDLE Handle,
3187     PICONINFO IconInfo);
3188 
3189 BOOL
3190 NTAPI
3191 NtUserSetCursorIconData(
3192     _In_ HCURSOR hCursor,
3193     _In_opt_ PUNICODE_STRING pustrModule,
3194     _In_opt_ PUNICODE_STRING puSrcName,
3195     _In_ const CURSORDATA *pCursorData);
3196 
3197 typedef struct _tagFINDEXISTINGCURICONPARAM
3198 {
3199     BOOL bIcon;
3200     LONG cx;
3201     LONG cy;
3202 } FINDEXISTINGCURICONPARAM;
3203 
3204 HICON
3205 NTAPI
3206 NtUserFindExistingCursorIcon(
3207     _In_ PUNICODE_STRING pustrModule,
3208     _In_ PUNICODE_STRING pustrRsrc,
3209     _In_ FINDEXISTINGCURICONPARAM *param);
3210 
3211 DWORD
3212 NTAPI
3213 NtUserSetDbgTag(
3214     DWORD Unknown0,
3215     DWORD Unknown1);
3216 
3217 DWORD
3218 APIENTRY
3219 NtUserSetDbgTagCount(
3220     DWORD Unknown0);
3221 
3222 HWND
3223 NTAPI
3224 NtUserSetFocus(
3225     HWND hWnd);
3226 
3227 BOOL
3228 NTAPI
3229 NtUserSetImeHotKey(
3230     DWORD dwHotKeyId,
3231     UINT uModifiers,
3232     UINT uVirtualKey,
3233     HKL hKL,
3234     DWORD dwAction);
3235 
3236 BOOL
3237 NTAPI
3238 NtUserSetImeInfoEx(
3239     PIMEINFOEX pImeInfoEx);
3240 
3241 BOOL
3242 NTAPI
3243 NtUserSetImeOwnerWindow(HWND hImeWnd, HWND hwndFocus);
3244 
3245 DWORD
3246 NTAPI
3247 NtUserSetInformationProcess(
3248     DWORD dwUnknown1,
3249     DWORD dwUnknown2,
3250     DWORD dwUnknown3,
3251     DWORD dwUnknown4);
3252 
3253 NTSTATUS
3254 NTAPI
3255 NtUserSetInformationThread(
3256     IN HANDLE ThreadHandle,
3257     IN USERTHREADINFOCLASS ThreadInformationClass,
3258     IN PVOID ThreadInformation,
3259     IN ULONG ThreadInformationLength);
3260 
3261 DWORD
3262 NTAPI
3263 NtUserSetInternalWindowPos(
3264     HWND hwnd,
3265     UINT showCmd,
3266     LPRECT rect,
3267     LPPOINT pt);
3268 
3269 BOOL
3270 NTAPI
3271 NtUserSetKeyboardState(
3272     LPBYTE lpKeyState);
3273 
3274 BOOL
3275 NTAPI
3276 NtUserSetLayeredWindowAttributes(
3277     HWND hwnd,
3278     COLORREF crKey,
3279     BYTE bAlpha,
3280     DWORD dwFlags);
3281 
3282 BOOL
3283 NTAPI
3284 NtUserSetLogonNotifyWindow(
3285     HWND hWnd);
3286 
3287 BOOL
3288 NTAPI
3289 NtUserSetObjectInformation(
3290     HANDLE hObject,
3291     DWORD nIndex,
3292     PVOID pvInformation,
3293     DWORD nLength);
3294 
3295 HWND
3296 NTAPI
3297 NtUserSetParent(
3298     HWND hWndChild,
3299     HWND hWndNewParent);
3300 
3301 BOOL
3302 NTAPI
3303 NtUserSetProcessWindowStation(
3304     HWINSTA hWindowStation);
3305 
3306 BOOL
3307 NTAPI
3308 NtUserSetProp(
3309     HWND hWnd,
3310     ATOM Atom,
3311     HANDLE Data);
3312 
3313 DWORD
3314 NTAPI
3315 NtUserSetRipFlags(
3316     DWORD Unknown0);
3317 
3318 DWORD
3319 NTAPI
3320 NtUserSetScrollInfo(
3321     HWND hwnd,
3322     int fnBar,
3323     LPCSCROLLINFO lpsi,
3324     BOOL bRedraw);
3325 
3326 BOOL
3327 NTAPI
3328 NtUserSetShellWindowEx(
3329     HWND hwndShell,
3330     HWND hwndShellListView);
3331 
3332 BOOL
3333 NTAPI
3334 NtUserSetSysColors(
3335     int cElements,
3336     IN CONST INT *lpaElements,
3337     IN CONST COLORREF *lpaRgbValues,
3338     FLONG Flags);
3339 
3340 BOOL
3341 NTAPI
3342 NtUserSetSystemCursor(
3343     HCURSOR hcur,
3344     DWORD id);
3345 
3346 BOOL
3347 NTAPI
3348 NtUserSetThreadDesktop(
3349     HDESK hDesktop);
3350 
3351 DWORD
3352 NTAPI
3353 NtUserSetThreadState(
3354     DWORD Unknown0,
3355     DWORD Unknown1);
3356 
3357 UINT_PTR
3358 NTAPI
3359 NtUserSetSystemTimer(
3360     HWND hWnd,
3361     UINT_PTR nIDEvent,
3362     UINT uElapse,
3363     TIMERPROC lpTimerFunc);
3364 
3365 DWORD
3366 NTAPI
3367 NtUserSetThreadLayoutHandles(HKL hNewKL, HKL hOldKL);
3368 
3369 UINT_PTR
3370 NTAPI
3371 NtUserSetTimer(
3372     HWND hWnd,
3373     UINT_PTR nIDEvent,
3374     UINT uElapse,
3375     TIMERPROC lpTimerFunc);
3376 
3377 BOOL
3378 NTAPI
3379 NtUserSetWindowFNID(
3380     HWND hWnd,
3381     WORD fnID);
3382 
3383 LONG
3384 NTAPI
3385 NtUserSetWindowLong(
3386     HWND hWnd,
3387     DWORD Index,
3388     LONG NewValue,
3389     BOOL Ansi);
3390 
3391 #ifdef _WIN64
3392 LONG_PTR
3393 NTAPI
3394 NtUserSetWindowLongPtr(
3395     HWND hWnd,
3396     DWORD Index,
3397     LONG_PTR NewValue,
3398     BOOL Ansi);
3399 #else
3400 #define NtUserSetWindowLongPtr NtUserSetWindowLong
3401 #endif // _WIN64
3402 
3403 BOOL
3404 NTAPI
3405 NtUserSetWindowPlacement(
3406     HWND hWnd,
3407     WINDOWPLACEMENT *lpwndpl);
3408 
3409 BOOL
3410 NTAPI
3411 NtUserSetWindowPos(
3412     HWND hWnd,
3413     HWND hWndInsertAfter,
3414     int X,
3415     int Y,
3416     int cx,
3417     int cy,
3418     UINT uFlags);
3419 
3420 INT
3421 NTAPI
3422 NtUserSetWindowRgn(
3423     HWND hWnd,
3424     HRGN hRgn,
3425     BOOL bRedraw);
3426 
3427 HHOOK
3428 NTAPI
3429 NtUserSetWindowsHookAW(
3430     int idHook,
3431     HOOKPROC lpfn,
3432     BOOL Ansi);
3433 
3434 HHOOK
3435 NTAPI
3436 NtUserSetWindowsHookEx(
3437     HINSTANCE Mod,
3438     PUNICODE_STRING ModuleName,
3439     DWORD ThreadId,
3440     int HookId,
3441     HOOKPROC HookProc,
3442     BOOL Ansi);
3443 
3444 BOOL
3445 NTAPI
3446 NtUserSetWindowStationUser(
3447     IN HWINSTA hWindowStation,
3448     IN PLUID pluid,
3449     IN PSID psid OPTIONAL,
3450     IN DWORD size);
3451 
3452 WORD
3453 NTAPI
3454 NtUserSetWindowWord(
3455     HWND hWnd,
3456     INT Index,
3457     WORD NewVal);
3458 
3459 HWINEVENTHOOK
3460 NTAPI
3461 NtUserSetWinEventHook(
3462     UINT eventMin,
3463     UINT eventMax,
3464     HMODULE hmodWinEventProc,
3465     PUNICODE_STRING puString,
3466     WINEVENTPROC lpfnWinEventProc,
3467     DWORD idProcess,
3468     DWORD idThread,
3469     UINT dwflags);
3470 
3471 BOOL
3472 NTAPI
3473 NtUserShowCaret(
3474     HWND hWnd);
3475 
3476 BOOL
3477 NTAPI
3478 NtUserHideCaret(
3479     HWND hWnd);
3480 
3481 DWORD
3482 NTAPI
3483 NtUserShowScrollBar(
3484     HWND hWnd,
3485     int wBar,
3486     DWORD bShow);
3487 
3488 BOOL
3489 NTAPI
3490 NtUserShowWindow(
3491     HWND hWnd,
3492     LONG nCmdShow);
3493 
3494 BOOL
3495 NTAPI
3496 NtUserShowWindowAsync(
3497     HWND hWnd,
3498     LONG nCmdShow);
3499 
3500 BOOL
3501 NTAPI
3502 NtUserSoundSentry(VOID);
3503 
3504 BOOL
3505 NTAPI
3506 NtUserSwitchDesktop(
3507     HDESK hDesktop);
3508 
3509 BOOL
3510 NTAPI
3511 NtUserSystemParametersInfo(
3512     UINT uiAction,
3513     UINT uiParam,
3514     PVOID pvParam,
3515     UINT fWinIni);
3516 
3517 DWORD
3518 NTAPI
3519 NtUserTestForInteractiveUser(
3520     DWORD dwUnknown1);
3521 
3522 INT
3523 NTAPI
3524 NtUserToUnicodeEx(
3525     UINT wVirtKey,
3526     UINT wScanCode,
3527     PBYTE lpKeyState,
3528     LPWSTR pwszBuff,
3529     int cchBuff,
3530     UINT wFlags,
3531     HKL dwhkl);
3532 
3533 BOOL
3534 NTAPI
3535 NtUserTrackMouseEvent(
3536     LPTRACKMOUSEEVENT lpEventTrack);
3537 
3538 int
3539 NTAPI
3540 NtUserTranslateAccelerator(
3541     HWND Window,
3542     HACCEL Table,
3543     LPMSG Message);
3544 
3545 BOOL
3546 NTAPI
3547 NtUserTranslateMessage(
3548     LPMSG lpMsg,
3549     UINT flags );
3550 
3551 BOOL
3552 NTAPI
3553 NtUserUnhookWindowsHookEx(
3554     HHOOK Hook);
3555 
3556 BOOL
3557 NTAPI
3558 NtUserUnhookWinEvent(
3559     HWINEVENTHOOK hWinEventHook);
3560 
3561 BOOL
3562 NTAPI
3563 NtUserUnloadKeyboardLayout(
3564     HKL hKl);
3565 
3566 BOOL
3567 NTAPI
3568 NtUserUnlockWindowStation(
3569     HWINSTA hWindowStation);
3570 
3571 BOOL
3572 NTAPI
3573 NtUserUnregisterClass(
3574     PUNICODE_STRING ClassNameOrAtom,
3575     HINSTANCE hInstance,
3576     PCLSMENUNAME pClassMenuName);
3577 
3578 BOOL
3579 NTAPI
3580 NtUserUnregisterHotKey(
3581     HWND hWnd,
3582     int id);
3583 
3584 BOOL
3585 NTAPI
3586 NtUserUnregisterUserApiHook(VOID);
3587 
3588 BOOL
3589 NTAPI
3590 NtUserUpdateInputContext(
3591     HIMC hIMC,
3592     DWORD dwType,
3593     DWORD_PTR dwValue);
3594 
3595 DWORD
3596 NTAPI
3597 NtUserUpdateInstance(
3598     DWORD Unknown0,
3599     DWORD Unknown1,
3600     DWORD Unknown2);
3601 
3602 BOOL
3603 NTAPI
3604 NtUserUpdateLayeredWindow(
3605     HWND hwnd,
3606     HDC hdcDst,
3607     POINT *pptDst,
3608     SIZE *psize,
3609     HDC hdcSrc,
3610     POINT *pptSrc,
3611     COLORREF crKey,
3612     BLENDFUNCTION *pblend,
3613     DWORD dwFlags,
3614     RECT *prcDirty);
3615 
3616 BOOL
3617 NTAPI
3618 NtUserUpdatePerUserSystemParameters(
3619     DWORD dwReserved,
3620     BOOL bEnable);
3621 
3622 BOOL
3623 NTAPI
3624 NtUserUserHandleGrantAccess(
3625     IN HANDLE hUserHandle,
3626     IN HANDLE hJob,
3627     IN BOOL bGrant);
3628 
3629 BOOL
3630 NTAPI
3631 NtUserValidateHandleSecure(
3632     HANDLE hHdl);
3633 
3634 BOOL
3635 NTAPI
3636 NtUserValidateRect(
3637     HWND hWnd,
3638     CONST RECT *lpRect);
3639 
3640 BOOL
3641 APIENTRY
3642 NtUserValidateTimerCallback(
3643     LPARAM lParam);
3644 
3645 DWORD
3646 NTAPI
3647 NtUserVkKeyScanEx(
3648     WCHAR wChar,
3649     HKL KeyboardLayout,
3650     BOOL bUsehHK);
3651 
3652 DWORD
3653 NTAPI
3654 NtUserWaitForInputIdle(
3655     IN HANDLE hProcess,
3656     IN DWORD dwMilliseconds,
3657     IN BOOL bSharedWow); /* Always FALSE */
3658 
3659 DWORD
3660 NTAPI
3661 NtUserWaitForMsgAndEvent(
3662     DWORD Unknown0);
3663 
3664 BOOL
3665 NTAPI
3666 NtUserWaitMessage(VOID);
3667 
3668 DWORD
3669 NTAPI
3670 NtUserWin32PoolAllocationStats(
3671     DWORD Unknown0,
3672     DWORD Unknown1,
3673     DWORD Unknown2,
3674     DWORD Unknown3,
3675     DWORD Unknown4,
3676     DWORD Unknown5);
3677 
3678 HWND
3679 NTAPI
3680 NtUserWindowFromPoint(
3681     LONG X,
3682     LONG Y);
3683 
3684 DWORD
3685 NTAPI
3686 NtUserYieldTask(VOID);
3687 
3688 /* NtUserBad
3689  * ReactOS-specific NtUser calls and their related structures, both which shouldn't exist.
3690  */
3691 
3692 #define NOPARAM_ROUTINE_ISCONSOLEMODE             0xffff0001
3693 #define ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING     0xfffe000d
3694 #define ONEPARAM_ROUTINE_GETDESKTOPMAPPING        0xfffe000e
3695 #define TWOPARAM_ROUTINE_SETMENUBARHEIGHT         0xfffd0050
3696 #define TWOPARAM_ROUTINE_SETGUITHRDHANDLE         0xfffd0051
3697 #define HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOWMOUSE 0xfffd0052
3698 
3699 #define MSQ_STATE_CAPTURE   0x1
3700 #define MSQ_STATE_ACTIVE    0x2
3701 #define MSQ_STATE_FOCUS     0x3
3702 #define MSQ_STATE_MENUOWNER 0x4
3703 #define MSQ_STATE_MOVESIZE  0x5
3704 #define MSQ_STATE_CARET     0x6
3705 
3706 #define TWOPARAM_ROUTINE_ROS_UPDATEUISTATE   0x1004
3707 #define HWNDPARAM_ROUTINE_ROS_NOTIFYWINEVENT 0x1005
3708 
3709 BOOL
3710 NTAPI
3711 NtUserGetMonitorInfo(
3712     IN HMONITOR hMonitor,
3713     OUT LPMONITORINFO pMonitorInfo);
3714 
3715 /* Should be done in usermode */
3716 
3717 HMONITOR
3718 NTAPI
3719 NtUserMonitorFromPoint(
3720     IN POINT point,
3721     IN DWORD dwFlags);
3722 
3723 HMONITOR
3724 NTAPI
3725 NtUserMonitorFromRect(
3726     IN LPCRECT pRect,
3727     IN DWORD dwFlags);
3728 
3729 HMONITOR
3730 NTAPI
3731 NtUserMonitorFromWindow(
3732     IN HWND hWnd,
3733     IN DWORD dwFlags);
3734 
3735 typedef struct _SETSCROLLBARINFO
3736 {
3737     int nTrackPos;
3738     int reserved;
3739     DWORD rgstate[CCHILDREN_SCROLLBAR + 1];
3740 } SETSCROLLBARINFO, *PSETSCROLLBARINFO;
3741 
3742 BOOL
3743 NTAPI
3744 NtUserSetScrollBarInfo(
3745     HWND hwnd,
3746     LONG idObject,
3747     SETSCROLLBARINFO *info);
3748 
3749 #endif /* __WIN32K_NTUSER_H */
3750 
3751 /* EOF */
3752