1 #pragma once
2 
3 #if defined(__GNUC__)
4 #define EXTINLINE extern inline __attribute__((always_inline)) __attribute__((gnu_inline))
5 #elif defined(_MSC_VER)
6 #define EXTINLINE extern __forceinline
7 #else
8 #error
9 #endif
10 
11 BOOL FASTCALL TestState(PWND, UINT);
12 
13 #if 0
14 EXTINLINE BOOL WINAPI
15 GetScrollBarInfo(HWND hWnd, LONG idObject, PSCROLLBARINFO psbi)
16 {
17     return NtUserGetScrollBarInfo(hWnd, idObject, psbi);
18 }
19 #endif
20 
21 EXTINLINE BOOL WINAPI
ShowScrollBar(HWND hWnd,INT wBar,BOOL bShow)22 ShowScrollBar(HWND hWnd, INT wBar, BOOL bShow)
23 {
24     return NtUserShowScrollBar(hWnd, wBar, bShow);
25 }
26 
27 EXTINLINE BOOL WINAPI
CloseDesktop(HDESK hDesktop)28 CloseDesktop(HDESK hDesktop)
29 {
30     return NtUserCloseDesktop(hDesktop);
31 }
32 
33 EXTINLINE HDESK WINAPI
OpenInputDesktop(DWORD dwFlags,BOOL fInherit,ACCESS_MASK dwDesiredAccess)34 OpenInputDesktop(DWORD dwFlags, BOOL fInherit, ACCESS_MASK dwDesiredAccess)
35 {
36     return NtUserOpenInputDesktop(dwFlags, fInherit, dwDesiredAccess);
37 }
38 
39 EXTINLINE BOOL WINAPI
PaintDesktop(HDC hdc)40 PaintDesktop(HDC hdc)
41 {
42     return NtUserPaintDesktop(hdc);
43 }
44 
45 EXTINLINE BOOL WINAPI
SetThreadDesktop(HDESK hDesktop)46 SetThreadDesktop(HDESK hDesktop)
47 {
48     return NtUserSetThreadDesktop(hDesktop);
49 }
50 
51 EXTINLINE BOOL WINAPI
SwitchDesktop(HDESK hDesktop)52 SwitchDesktop(HDESK hDesktop)
53 {
54     return NtUserSwitchDesktop(hDesktop);
55 }
56 
57 EXTINLINE BOOL WINAPI
SetShellWindowEx(HWND hwndShell,HWND hwndShellListView)58 SetShellWindowEx(HWND hwndShell, HWND hwndShellListView)
59 {
60     return NtUserSetShellWindowEx(hwndShell, hwndShellListView);
61 }
62 
63 EXTINLINE DWORD WINAPI
GetGuiResources(HANDLE hProcess,DWORD uiFlags)64 GetGuiResources(HANDLE hProcess, DWORD uiFlags)
65 {
66     return NtUserGetGuiResources(hProcess, uiFlags);
67 }
68 
69 EXTINLINE BOOL WINAPI
GetUserObjectInformationW(HANDLE hObj,int nIndex,PVOID pvInfo,DWORD nLength,LPDWORD lpnLengthNeeded)70 GetUserObjectInformationW(HANDLE hObj, int nIndex, PVOID pvInfo, DWORD nLength, LPDWORD lpnLengthNeeded)
71 {
72     return NtUserGetObjectInformation(hObj, nIndex, pvInfo, nLength, lpnLengthNeeded);
73 }
74 
75 EXTINLINE BOOL WINAPI
LockWindowUpdate(HWND hWndLock)76 LockWindowUpdate(HWND hWndLock)
77 {
78     return NtUserLockWindowUpdate(hWndLock);
79 }
80 
81 EXTINLINE BOOL WINAPI
LockWorkStation(VOID)82 LockWorkStation(VOID)
83 {
84     return NtUserLockWorkStation();
85 }
86 
87 EXTINLINE DWORD WINAPI
RegisterTasklist(DWORD x)88 RegisterTasklist(DWORD x)
89 {
90     return NtUserRegisterTasklist(x);
91 }
92 
93 EXTINLINE DWORD WINAPI
DragObject(HWND hwnd1,HWND hwnd2,UINT u1,ULONG_PTR dw1,HCURSOR hc1)94 DragObject(HWND hwnd1, HWND hwnd2, UINT u1, ULONG_PTR dw1, HCURSOR hc1)
95 {
96     return NtUserDragObject(hwnd1, hwnd2, u1, dw1, hc1);
97 }
98 
99 EXTINLINE BOOL WINAPI
KillTimer(HWND hWnd,UINT_PTR IDEvent)100 KillTimer(HWND hWnd, UINT_PTR IDEvent)
101 {
102     return NtUserKillTimer(hWnd, IDEvent);
103 }
104 
105 EXTINLINE UINT_PTR WINAPI
SetSystemTimer(HWND hWnd,UINT_PTR IDEvent,UINT Period,TIMERPROC TimerFunc)106 SetSystemTimer(HWND hWnd, UINT_PTR IDEvent, UINT Period, TIMERPROC TimerFunc)
107 {
108     return NtUserSetSystemTimer(hWnd, IDEvent, Period, TimerFunc);
109 }
110 
111 EXTINLINE UINT_PTR WINAPI
SetTimer(HWND hWnd,UINT_PTR IDEvent,UINT Period,TIMERPROC TimerFunc)112 SetTimer(HWND hWnd, UINT_PTR IDEvent, UINT Period, TIMERPROC TimerFunc)
113 {
114     return NtUserSetTimer(hWnd, IDEvent, Period, TimerFunc);
115 }
116 
117 EXTINLINE BOOL WINAPI
CloseWindowStation(HWINSTA hWinSta)118 CloseWindowStation(HWINSTA hWinSta)
119 {
120     return NtUserCloseWindowStation(hWinSta);
121 }
122 
123 EXTINLINE HWINSTA WINAPI
GetProcessWindowStation(VOID)124 GetProcessWindowStation(VOID)
125 {
126     return NtUserGetProcessWindowStation();
127 }
128 
129 EXTINLINE BOOL WINAPI
SetProcessWindowStation(HWINSTA hWinSta)130 SetProcessWindowStation(HWINSTA hWinSta)
131 {
132     return NtUserSetProcessWindowStation(hWinSta);
133 }
134 
135 EXTINLINE BOOL WINAPI
LockWindowStation(HWINSTA hWinSta)136 LockWindowStation(HWINSTA hWinSta)
137 {
138     return NtUserLockWindowStation(hWinSta);
139 }
140 
141 EXTINLINE BOOL WINAPI
UnlockWindowStation(HWINSTA hWinSta)142 UnlockWindowStation(HWINSTA hWinSta)
143 {
144     return NtUserUnlockWindowStation(hWinSta);
145 }
146 
147 EXTINLINE int WINAPI
CopyAcceleratorTableW(HACCEL hAccelSrc,LPACCEL lpAccelDst,int cAccelEntries)148 CopyAcceleratorTableW(HACCEL hAccelSrc, LPACCEL lpAccelDst, int cAccelEntries)
149 {
150     return NtUserCopyAcceleratorTable(hAccelSrc, lpAccelDst, cAccelEntries);
151 }
152 
153 EXTINLINE HACCEL WINAPI
CreateAcceleratorTableW(LPACCEL lpaccl,int cEntries)154 CreateAcceleratorTableW(LPACCEL lpaccl, int cEntries)
155 {
156     return NtUserCreateAcceleratorTable(lpaccl, cEntries);
157 }
158 
159 EXTINLINE BOOL WINAPI
CreateCaret(HWND hWnd,HBITMAP hBitmap,int nWidth,int nHeight)160 CreateCaret(HWND hWnd, HBITMAP hBitmap, int nWidth, int nHeight)
161 {
162     return NtUserCreateCaret(hWnd, hBitmap, nWidth, nHeight);
163 }
164 
165 EXTINLINE UINT WINAPI
GetCaretBlinkTime(VOID)166 GetCaretBlinkTime(VOID)
167 {
168     return NtUserGetCaretBlinkTime();
169 }
170 
171 EXTINLINE BOOL WINAPI
GetCaretPos(LPPOINT lpPoint)172 GetCaretPos(LPPOINT lpPoint)
173 {
174     return NtUserGetCaretPos(lpPoint);
175 }
176 
177 EXTINLINE BOOL WINAPI
CloseClipboard(VOID)178 CloseClipboard(VOID)
179 {
180     return NtUserCloseClipboard();
181 }
182 
183 EXTINLINE INT WINAPI
CountClipboardFormats(VOID)184 CountClipboardFormats(VOID)
185 {
186     return NtUserCountClipboardFormats();
187 }
188 
189 EXTINLINE BOOL WINAPI
EmptyClipboard(VOID)190 EmptyClipboard(VOID)
191 {
192     return NtUserEmptyClipboard();
193 }
194 
195 EXTINLINE HWND WINAPI
GetClipboardOwner(VOID)196 GetClipboardOwner(VOID)
197 {
198     return NtUserGetClipboardOwner();
199 }
200 
201 EXTINLINE DWORD WINAPI
GetClipboardSequenceNumber(VOID)202 GetClipboardSequenceNumber(VOID)
203 {
204     return NtUserGetClipboardSequenceNumber();
205 }
206 
207 EXTINLINE HWND WINAPI
GetClipboardViewer(VOID)208 GetClipboardViewer(VOID)
209 {
210     return NtUserGetClipboardViewer();
211 }
212 
213 EXTINLINE HWND WINAPI
GetOpenClipboardWindow(VOID)214 GetOpenClipboardWindow(VOID)
215 {
216     return NtUserGetOpenClipboardWindow();
217 }
218 
219 EXTINLINE INT WINAPI
GetPriorityClipboardFormat(UINT * paFormatPriorityList,INT cFormats)220 GetPriorityClipboardFormat(UINT *paFormatPriorityList, INT cFormats)
221 {
222     return NtUserGetPriorityClipboardFormat(paFormatPriorityList, cFormats);
223 }
224 
225 EXTINLINE BOOL WINAPI
IsClipboardFormatAvailable(UINT format)226 IsClipboardFormatAvailable(UINT format)
227 {
228     return NtUserIsClipboardFormatAvailable(format);
229 }
230 
231 EXTINLINE HWND WINAPI
SetClipboardViewer(HWND hWndNewViewer)232 SetClipboardViewer(HWND hWndNewViewer)
233 {
234     return NtUserSetClipboardViewer(hWndNewViewer);
235 }
236 
237 EXTINLINE BOOL WINAPI
ChangeClipboardChain(HWND hWndRemove,HWND hWndNewNext)238 ChangeClipboardChain(HWND hWndRemove, HWND hWndNewNext)
239 {
240     return NtUserChangeClipboardChain(hWndRemove, hWndNewNext);
241 }
242 
243 EXTINLINE BOOL WINAPI
GetClipCursor(LPRECT lpRect)244 GetClipCursor(LPRECT lpRect)
245 {
246     return NtUserGetClipCursor(lpRect);
247 }
248 
GetControlBrush(HWND hwnd,HDC hdc,UINT ctlType)249 EXTINLINE HBRUSH WINAPI GetControlBrush(HWND hwnd, HDC  hdc, UINT ctlType)
250 {
251     return NtUserGetControlBrush(hwnd, hdc, ctlType);
252 }
253 
GetControlColor(HWND hwndParent,HWND hwnd,HDC hdc,UINT CtlMsg)254 EXTINLINE HBRUSH WINAPI GetControlColor(HWND hwndParent, HWND hwnd, HDC hdc, UINT CtlMsg)
255 {
256     return NtUserGetControlColor(hwndParent, hwnd, hdc, CtlMsg);
257 }
258 
259 EXTINLINE BOOL WINAPI
GetCursorInfo(PCURSORINFO pci)260 GetCursorInfo(PCURSORINFO pci)
261 {
262     return NtUserGetCursorInfo(pci);
263 }
264 
265 EXTINLINE BOOL WINAPI
ClipCursor(CONST RECT * lpRect)266 ClipCursor(CONST RECT *lpRect)
267 {
268     return NtUserClipCursor((RECT *)lpRect);
269 }
270 
271 EXTINLINE HCURSOR WINAPI
SetCursor(HCURSOR hCursor)272 SetCursor(HCURSOR hCursor)
273 {
274     return NtUserSetCursor(hCursor);
275 }
276 
277 EXTINLINE HDC WINAPI
GetDC(HWND hWnd)278 GetDC(HWND hWnd)
279 {
280     return NtUserGetDC(hWnd);
281 }
282 
283 EXTINLINE HDC WINAPI
GetDCEx(HWND hWnd,HRGN hrgnClip,DWORD flags)284 GetDCEx(HWND hWnd, HRGN hrgnClip, DWORD flags)
285 {
286     return NtUserGetDCEx(hWnd, hrgnClip, flags);
287 }
288 
289 EXTINLINE HDC WINAPI
GetWindowDC(HWND hWnd)290 GetWindowDC(HWND hWnd)
291 {
292     return NtUserGetWindowDC(hWnd);
293 }
294 
295 EXTINLINE BOOL WINAPI
FlashWindowEx(PFLASHWINFO pfwi)296 FlashWindowEx(PFLASHWINFO pfwi)
297 {
298     return NtUserFlashWindowEx(pfwi);
299 }
300 
301 EXTINLINE BOOL WINAPI
DrawAnimatedRects(HWND hWnd,int idAni,CONST RECT * lprcFrom,CONST RECT * lprcTo)302 DrawAnimatedRects(HWND hWnd, int idAni, CONST RECT *lprcFrom, CONST RECT *lprcTo)
303 {
304     return NtUserDrawAnimatedRects(hWnd, idAni, (RECT*)lprcFrom, (RECT*)lprcTo);
305 }
306 
307 EXTINLINE BOOL WINAPI
BlockInput(BOOL fBlockIt)308 BlockInput(BOOL fBlockIt)
309 {
310     return NtUserBlockInput(fBlockIt);
311 }
312 
313 EXTINLINE UINT WINAPI
GetDoubleClickTime(VOID)314 GetDoubleClickTime(VOID)
315 {
316     return NtUserGetDoubleClickTime();
317 }
318 
319 EXTINLINE BOOL WINAPI
GetKeyboardState(PBYTE lpKeyState)320 GetKeyboardState(PBYTE lpKeyState)
321 {
322     return NtUserGetKeyboardState((LPBYTE)lpKeyState);
323 }
324 
325 EXTINLINE BOOL WINAPI
RegisterHotKey(HWND hWnd,int id,UINT fsModifiers,UINT vk)326 RegisterHotKey(HWND hWnd, int id, UINT fsModifiers, UINT vk)
327 {
328     return NtUserRegisterHotKey(hWnd, id, fsModifiers, vk);
329 }
330 
331 EXTINLINE HWND WINAPI
SetFocus(HWND hWnd)332 SetFocus(HWND hWnd)
333 {
334     return NtUserSetFocus(hWnd);
335 }
336 
337 EXTINLINE BOOL WINAPI
SetKeyboardState(LPBYTE lpKeyState)338 SetKeyboardState(LPBYTE lpKeyState)
339 {
340     return NtUserSetKeyboardState((LPBYTE)lpKeyState);
341 }
342 
343 EXTINLINE UINT WINAPI
SendInput(UINT nInputs,LPINPUT pInputs,int cbSize)344 SendInput(UINT nInputs, LPINPUT pInputs, int cbSize)
345 {
346     return NtUserSendInput(nInputs, pInputs, cbSize);
347 }
348 
349 EXTINLINE BOOL WINAPI
WaitMessage(VOID)350 WaitMessage(VOID)
351 {
352     return NtUserWaitMessage();
353 }
354 
355 EXTINLINE HDC WINAPI
BeginPaint(HWND hwnd,LPPAINTSTRUCT lpPaint)356 BeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint)
357 {
358     return NtUserBeginPaint(hwnd, lpPaint);
359 }
360 
361 EXTINLINE BOOL WINAPI
EndPaint(HWND hWnd,CONST PAINTSTRUCT * lpPaint)362 EndPaint(HWND hWnd, CONST PAINTSTRUCT *lpPaint)
363 {
364     return NtUserEndPaint(hWnd, lpPaint);
365 }
366 
367 EXTINLINE int WINAPI
ExcludeUpdateRgn(HDC hDC,HWND hWnd)368 ExcludeUpdateRgn(HDC hDC, HWND hWnd)
369 {
370     return NtUserExcludeUpdateRgn(hDC, hWnd);
371 }
372 
373 EXTINLINE BOOL WINAPI
InvalidateRgn(HWND hWnd,HRGN hRgn,BOOL bErase)374 InvalidateRgn(HWND hWnd, HRGN hRgn, BOOL bErase)
375 {
376     return NtUserInvalidateRgn(hWnd, hRgn, bErase);
377 }
378 
379 EXTINLINE BOOL WINAPI
RedrawWindow(HWND hWnd,CONST RECT * lprcUpdate,HRGN hrgnUpdate,UINT flags)380 RedrawWindow(HWND hWnd, CONST RECT *lprcUpdate, HRGN hrgnUpdate, UINT flags)
381 {
382     return NtUserRedrawWindow(hWnd, lprcUpdate, hrgnUpdate, flags);
383 }
384 
385 EXTINLINE BOOL WINAPI
DestroyWindow(HWND hWnd)386 DestroyWindow(HWND hWnd)
387 {
388     return NtUserDestroyWindow(hWnd);
389 }
390 
391 EXTINLINE HWND WINAPI
GetForegroundWindow(VOID)392 GetForegroundWindow(VOID)
393 {
394     return NtUserGetForegroundWindow();
395 }
396 
397 EXTINLINE BOOL WINAPI
GetGUIThreadInfo(DWORD idThread,LPGUITHREADINFO lpgui)398 GetGUIThreadInfo(DWORD idThread, LPGUITHREADINFO lpgui)
399 {
400     return NtUserGetGUIThreadInfo(idThread, lpgui);
401 }
402 
403 EXTINLINE BOOL WINAPI
GetTitleBarInfo(HWND hwnd,PTITLEBARINFO pti)404 GetTitleBarInfo(HWND hwnd, PTITLEBARINFO pti)
405 {
406     return NtUserGetTitleBarInfo(hwnd, pti);
407 }
408 
409 EXTINLINE BOOL WINAPI
GetWindowPlacement(HWND hWnd,WINDOWPLACEMENT * lpwndpl)410 GetWindowPlacement(HWND hWnd, WINDOWPLACEMENT *lpwndpl)
411 {
412     return NtUserGetWindowPlacement(hWnd, lpwndpl);
413 }
414 
415 EXTINLINE BOOL WINAPI
MoveWindow(HWND hWnd,int X,int Y,int nWidth,int nHeight,BOOL bRepaint)416 MoveWindow(HWND hWnd, int X, int Y, int nWidth, int nHeight, BOOL bRepaint)
417 {
418     return NtUserMoveWindow(hWnd, X, Y, nWidth, nHeight, bRepaint);
419 }
420 
421 EXTINLINE HWND WINAPI
SetParent(HWND hWndChild,HWND hWndNewParent)422 SetParent(HWND hWndChild, HWND hWndNewParent)
423 {
424     return NtUserSetParent(hWndChild, hWndNewParent);
425 }
426 
427 EXTINLINE BOOL WINAPI
SetWindowPlacement(HWND hWnd,CONST WINDOWPLACEMENT * lpwndpl)428 SetWindowPlacement(HWND hWnd, CONST WINDOWPLACEMENT *lpwndpl)
429 {
430     return NtUserSetWindowPlacement(hWnd, (WINDOWPLACEMENT *)lpwndpl);
431 }
432 
433 EXTINLINE BOOL WINAPI
SetWindowPos(HWND hWnd,HWND hWndAfter,int X,int Y,int cx,int cy,UINT uFlags)434 SetWindowPos(HWND hWnd, HWND hWndAfter, int X, int Y, int cx, int cy, UINT uFlags)
435 {
436     return NtUserSetWindowPos(hWnd,hWndAfter, X, Y, cx, cy, uFlags);
437 }
438 
439 EXTINLINE BOOL WINAPI
ShowWindow(HWND hWnd,int nCmdShow)440 ShowWindow(HWND hWnd, int nCmdShow)
441 {
442     return NtUserShowWindow(hWnd, nCmdShow);
443 }
444 
445 EXTINLINE BOOL WINAPI
ShowWindowAsync(HWND hWnd,int nCmdShow)446 ShowWindowAsync(HWND hWnd, int nCmdShow)
447 {
448     return NtUserShowWindowAsync(hWnd, nCmdShow);
449 }
450 
451 EXTINLINE HWND WINAPI
SetActiveWindow(HWND hWnd)452 SetActiveWindow(HWND hWnd)
453 {
454     return NtUserSetActiveWindow(hWnd);
455 }
456 
457 EXTINLINE DWORD WINAPI
GetListBoxInfo(HWND hwnd)458 GetListBoxInfo(HWND hwnd)
459 {
460     return NtUserGetListBoxInfo(hwnd); // Do it right! Have the message org from kmode!
461 }
462 
463 EXTINLINE BOOL WINAPI
DeleteMenu(HMENU hMenu,UINT uPosition,UINT uFlags)464 DeleteMenu(HMENU hMenu, UINT uPosition, UINT uFlags)
465 {
466     return NtUserDeleteMenu(hMenu, uPosition, uFlags);
467 }
468 
469 EXTINLINE BOOL WINAPI
DestroyMenu(HMENU hMenu)470 DestroyMenu(HMENU hMenu)
471 {
472     return NtUserDestroyMenu(hMenu);
473 }
474 
475 /*EXTINLINE BOOL WINAPI
476 GetMenuBarInfo(HWND hwnd, LONG idObject, LONG idItem, PMENUBARINFO pmbi)
477 {
478     return NtUserGetMenuBarInfo(hwnd, idObject, idItem, pmbi);
479 }
480 */
481 EXTINLINE BOOL WINAPI
GetMenuItemRect(HWND hWnd,HMENU hMenu,UINT uItem,LPRECT lprcItem)482 GetMenuItemRect(HWND hWnd, HMENU hMenu, UINT uItem, LPRECT lprcItem)
483 {
484     return NtUserGetMenuItemRect(hWnd, hMenu, uItem, lprcItem);
485 }
486 
487 EXTINLINE BOOL WINAPI
RemoveMenu(HMENU hMenu,UINT uPosition,UINT uFlags)488 RemoveMenu(HMENU hMenu, UINT uPosition, UINT uFlags)
489 {
490     return NtUserRemoveMenu(hMenu, uPosition, uFlags);
491 }
492 
493 EXTINLINE BOOL WINAPI
SetMenuDefaultItem(HMENU hMenu,UINT uItem,UINT fByPos)494 SetMenuDefaultItem(HMENU hMenu, UINT uItem, UINT fByPos)
495 {
496   return NtUserSetMenuDefaultItem(hMenu, uItem, fByPos);
497 }
498 
499 EXTINLINE BOOL WINAPI
SetMenuContextHelpId(HMENU hmenu,DWORD dwContextHelpId)500 SetMenuContextHelpId(HMENU hmenu, DWORD dwContextHelpId)
501 {
502     return NtUserSetMenuContextHelpId(hmenu, dwContextHelpId);
503 }
504 
505 EXTINLINE HWND WINAPI
SetCapture(HWND hWnd)506 SetCapture(HWND hWnd)
507 {
508     return NtUserSetCapture(hWnd);
509 }
510 
511 EXTINLINE BOOL WINAPI
InvalidateRect(HWND hWnd,CONST RECT * lpRect,BOOL bErase)512 InvalidateRect(HWND hWnd, CONST RECT* lpRect, BOOL bErase)
513 {
514     return NtUserInvalidateRect(hWnd, lpRect, bErase);
515 }
516 
ValidateRect(HWND hWnd,CONST RECT * lpRect)517 EXTINLINE BOOL WINAPI ValidateRect(HWND hWnd, CONST RECT *lpRect)
518 {
519     return NtUserValidateRect(hWnd, lpRect);
520 }
521 
ShowCaret(HWND hWnd)522 EXTINLINE BOOL WINAPI ShowCaret(HWND hWnd)
523 {
524     return NtUserShowCaret(hWnd);
525 }
526 
HideCaret(HWND hWnd)527 EXTINLINE BOOL WINAPI HideCaret(HWND hWnd)
528 {
529     return NtUserHideCaret(hWnd);
530 }
531 
532 
533 
534 
535 /*
536     Inline functions that make calling NtUserCall*** functions readable
537     These functions are prepended with NtUserx because they are not
538     real syscalls and they are inlined
539 */
540 
NtUserxDestroyCaret(VOID)541 EXTINLINE BOOL NtUserxDestroyCaret(VOID)
542 {
543     return (BOOL)NtUserCallNoParam(NOPARAM_ROUTINE_DESTROY_CARET);
544 }
545 
NtUserxMsqClearWakeMask(VOID)546 EXTINLINE VOID NtUserxMsqClearWakeMask(VOID)
547 {
548     NtUserCallNoParam(NOPARAM_ROUTINE_MSQCLEARWAKEMASK);
549 }
550 
NtUserxCreateMenu(VOID)551 EXTINLINE HMENU NtUserxCreateMenu(VOID)
552 {
553     return (HMENU)NtUserCallNoParam(NOPARAM_ROUTINE_CREATEMENU);
554 }
555 
NtUserxCreatePopupMenu(VOID)556 EXTINLINE HMENU NtUserxCreatePopupMenu(VOID)
557 {
558     return (HMENU)NtUserCallNoParam(NOPARAM_ROUTINE_CREATEMENUPOPUP);
559 }
560 
NtUserxGetMessagePos(VOID)561 EXTINLINE DWORD NtUserxGetMessagePos(VOID)
562 {
563     return (DWORD)NtUserCallNoParam(NOPARAM_ROUTINE_GETMSESSAGEPOS);
564 }
565 
NtUserxReleaseCapture(VOID)566 EXTINLINE BOOL NtUserxReleaseCapture(VOID)
567 {
568     return (BOOL)NtUserCallNoParam(NOPARAM_ROUTINE_RELEASECAPTURE);
569 }
570 
NtUserxInitMessagePump(VOID)571 EXTINLINE BOOL NtUserxInitMessagePump(VOID)
572 {
573     return (BOOL)NtUserCallNoParam(NOPARAM_ROUTINE_INIT_MESSAGE_PUMP);
574 }
575 
NtUserxUnInitMessagePump(VOID)576 EXTINLINE BOOL NtUserxUnInitMessagePump(VOID)
577 {
578     return NtUserCallNoParam(NOPARAM_ROUTINE_UNINIT_MESSAGE_PUMP);
579 }
580 
NtUserxMsqSetWakeMask(DWORD_PTR dwWaitMask)581 EXTINLINE HANDLE NtUserxMsqSetWakeMask(DWORD_PTR dwWaitMask)
582 {
583     return (HANDLE)NtUserCallOneParam(dwWaitMask, ONEPARAM_ROUTINE_GETINPUTEVENT);
584 }
585 
NtUserxSetCaretBlinkTime(UINT uMSeconds)586 EXTINLINE BOOL NtUserxSetCaretBlinkTime(UINT uMSeconds)
587 {
588     return (BOOL)NtUserCallOneParam(uMSeconds, ONEPARAM_ROUTINE_SETCARETBLINKTIME);
589 }
590 
NtUserxWindowFromDC(HDC hDC)591 EXTINLINE HWND NtUserxWindowFromDC(HDC hDC)
592 {
593     return (HWND)NtUserCallOneParam((DWORD_PTR)hDC, ONEPARAM_ROUTINE_WINDOWFROMDC);
594 }
595 
NtUserxSwapMouseButton(BOOL fSwap)596 EXTINLINE BOOL NtUserxSwapMouseButton(BOOL fSwap)
597 {
598     return (BOOL)NtUserCallOneParam((DWORD_PTR)fSwap, ONEPARAM_ROUTINE_SWAPMOUSEBUTTON);
599 }
600 
NtUserxSetMessageExtraInfo(LPARAM lParam)601 EXTINLINE LPARAM NtUserxSetMessageExtraInfo(LPARAM lParam)
602 {
603     return (LPARAM)NtUserCallOneParam((DWORD_PTR)lParam, ONEPARAM_ROUTINE_SETMESSAGEEXTRAINFO);
604 }
605 
NtUserxShowCursor(BOOL bShow)606 EXTINLINE INT NtUserxShowCursor(BOOL bShow)
607 {
608     return (INT)NtUserCallOneParam((DWORD_PTR)bShow, ONEPARAM_ROUTINE_SHOWCURSOR);
609 }
610 
NtUserxEnumClipboardFormats(UINT format)611 EXTINLINE UINT NtUserxEnumClipboardFormats(UINT format)
612 {
613     return (UINT)NtUserCallOneParam((DWORD_PTR)format, ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMATS);
614 }
615 
NtUserxCreateEmptyCurObject(DWORD_PTR Param)616 EXTINLINE HICON NtUserxCreateEmptyCurObject(DWORD_PTR Param)
617 {
618     return (HICON)NtUserCallOneParam(Param, ONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT);
619 }
620 
NtUserxMessageBeep(UINT uType)621 EXTINLINE BOOL NtUserxMessageBeep(UINT uType)
622 {
623     return (BOOL)NtUserCallOneParam(uType, ONEPARAM_ROUTINE_MESSAGEBEEP);
624 }
625 
NtUserxGetKeyboardLayout(DWORD idThread)626 EXTINLINE HKL NtUserxGetKeyboardLayout(DWORD idThread)
627 {
628     return (HKL)NtUserCallOneParam((DWORD_PTR)idThread,  ONEPARAM_ROUTINE_GETKEYBOARDLAYOUT);
629 }
630 
NtUserxGetKeyboardType(INT nTypeFlag)631 EXTINLINE INT NtUserxGetKeyboardType(INT nTypeFlag)
632 {
633     return (INT)NtUserCallOneParam((DWORD_PTR)nTypeFlag,  ONEPARAM_ROUTINE_GETKEYBOARDTYPE);
634 }
635 
NtUserxReleaseDC(HDC hDC)636 EXTINLINE INT NtUserxReleaseDC(HDC hDC)
637 {
638     return (INT)NtUserCallOneParam((DWORD_PTR)hDC, ONEPARAM_ROUTINE_RELEASEDC);
639 }
640 
NtUserxRealizePalette(HDC hDC)641 EXTINLINE UINT NtUserxRealizePalette(HDC hDC)
642 {
643     return (UINT)NtUserCallOneParam((DWORD_PTR)hDC, ONEPARAM_ROUTINE_REALIZEPALETTE);
644 }
645 
NtUserxCreateSystemThreads(BOOL bRemoteProcess)646 EXTINLINE VOID NtUserxCreateSystemThreads(BOOL bRemoteProcess)
647 {
648     NtUserCallOneParam(bRemoteProcess, ONEPARAM_ROUTINE_CREATESYSTEMTHREADS);
649 }
650 
NtUserxBeginDeferWindowPos(INT nNumWindows)651 EXTINLINE HDWP NtUserxBeginDeferWindowPos(INT nNumWindows)
652 {
653     return (HDWP)NtUserCallOneParam((DWORD_PTR)nNumWindows, ONEPARAM_ROUTINE_BEGINDEFERWNDPOS);
654 }
655 
NtUserxReplyMessage(LRESULT lResult)656 EXTINLINE BOOL NtUserxReplyMessage(LRESULT lResult)
657 {
658     return NtUserCallOneParam(lResult, ONEPARAM_ROUTINE_REPLYMESSAGE);
659 }
660 
NtUserxPostQuitMessage(int nExitCode)661 EXTINLINE VOID NtUserxPostQuitMessage(int nExitCode)
662 {
663     NtUserCallOneParam(nExitCode, ONEPARAM_ROUTINE_POSTQUITMESSAGE);
664 }
665 
NtUserxGetQueueStatus(UINT flags)666 EXTINLINE DWORD NtUserxGetQueueStatus(UINT flags)
667 {
668     return (DWORD)NtUserCallOneParam(flags, ONEPARAM_ROUTINE_GETQUEUESTATUS);
669 }
670 
NtUserxValidateRgn(HWND hWnd,HRGN hRgn)671 EXTINLINE BOOL NtUserxValidateRgn(HWND hWnd, HRGN hRgn)
672 {
673     return (BOOL)NtUserCallHwndParamLock(hWnd, (DWORD_PTR)hRgn, TWOPARAM_ROUTINE_VALIDATERGN);
674 }
675 
NtUserxSetCursorPos(INT x,INT y)676 EXTINLINE BOOL NtUserxSetCursorPos(INT x, INT y)
677 {
678     return (BOOL)NtUserCallTwoParam((DWORD)x, (DWORD)y, TWOPARAM_ROUTINE_SETCURSORPOS);
679 }
680 
NtUserxEnableWindow(HWND hWnd,BOOL bEnable)681 EXTINLINE BOOL NtUserxEnableWindow(HWND hWnd, BOOL bEnable)
682 {
683     return (BOOL)NtUserCallTwoParam((DWORD_PTR)hWnd, (DWORD_PTR)bEnable, TWOPARAM_ROUTINE_ENABLEWINDOW);
684 }
685 
NtUserxUpdateUiState(HWND hWnd,DWORD Param)686 EXTINLINE BOOL NtUserxUpdateUiState(HWND hWnd, DWORD Param)
687 {
688     return (BOOL)NtUserCallTwoParam((DWORD_PTR)hWnd, (DWORD_PTR)Param, TWOPARAM_ROUTINE_ROS_UPDATEUISTATE);
689 }
690 
NtUserxSwitchToThisWindow(HWND hWnd,BOOL fAltTab)691 EXTINLINE VOID NtUserxSwitchToThisWindow(HWND hWnd, BOOL fAltTab)
692 {
693     NtUserCallTwoParam((DWORD_PTR)hWnd, (DWORD_PTR)fAltTab, TWOPARAM_ROUTINE_SWITCHTOTHISWINDOW);
694 }
695 
NtUserxShowOwnedPopups(HWND hWnd,BOOL fShow)696 EXTINLINE BOOL NtUserxShowOwnedPopups(HWND hWnd, BOOL fShow)
697 {
698     return (BOOL)NtUserCallTwoParam((DWORD_PTR)hWnd, fShow, TWOPARAM_ROUTINE_SHOWOWNEDPOPUPS);
699 }
700 
NtUserxUnhookWindowsHook(int nCode,HOOKPROC pfnFilterProc)701 EXTINLINE BOOL NtUserxUnhookWindowsHook(int nCode, HOOKPROC pfnFilterProc)
702 {
703     return (BOOL)NtUserCallTwoParam(nCode, (DWORD_PTR)pfnFilterProc, TWOPARAM_ROUTINE_UNHOOKWINDOWSHOOK);
704 }
705 
NtUserxSetWindowContextHelpId(HWND hWnd,DWORD_PTR dwContextHelpId)706 EXTINLINE BOOL NtUserxSetWindowContextHelpId(HWND hWnd, DWORD_PTR dwContextHelpId)
707 {
708     return (BOOL)NtUserCallHwndParam(hWnd, dwContextHelpId, HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID);
709 }
710 
NtUserxKillSystemTimer(HWND hWnd,UINT_PTR IDEvent)711 EXTINLINE BOOL NtUserxKillSystemTimer(HWND hWnd, UINT_PTR IDEvent)
712 {
713     return (BOOL)NtUserCallHwndParam(hWnd, IDEvent, HWNDPARAM_ROUTINE_KILLSYSTEMTIMER);
714 }
715 
NtUserxSetDialogPointer(HWND hWnd,PVOID dlgInfo)716 EXTINLINE VOID NtUserxSetDialogPointer(HWND hWnd, PVOID dlgInfo)
717 {
718     NtUserCallHwndParam(hWnd, (DWORD_PTR)dlgInfo, HWNDPARAM_ROUTINE_SETDIALOGPOINTER);
719 }
720 
NtUserxNotifyWinEvent(HWND hWnd,PVOID ne)721 EXTINLINE VOID NtUserxNotifyWinEvent(HWND hWnd, PVOID ne)
722 {
723     NtUserCallHwndParam(hWnd, (DWORD_PTR)ne, HWNDPARAM_ROUTINE_ROS_NOTIFYWINEVENT);
724 }
725 
NtUserxGetWindowContextHelpId(HWND hwnd)726 EXTINLINE DWORD NtUserxGetWindowContextHelpId(HWND hwnd)
727 {
728     return NtUserCallHwnd(hwnd, HWND_ROUTINE_GETWNDCONTEXTHLPID);
729 }
730 
NtUserxDeregisterShellHookWindow(HWND hWnd)731 EXTINLINE BOOL NtUserxDeregisterShellHookWindow(HWND hWnd)
732 {
733     return NtUserCallHwnd(hWnd, HWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW);
734 }
735 
NtUserxRegisterShellHookWindow(HWND hWnd)736 EXTINLINE BOOL NtUserxRegisterShellHookWindow(HWND hWnd)
737 {
738     return NtUserCallHwnd(hWnd, HWND_ROUTINE_REGISTERSHELLHOOKWINDOW);
739 }
740 
NtUserxSetMessageBox(HWND hWnd)741 EXTINLINE BOOL NtUserxSetMessageBox(HWND hWnd)
742 {
743     return NtUserCallHwnd(hWnd, HWND_ROUTINE_SETMSGBOX);
744 }
745 
NtUserxClearWindowState(PWND pWnd,UINT Flag)746 EXTINLINE VOID NtUserxClearWindowState(PWND pWnd, UINT Flag)
747 {
748     if (!TestState(pWnd, Flag)) return;
749     NtUserCallHwndParam(UserHMGetHandle(pWnd), (DWORD_PTR)Flag, HWNDPARAM_ROUTINE_CLEARWINDOWSTATE);
750 }
751 
NtUserxSetWindowState(PWND pWnd,UINT Flag)752 EXTINLINE VOID NtUserxSetWindowState(PWND pWnd, UINT Flag)
753 {
754     if (TestState(pWnd, Flag)) return;
755     NtUserCallHwndParam(UserHMGetHandle(pWnd), (DWORD_PTR)Flag, HWNDPARAM_ROUTINE_SETWINDOWSTATE);
756 }
757 
NtUserxSetTaskmanWindow(HWND hWnd)758 EXTINLINE HWND NtUserxSetTaskmanWindow(HWND hWnd)
759 {
760     return NtUserCallHwndOpt(hWnd, HWNDOPT_ROUTINE_SETTASKMANWINDOW);
761 }
762 
NtUserxSetProgmanWindow(HWND hWnd)763 EXTINLINE HWND NtUserxSetProgmanWindow(HWND hWnd)
764 {
765     return NtUserCallHwndOpt(hWnd, HWNDOPT_ROUTINE_SETPROGMANWINDOW);
766 }
767 
NtUserxArrangeIconicWindows(HWND hWnd)768 EXTINLINE UINT NtUserxArrangeIconicWindows(HWND hWnd)
769 {
770     return (UINT)NtUserCallHwndLock(hWnd, HWNDLOCK_ROUTINE_ARRANGEICONICWINDOWS);
771 }
772 
NtUserxUpdateWindow(HWND hWnd)773 EXTINLINE BOOL NtUserxUpdateWindow(HWND hWnd)
774 {
775     return NtUserCallHwndLock(hWnd, HWNDLOCK_ROUTINE_UPDATEWINDOW);
776 }
777 
NtUserxDrawMenuBar(HWND hWnd)778 EXTINLINE BOOL NtUserxDrawMenuBar(HWND hWnd)
779 {
780     return (BOOL)NtUserCallHwndLock(hWnd, HWNDLOCK_ROUTINE_DRAWMENUBAR);
781 }
782 
NtUserxMDIRedrawFrame(HWND hWnd)783 EXTINLINE BOOL NtUserxMDIRedrawFrame(HWND hWnd)
784 {
785   return (BOOL)NtUserCallHwndLock(hWnd, HWNDLOCK_ROUTINE_REDRAWFRAME);
786 }
787 
NtUserxSetForegroundWindow(HWND hWnd)788 EXTINLINE BOOL NtUserxSetForegroundWindow(HWND hWnd)
789 {
790     return NtUserCallHwndLock(hWnd, HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOW);
791 }
792 
793 
794 /* ReactOS-specific definitions */
795 
NtUserxGetMessageExtraInfo(VOID)796 EXTINLINE LPARAM NtUserxGetMessageExtraInfo(VOID)
797 {
798     return (LPARAM)NtUserGetThreadState(THREADSTATE_GETMESSAGEEXTRAINFO);
799 }
800 
NtUserxEnableProcessWindowGhosting(BOOL bEnable)801 EXTINLINE VOID NtUserxEnableProcessWindowGhosting(BOOL bEnable)
802 {
803     NtUserCallOneParam((DWORD_PTR)bEnable, ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING);
804 }
805 
NtUserxGetDesktopMapping(PVOID ptr)806 EXTINLINE PVOID NtUserxGetDesktopMapping(PVOID ptr)
807 {
808     return (PVOID)NtUserCallOneParam((DWORD_PTR)ptr, ONEPARAM_ROUTINE_GETDESKTOPMAPPING);
809 }
810 
NtUserxGetCursorPos(POINT * lpPoint)811 EXTINLINE BOOL NtUserxGetCursorPos(POINT* lpPoint)
812 {
813     return (BOOL)NtUserCallOneParam((DWORD_PTR)lpPoint, ONEPARAM_ROUTINE_GETCURSORPOS);
814 }
815 
NtUserxSetMenuBarHeight(HMENU menu,INT height)816 EXTINLINE BOOL NtUserxSetMenuBarHeight(HMENU menu, INT height)
817 {
818     return (BOOL)NtUserCallTwoParam((DWORD_PTR)menu, (DWORD_PTR)height, TWOPARAM_ROUTINE_SETMENUBARHEIGHT);
819 }
820 
NtUserxSetGUIThreadHandle(DWORD_PTR field,HWND hwnd)821 EXTINLINE BOOL NtUserxSetGUIThreadHandle(DWORD_PTR field, HWND hwnd)
822 {
823     return (BOOL)NtUserCallTwoParam((DWORD_PTR)field, (DWORD_PTR)hwnd, TWOPARAM_ROUTINE_SETGUITHRDHANDLE);
824 }
825 
NtUserxSetCaretPos(INT x,INT y)826 EXTINLINE BOOL NtUserxSetCaretPos(INT x, INT y)
827 {
828     return (BOOL)NtUserCallTwoParam((DWORD_PTR)x, (DWORD_PTR)y, TWOPARAM_ROUTINE_SETCARETPOS);
829 }
830 
NtUserxRegisterLogonProcess(DWORD dwProcessId,BOOL bRegister)831 EXTINLINE BOOL NtUserxRegisterLogonProcess(DWORD dwProcessId, BOOL bRegister)
832 {
833     return (BOOL)NtUserCallTwoParam((DWORD_PTR)dwProcessId, (DWORD_PTR)bRegister, TWOPARAM_ROUTINE_REGISTERLOGONPROCESS);
834 }
835 
NtUserxAllowSetForegroundWindow(DWORD dwProcessId)836 EXTINLINE BOOL NtUserxAllowSetForegroundWindow(DWORD dwProcessId)
837 {
838     return (BOOL)NtUserCallOneParam((DWORD_PTR)dwProcessId, ONEPARAM_ROUTINE_ALLOWSETFOREGND);
839 }
840 
NtUserxLockSetForegroundWindow(UINT uLockCode)841 EXTINLINE BOOL NtUserxLockSetForegroundWindow(UINT uLockCode)
842 {
843     return (BOOL)NtUserCallOneParam((DWORD_PTR)uLockCode, ONEPARAM_ROUTINE_LOCKFOREGNDWINDOW);
844 }
845