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