Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

ntuser.h File Reference

#include "w32wow64.h"
#include "usercall.h"

Go to the source code of this file.

Defines

#define W32KAPI   DECLSPEC_ADDRSAFE
#define DBGHYD(m)
#define NtUserSetClassLongPtr   NtUserSetClassLong
#define NtUserSetWindowLongPtr   NtUserSetWindowLong

Functions

W32KAPI UINT NtUserHardErrorControl (IN HARDERRORCONTROL dwCmd, IN HANDLE handle OPTIONAL, OUT PDESKRESTOREDATA pdrdRestore OPTIONAL)
VOID NtUserSetDebugErrorLevel (IN DWORD dwErrorLevel)
W32KAPI BOOL NtUserGetObjectInformation (IN HANDLE hObject, IN int nIndex, OUT PVOID pvInfo, IN DWORD nLength, OUT LPDWORD pnLengthNeeded)
W32KAPI BOOL NtUserSetObjectInformation (IN HANDLE hObject, IN int nIndex, IN LPCVOID pvInfo, IN DWORD nLength)
W32KAPI BOOL NtUserWin32PoolAllocationStats (IN LPDWORD parrTags, IN SIZE_T tagsCount, OUT SIZE_T *lpdwMaxMem, OUT SIZE_T *lpdwCrtMem, OUT LPDWORD lpdwMaxAlloc, OUT LPDWORD lpdwCrtAlloc)
W32KAPI NTSTATUS NtUserConsoleControl (IN CONSOLECONTROL ConsoleCommand, IN PVOID ConsoleInformation, IN DWORD ConsoleInformationLength)
W32KAPI HWINSTA NtUserCreateWindowStation (IN POBJECT_ATTRIBUTES pObja, IN ACCESS_MASK amRequest, IN HANDLE hKbdLayoutFile, IN DWORD offTable, IN PUNICODE_STRING pstrKLID, IN UINT uKbdInputLocale)
W32KAPI HWINSTA NtUserOpenWindowStation (IN POBJECT_ATTRIBUTES pObja, IN ACCESS_MASK amRequest)
W32KAPI BOOL NtUserCloseWindowStation (IN HWINSTA hwinsta)
W32KAPI BOOL NtUserSetProcessWindowStation (IN HWINSTA hwinsta)
W32KAPI HWINSTA NtUserGetProcessWindowStation (VOID)
W32KAPI BOOL NtUserLockWorkStation (VOID)
W32KAPI HDESK NtUserCreateDesktop (IN POBJECT_ATTRIBUTES pObja, IN PUNICODE_STRING pstrDevice, IN LPDEVMODEW pDevmode, IN DWORD dwFlags, IN ACCESS_MASK amRequest)
W32KAPI HDESK NtUserOpenDesktop (IN POBJECT_ATTRIBUTES pObja, IN DWORD dwFlags, IN ACCESS_MASK amRequest)
W32KAPI HDESK NtUserOpenInputDesktop (IN DWORD dwFlags, IN BOOL fInherit, IN DWORD amRequest)
W32KAPI NTSTATUS NtUserResolveDesktopForWOW (IN OUT PUNICODE_STRING pstrDesktop)
W32KAPI HDESK NtUserResolveDesktop (IN HANDLE hProcess, IN PUNICODE_STRING pstrDesktop, IN BOOL fInherit, OUT HWINSTA *phwinsta)
W32KAPI BOOL NtUserCloseDesktop (IN HDESK hdesk)
W32KAPI BOOL NtUserSetThreadDesktop (IN HDESK hdesk)
W32KAPI HDESK NtUserGetThreadDesktop (IN DWORD dwThreadId, IN HDESK hdeskConsole)
W32KAPI BOOL NtUserSwitchDesktop (IN HDESK hdesk)
W32KAPI NTSTATUS NtUserInitializeClientPfnArrays (IN CONST PFNCLIENT *ppfnClientA OPTIONAL, IN CONST PFNCLIENT *ppfnClientW OPTIONAL, IN CONST PFNCLIENTWORKER *ppfnClientWorker OPTIONAL, IN HANDLE hModUser)
W32KAPI BOOL NtUserWaitForMsgAndEvent (IN HANDLE hevent)
W32KAPI DWORD NtUserDragObject (IN HWND hwndParent, IN HWND hwndFrom, IN UINT wFmt, IN ULONG_PTR dwData, IN HCURSOR hcur)
W32KAPI BOOL NtUserGetIconInfo (IN HICON hicon, OUT PICONINFO piconinfo, IN OUT OPTIONAL PUNICODE_STRING pstrInstanceName, IN OUT OPTIONAL PUNICODE_STRING pstrResName, OUT OPTIONAL LPDWORD pbpp, IN BOOL fInternal)
W32KAPI BOOL NtUserGetIconSize (IN HICON hIcon, IN UINT istepIfAniCur, OUT int *pcx, OUT int *pcy)
W32KAPI BOOL NtUserDrawIconEx (IN HDC hdc, IN int x, IN int y, IN HICON hicon, IN int cx, IN int cy, IN UINT istepIfAniCur, IN HBRUSH hbrush, IN UINT diFlags, IN BOOL fMeta, OUT DRAWICONEXDATA *pdid)
W32KAPI HANDLE NtUserDeferWindowPos (IN HDWP hWinPosInfo, IN HWND hwnd, IN HWND hwndInsertAfter, IN int x, IN int y, IN int cx, IN int cy, IN UINT wFlags)
W32KAPI BOOL NtUserEndDeferWindowPosEx (IN HDWP hWinPosInfo, IN BOOL fAsync)
W32KAPI BOOL NtUserGetMessage (OUT LPMSG pmsg, IN HWND hwnd, IN UINT wMsgFilterMin, IN UINT wMsgFilterMax)
W32KAPI BOOL NtUserMoveWindow (IN HWND hwnd, IN int x, IN int y, IN int cx, IN int cy, IN BOOL fRepaint)
W32KAPI int NtUserTranslateAccelerator (IN HWND hwnd, IN HACCEL hAccTable, IN LPMSG lpMsg)
W32KAPI LONG NtUserSetClassLong (IN HWND hwnd, IN int nIndex, IN LONG dwNewLong, IN BOOL bAnsi)
W32KAPI BOOL NtUserSetKeyboardState (IN CONST BYTE *lpKeyState)
W32KAPI BOOL NtUserSetWindowPos (IN HWND hwnd, IN HWND hwndInsertAfter, IN int x, IN int y, IN int cx, IN int cy, IN UINT dwFlags)
W32KAPI BOOL NtUserSetShellWindowEx (IN HWND hwnd, IN HWND hwndBkGnd)
W32KAPI BOOL NtUserSystemParametersInfo (IN UINT wFlag, IN DWORD wParam, IN OUT LPVOID lpData, IN UINT flags)
W32KAPI BOOL NtUserUpdatePerUserSystemParameters (IN HANDLE hToken, IN BOOL bUserLoggedOn)
W32KAPI DWORD NtUserDdeInitialize (OUT PHANDLE phInst, OUT HWND *phwnd, OUT LPDWORD pMonFlags, IN DWORD afCmd, IN PVOID pcii)
W32KAPI DWORD NtUserUpdateInstance (IN HANDLE hInst, OUT LPDWORD pMonFlags, IN DWORD afCmd)
W32KAPI DWORD NtUserEvent (IN PEVENT_PACKET pep)
W32KAPI BOOL NtUserFillWindow (IN HWND hwndBrush, IN HWND hwndPaint, IN HDC hdc, IN HBRUSH hbr)
W32KAPI PCLS NtUserGetWOWClass (IN HINSTANCE hInstance, IN PUNICODE_STRING pString)
W32KAPI UINT NtUserGetInternalWindowPos (IN HWND hwnd, OUT LPRECT lpRect OPTIONAL, OUT LPPOINT lpPoint OPTIONAL)
W32KAPI NTSTATUS NtUserInitTask (IN UINT dwExpWinVer, IN DWORD dwAppCompatFlags, IN PUNICODE_STRING pstrModName, IN PUNICODE_STRING pstrBaseFileName, IN DWORD hTaskWow, IN DWORD dwHotkey, IN DWORD idTask, IN DWORD dwX, IN DWORD dwY, IN DWORD dwXSize, IN DWORD dwYSize)
W32KAPI BOOL NtUserPostThreadMessage (IN DWORD id, IN UINT msg, IN WPARAM wParam, IN LPARAM lParam)
W32KAPI BOOL NtUserRegisterTasklist (IN HWND hwndTasklist)
W32KAPI BOOL NtUserSetClipboardData (IN UINT wFmt, IN HANDLE hMem, IN PSETCLIPBDATA scd)
W32KAPI BOOL NtUserCloseClipboard (VOID)
W32KAPI BOOL NtUserEmptyClipboard (VOID)
W32KAPI HANDLE NtUserConvertMemHandle (IN LPBYTE lpData, IN UINT cbNULL)
W32KAPI NTSTATUS NtUserCreateLocalMemHandle (IN HANDLE hMem, OUT LPBYTE lpData OPTIONAL, IN UINT cbData, OUT PUINT lpcbNeeded OPTIONAL)
W32KAPI HHOOK NtUserSetWindowsHookEx (IN HANDLE hmod, IN PUNICODE_STRING pstrLib OPTIONAL, IN DWORD idThread, IN int nFilterType, IN PROC pfnFilterProc, IN DWORD dwFlags)
W32KAPI BOOL NtUserSetInternalWindowPos (IN HWND hwnd, IN UINT cmdShow, IN CONST RECT *lpRect, IN CONST POINT *lpPoint)
W32KAPI BOOL NtUserChangeClipboardChain (IN HWND hwndRemove, IN HWND hwndNewNext)
W32KAPI DWORD NtUserCheckMenuItem (IN HMENU hmenu, IN UINT wIDCheckItem, IN UINT wCheck)
W32KAPI HWND NtUserChildWindowFromPointEx (IN HWND hwndParent, IN POINT point, IN UINT flags)
W32KAPI BOOL NtUserClipCursor (IN CONST RECT *lpRect OPTIONAL)
W32KAPI HACCEL NtUserCreateAcceleratorTable (IN LPACCEL lpAccel, IN INT cAccel)
W32KAPI BOOL NtUserDeleteMenu (IN HMENU hmenu, IN UINT nPosition, IN UINT dwFlags)
W32KAPI BOOL NtUserDestroyAcceleratorTable (IN HACCEL hAccel)
W32KAPI BOOL NtUserDestroyCursor (IN HCURSOR hcurs, IN DWORD cmd)
W32KAPI HANDLE NtUserGetClipboardData (IN UINT fmt, OUT PGETCLIPBDATA pgcd)
W32KAPI BOOL NtUserDestroyMenu (IN HMENU hmenu)
W32KAPI BOOL NtUserDestroyWindow (IN HWND hwnd)
W32KAPI LRESULT NtUserDispatchMessage (IN CONST MSG *pmsg)
W32KAPI BOOL NtUserEnableMenuItem (IN HMENU hMenu, IN UINT wIDEnableItem, IN UINT wEnable)
W32KAPI BOOL NtUserAttachThreadInput (IN DWORD idAttach, IN DWORD idAttachTo, IN BOOL fAttach)
W32KAPI BOOL NtUserGetWindowPlacement (IN HWND hwnd, OUT PWINDOWPLACEMENT pwp)
W32KAPI BOOL NtUserSetWindowPlacement (IN HWND hwnd, IN CONST WINDOWPLACEMENT *lpwndpl)
W32KAPI BOOL NtUserLockWindowUpdate (IN HWND hwnd)
W32KAPI BOOL NtUserGetClipCursor (OUT LPRECT lpRect)
W32KAPI BOOL NtUserEnableScrollBar (IN HWND hwnd, IN UINT wSBflags, IN UINT wArrows)
W32KAPI BOOL NtUserDdeSetQualityOfService (IN HWND hwndClient, IN CONST SECURITY_QUALITY_OF_SERVICE *pqosNew, OUT PSECURITY_QUALITY_OF_SERVICE pqosPrev OPTIONAL)
W32KAPI BOOL NtUserDdeGetQualityOfService (IN HWND hwndClient, IN HWND hwndServer, OUT PSECURITY_QUALITY_OF_SERVICE pqos)
W32KAPI DWORD NtUserGetMenuIndex (IN HMENU hMenu, IN HMENU hSubMenu)
W32KAPI VOID NtUserSetRipFlags (DWORD dwRipFlags, DWORD PID)
W32KAPI VOID NtUserSetDbgTag (int tag, DWORD dwBitFlags)
W32KAPI BOOL NtUserThunkedMenuItemInfo (IN HMENU hMenu, IN UINT nPosition, IN BOOL fByPosition, IN BOOL fInsert, IN LPMENUITEMINFOW lpmii, IN PUNICODE_STRING pstrItem OPTIONAL)
W32KAPI BOOL NtUserThunkedMenuInfo (IN HMENU hMenu, IN LPCMENUINFO lpmi)
W32KAPI BOOL NtUserSetMenuDefaultItem (IN HMENU hMenu, IN UINT wID, IN UINT fByPosition)
W32KAPI BOOL NtUserDrawAnimatedRects (IN HWND hwnd, IN int idAni, IN CONST RECT *lprcFrom, IN CONST RECT *lprcTo)
HANDLE NtUserLoadIcoCur (HANDLE hIcon, DWORD cxNew, DWORD cyNew, DWORD LR_flags)
W32KAPI BOOL NtUserDrawCaption (IN HWND hwnd, IN HDC hdc, IN CONST RECT *lprc, IN UINT flags)
W32KAPI BOOL NtUserFlashWindowEx (IN PFLASHWINFO pfwi)
W32KAPI BOOL NtUserPaintDesktop (IN HDC hdc)
W32KAPI SHORT NtUserGetAsyncKeyState (IN int vKey)
W32KAPI HBRUSH NtUserGetControlBrush (IN HWND hwnd, IN HDC hdc, IN UINT msg)
W32KAPI HBRUSH NtUserGetControlColor (IN HWND hwndParent, IN HWND hwndCtl, IN HDC hdc, IN UINT msg)
W32KAPI BOOL NtUserEndMenu (VOID)
W32KAPI int NtUserCountClipboardFormats (VOID)
W32KAPI DWORD NtUserGetClipboardSequenceNumber (VOID)
W32KAPI UINT NtUserGetCaretBlinkTime (VOID)
W32KAPI HWND NtUserGetClipboardOwner (VOID)
DWORD NtUserGetClipboardSerialNumber (VOID)
W32KAPI HWND NtUserGetClipboardViewer (VOID)
W32KAPI UINT NtUserGetDoubleClickTime (VOID)
W32KAPI HWND NtUserGetForegroundWindow (VOID)
W32KAPI HWND NtUserGetOpenClipboardWindow (VOID)
W32KAPI int NtUserGetPriorityClipboardFormat (OUT UINT *paFormatPriorityList, IN int cFormats)
W32KAPI HMENU NtUserGetSystemMenu (IN HWND hwnd, IN BOOL bRevert)
W32KAPI BOOL NtUserGetUpdateRect (IN HWND hwnd, IN LPRECT prect OPTIONAL, IN BOOL bErase)
W32KAPI BOOL NtUserHideCaret (IN HWND hwnd)
W32KAPI BOOL NtUserHiliteMenuItem (IN HWND hwnd, IN HMENU hMenu, IN UINT uIDHiliteItem, IN UINT uHilite)
W32KAPI BOOL NtUserInvalidateRect (IN HWND hwnd, IN CONST RECT *prect OPTIONAL, IN BOOL bErase)
W32KAPI BOOL NtUserIsClipboardFormatAvailable (IN UINT nFormat)
W32KAPI BOOL NtUserKillTimer (IN HWND hwnd, IN UINT_PTR nIDEvent)
W32KAPI HWND NtUserMinMaximize (IN HWND hwnd, IN UINT nCmdShow, IN BOOL fKeepHidden)
W32KAPI BOOL NtUserMNDragOver (IN POINT *ppt, OUT PMNDRAGOVERINFO pmndoi)
W32KAPI BOOL NtUserMNDragLeave (VOID)
W32KAPI BOOL NtUserOpenClipboard (IN HWND hwnd, OUT PBOOL pfEmptyClient)
W32KAPI BOOL NtUserPeekMessage (OUT LPMSG pmsg, IN HWND hwnd, IN UINT wMsgFilterMin, IN UINT wMsgFilterMax, IN UINT wRemoveMsg)
W32KAPI BOOL NtUserPostMessage (IN HWND hwnd, IN UINT msg, IN WPARAM wParam, IN LPARAM lParam)
W32KAPI BOOL NtUserSendNotifyMessage (IN HWND hwnd, IN UINT Msg, IN WPARAM wParam, IN LPARAM lParam OPTIONAL)
W32KAPI BOOL NtUserSendMessageCallback (IN HWND hwnd, IN UINT wMsg, IN WPARAM wParam, IN LPARAM lParam, IN SENDASYNCPROC lpResultCallBack, IN ULONG_PTR dwData)
W32KAPI BOOL NtUserRegisterHotKey (IN HWND hwnd, IN int id, IN UINT fsModifiers, IN UINT vk)
W32KAPI BOOL NtUserRemoveMenu (IN HMENU hmenu, IN UINT nPosition, IN UINT dwFlags)
W32KAPI BOOL NtUserScrollWindowEx (IN HWND hwnd, IN int XAmount, IN int YAmount, IN CONST RECT *pRect OPTIONAL, IN CONST RECT *pClipRect OPTIONAL, IN HRGN hrgnUpdate, OUT LPRECT prcUpdate OPTIONAL, IN UINT flags)
W32KAPI HWND NtUserSetActiveWindow (IN HWND hwnd)
W32KAPI HWND NtUserSetCapture (IN HWND hwnd)
W32KAPI WORD NtUserSetClassWord (IN HWND hwnd, IN int nIndex, IN WORD wNewWord)
W32KAPI HWND NtUserSetClipboardViewer (IN HWND hwndNewViewer)
W32KAPI HCURSOR NtUserSetCursor (IN HCURSOR hCursor)
W32KAPI HWND NtUserSetFocus (IN HWND hwnd)
W32KAPI BOOL NtUserSetMenu (IN HWND hwnd, IN HMENU hmenu, IN BOOL fRedraw)
W32KAPI BOOL NtUserSetMenuContextHelpId (IN HMENU hMenu, IN DWORD dwContextHelpId)
W32KAPI BOOL NtUserSetMenuFlagRtoL (IN HMENU hMenu)
W32KAPI HWND NtUserSetParent (IN HWND hwndChild, IN HWND hwndNewParent)
W32KAPI int NtUserSetScrollInfo (IN HWND hwnd, IN int nBar, IN LPCSCROLLINFO pInfo, IN BOOL fRedraw)
W32KAPI BOOL NtUserSetSysColors (IN int cElements, IN CONST INT *lpaElements, IN CONST COLORREF *lpaRgbValues, IN UINT uOptions)
W32KAPI UINT_PTR NtUserSetTimer (IN HWND hwnd, IN UINT_PTR nIDEvent, IN UINT wElapse, IN TIMERPROC pTimerFunc)
W32KAPI LONG NtUserSetWindowLong (IN HWND hwnd, IN int nIndex, IN LONG dwNewLong, IN BOOL bAnsi)
W32KAPI WORD NtUserSetWindowWord (IN HWND hwnd, IN int nIndex, IN WORD wNewWord)
W32KAPI HHOOK NtUserSetWindowsHookAW (IN int nFilterType, IN HOOKPROC pfnFilterProc, IN DWORD dwFlags)
W32KAPI BOOL NtUserShowCaret (IN HWND hwnd)
W32KAPI BOOL NtUserShowScrollBar (IN HWND hwnd, IN int iBar, IN BOOL fShow)
W32KAPI BOOL NtUserShowWindowAsync (IN HWND hwnd, IN int nCmdShow)
W32KAPI BOOL NtUserShowWindow (IN HWND hwnd, IN int nCmdShow)
W32KAPI BOOL NtUserTrackMouseEvent (IN OUT LPTRACKMOUSEEVENT lpTME)
W32KAPI BOOL NtUserTrackPopupMenuEx (IN HMENU hMenu, IN UINT uFlags, IN int x, IN int y, IN HWND hwnd, IN CONST TPMPARAMS *pparamst OPTIONAL)
W32KAPI BOOL NtUserTranslateMessage (IN CONST MSG *lpMsg, IN UINT flags)
W32KAPI BOOL NtUserUnhookWindowsHookEx (IN HHOOK hhk)
W32KAPI BOOL NtUserUnregisterHotKey (IN HWND hwnd, IN int id)
W32KAPI BOOL NtUserValidateRect (IN HWND hwnd, IN CONST RECT *lpRect OPTIONAL)
W32KAPI DWORD NtUserWaitForInputIdle (IN ULONG_PTR idProcess, IN DWORD dwMilliseconds, IN BOOL fSharedWow)
W32KAPI HWND NtUserWindowFromPoint (IN POINT Point)
W32KAPI HDC NtUserBeginPaint (IN HWND hwnd, OUT LPPAINTSTRUCT lpPaint)
W32KAPI BOOL NtUserCreateCaret (IN HWND hwnd, IN HBITMAP hBitmap, IN int nWidth, IN int nHeight)
W32KAPI BOOL NtUserEndPaint (IN HWND hwnd, IN CONST PAINTSTRUCT *lpPaint)
W32KAPI int NtUserExcludeUpdateRgn (IN HDC hDC, IN HWND hwnd)
W32KAPI HDC NtUserGetDC (IN HWND hwnd)
W32KAPI HDC NtUserGetDCEx (IN HWND hwnd, IN HRGN hrgnClip, IN DWORD flags)
W32KAPI HDC NtUserGetWindowDC (IN HWND hwnd)
W32KAPI int NtUserGetUpdateRgn (IN HWND hwnd, IN HRGN hRgn, IN BOOL bErase)
W32KAPI BOOL NtUserRedrawWindow (IN HWND hwnd, IN CONST RECT *lprcUpdate OPTIONAL, IN HRGN hrgnUpdate, IN UINT flags)
W32KAPI BOOL NtUserInvalidateRgn (IN HWND hwnd, IN HRGN hRgn, IN BOOL bErase)
W32KAPI int NtUserSetWindowRgn (IN HWND hwnd, IN HRGN hRgn, IN BOOL bRedraw)
W32KAPI BOOL NtUserScrollDC (IN HDC hDC, IN int dx, IN int dy, IN CONST RECT *lprcScroll OPTIONAL, IN CONST RECT *lprcClip OPTIONAL, IN HRGN hrgnUpdate, OUT LPRECT lprcUpdate OPTIONAL)
W32KAPI int NtUserInternalGetWindowText (IN HWND hwnd, OUT LPWSTR lpString, IN int nMaxCount)
W32KAPI int NtUserGetMouseMovePointsEx (IN UINT cbSize, IN CONST MOUSEMOVEPOINT *lppt, OUT MOUSEMOVEPOINT *lpptBuf, IN UINT nBufPoints, IN DWORD resolution)
W32KAPI int NtUserToUnicodeEx (IN UINT wVirtKey, IN UINT wScanCode, IN CONST BYTE *lpKeyState, OUT LPWSTR lpszBuff, IN int cchBuff, IN UINT wFlags, IN HKL hKeyboardLayout)
W32KAPI BOOL NtUserYieldTask (VOID)
W32KAPI BOOL NtUserWaitMessage (VOID)
W32KAPI UINT NtUserLockWindowStation (IN HWINSTA hWindowStation)
W32KAPI BOOL NtUserUnlockWindowStation (IN HWINSTA hWindowStation)
W32KAPI UINT NtUserSetWindowStationUser (IN HWINSTA hWindowStation, IN PLUID pLuidUser, IN PSID pSidUser OPTIONAL, IN DWORD cbSidUser)
W32KAPI BOOL NtUserSetLogonNotifyWindow (IN HWND hwndNotify)
W32KAPI BOOL NtUserSetSystemCursor (IN HCURSOR hcur, IN DWORD id)
W32KAPI HCURSOR NtUserGetCursorFrameInfo (IN HCURSOR hcur, IN int iFrame, OUT LPDWORD pjifRate, OUT LPINT pccur)
W32KAPI BOOL NtUserSetCursorContents (IN HCURSOR hCursor, IN HCURSOR hCursorNew)
W32KAPI HCURSOR NtUserFindExistingCursorIcon (IN PUNICODE_STRING pstrModName, IN PUNICODE_STRING pstrResName, IN PCURSORFIND pcfSearch)
W32KAPI BOOL NtUserSetCursorIconData (IN HCURSOR hCursor, IN PUNICODE_STRING pstrModName, IN PUNICODE_STRING pstrResName, IN PCURSORDATA pData)
BOOL NtUserWOWModuleUnload (IN HANDLE hModule)
BOOL NtUserWOWCleanup (IN HANDLE hInstance, IN DWORD hTaskWow)
W32KAPI BOOL NtUserGetMenuItemRect (IN HWND hwnd, IN HMENU hMenu, IN UINT uItem, OUT LPRECT lprcItem)
W32KAPI int NtUserMenuItemFromPoint (IN HWND hwnd, IN HMENU hMenu, IN POINT ptScreen)
W32KAPI BOOL NtUserGetCaretPos (OUT LPPOINT lpPoint)
W32KAPI BOOL NtUserDefSetText (IN HWND hwnd, IN PLARGE_STRING Text OPTIONAL)
W32KAPI NTSTATUS NtUserQueryInformationThread (IN HANDLE hThread, IN USERTHREADINFOCLASS ThreadInfoClass, OUT PVOID ThreadInformation, IN ULONG ThreadInformationLength, IN OUT PULONG ReturnLength OPTIONAL)
W32KAPI NTSTATUS NtUserSetInformationThread (IN HANDLE hThread, IN USERTHREADINFOCLASS ThreadInfoClass, IN PVOID ThreadInformation, IN ULONG ThreadInformationLength)
W32KAPI NTSTATUS NtUserSetInformationProcess (IN HANDLE hProcess, IN USERPROCESSINFOCLASS ProcessInfoClass, IN PVOID ProcessInformation, IN ULONG ProcessInformationLength)
W32KAPI BOOL NtUserNotifyProcessCreate (IN DWORD dwProcessId, IN DWORD dwParentThreadId, IN ULONG_PTR dwData, IN DWORD dwFlags)
W32KAPI NTSTATUS NtUserTestForInteractiveUser (IN PLUID pluidCaller)
W32KAPI BOOL NtUserSetConsoleReserveKeys (IN HWND hwnd, IN DWORD fsReserveKeys)
W32KAPI VOID NtUserModifyUserStartupInfoFlags (IN DWORD dwMask, IN DWORD dwFlags)
W32KAPI BOOL NtUserSetWindowFNID (IN HWND hwnd, IN WORD fnid)
W32KAPI VOID NtUserAlterWindowStyle (IN HWND hwnd, IN DWORD mask, IN DWORD flags)
W32KAPI VOID NtUserSetThreadState (IN DWORD dwFlags, IN DWORD dwMask)
W32KAPI ULONG_PTR NtUserGetThreadState (IN USERTHREADSTATECLASS ThreadState)
LRESULT NtUserGetListboxString (IN HWND hwnd, IN UINT msg, IN WPARAM wParam, IN PLARGE_STRING pString, IN ULONG_PTR xParam, IN DWORD xpfn, IN PBOOL pbNotString)
W32KAPI BOOL NtUserValidateHandleSecure (IN HANDLE h)
W32KAPI BOOL NtUserUserHandleGrantAccess (IN HANDLE hUserHandle, IN HANDLE hJob, IN BOOL bGrant)
W32KAPI HWND NtUserCreateWindowEx (IN DWORD dwExStyle, IN PLARGE_STRING pstrClassName, IN PLARGE_STRING pstrWindowName OPTIONAL, IN DWORD dwStyle, IN int x, IN int y, IN int nWidth, IN int nHeight, IN HWND hwndParent, IN HMENU hmenu, IN HANDLE hModule, IN LPVOID pParam, IN DWORD dwFlags)
W32KAPI NTSTATUS NtUserBuildHwndList (IN HDESK hdesk, IN HWND hwndNext, IN BOOL fEnumChildren, IN DWORD idThread, IN UINT cHwndMax, OUT HWND *phwndFirst, OUT PUINT pcHwndNeeded)
W32KAPI NTSTATUS NtUserBuildPropList (IN HWND hwnd, IN UINT cPropMax, OUT PPROPSET pPropSet, OUT PUINT pcPropNeeded)
W32KAPI NTSTATUS NtUserBuildNameList (IN HWINSTA hwinsta, IN UINT cbNameList, OUT PNAMELIST pNameList, OUT PUINT pcbNeeded)
W32KAPI HKL NtUserActivateKeyboardLayout (IN HKL hkl, IN UINT Flags)
W32KAPI HKL NtUserLoadKeyboardLayoutEx (IN HANDLE hFile, IN DWORD offTable, IN HKL hkl, IN PUNICODE_STRING pstrKLID, IN UINT KbdInputLocale, IN UINT Flags)
W32KAPI BOOL NtUserUnloadKeyboardLayout (IN HKL hkl)
W32KAPI BOOL NtUserSetSystemMenu (IN HWND hwnd, IN HMENU hmenu)
W32KAPI BOOL NtUserDragDetect (IN HWND hwnd, IN POINT pt)
W32KAPI UINT_PTR NtUserSetSystemTimer (IN HWND hwnd, IN UINT_PTR nIDEvent, IN DWORD dwElapse, IN WNDPROC pTimerFunc)
W32KAPI BOOL NtUserQuerySendMessage (OUT PMSG pmsg)
W32KAPI UINT NtUserSendInput (IN UINT cInputs, IN CONST INPUT *pInputs, IN int cbSize)
W32KAPI BOOL NtUserImpersonateDdeClientWindow (IN HWND hwndClient, IN HWND hwndServer)
W32KAPI ULONG_PTR NtUserGetCPD (IN HWND hwnd, IN DWORD options, IN ULONG_PTR dwData)
W32KAPI int NtUserCopyAcceleratorTable (IN HACCEL hAccelSrc, IN OUT LPACCEL lpAccelDst OPTIONAL, IN int cAccelEntries)
W32KAPI HWND NtUserFindWindowEx (IN HWND hwndParent, IN HWND hwndChild, IN PUNICODE_STRING pstrClassName OPTIONAL, IN PUNICODE_STRING pstrWindowName OPTIONAL, IN DWORD dwType)
W32KAPI BOOL NtUserGetClassInfo (IN HINSTANCE hInstance OPTIONAL, IN PUNICODE_STRING pstrClassName, IN OUT LPWNDCLASSEXW lpWndClass, OUT LPWSTR *ppszMenuName, IN BOOL bAnsi)
W32KAPI int NtUserGetClassName (IN HWND hwnd, IN BOOL bReal, IN OUT PUNICODE_STRING pstrClassName)
W32KAPI int NtUserGetClipboardFormatName (IN UINT format, OUT LPWSTR lpszFormatName, IN UINT chMax)
W32KAPI int NtUserGetKeyNameText (IN LONG lParam, OUT LPWSTR lpszKeyName, IN UINT chMax)
W32KAPI BOOL NtUserGetKeyboardLayoutName (IN OUT PUNICODE_STRING pstrKLID)
W32KAPI UINT NtUserGetKeyboardLayoutList (IN UINT nItems, OUT HKL *lpBuff)
W32KAPI DWORD NtUserGetGuiResources (HANDLE hProcess, DWORD dwFlags)
W32KAPI UINT NtUserMapVirtualKeyEx (IN UINT uCode, IN UINT uMapType, IN ULONG_PTR dwHKLorPKL, IN BOOL bHKL)
W32KAPI ATOM NtUserRegisterClassExWOW (IN WNDCLASSEX *lpWndClass, IN PUNICODE_STRING pstrClassName, IN PCLSMENUNAME pcmn, IN WORD fnid, IN DWORD dwFlags, IN LPDWORD pdwWOWstuff OPTIONAL)
W32KAPI UINT NtUserRegisterWindowMessage (IN PUNICODE_STRING pstrMessage)
W32KAPI HANDLE NtUserRemoveProp (IN HWND hwnd, IN DWORD dwProp)
W32KAPI BOOL NtUserSetProp (IN HWND hwnd, IN DWORD dwProp, IN HANDLE hData)
W32KAPI BOOL NtUserUnregisterClass (IN PUNICODE_STRING pstrClassName, IN HINSTANCE hInstance, OUT PCLSMENUNAME pcmn)
W32KAPI SHORT NtUserVkKeyScanEx (IN WCHAR ch, IN ULONG_PTR dwHKLorPKL, IN BOOL bHKL)
W32KAPI NTSTATUS NtUserEnumDisplayDevices (IN PUNICODE_STRING pstrDeviceName, IN DWORD iDevNum, IN OUT LPDISPLAY_DEVICEW lpDisplayDevice, IN DWORD dwFlags)
W32KAPI HWINEVENTHOOK NtUserSetWinEventHook (IN DWORD eventMin, IN DWORD eventMax, IN HMODULE hmodWinEventProc, IN PUNICODE_STRING pstrLib OPTIONAL, IN WINEVENTPROC pfnWinEventProc, IN DWORD idEventProcess, IN DWORD idEventThread, IN DWORD dwFlags)
W32KAPI BOOL NtUserUnhookWinEvent (IN HWINEVENTHOOK hWinEventHook)
W32KAPI VOID NtUserNotifyWinEvent (IN DWORD event, IN HWND hwnd, IN LONG idObject, IN LONG idChild)
W32KAPI BOOL NtUserGetGUIThreadInfo (IN DWORD idThread, IN OUT PGUITHREADINFO pgui)
W32KAPI BOOL NtUserGetTitleBarInfo (IN HWND hwnd, IN OUT PTITLEBARINFO ptbi)
W32KAPI BOOL NtUserGetScrollBarInfo (IN HWND hwnd, IN LONG idObject, IN OUT PSCROLLBARINFO ptbi)
W32KAPI BOOL NtUserGetComboBoxInfo (IN HWND hwnd, IN OUT PCOMBOBOXINFO pcbi)
W32KAPI DWORD NtUserGetListBoxInfo (IN HWND hwnd)
W32KAPI HWND NtUserGetAncestor (IN HWND hwnd, IN UINT gaFlags)
W32KAPI BOOL NtUserGetCursorInfo (IN OUT PCURSORINFO pci)
W32KAPI HWND NtUserRealChildWindowFromPoint (IN HWND hwndParent, IN POINT pt)
W32KAPI BOOL NtUserGetAltTabInfo (IN HWND hwnd, IN int iItem, IN OUT PALTTABINFO pati, OUT LPWSTR lpszItemText, IN UINT cchItemText, IN BOOL bAnsi)
W32KAPI BOOL NtUserGetMenuBarInfo (IN HWND hwnd, IN long idObject, IN long idItem, IN OUT PMENUBARINFO pmbi)
W32KAPI LONG NtUserChangeDisplaySettings (IN PUNICODE_STRING pstrDeviceName, IN LPDEVMODEW lpDevMode, IN HWND hwnd, IN DWORD dwFlags, IN PVOID lParam)
W32KAPI BOOL NtUserCallMsgFilter (IN OUT LPMSG lpMsg, IN int nCode)
W32KAPI int NtUserDrawMenuBarTemp (IN HWND hwnd, IN HDC hdc, IN LPCRECT lprc, IN HMENU hMenu, IN HFONT hFont)
W32KAPI BOOL NtUserDrawCaptionTemp (IN HWND hwnd, IN HDC hdc, IN LPCRECT lprc, IN HFONT hFont, IN HICON hicon, IN PUNICODE_STRING pstrText, IN UINT flags)
W32KAPI SHORT NtUserGetKeyState (IN int vk)
W32KAPI BOOL NtUserGetKeyboardState (OUT PBYTE pb)
W32KAPI HANDLE NtUserQueryWindow (IN HWND hwnd, IN WINDOWINFOCLASS WindowInfo)
W32KAPI BOOL NtUserSBGetParms (IN HWND hwnd, IN int code, IN PSBDATA pw, IN OUT LPSCROLLINFO lpsi)
W32KAPI BOOL NtUserBitBltSysBmp (IN HDC hdc, IN int xDest, IN int yDest, IN int cxDest, IN int cyDest, IN int xSrc, IN int ySrc, IN DWORD dwRop)
W32KAPI LRESULT NtUserMessageCall (IN HWND hwnd, IN UINT msg, IN WPARAM wParam, IN LPARAM lParam, IN ULONG_PTR xParam, IN DWORD xpfnProc, IN BOOL bAnsi)
W32KAPI LRESULT NtUserCallNextHookEx (IN int nCode, IN WPARAM wParam, IN LPARAM lParam, IN BOOL bAnsi)
W32KAPI BOOL NtUserEnumDisplayMonitors (IN HDC hdc, IN LPCRECT lprcClip, IN MONITORENUMPROC lpfnEnum, IN LPARAM dwData)
W32KAPI NTSTATUS NtUserEnumDisplaySettings (IN PUNICODE_STRING pstrDeviceName, IN DWORD iModeNum, OUT LPDEVMODEW lpDevMode, IN DWORD dwFlags)
W32KAPI BOOL NtUserQueryUserCounters (IN DWORD dwQueryType, IN LPVOID pvIn, IN DWORD dwInSize, OUT LPVOID pvResult, IN DWORD dwOutSize)
W32KAPI BOOL NtUserUpdateLayeredWindow (IN HWND hwnd, IN HDC hdcDst, IN POINT *pptDst, IN SIZE *psize, IN HDC hdcSrc, IN POINT *pptSrc, IN COLORREF crKey, IN BLENDFUNCTION *pblend, IN DWORD dwFlags)
W32KAPI BOOL NtUserSetLayeredWindowAttributes (IN HWND hwnd, IN COLORREF crKey, IN BYTE bAlpha, IN DWORD dwFlags)
W32KAPI NTSTATUS NtUserRemoteConnect (IN PDOCONNECTDATA pDoConnectData, IN ULONG DisplayDriverNameLength, IN PWCHAR DisplayDriverName)
W32KAPI NTSTATUS NtUserRemoteRedrawRectangle (IN WORD Left, IN WORD Top, IN WORD Right, IN WORD Bottom)
W32KAPI NTSTATUS NtUserRemoteRedrawScreen (VOID)
W32KAPI NTSTATUS NtUserRemoteStopScreenUpdates (VOID)
W32KAPI NTSTATUS NtUserCtxDisplayIOCtl (IN ULONG DisplayIOCtlFlags, IN PUCHAR pDisplayIOCtlData, IN ULONG cbDisplayIOCtlData)
W32KAPI HPALETTE NtUserSelectPalette (IN HDC hdc, IN HPALETTE hpalette, IN BOOL fForceBackground)
W32KAPI NTSTATUS NtUserProcessConnect (IN HANDLE hProcess, IN OUT PVOID pConnectInfo, IN ULONG cbConnectInfo)
W32KAPI NTSTATUS NtUserSoundSentry (VOID)
W32KAPI NTSTATUS NtUserInitialize (IN DWORD dwVersion, IN HANDLE hPowerRequestEvent, IN HANDLE hMediaRequestEvent)


Define Documentation

#define DBGHYD  ) 
 

Definition at line 29 of file ntuser.h.

Referenced by CleanupSessionObjectDirectories(), RemoteDoMessage(), RemoteMessageThread(), TerminalServerRequestThread(), W32WinStationBroadcastSystemMessage(), W32WinStationDoConnect(), W32WinStationDoDisconnect(), W32WinStationDoMessage(), W32WinStationDoReconnect(), W32WinStationExitWindows(), W32WinStationNtSecurity(), W32WinStationPassthruDisable(), W32WinStationPassthruEnable(), W32WinStationSendWindowMessage(), W32WinStationShadowCleanup(), W32WinStationShadowSetup(), W32WinStationShadowStart(), W32WinStationShadowStop(), W32WinStationTerminate(), W32WinStationThinwireStats(), Win32CommandChannelThread(), and WinStationAPIInit().

#define NtUserSetClassLongPtr   NtUserSetClassLong
 

Definition at line 303 of file ntuser.h.

Referenced by SetClassLongPtr().

#define NtUserSetWindowLongPtr   NtUserSetWindowLong
 

Definition at line 964 of file ntuser.h.

Referenced by _SetWindowLongPtr(), CreateIMEUI(), DefDlgProcWorker(), and MDIClientWndProcWorker().

#define W32KAPI   DECLSPEC_ADDRSAFE
 

Definition at line 18 of file ntuser.h.


Function Documentation

W32KAPI HKL NtUserActivateKeyboardLayout IN HKL  hkl,
IN UINT  Flags
 

Definition at line 8426 of file kernel/ntstubs.c.

References _GetProcessWindowStation(), BEGINRECV, ENDRECV, IS_CURRENT_THREAD_RESTRICTED, MSGERROR, NULL, TRACE, and xxxActivateKeyboardLayout().

08429 { 08430 BEGINRECV(HKL, NULL); 08431 08432 /* 08433 * Prevent restricted threads from setting the keyboard layout 08434 * for the entire system. 08435 */ 08436 if (IS_CURRENT_THREAD_RESTRICTED(JOB_OBJECT_UILIMIT_HANDLES)) { 08437 MSGERROR(0); 08438 } 08439 08440 retval = (HKL)xxxActivateKeyboardLayout( 08441 _GetProcessWindowStation(NULL), 08442 hkl, 08443 Flags, NULL); 08444 08445 TRACE("NtUserActivateKeyboardLayout"); 08446 ENDRECV(); 08447 }

W32KAPI VOID NtUserAlterWindowStyle IN HWND  hwnd,
IN DWORD  mask,
IN DWORD  flags
 

Definition at line 7752 of file kernel/ntstubs.c.

References AWS_MASK, BEGINRECV_HWND_VOID, ENDRECV_HWND_VOID, GETPTI, PpiCurrent, TRACEVOID, and VOID().

Referenced by ButtonWndProcWorker(), ListBoxWndProcWorker(), and StaticWndProcWorker().

07756 { 07757 BEGINRECV_HWND_VOID(hwnd); 07758 07759 if (GETPTI(pwnd)->ppi == PpiCurrent()) { 07760 07761 #if DBG 07762 if (mask & ~AWS_MASK) { 07763 RIPMSG1(RIP_WARNING, "NtUserAlterWindowStyle: bad mask %x", mask); 07764 } 07765 #endif 07766 07767 mask &= AWS_MASK; 07768 pwnd->style = (pwnd->style & (~mask)) | (flags & mask); 07769 } else { 07770 RIPMSG1(RIP_WARNING, "NtUserAlterWIndowStyle: current ppi doesn't own pwnd %#p", pwnd); 07771 } 07772 07773 TRACEVOID("NtUserAlterWindowStyle"); 07774 ENDRECV_HWND_VOID(); 07775 }

W32KAPI BOOL NtUserAttachThreadInput IN DWORD  idAttach,
IN DWORD  idAttachTo,
IN BOOL  fAttach
 

Definition at line 4179 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, MSGERROR, NULL, PtiFromThreadId(), TRACE, and zzzAttachThreadInput().

04183 { 04184 PTHREADINFO ptiAttach; 04185 PTHREADINFO ptiAttachTo; 04186 04187 BEGINRECV(BOOL, FALSE); 04188 04189 /* 04190 * Always must attach or detach from a real thread id. 04191 */ 04192 if ((ptiAttach = PtiFromThreadId(idAttach)) == NULL) { 04193 MSGERROR(0); 04194 } 04195 if ((ptiAttachTo = PtiFromThreadId(idAttachTo)) == NULL) { 04196 MSGERROR(0); 04197 } 04198 04199 retval = zzzAttachThreadInput( 04200 ptiAttach, 04201 ptiAttachTo, 04202 fAttach); 04203 04204 TRACE("NtUserAttachThreadInput"); 04205 ENDRECV(); 04206 }

W32KAPI HDC NtUserBeginPaint IN HWND  hwnd,
OUT LPPAINTSTRUCT  lpPaint
 

Definition at line 6520 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, ENDRECV_HWNDLOCK, MSGERROR, NULL, ProbeAndWriteStructure, StubExceptionHandler, TRACE, TRUE, xxxBeginPaint(), and xxxEndPaint().

Referenced by ButtonWndProcWorker(), ComboBoxWndProcWorker(), ListBoxWndProcWorker(), MLEditWndProc(), SLEditWndProc(), and StaticWndProcWorker().

06523 { 06524 PAINTSTRUCT ps; 06525 06526 // 06527 // N.B. This function has implicit window translation and thread locking 06528 // enabled. These operations are performed in the User server API 06529 // dispatcher. 06530 // 06531 06532 BEGINRECV_HWNDLOCK(HDC, NULL, hwnd); 06533 06534 retval = xxxBeginPaint(pwnd, &ps); 06535 06536 /* 06537 * Probe arguments 06538 */ 06539 try { 06540 ProbeAndWriteStructure(lpPaint, ps, PAINTSTRUCT); 06541 } except (StubExceptionHandler(TRUE)) { 06542 xxxEndPaint(pwnd, &ps); 06543 MSGERROR(0); 06544 } 06545 06546 TRACE("NtUserBeginPaint"); 06547 ENDRECV_HWNDLOCK(); 06548 }

W32KAPI BOOL NtUserBitBltSysBmp IN HDC  hdc,
IN int  xDest,
IN int  yDest,
IN int  cxDest,
IN int  cyDest,
IN int  xSrc,
IN int  ySrc,
IN DWORD  dwRop
 

Definition at line 9755 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, and HDCBITS.

Referenced by BitBltSysBmp(), LoadBmp(), and xxxButtonDrawCheck().

09764 { 09765 BEGINRECV(BOOL, FALSE); 09766 09767 /* 09768 * Note -- this interface requires exclusive ownership of 09769 * the User crit sect in order to serialize use 09770 * of HDCBITS. Only one thread at a time may use 09771 * a DC. 09772 */ 09773 09774 retval = GreBitBlt(hdc, 09775 xDest, 09776 yDest, 09777 cxDest, 09778 cyDest, 09779 HDCBITS(), 09780 xSrc, 09781 ySrc, 09782 dwRop, 09783 0); 09784 09785 ENDRECV(); 09786 }

W32KAPI NTSTATUS NtUserBuildHwndList IN HDESK  hdesk,
IN HWND  hwndNext,
IN BOOL  fEnumChildren,
IN DWORD  idThread,
IN UINT  cHwndMax,
OUT HWND *  phwndFirst,
OUT PUINT  pcHwndNeeded
 

Definition at line 8222 of file kernel/ntstubs.c.

References _GetDesktopWindow(), BEGINATOMICRECV, BuildHwndList(), BWL_ENUMCHILDREN, BWL_ENUMIMELAST, BWL_ENUMLIST, CLEANUPRECV, DWORD, ENDATOMICRECV, FALSE, FreeHwndList(), IS_IME_ENABLED, LogDesktop, MSGERROR, MSGERRORCLEANUP, NT_SUCCESS, NTSTATUS(), NULL, ObDereferenceObject, tagDESKTOP::pDeskInfo, tagBWL::phwndNext, ProbeForWriteBuffer, ProbeForWriteUlong, PtiCurrent, PtiFromThreadId(), tagBWL::rghwnd, tagTHREADINFO::rpdesk, tagDESKTOPINFO::spwnd, tagWND::spwndChild, StubExceptionHandler, TRACE, TRUE, UINT, UserMode, ValidateHdesk(), and ValidateHWNDOPT.

Referenced by BuildHwndList().

08230 { 08231 PWND pwndNext; 08232 PDESKTOP pdesk; 08233 PBWL pbwl; 08234 PTHREADINFO pti; 08235 UINT cHwndNeeded; 08236 UINT wFlags = BWL_ENUMLIST; 08237 BEGINATOMICRECV(NTSTATUS, STATUS_INVALID_HANDLE); 08238 08239 if (IS_IME_ENABLED()) { 08240 // special treatment of IME Window 08241 wFlags |= BWL_ENUMIMELAST; 08242 } 08243 08244 /* 08245 * Validate prior to referencing the desktop 08246 */ 08247 ValidateHWNDOPT(pwndNext, hwndNext); 08248 08249 if (idThread) { 08250 pti = PtiFromThreadId(idThread); 08251 if (pti == NULL || pti->rpdesk == NULL){ 08252 MSGERROR(ERROR_INVALID_PARAMETER); 08253 } 08254 pwndNext = pti->rpdesk->pDeskInfo->spwnd->spwndChild; 08255 } else { 08256 pti = NULL; 08257 } 08258 08259 if (hdesk) { 08260 retval = ValidateHdesk(hdesk, UserMode, DESKTOP_READOBJECTS, &pdesk); 08261 if (!NT_SUCCESS(retval)){ 08262 MSGERROR(ERROR_INVALID_HANDLE); 08263 } 08264 pwndNext = pdesk->pDeskInfo->spwnd->spwndChild; 08265 } else { 08266 pdesk = NULL; 08267 } 08268 08269 08270 if (pwndNext == NULL) { 08271 /* 08272 * Bug: 262004 joejo 08273 * If we have a valid desk (just no windows on it), then we need 08274 * to fall through. Otherwise, we'll just grab the current desktop and enum it's 08275 * windows! 08276 */ 08277 if (pdesk == NULL) { 08278 if (pti != NULL) { 08279 pwndNext = pti->rpdesk->pDeskInfo->spwnd->spwndChild; 08280 } else { 08281 pwndNext = _GetDesktopWindow()->spwndChild; 08282 } 08283 } 08284 } else { 08285 if (fEnumChildren) { 08286 wFlags |= BWL_ENUMCHILDREN; 08287 pwndNext = pwndNext->spwndChild; 08288 } 08289 } 08290 08291 if ((pbwl = BuildHwndList(pwndNext, wFlags, pti)) == NULL) { 08292 MSGERRORCLEANUP(ERROR_NOT_ENOUGH_MEMORY); 08293 } 08294 08295 cHwndNeeded = (UINT)(pbwl->phwndNext - pbwl->rghwnd) + 1; 08296 08297 /* 08298 * Probe arguments 08299 */ 08300 try { 08301 ProbeForWriteBuffer(phwndFirst, cHwndMax, sizeof(DWORD)); 08302 ProbeForWriteUlong(pcHwndNeeded); 08303 08304 /* 08305 * If we have enough space, copy out list of hwnds to user mode buffer. 08306 */ 08307 if (cHwndNeeded <= cHwndMax) { 08308 RtlCopyMemory(phwndFirst, pbwl->rghwnd, cHwndNeeded * sizeof(HWND)); 08309 retval = STATUS_SUCCESS; 08310 } else { 08311 retval = STATUS_BUFFER_TOO_SMALL; 08312 } 08313 *pcHwndNeeded = cHwndNeeded; 08314 } except (StubExceptionHandler(TRUE)) { 08315 MSGERRORCLEANUP(0); // phwndFirst/pcHwndNeeded are USER's, not app's 08316 } 08317 08318 CLEANUPRECV(); 08319 08320 if (pbwl != NULL) { 08321 FreeHwndList(pbwl); 08322 } 08323 08324 if (pdesk != NULL) { 08325 LogDesktop(pdesk, LD_DEREF_VALIDATE_HDESK4, FALSE, (ULONG_PTR)PtiCurrent()); 08326 ObDereferenceObject(pdesk); 08327 } 08328 08329 TRACE("NtUserBuildHwndList"); 08330 ENDATOMICRECV(); 08331 }

W32KAPI NTSTATUS NtUserBuildNameList IN HWINSTA  hwinsta,
IN UINT  cbNameList,
OUT PNAMELIST  pNameList,
OUT PUINT  pcbNeeded
 

Definition at line 8365 of file kernel/ntstubs.c.

References _BuildNameList(), BEGINRECV_SHARED, DWORD, ENDRECV_SHARED, FALSE, MSGERROR, NAMELIST, NT_SUCCESS, NTSTATUS(), NULL, ObDereferenceObject, PNAMELIST, ProbeForWrite(), ProbeForWriteUlong, StubExceptionHandler, TRACE, UINT, UserMode, and ValidateHwinsta().

Referenced by InternalEnumObjects().

08370 { 08371 UINT cbNeeded; 08372 PWINDOWSTATION pwinsta = NULL; 08373 08374 BEGINRECV_SHARED(NTSTATUS, STATUS_INVALID_HANDLE); 08375 08376 if (cbNameList < sizeof(NAMELIST)) { 08377 MSGERROR(0); 08378 } 08379 08380 try { 08381 ProbeForWriteUlong(pcbNeeded); 08382 ProbeForWrite(pNameList, cbNameList, sizeof(DWORD)); 08383 } except (StubExceptionHandler(FALSE)) { 08384 MSGERROR(0); 08385 } 08386 08387 if (hwinsta != NULL) { 08388 retval = ValidateHwinsta(hwinsta, UserMode, WINSTA_ENUMDESKTOPS, &pwinsta); 08389 } else { 08390 retval = STATUS_SUCCESS; 08391 } 08392 08393 if (!NT_SUCCESS(retval)) { 08394 try { 08395 *pNameList->awchNames = 0; 08396 pNameList->cb = 1; 08397 } except (StubExceptionHandler(FALSE)) { 08398 MSGERROR(0); 08399 } 08400 08401 } else { 08402 /* 08403 * Note -- pNameList is a client-side pointers. 08404 * BuildNameList protects access with try blocks. 08405 */ 08406 08407 retval = _BuildNameList( 08408 pwinsta, 08409 pNameList, 08410 cbNameList, 08411 &cbNeeded); 08412 try { 08413 *pcbNeeded = cbNeeded; 08414 } except (StubExceptionHandler(FALSE)) { 08415 retval = STATUS_ACCESS_VIOLATION; 08416 } 08417 } 08418 08419 if (pwinsta != NULL) 08420 ObDereferenceObject(pwinsta); 08421 08422 TRACE("NtUserBuildNameList"); 08423 ENDRECV_SHARED(); 08424 }

W32KAPI NTSTATUS NtUserBuildPropList IN HWND  hwnd,
IN UINT  cPropMax,
OUT PPROPSET  pPropSet,
OUT PUINT  pcPropNeeded
 

Definition at line 8333 of file kernel/ntstubs.c.

References _BuildPropList(), BEGINRECV_HWNDLOCK, DWORD, ENDRECV_HWNDLOCK, FALSE, MSGERROR, NTSTATUS(), PPROPSET, ProbeForWriteBuffer, ProbeForWriteUlong, StubExceptionHandler, and TRACE.

Referenced by InternalEnumProps().

08338 { 08339 BEGINRECV_HWNDLOCK(NTSTATUS, STATUS_INVALID_HANDLE, hwnd); 08340 08341 if (cPropMax == 0) { 08342 MSGERROR(0); 08343 } 08344 08345 /* 08346 * Probe arguments 08347 */ 08348 try { 08349 ProbeForWriteBuffer(pPropSet, cPropMax, sizeof(DWORD)); 08350 ProbeForWriteUlong(pcPropNeeded); 08351 08352 retval = _BuildPropList( 08353 pwnd, 08354 pPropSet, 08355 cPropMax, 08356 pcPropNeeded); 08357 } except (StubExceptionHandler(FALSE)) { 08358 MSGERROR(0); // pPropSet/pcPropNeed are USER's, not app's 08359 } 08360 08361 TRACE("NtUserBuildPropList"); 08362 ENDRECV_HWNDLOCK(); 08363 }

W32KAPI BOOL NtUserCallMsgFilter IN OUT LPMSG  lpMsg,
IN int  nCode
 

Definition at line 9413 of file kernel/ntstubs.c.

References _CallMsgFilter(), BEGINRECV, BOOL, ENDRECV, FALSE, msg, MSGERROR, ProbeForWriteMessage, StubExceptionHandler, TRACE, and TRUE.

Referenced by CallMsgFilter().

09416 { 09417 MSG msg; 09418 09419 BEGINRECV(BOOL, FALSE); 09420 09421 /* 09422 * Probe arguments 09423 */ 09424 try { 09425 ProbeForWriteMessage(lpMsg); 09426 msg = *lpMsg; 09427 } except (StubExceptionHandler(TRUE)) { 09428 MSGERROR(0); 09429 } 09430 09431 retval = _CallMsgFilter( 09432 &msg, 09433 nCode); 09434 try { 09435 *lpMsg = msg; 09436 } except (StubExceptionHandler(TRUE)) { 09437 MSGERROR(0); 09438 } 09439 09440 TRACE("NtUserCallMsgFilter"); 09441 ENDRECV(); 09442 }

W32KAPI LRESULT NtUserCallNextHookEx IN int  nCode,
IN WPARAM  wParam,
IN LPARAM  lParam,
IN BOOL  bAnsi
 

W32KAPI BOOL NtUserChangeClipboardChain IN HWND  hwndRemove,
IN HWND  hwndNewNext
 

Definition at line 3864 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, BOOL, DWORD, ENDRECV_HWNDLOCK, ThreadLockWithPti, ThreadUnlock, TRACE, ValidateHWNDOPT, and xxxChangeClipboardChain().

03867 { 03868 03869 // 03870 // N.B. This function has implicit window translation and thread locking 03871 // enabled. These operations are performed in the User server API 03872 // dispatcher. 03873 // 03874 03875 PWND pwndNewNext; 03876 TL tlpwndNewNext; 03877 03878 BEGINRECV_HWNDLOCK(DWORD, 0, hwndRemove); 03879 03880 ValidateHWNDOPT(pwndNewNext, hwndNewNext); 03881 03882 ThreadLockWithPti(ptiCurrent, pwndNewNext, &tlpwndNewNext); 03883 retval = xxxChangeClipboardChain( 03884 pwnd, 03885 pwndNewNext); 03886 03887 ThreadUnlock(&tlpwndNewNext); 03888 03889 TRACE("NtUserChangeClipboardChain"); 03890 ENDRECV_HWNDLOCK(); 03891 }

LONG NtUserChangeDisplaySettings IN PUNICODE_STRING  pstrDeviceName,
IN LPDEVMODEW  lpDevMode,
IN HWND  hwnd,
IN DWORD  dwFlags,
IN PVOID  lParam
 

Definition at line 9380 of file kernel/ntstubs.c.

References BEGINRECV, dwFlags, ENDRECV, IS_CURRENT_THREAD_RESTRICTED, MSGERROR, NULL, TRACE, UserMode, and xxxUserChangeDisplaySettings().

Referenced by ChangeDisplaySettingsEx(), and DrChangeDisplaySettings().

09386 { 09387 BEGINRECV(LONG, DISP_CHANGE_FAILED); 09388 09389 /* 09390 * Prevent restricted threads from changing 09391 * display settings 09392 */ 09393 if (IS_CURRENT_THREAD_RESTRICTED(JOB_OBJECT_UILIMIT_DISPLAYSETTINGS)) { 09394 MSGERROR(0); 09395 } 09396 09397 /* 09398 * Address checking, etc., occurs in GRE. 09399 */ 09400 09401 retval = xxxUserChangeDisplaySettings(pstrDeviceName, 09402 pDevMode, 09403 hwnd, 09404 NULL, // pdesk 09405 dwFlags, 09406 lParam, 09407 UserMode); 09408 09409 TRACE("NtUserChangeDisplaySettings"); 09410 ENDRECV(); 09411 }

W32KAPI DWORD NtUserCheckMenuItem IN HMENU  hmenu,
IN UINT  wIDCheckItem,
IN UINT  wCheck
 

Definition at line 3893 of file kernel/ntstubs.c.

References _CheckMenuItem(), BEGINATOMICRECV, DWORD, ENDATOMICRECV, TESTFLAGS, TRACE, and ValidateHMENUMODIFY.

Referenced by CheckMenuItem().

03897 { 03898 PMENU pmenu; 03899 03900 BEGINATOMICRECV(DWORD, (DWORD)-1); 03901 03902 TESTFLAGS(wCheck, MF_VALID); 03903 03904 ValidateHMENUMODIFY(pmenu, hmenu); 03905 03906 retval = _CheckMenuItem( 03907 pmenu, 03908 wIDCheckItem, 03909 wCheck); 03910 03911 TRACE("NtUserCheckMenuItem"); 03912 ENDATOMICRECV(); 03913 }

W32KAPI HWND NtUserChildWindowFromPointEx IN HWND  hwndParent,
IN POINT  point,
IN UINT  flags
 

Definition at line 3915 of file kernel/ntstubs.c.

References _ChildWindowFromPointEx(), BEGINRECV_HWND, ENDRECV_HWND, NULL, PtoH, and TRACE.

Referenced by ChildWindowFromPoint(), and MDIClientWndProcWorker().

03919 { 03920 03921 // 03922 // N.B. This function has implicit window handle translation. This 03923 // operation is performed in the User server API dispatcher. 03924 // 03925 03926 BEGINRECV_HWND(HWND, NULL, hwndParent); 03927 03928 retval = (HWND)_ChildWindowFromPointEx(pwnd, point, flags); 03929 retval = PtoH((PVOID)retval); 03930 03931 TRACE("NtUserChildWindowFromPointEx"); 03932 ENDRECV_HWND(); 03933 }

W32KAPI BOOL NtUserClipCursor IN CONST RECT *lpRect  OPTIONAL  ) 
 

Definition at line 3935 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, MSGERROR, ProbeAndReadRect, StubExceptionHandler, TRACE, TRUE, and zzzClipCursor().

03937 { 03938 RECT rc; 03939 03940 BEGINRECV(BOOL, FALSE); 03941 03942 /* 03943 * Probe arguments 03944 */ 03945 if (ARGUMENT_PRESENT(lpRect)) { 03946 try { 03947 rc = ProbeAndReadRect(lpRect); 03948 lpRect = &rc; 03949 } except (StubExceptionHandler(TRUE)) { 03950 MSGERROR(0); 03951 } 03952 } 03953 03954 retval = zzzClipCursor(lpRect); 03955 03956 TRACE("NtUserClipCursor"); 03957 ENDRECV(); 03958 }

W32KAPI BOOL NtUserCloseClipboard VOID   ) 
 

Definition at line 3252 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, NULL, TRACE, and xxxCloseClipboard().

Referenced by ECCopy(), MB_CopyToClipboard(), MLPasteText(), and SLPasteText().

03254 { 03255 BEGINRECV(BOOL, FALSE); 03256 03257 retval = xxxCloseClipboard(NULL); 03258 03259 TRACE("NtUserCloseClipboard"); 03260 ENDRECV(); 03261 }

W32KAPI BOOL NtUserCloseDesktop IN HDESK  hdesk  ) 
 

Definition at line 1423 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, TRACE, UserMode, and xxxCloseDesktop().

01425 { 01426 BEGINRECV(BOOL, FALSE); 01427 01428 retval = xxxCloseDesktop(hdesk, UserMode); 01429 01430 TRACE("NtUserCloseDesktop"); 01431 ENDRECV(); 01432 }

W32KAPI BOOL NtUserCloseWindowStation IN HWINSTA  hwinsta  ) 
 

Definition at line 1118 of file kernel/ntstubs.c.

References _CloseWindowStation(), BEGINRECV, BOOL, ENDRECV, FALSE, NT_SUCCESS, NTSTATUS(), ObDereferenceObject, Status, TRACE, UserMode, and ValidateHwinsta().

01120 { 01121 PWINDOWSTATION pwinsta; 01122 NTSTATUS Status; 01123 01124 BEGINRECV(BOOL, FALSE); 01125 01126 retval = FALSE; 01127 01128 Status = ValidateHwinsta(hwinsta, UserMode, 0, &pwinsta); 01129 if (NT_SUCCESS(Status)) { 01130 retval = _CloseWindowStation(hwinsta); 01131 ObDereferenceObject(pwinsta); 01132 } 01133 01134 TRACE("NtUserCloseWindowStation"); 01135 ENDRECV(); 01136 }

W32KAPI NTSTATUS NtUserConsoleControl IN CONSOLECONTROL  ConsoleCommand,
IN PVOID  ConsoleInformation,
IN DWORD  ConsoleInformationLength
 

Definition at line 870 of file kernel/ntstubs.c.

References BEGINRECVCSRSS, ENDRECVCSRSS, NTSTATUS(), ProbeForWrite(), TRACE, and xxxConsoleControl().

Referenced by ConsoleClientConnectRoutine(), ConsoleInputThread(), CursorTimerRoutine(), DisplayModeTransition(), InitWindowClass(), InitWindowsStuff(), SrvRegisterConsoleVDM(), SrvSetConsolePalette(), and UnregisterVDM().

00874 { 00875 BEGINRECVCSRSS(NTSTATUS, STATUS_UNSUCCESSFUL); 00876 00877 #if DBG 00878 ProbeForWrite(ConsoleInformation, 00879 ConsoleInformationLength, 00880 sizeof(WORD)); 00881 #endif 00882 00883 retval = xxxConsoleControl(ConsoleCommand, 00884 ConsoleInformation, 00885 ConsoleInformationLength); 00886 00887 TRACE("NtUserConsoleControl"); 00888 ENDRECVCSRSS(); 00889 }

W32KAPI HANDLE NtUserConvertMemHandle IN LPBYTE  lpData,
IN UINT  cbNULL
 

Definition at line 3310 of file kernel/ntstubs.c.

References _ConvertMemHandle(), BEGINRECV, BYTE, ENDRECV, FALSE, MSGERROR, NULL, ProbeForRead, StubExceptionHandler, and TRACE.

Referenced by ConvertMemHandle().

03313 { 03314 BEGINRECV(HANDLE, NULL); 03315 03316 /* 03317 * Probe arguments 03318 */ 03319 try { 03320 03321 ProbeForRead(lpData, cbData, sizeof(BYTE)); 03322 03323 } except (StubExceptionHandler(FALSE)) { 03324 MSGERROR(0); 03325 } 03326 03327 /* 03328 * lpData is client-side. 03329 */ 03330 retval = _ConvertMemHandle(lpData, cbData); 03331 03332 TRACE("NtUserConvertMemHandle"); 03333 ENDRECV(); 03334 }

W32KAPI int NtUserCopyAcceleratorTable IN HACCEL  hAccelSrc,
IN OUT LPACCEL lpAccelDst  OPTIONAL,
IN int  cAccelEntries
 

Definition at line 8729 of file kernel/ntstubs.c.

References tagACCELTABLE::accel, BEGINATOMICRECV, tagACCELTABLE::cAccel, DATAALIGN, ENDATOMICRECV, FLASTKEY, MSGERROR, NULL, ProbeForWriteBuffer, StubExceptionHandler, TRACE, TRUE, and ValidateHACCEL.

Referenced by CopyAcceleratorTableA().

08733 { 08734 LPACCELTABLE pat; 08735 int i; 08736 BEGINATOMICRECV(int, 0); 08737 08738 ValidateHACCEL(pat, hAccelSrc); 08739 08740 if (lpAccelDst == NULL) { 08741 retval = pat->cAccel; 08742 } else { 08743 08744 /* 08745 * Probe arguments 08746 */ 08747 try { 08748 ProbeForWriteBuffer(lpAccelDst, cAccel, DATAALIGN); 08749 08750 if (cAccel > (int)pat->cAccel) 08751 cAccel = pat->cAccel; 08752 08753 retval = cAccel; 08754 for (i = 0; i < cAccel; i++) { 08755 RtlCopyMemory(&lpAccelDst[i], &pat->accel[i], sizeof(ACCEL)); 08756 lpAccelDst[i].fVirt &= ~FLASTKEY; 08757 } 08758 } except (StubExceptionHandler(TRUE)) { 08759 MSGERROR(0); 08760 } 08761 } 08762 08763 TRACE("NtUserCopyAcceleratorTable"); 08764 ENDATOMICRECV(); 08765 }

W32KAPI int NtUserCountClipboardFormats VOID   ) 
 

Definition at line 5042 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, CheckClipboardAccess(), tagWINDOWSTATION::cNumClipFormats, ENDRECV_SHARED, MSGERROR, NULL, and TRACE.

05044 { 05045 PWINDOWSTATION pwinsta; 05046 05047 BEGINRECV_SHARED(int, 0); 05048 05049 /* 05050 * Blow it off if the caller doesn't have the proper access rights 05051 */ 05052 if ((pwinsta = CheckClipboardAccess()) == NULL) { 05053 MSGERROR(0); 05054 } 05055 05056 retval = pwinsta->cNumClipFormats; 05057 05058 TRACE("NtUserCountClipboardFormats"); 05059 ENDRECV_SHARED(); 05060 }

W32KAPI HACCEL NtUserCreateAcceleratorTable IN LPACCEL  lpAccel,
IN INT  cAccel
 

Definition at line 3960 of file kernel/ntstubs.c.

References _CreateAcceleratorTable(), BEGINRECV, DATAALIGN, ENDRECV, MSGERROR, NULL, ProbeForReadBuffer, PtoH, StubExceptionHandler, TRACE, and TRUE.

Referenced by CreateAcceleratorTableA(), and LoadAcc().

03963 { 03964 BEGINRECV(HACCEL, NULL); 03965 03966 if (cAccel <= 0) { 03967 MSGERROR(0); 03968 } 03969 03970 /* 03971 * Probe arguments 03972 */ 03973 try { 03974 ProbeForReadBuffer(paccel, cAccel, DATAALIGN); 03975 } except (StubExceptionHandler(TRUE)) { 03976 MSGERROR(0); 03977 } 03978 03979 retval = (HACCEL)_CreateAcceleratorTable( 03980 paccel, 03981 cAccel * sizeof(ACCEL)); 03982 retval = PtoH((PVOID)retval); 03983 03984 TRACE("NtUserCreateAcceleratorTable"); 03985 ENDRECV(); 03986 }

W32KAPI BOOL NtUserCreateCaret IN HWND  hwnd,
IN HBITMAP  hBitmap,
IN int  nWidth,
IN int  nHeight
 

Definition at line 6550 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, BOOL, DWORD, ENDRECV_HWNDLOCK, TRACE, and xxxCreateCaret().

Referenced by ECSetFont(), MLSetFocus(), and SLSetFocus().

06555 { 06556 06557 // 06558 // N.B. This function has implicit window handle translation. This 06559 // operation is performed in the User server API dispatcher. 06560 // 06561 06562 BEGINRECV_HWNDLOCK(DWORD, 0, hwnd); 06563 06564 retval = xxxCreateCaret( 06565 pwnd, 06566 hBitmap, 06567 nWidth, 06568 nHeight 06569 ); 06570 06571 TRACE("NtUserCreateCaret"); 06572 ENDRECV_HWNDLOCK(); 06573 }

W32KAPI HDESK NtUserCreateDesktop IN POBJECT_ATTRIBUTES  pObja,
IN PUNICODE_STRING  pstrDevice,
IN LPDEVMODEW  pDevmode,
IN DWORD  dwFlags,
IN ACCESS_MASK  amRequest
 

Definition at line 1173 of file kernel/ntstubs.c.

References BEGINRECV, dwFlags, DWORD, ENDRECV, IS_CURRENT_THREAD_RESTRICTED, MSGERROR, NULL, ProbeForRead, StubExceptionHandler, TRACE, TRUE, UserMode, and xxxCreateDesktop().

Referenced by CommonCreateDesktop().

01179 { 01180 BEGINRECV(HDESK, NULL); 01181 01182 /* 01183 * Fail this call for restricted threads 01184 */ 01185 if (IS_CURRENT_THREAD_RESTRICTED(JOB_OBJECT_UILIMIT_DESKTOP)) { 01186 RIPMSG0(RIP_WARNING, "NtUserCreateDesktop failed for restricted thread"); 01187 MSGERROR(0); 01188 } 01189 01190 /* 01191 * Probe arguments 01192 */ 01193 try { 01194 ProbeForRead(pObja, sizeof(*pObja), sizeof(DWORD)); 01195 } except (StubExceptionHandler(TRUE)) { 01196 MSGERROR(0); 01197 } 01198 01199 /* 01200 * pObja, pDevmode, and pstrDevice are all client side addresses. 01201 * 01202 * pstrDevice and pDevmode are put into the Context info, 01203 * and they are used in ntgdi\dre\drvsup.cxx, 01204 * where thay are captured before use. 01205 01206 */ 01207 01208 retval = xxxCreateDesktop(pObja, 01209 UserMode, 01210 pstrDevice, 01211 pDevmode, 01212 dwFlags, 01213 amRequest); 01214 01215 TRACE("NtUserCreateDesktop"); 01216 ENDRECV(); 01217 }

W32KAPI NTSTATUS NtUserCreateLocalMemHandle IN HANDLE  hMem,
OUT LPBYTE lpData  OPTIONAL,
IN UINT  cbData,
OUT PUINT lpcbNeeded  OPTIONAL
 

Definition at line 3336 of file kernel/ntstubs.c.

References tagCLIPDATA::abData, BEGINRECV, BYTE, tagCLIPDATA::cbData, ENDRECV, FALSE, HMValidateHandle(), MSGERROR, NTSTATUS(), NULL, PCLIPDATA, ProbeAndWriteUlong, ProbeForWrite(), StubExceptionHandler, TRACE, and TYPE_CLIPDATA.

Referenced by CreateLocalMemHandle().

03341 { 03342 PCLIPDATA pClipData; 03343 03344 BEGINRECV(NTSTATUS, STATUS_INVALID_HANDLE); 03345 03346 pClipData = HMValidateHandle(hMem, TYPE_CLIPDATA); 03347 if (pClipData == NULL) 03348 MSGERROR(0); 03349 03350 /* 03351 * Probe arguments 03352 */ 03353 try { 03354 if (ARGUMENT_PRESENT(lpData)) { 03355 ProbeForWrite(lpData, cbData, sizeof(BYTE)); 03356 } 03357 03358 if (ARGUMENT_PRESENT(lpcbNeeded)) { 03359 ProbeAndWriteUlong(lpcbNeeded, pClipData->cbData); 03360 } 03361 03362 if (!ARGUMENT_PRESENT(lpData) || cbData < pClipData->cbData) { 03363 retval = STATUS_BUFFER_TOO_SMALL; 03364 } else { 03365 RtlCopyMemory(lpData, &pClipData->abData, pClipData->cbData); 03366 retval = STATUS_SUCCESS; 03367 } 03368 } except (StubExceptionHandler(FALSE)) { 03369 MSGERROR(0); 03370 } 03371 03372 TRACE("NtUserCreateLocalMemHandle"); 03373 ENDRECV(); 03374 }

W32KAPI HWND NtUserCreateWindowEx IN DWORD  dwExStyle,
IN PLARGE_STRING  pstrClassName,
IN PLARGE_STRING pstrWindowName  OPTIONAL,
IN DWORD  dwStyle,
IN int  x,
IN int  y,
IN int  nWidth,
IN int  nHeight,
IN HWND  hwndParent,
IN HMENU  hmenu,
IN HANDLE  hModule,
IN LPVOID  pParam,
IN DWORD  dwFlags
 

Definition at line 8087 of file kernel/ntstubs.c.

References _GetMessageWindow(), _LARGE_STRING::bAnsi, BEGINRECV, BOOL, _LARGE_STRING::Buffer, BYTE, CLEANUPRECV, dwFlags, ENDRECV, FALSE, GetAppCompatFlags2(), IS_PTR, _LARGE_STRING::Length, MSGERRORCLEANUP, NULL, ProbeAndReadLargeString, ProbeForRead, PtiCurrent, PtoH, StubExceptionHandler, ThreadLockAlwaysWithPti, ThreadLockWithPti, ThreadUnlock, TRACE, TRUE, ValidateHMENU, ValidateHWNDOPT, VER40, and xxxCreateWindowEx().

Referenced by _CreateWindowEx(), and InternalCreateDialog().

08101 { 08102 LARGE_STRING strClassName; 08103 LARGE_STRING strWindowName; 08104 PWND pwndParent; 08105 PMENU pmenu; 08106 TL tlpwndParent; 08107 TL tlpmenu; 08108 BOOL fLockMenu = FALSE; 08109 PTHREADINFO ptiCurrent; 08110 08111 BEGINRECV(HWND, NULL); 08112 08113 if (hwndParent != HWND_MESSAGE) { 08114 ValidateHWNDOPT(pwndParent, hwndParent); 08115 } else 08116 pwndParent = _GetMessageWindow(); 08117 08118 08119 /* 08120 * Win3.1 only checks for WS_CHILD before treating pmenu as an id. This 08121 * is a bug, because throughout the code, the real check is TestwndChild(), 08122 * which checks (style & (WS_CHILD | WS_POPUP)) == WS_CHILD. This is 08123 * because old style "iconic popup" is WS_CHILD | WS_POPUP. So... if on 08124 * win3.1 an app used ws_iconicpopup, menu validation would not occur 08125 * (could crash if hmenu != NULL). On Win32, check for the real thing - 08126 * but allow NULL! 08127 */ 08128 ptiCurrent = PtiCurrent(); 08129 if (((dwStyle & (WS_CHILD | WS_POPUP)) != WS_CHILD) && 08130 (hmenu != NULL)) { 08131 ValidateHMENU(pmenu, hmenu); 08132 08133 ThreadLockAlwaysWithPti(ptiCurrent, pmenu, &tlpmenu); 08134 fLockMenu = TRUE; 08135 08136 } else { 08137 pmenu = (PMENU)hmenu; 08138 } 08139 08140 /* 08141 * Mask out the new 5.0 extended style bits for apps 08142 * that would try to use them and we'll fail in xxxCreateWindowEx 08143 */ 08144 if (GetAppCompatFlags2(VER40) & GACF2_NO50EXSTYLEBITSCW) { 08145 08146 #if DBG 08147 if (dwExStyle & ~(WS_EX_VALID40 | WS_EX_INTERNAL)) { 08148 RIPMSG0(RIP_WARNING, "CreateWindowEx: appcompat removed 5.0 EX bits"); 08149 } 08150 #endif 08151 08152 dwExStyle &= (WS_EX_VALID40 | WS_EX_INTERNAL); 08153 } 08154 08155 /* 08156 * Probe arguments 08157 */ 08158 try { 08159 #if defined(_X86_) 08160 if (IS_PTR(pstrClassName)) { 08161 strClassName = ProbeAndReadLargeString(pstrClassName); 08162 ProbeForRead(strClassName.Buffer, strClassName.Length, 08163 sizeof(BYTE)); 08164 pstrClassName = &strClassName; 08165 } 08166 if (ARGUMENT_PRESENT(pstrWindowName)) { 08167 strWindowName = ProbeAndReadLargeString(pstrWindowName); 08168 ProbeForRead(strWindowName.Buffer, strWindowName.Length, 08169 sizeof(BYTE)); 08170 pstrWindowName = &strWindowName; 08171 } 08172 #else 08173 if (IS_PTR(pstrClassName)) { 08174 strClassName = ProbeAndReadLargeString(pstrClassName); 08175 ProbeForRead(strClassName.Buffer, strClassName.Length, 08176 sizeof(WORD)); 08177 pstrClassName = &strClassName; 08178 } 08179 if (ARGUMENT_PRESENT(pstrWindowName)) { 08180 strWindowName = ProbeAndReadLargeString(pstrWindowName); 08181 ProbeForRead(strWindowName.Buffer, strWindowName.Length, 08182 (strWindowName.bAnsi ? sizeof(BYTE) : sizeof(WORD))); 08183 pstrWindowName = &strWindowName; 08184 } 08185 #endif 08186 } except (StubExceptionHandler(TRUE)) { 08187 MSGERRORCLEANUP(0); 08188 } 08189 08190 ThreadLockWithPti(ptiCurrent, pwndParent, &tlpwndParent); 08191 08192 /* 08193 * The buffers for ClassName and WindowName are still in client space. 08194 */ 08195 08196 retval = (HWND)xxxCreateWindowEx( 08197 dwExStyle, 08198 pstrClassName, 08199 pstrWindowName, 08200 dwStyle, 08201 x, 08202 y, 08203 nWidth, 08204 nHeight, 08205 pwndParent, 08206 pmenu, 08207 hModule, 08208 pParam, 08209 dwFlags); 08210 retval = PtoH((PVOID)retval); 08211 08212 ThreadUnlock(&tlpwndParent); 08213 08214 CLEANUPRECV(); 08215 if (fLockMenu) 08216 ThreadUnlock(&tlpmenu); 08217 08218 TRACE("NtUserCreateWindowEx"); 08219 ENDRECV(); 08220 }

W32KAPI HWINSTA NtUserCreateWindowStation IN POBJECT_ATTRIBUTES  pObja,
IN ACCESS_MASK  amRequest,
IN HANDLE  hKbdLayoutFile,
IN DWORD  offTable,
IN PUNICODE_STRING  pstrKLID,
IN UINT  uKbdInputLocale
 

W32KAPI NTSTATUS NtUserCtxDisplayIOCtl IN ULONG  DisplayIOCtlFlags,
IN PUCHAR  pDisplayIOCtlData,
IN ULONG  cbDisplayIOCtlData
 

Definition at line 615 of file kernel/ntstubs.c.

References BEGINRECVCSRSS, BYTE, CtxDisplayIOCtl(), ENDRECVCSRSS, ISTS, MSGERROR, NTSTATUS(), ProbeForRead, and TRACE.

Referenced by Win32CommandChannelThread().

00619 { 00620 BEGINRECVCSRSS(NTSTATUS, STATUS_UNSUCCESSFUL); 00621 if (!ISTS()) { 00622 errret = STATUS_ACCESS_DENIED; 00623 MSGERROR(0); 00624 } 00625 00626 /* 00627 * Probe all read arguments 00628 */ 00629 #if DBG 00630 ProbeForRead(pDisplayIOCtlData, cbDisplayIOCtlData, sizeof(BYTE)); 00631 #endif 00632 00633 retval = CtxDisplayIOCtl( 00634 DisplayIOCtlFlags, 00635 pDisplayIOCtlData, 00636 cbDisplayIOCtlData); 00637 00638 TRACE("NtUserCtxDisplayIOCtl"); 00639 ENDRECVCSRSS(); 00640 00641 }

W32KAPI BOOL NtUserDdeGetQualityOfService IN HWND  hwndClient,
IN HWND  hwndServer,
OUT PSECURITY_QUALITY_OF_SERVICE  pqos
 

Definition at line 4415 of file kernel/ntstubs.c.

References _DdeGetQualityOfService(), BEGINATOMICRECV_HWND, BOOL, DATAALIGN, ENDATOMICRECV_HWND, FALSE, GETPTI, MSGERROR, NULL, ProbeForWrite(), PtiCurrent, StubExceptionHandler, TRACE, and ValidateHWNDOPT.

Referenced by ProcessDDEMLInitiate().

04419 { 04420 04421 // 04422 // N.B. This function has implicit window handle translation. This 04423 // operation is performed in the User server API dispatcher. 04424 // 04425 04426 PWND pwndServer; 04427 PTHREADINFO ptiCurrent; 04428 SECURITY_QUALITY_OF_SERVICE qos; 04429 04430 BEGINATOMICRECV_HWND(BOOL, FALSE, hwndClient); 04431 04432 ValidateHWNDOPT(pwndServer, hwndServer); 04433 ptiCurrent = PtiCurrent(); 04434 if (GETPTI(pwnd) != ptiCurrent && pwndServer != NULL && 04435 GETPTI(pwndServer) != ptiCurrent) { 04436 MSGERROR(0); 04437 } 04438 04439 /* 04440 * Probe arguments 04441 */ 04442 try { 04443 ProbeForWrite(pqos, sizeof(*pqos), DATAALIGN); 04444 04445 } except (StubExceptionHandler(FALSE)) { 04446 MSGERROR(0); 04447 } 04448 retval = _DdeGetQualityOfService( 04449 pwnd, 04450 pwndServer, 04451 &qos); 04452 try { 04453 RtlCopyMemory(pqos, &qos, sizeof (SECURITY_QUALITY_OF_SERVICE)); 04454 } except (StubExceptionHandler(FALSE)) { 04455 MSGERROR(0); 04456 } 04457 04458 TRACE("NtUserDdeGetQualityOfService"); 04459 ENDATOMICRECV_HWND(); 04460 }

W32KAPI DWORD NtUserDdeInitialize OUT PHANDLE  phInst,
OUT HWND *  phwnd,
OUT LPDWORD  pMonFlags,
IN DWORD  afCmd,
IN PVOID  pcii
 

Definition at line 2888 of file kernel/ntstubs.c.

References BEGINRECV, DWORD, ENDRECV, hInst, HtoP, MSGERROR, ProbeAndWriteHandle, ProbeAndWriteUlong, PtiCurrent, StubExceptionHandler, TRACE, TRUE, xxxCsDdeInitialize(), and xxxDestroyThreadDDEObject().

Referenced by InternalDdeInitialize().

02894 { 02895 HANDLE hInst; 02896 HWND hwnd; 02897 DWORD MonFlags; 02898 02899 BEGINRECV(DWORD, DMLERR_INVALIDPARAMETER); 02900 02901 /* 02902 * NOTE -- pcii is a value that is passed back to the client side 02903 * for event callbacks. It is not probed because it is not used 02904 * on the kernel side. 02905 */ 02906 02907 retval = xxxCsDdeInitialize(&hInst, &hwnd, 02908 &MonFlags, afCmd, pcii); 02909 02910 /* 02911 * Probe arguments. pcii is not dereferenced in the kernel so probing 02912 * is not needed. 02913 */ 02914 if (retval == DMLERR_NO_ERROR) { 02915 try { 02916 ProbeAndWriteHandle(phInst, hInst); 02917 ProbeAndWriteHandle((PHANDLE)phwnd, hwnd); 02918 ProbeAndWriteUlong(pMonFlags, MonFlags); 02919 } except (StubExceptionHandler(TRUE)) { 02920 xxxDestroyThreadDDEObject(PtiCurrent(), HtoP(hInst)); 02921 MSGERROR(0); 02922 } 02923 } 02924 02925 TRACE("NtUserDdeInitialize"); 02926 ENDRECV(); 02927 }

W32KAPI BOOL NtUserDdeSetQualityOfService IN HWND  hwndClient,
IN CONST SECURITY_QUALITY_OF_SERVICE *  pqosNew,
OUT PSECURITY_QUALITY_OF_SERVICE pqosPrev  OPTIONAL
 

Definition at line 4369 of file kernel/ntstubs.c.

References _DdeSetQualityOfService(), BEGINRECV_HWND, BOOL, DWORD, ENDRECV_HWND, FALSE, GETPTI, MSGERROR, ProbeAndReadStructure, ProbeForWrite(), PtiCurrent, StubExceptionHandler, TRACE, and TRUE.

Referenced by ConnectConv().

04373 { 04374 SECURITY_QUALITY_OF_SERVICE qosNew, qosPrev; 04375 04376 // 04377 // N.B. This function has implicit window handle translation. This 04378 // operation is performed in the User server API dispatcher. 04379 // 04380 04381 BEGINRECV_HWND(BOOL, FALSE, hwndClient); 04382 04383 if (GETPTI(pwnd) != PtiCurrent()) { 04384 MSGERROR(0); 04385 } 04386 04387 /* 04388 * Probe arguments 04389 */ 04390 try { 04391 qosNew = ProbeAndReadStructure(pqosNew, SECURITY_QUALITY_OF_SERVICE); 04392 if (ARGUMENT_PRESENT(pqosPrev)) 04393 ProbeForWrite(pqosPrev, sizeof(*pqosPrev), sizeof(DWORD)); 04394 04395 } except (StubExceptionHandler(TRUE)) { 04396 MSGERROR(0); 04397 } 04398 04399 retval = _DdeSetQualityOfService( 04400 pwnd, 04401 &qosNew, 04402 &qosPrev); 04403 04404 try { 04405 if (ARGUMENT_PRESENT(pqosPrev)) 04406 *pqosPrev = qosPrev; 04407 } except (StubExceptionHandler(TRUE)) { 04408 MSGERROR(0); 04409 } 04410 04411 TRACE("NtUserDdeSetQualityOfService"); 04412 ENDRECV_HWND(); 04413 }

W32KAPI HANDLE NtUserDeferWindowPos IN HDWP  hWinPosInfo,
IN HWND  hwnd,
IN HWND  hwndInsertAfter,
IN int  x,
IN int  y,
IN int  cx,
IN int  cy,
IN UINT  wFlags
 

Definition at line 1761 of file kernel/ntstubs.c.

References _DeferWindowPos(), BEGINATOMICRECV, cy, ENDATOMICRECV, MSGERROR, NULL, PtoH, TESTFLAGS, TRACE, ValidateHDWP, ValidateHWNDIA, and ValidateHWNDND.

Referenced by CascadeWindowsEnum(), MDIActivateDlgSize(), TileWindowsEnum(), and xxxMDINext().

01770 { 01771 PWND pwnd; 01772 PWND pwndInsertAfter; 01773 PSMWP psmwp; 01774 01775 BEGINATOMICRECV(HANDLE, NULL); 01776 01777 TESTFLAGS(wFlags, SWP_VALID); 01778 01779 ValidateHWNDND(pwnd, hwnd); 01780 ValidateHWNDIA(pwndInsertAfter, hwndInsertAfter); 01781 ValidateHDWP(psmwp, hWinPosInfo); 01782 01783 if (wFlags & ~(SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | 01784 SWP_NOREDRAW | SWP_NOACTIVATE | SWP_FRAMECHANGED | 01785 SWP_SHOWWINDOW | SWP_HIDEWINDOW | SWP_NOCOPYBITS | 01786 SWP_NOOWNERZORDER)) { 01787 RIPERR1(ERROR_INVALID_PARAMETER, RIP_WARNING, "Invalid flags (0x%lx) passed to DeferWindowPos", 01788 wFlags); 01789 MSGERROR(0); 01790 } 01791 01792 /* 01793 * Make sure the window coordinates can fit in WORDs. 01794 */ 01795 if (!(wFlags & SWP_NOMOVE)) { 01796 if (x > SHRT_MAX) { 01797 x = SHRT_MAX; 01798 } else if (x < SHRT_MIN) { 01799 x = SHRT_MIN; 01800 } 01801 if (y > SHRT_MAX) { 01802 y = SHRT_MAX; 01803 } else if (y < SHRT_MIN) { 01804 y = SHRT_MIN; 01805 } 01806 } 01807 01808 /* 01809 * Actually, if we were going to be really strict about this we'd 01810 * make sure that x + cx < SHRT_MAX, etc but since we do maintain 01811 * signed 32-bit coords internally this case doesn't cause a problem. 01812 */ 01813 if (!(wFlags & SWP_NOSIZE)) { 01814 if (cx < 0) { 01815 cx = 0; 01816 } else if (cx > SHRT_MAX) { 01817 cx = SHRT_MAX; 01818 } 01819 if (cy < 0) { 01820 cy = 0; 01821 } else if (cy > SHRT_MAX) { 01822 cy = SHRT_MAX; 01823 } 01824 } 01825 01826 #ifdef NEVER 01827 // 01828 // do not fail these conditions because real apps use them. 01829 // 01830 if (!(wFlags & SWP_NOMOVE) && 01831 (x > SHRT_MAX || x < SHRT_MIN || 01832 y > SHRT_MAX || y < SHRT_MIN)) { 01833 RIPERR0(ERROR_INVALID_PARAMETER, RIP_WARNING, "Invalid coordinate passed to SetWindowPos"); 01834 MSGERROR(0); 01835 } 01836 01837 /* 01838 * Actually, if we were going to be really strict about this we'd 01839 * make sure that x + cx < SHRT_MAX, etc but since we do maintain 01840 * signed 32-bit coords internally this case doesn't cause a problem. 01841 */ 01842 if (!(wFlags & SWP_NOSIZE) && 01843 (cx < 0 || cx > SHRT_MAX || 01844 cy < 0 || cy > SHRT_MAX)) { 01845 RIPERR0(ERROR_INVALID_PARAMETER, RIP_WARNING, "Invalid width/height passed to SetWindowPos"); 01846 MSGERROR(0); 01847 } 01848 #endif 01849 01850 retval = _DeferWindowPos( 01851 psmwp, 01852 pwnd, 01853 pwndInsertAfter, 01854 x, 01855 y, 01856 cx, 01857 cy, 01858 wFlags); 01859 retval = PtoH((PVOID)retval); 01860 01861 TRACE("NtUserDeferWindowPos"); 01862 ENDATOMICRECV(); 01863 }

W32KAPI BOOL NtUserDefSetText IN HWND  hwnd,
IN PLARGE_STRING Text  OPTIONAL
 

W32KAPI BOOL NtUserDeleteMenu IN HMENU  hmenu,
IN UINT  nPosition,
IN UINT  dwFlags
 

Definition at line 3988 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, dwFlags, ENDRECV, FALSE, TESTFLAGS, ThreadLock, ThreadUnlock, TRACE, ValidateHMENUMODIFY, and xxxDeleteMenu().

Referenced by ChangeMenuA(), ChangeMenuW(), ECMenu(), ECSetIMEMenu(), MB_DlgProcWorker(), MDIClientWndProcWorker(), MDIRemoveSysMenu(), and MDISetMenu().

03992 { 03993 PMENU pmenu; 03994 TL tlpmenu; 03995 03996 BEGINRECV(BOOL, FALSE); 03997 03998 TESTFLAGS(dwFlags, MF_VALID); 03999 04000 ValidateHMENUMODIFY(pmenu, hmenu); 04001 ThreadLock(pmenu, &tlpmenu); 04002 retval = xxxDeleteMenu( 04003 pmenu, 04004 nPosition, 04005 dwFlags); 04006 ThreadUnlock(&tlpmenu); 04007 04008 TRACE("NtUserDeleteMenu"); 04009 ENDRECV(); 04010 }

W32KAPI BOOL NtUserDestroyAcceleratorTable IN HACCEL  hAccel  ) 
 

Definition at line 4012 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, HMFreeObject(), HMMarkObjectDestroy(), TRACE, TRUE, and ValidateHACCEL.

Referenced by DestroyAcceleratorTable().

04014 { 04015 LPACCELTABLE pat; 04016 04017 BEGINRECV(BOOL, FALSE); 04018 04019 ValidateHACCEL(pat, hAccel); 04020 04021 /* 04022 * Mark the object for destruction - if it says it's ok to free, 04023 * then free it. 04024 */ 04025 if (HMMarkObjectDestroy(pat)) 04026 HMFreeObject(pat); 04027 retval = TRUE; 04028 04029 TRACE("NtUserDestroyAcceleratorTable"); 04030 ENDRECV(); 04031 }

W32KAPI BOOL NtUserDestroyCursor IN HCURSOR  hcurs,
IN DWORD  cmd
 

Definition at line 4033 of file kernel/ntstubs.c.

References _DestroyCursor(), BEGINATOMICRECV, BOOL, ENDATOMICRECV, FALSE, TRACE, and ValidateHCURSOR.

Referenced by CopyIcoCur(), CreateAniIcon(), CreateIcoCur(), CreateIcoCurIndirect(), CreateIconIndirect(), DestroyCursor(), LoadAniIcon(), and StaticWndProcWorker().

04036 { 04037 PCURSOR pcurs; 04038 04039 BEGINATOMICRECV(BOOL, FALSE); 04040 04041 ValidateHCURSOR(pcurs, hcurs); 04042 04043 retval = _DestroyCursor( 04044 pcurs, cmd); 04045 04046 TRACE("NtUserDestroyCursor"); 04047 ENDATOMICRECV(); 04048 }

W32KAPI BOOL NtUserDestroyMenu IN HMENU  hmenu  ) 
 

Definition at line 4100 of file kernel/ntstubs.c.

References _DestroyMenu(), BEGINATOMICRECV, BOOL, ENDATOMICRECV, FALSE, TRACE, and ValidateHMENUMODIFY.

Referenced by ECMenu(), HelpMenu(), InternalCreateDialog(), MDICompleteChildCreation(), MenuLoadChicagoTemplates(), and MenuLoadWinTemplates().

04102 { 04103 PMENU pmenu; 04104 04105 BEGINATOMICRECV(BOOL, FALSE); 04106 04107 ValidateHMENUMODIFY(pmenu, hmenu); 04108 04109 retval = _DestroyMenu(pmenu); 04110 04111 TRACE("NtUserDestroyMenu"); 04112 ENDATOMICRECV(); 04113 }

W32KAPI BOOL NtUserDestroyWindow IN HWND  hwnd  ) 
 

Definition at line 4115 of file kernel/ntstubs.c.

References BEGINRECV_HWND, BOOL, DWORD, ENDRECV_HWND, TRACE, and xxxDestroyWindow().

Referenced by ConnectConv(), DdeUninitialize(), DestroyIMEUI(), DialogBox2(), InternalCreateDialog(), InternalDdeInitialize(), ProcessDDEMLInitiate(), ReaderFeedback(), ReaderWndProc(), UnlinkConvFromOthers(), xxxCBNcDestroyHandler(), and xxxMDIDestroy().

04117 { 04118 04119 // 04120 // N.B. This function has implicit window handle translation. This 04121 // operation is performed in the User server API dispatcher. 04122 // 04123 04124 BEGINRECV_HWND(DWORD, 0, hwnd); 04125 04126 retval = xxxDestroyWindow(pwnd); 04127 04128 TRACE("NtUserDestroyWindow"); 04129 ENDRECV_HWND(); 04130 }

W32KAPI LRESULT NtUserDispatchMessage IN CONST MSG *  pmsg  ) 
 

Definition at line 4132 of file kernel/ntstubs.c.

References BEGINRECV, ENDRECV, msg, MSGERROR, ProbeAndReadMessage, StubExceptionHandler, TRACE, TRUE, and xxxDispatchMessage().

Referenced by DispatchMessageWorker().

04134 { 04135 MSG msg; 04136 04137 BEGINRECV(LRESULT, 0); 04138 04139 /* 04140 * Probe arguments 04141 */ 04142 try { 04143 msg = ProbeAndReadMessage(pmsg); 04144 } except (StubExceptionHandler(TRUE)) { 04145 MSGERROR(0); 04146 } 04147 04148 retval = xxxDispatchMessage(&msg); 04149 04150 TRACE("NtUserDispatchMessage"); 04151 ENDRECV(); 04152 }

W32KAPI BOOL NtUserDragDetect IN HWND  hwnd,
IN POINT  pt
 

Definition at line 8535 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, BOOL, DWORD, ENDRECV_HWNDLOCK, TRACE, and xxxDragDetect().

Referenced by xxxTrackMouse().

08538 { 08539 08540 // 08541 // N.B. This function has implicit window translation and thread locking 08542 // enabled. These operations are performed in the User server API 08543 // dispatcher. 08544 // 08545 08546 BEGINRECV_HWNDLOCK(DWORD, 0, hwnd); 08547 08548 retval = xxxDragDetect(pwnd, pt); 08549 08550 TRACE("NtUserDragDetect"); 08551 ENDRECV_HWNDLOCK(); 08552 }

W32KAPI DWORD NtUserDragObject IN HWND  hwndParent,
IN HWND  hwndFrom,
IN UINT  wFmt,
IN ULONG_PTR  dwData,
IN HCURSOR  hcur
 

Definition at line 1552 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, DWORD, ENDRECV_HWNDLOCK, ThreadLockWithPti, ThreadUnlock, TRACE, ValidateHCURSOROPT, ValidateHWNDOPT, and xxxDragObject().

01558 { 01559 01560 // 01561 // N.B. This function has implicit window translation and thread locking 01562 // enabled. These operations are performed in the User server API 01563 // dispatcher. 01564 // 01565 01566 PWND pwndFrom; 01567 PCURSOR pcur; 01568 TL tlpwndFrom; 01569 TL tlpcur; 01570 01571 BEGINRECV_HWNDLOCK(DWORD, 0, hwndParent); 01572 01573 ValidateHWNDOPT(pwndFrom, hwndFrom); 01574 ValidateHCURSOROPT(pcur, hcur); 01575 01576 ThreadLockWithPti(ptiCurrent, pwndFrom, &tlpwndFrom); 01577 ThreadLockWithPti(ptiCurrent, pcur, &tlpcur); 01578 01579 retval = xxxDragObject( 01580 pwnd, 01581 pwndFrom, 01582 wFmt, 01583 dwData, 01584 pcur); 01585 01586 ThreadUnlock(&tlpcur); 01587 ThreadUnlock(&tlpwndFrom); 01588 01589 TRACE("NtUserDragObject"); 01590 ENDRECV_HWNDLOCK(); 01591 }

W32KAPI BOOL NtUserDrawAnimatedRects IN HWND  hwnd,
IN int  idAni,
IN CONST RECT *  lprcFrom,
IN CONST RECT *  lprcTo
 

Definition at line 4812 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, MSGERROR, ProbeAndReadRect, StubExceptionHandler, ThreadLock, ThreadUnlock, TRACE, TRUE, ValidateHWNDOPT, and xxxDrawAnimatedRects().

04817 { 04818 PWND pwnd; 04819 TL tlpwnd; 04820 RECT rcFrom; 04821 RECT rcTo; 04822 04823 BEGINRECV(BOOL, FALSE); 04824 04825 ValidateHWNDOPT(pwnd, hwnd); 04826 04827 /* 04828 * Probe arguments 04829 */ 04830 try { 04831 rcFrom = ProbeAndReadRect(lprcFrom); 04832 rcTo = ProbeAndReadRect(lprcTo); 04833 } except (StubExceptionHandler(TRUE)) { 04834 MSGERROR(0); 04835 } 04836 04837 ThreadLock(pwnd, &tlpwnd); 04838 04839 retval = xxxDrawAnimatedRects( 04840 pwnd, 04841 idAni, 04842 &rcFrom, 04843 &rcTo 04844 ); 04845 04846 ThreadUnlock(&tlpwnd); 04847 04848 TRACE("NtUserDrawAnimatedRects"); 04849 ENDRECV(); 04850 }

W32KAPI BOOL NtUserDrawCaption IN HWND  hwnd,
IN HDC  hdc,
IN CONST RECT *  lprc,
IN UINT  flags
 

Definition at line 4852 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, BOOL, DWORD, ENDRECV_HWNDLOCK, FALSE, MSGERROR, NULL, ProbeAndReadRect, StubExceptionHandler, TRACE, TRUE, and xxxDrawCaptionTemp().

Referenced by DrawCaption().

04857 { 04858 RECT rc; 04859 04860 // 04861 // N.B. This function has implicit window translation and thread locking 04862 // enabled. These operations are performed in the User server API 04863 // dispatcher. 04864 // 04865 04866 BEGINRECV_HWNDLOCK(DWORD, FALSE, hwnd); 04867 04868 /* 04869 * Probe arguments 04870 */ 04871 try { 04872 rc = ProbeAndReadRect(lprc); 04873 } except (StubExceptionHandler(TRUE)) { 04874 MSGERROR(0); 04875 } 04876 04877 retval = xxxDrawCaptionTemp(pwnd, hdc, &rc, NULL, NULL, NULL, flags); 04878 04879 TRACE("NtUserDrawCaption"); 04880 ENDRECV_HWNDLOCK(); 04881 }

W32KAPI BOOL NtUserDrawCaptionTemp IN HWND  hwnd,
IN HDC  hdc,
IN LPCRECT  lprc,
IN HFONT  hFont,
IN HICON  hicon,
IN PUNICODE_STRING  pstrText,
IN UINT  flags
 

Definition at line 9490 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, CHARALIGN, CLEANUPRECV, DWORD, ENDRECV, ExRaiseStatus(), FALSE, MSGERRORCLEANUP, NULL, ProbeAndReadRect, ProbeAndReadUnicodeString, ProbeForRead, PtiCurrent, StubExceptionHandler, ThreadLockPool, ThreadLockWithPti, ThreadUnlock, ThreadUnlockAndFreePool, TRACE, TRUE, ValidateHCURSOROPT, ValidateHWNDOPT, and xxxDrawCaptionTemp().

Referenced by DrawCaptionTemp().

09498 { 09499 PCURSOR pcur; 09500 TL tlpcur; 09501 RECT rc; 09502 UNICODE_STRING strCapture; 09503 PWND pwnd; 09504 TL tlpwnd; 09505 PTHREADINFO ptiCurrent; 09506 TL tlBuffer; 09507 BOOL fFreeBuffer = FALSE; 09508 09509 BEGINRECV(DWORD, FALSE); 09510 09511 ptiCurrent = PtiCurrent(); 09512 09513 ValidateHWNDOPT(pwnd, hwnd); 09514 ValidateHCURSOROPT(pcur, hIcon); 09515 09516 /* 09517 * Probe and capture arguments. Capturing the text is ugly, 09518 * but must be done because it is passed to GDI. 09519 */ 09520 try { 09521 rc = ProbeAndReadRect(lprc); 09522 strCapture = ProbeAndReadUnicodeString(pstrText); 09523 if (strCapture.Buffer != NULL) { 09524 PWSTR pszCapture = strCapture.Buffer; 09525 ProbeForRead(strCapture.Buffer, strCapture.Length, CHARALIGN); 09526 strCapture.Buffer = UserAllocPoolWithQuota(strCapture.Length+sizeof(UNICODE_NULL), TAG_TEXT); 09527 if (strCapture.Buffer != NULL) { 09528 fFreeBuffer = TRUE; 09529 ThreadLockPool(ptiCurrent, strCapture.Buffer, &tlBuffer); 09530 RtlCopyMemory(strCapture.Buffer, pszCapture, strCapture.Length); 09531 strCapture.Buffer[strCapture.Length/sizeof(WCHAR)]=0; // null-terminate string 09532 strCapture.MaximumLength = strCapture.Length+sizeof(UNICODE_NULL); 09533 pstrText = &strCapture; 09534 } else { 09535 ExRaiseStatus(STATUS_NO_MEMORY); 09536 } 09537 } 09538 } except (StubExceptionHandler(FALSE)) { 09539 MSGERRORCLEANUP(0); 09540 } 09541 09542 ThreadLockWithPti(ptiCurrent, pwnd, &tlpwnd); 09543 ThreadLockWithPti(ptiCurrent, pcur, &tlpcur); 09544 09545 retval = xxxDrawCaptionTemp( 09546 pwnd, 09547 hdc, 09548 &rc, 09549 hFont, 09550 pcur, 09551 strCapture.Buffer ? &strCapture : NULL, 09552 flags); 09553 09554 ThreadUnlock(&tlpcur); 09555 ThreadUnlock(&tlpwnd); 09556 09557 CLEANUPRECV(); 09558 if (fFreeBuffer) 09559 ThreadUnlockAndFreePool(ptiCurrent, &tlBuffer); 09560 09561 TRACE("NtUserDrawCaptionTemp"); 09562 ENDRECV(); 09563 }

W32KAPI BOOL NtUserDrawIconEx IN HDC  hdc,
IN int  x,
IN int  y,
IN HICON  hicon,
IN int  cx,
IN int  cy,
IN UINT  istepIfAniCur,
IN HBRUSH  hbrush,
IN UINT  diFlags,
IN BOOL  fMeta,
OUT DRAWICONEXDATA pdid
 

Definition at line 1710 of file kernel/ntstubs.c.

References _DrawIconEx(), BEGINATOMICRECV, BOOL, CURSORF_ACON, cy, DATAALIGN, DRAWICONEXDATA, ENDATOMICRECV, FALSE, MSGERROR, ProbeForWrite(), StubExceptionHandler, TRACE, TRUE, and ValidateHICON.

Referenced by DrawIconEx().

01722 { 01723 PCURSOR picon; 01724 01725 BEGINATOMICRECV(BOOL, FALSE); 01726 01727 ValidateHICON(picon, hicon); 01728 01729 if (fMeta) { 01730 if (picon->CURSORF_flags & CURSORF_ACON) 01731 picon = ((PACON)picon)->aspcur[((PACON)picon)->aicur[0]]; 01732 01733 /* 01734 * Probe arguments 01735 */ 01736 try { 01737 ProbeForWrite(pdid, sizeof(*pdid), DATAALIGN); 01738 01739 pdid->hbmMask = picon->hbmMask; 01740 pdid->hbmColor = picon->hbmColor; 01741 01742 pdid->cx = cx ? cx : picon->cx ; 01743 pdid->cy = cy ? cy : picon->cy ; 01744 01745 retval = 1; 01746 } except (StubExceptionHandler(TRUE)) { 01747 MSGERROR(0); 01748 } 01749 01750 } else { 01751 retval = _DrawIconEx(hdc, x, y, picon, 01752 cx, cy, 01753 istepIfAniCur, hbrush, 01754 diFlags ); 01755 } 01756 01757 TRACE("NtUserDrawIconEx"); 01758 ENDATOMICRECV(); 01759 }

W32KAPI int NtUserDrawMenuBarTemp IN HWND  hwnd,
IN HDC  hdc,
IN LPCRECT  lprc,
IN HMENU  hMenu,
IN HFONT  hFont
 

Definition at line 9444 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, ENDRECV_HWNDLOCK, FALSE, MSGERROR, ProbeAndReadRect, StubExceptionHandler, ThreadLockAlwaysWithPti, ThreadUnlock, TRACE, ValidateHMENU, and xxxDrawMenuBarTemp().

Referenced by DrawMenuBarTemp().

09450 { 09451 // 09452 // N.B. This function has implicit window translation and thread locking 09453 // enabled. These operations are performed in the User server API 09454 // dispatcher. 09455 // 09456 09457 PMENU pMenu; 09458 TL tlpMenu; 09459 RECT rc; 09460 09461 09462 BEGINRECV_HWNDLOCK(int, 0, hwnd); 09463 09464 /* 09465 * Probe and capture arguments. 09466 */ 09467 try { 09468 rc = ProbeAndReadRect(lprc); 09469 } except (StubExceptionHandler(FALSE)) { 09470 MSGERROR(0); 09471 } 09472 09473 ValidateHMENU(pMenu, hMenu); 09474 09475 ThreadLockAlwaysWithPti(ptiCurrent, pMenu, &tlpMenu); 09476 09477 retval = xxxDrawMenuBarTemp( 09478 pwnd, 09479 hdc, 09480 &rc, 09481 pMenu, 09482 hFont); 09483 09484 ThreadUnlock(&tlpMenu); 09485 09486 TRACE("NtUserDrawMenuBarTemp"); 09487 ENDRECV_HWNDLOCK(); 09488 }

W32KAPI BOOL NtUserEmptyClipboard VOID   ) 
 

Definition at line 3263 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, NULL, TRACE, and xxxEmptyClipboard().

Referenced by ECCopy(), and MB_CopyToClipboard().

03265 { 03266 BEGINRECV(BOOL, FALSE); 03267 03268 retval = xxxEmptyClipboard(NULL); 03269 03270 TRACE("NtUserEmptyClipboard"); 03271 ENDRECV(); 03272 }

W32KAPI BOOL NtUserEnableMenuItem IN HMENU  hMenu,
IN UINT  wIDEnableItem,
IN UINT  wEnable
 

Definition at line 4154 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, TESTFLAGS, ThreadLockAlways, ThreadUnlock, TRACE, ValidateHMENUMODIFY, and xxxEnableMenuItem().

Referenced by EnableMenuItem().

04158 { 04159 PMENU pmenu; 04160 TL tlmenu; 04161 04162 BEGINRECV(BOOL, -1); 04163 04164 TESTFLAGS(wEnable, MF_VALID); 04165 04166 ValidateHMENUMODIFY(pmenu, hMenu); 04167 04168 ThreadLockAlways(pmenu, &tlmenu); 04169 retval = xxxEnableMenuItem( 04170 pmenu, 04171 wIDEnableItem, 04172 wEnable); 04173 ThreadUnlock(&tlmenu); 04174 04175 TRACE("NtUserEnableMenuItem"); 04176 ENDRECV(); 04177 }

W32KAPI BOOL NtUserEnableScrollBar IN HWND  hwnd,
IN UINT  wSBflags,
IN UINT  wArrows
 

Definition at line 4344 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK_ND, BOOL, ENDRECV_HWNDLOCK_ND, FALSE, LIMITVALUE, TRACE, and xxxEnableScrollBar().

04348 { 04349 04350 // 04351 // N.B. This function has implicit window translation and thread locking 04352 // enabled. These operations are performed in the User server API 04353 // dispatcher. 04354 // 04355 04356 BEGINRECV_HWNDLOCK_ND(BOOL, FALSE, hwnd); 04357 04358 LIMITVALUE(wSBflags, SB_MAX, "EnableScrollBar"); 04359 04360 retval = xxxEnableScrollBar( 04361 pwndND, 04362 wSBflags, 04363 wArrows); 04364 04365 TRACE("NtUserEnableScrollBar"); 04366 ENDRECV_HWNDLOCK_ND(); 04367 }

W32KAPI BOOL NtUserEndDeferWindowPosEx IN HDWP  hWinPosInfo,
IN BOOL  fAsync
 

Definition at line 1865 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, ThreadLockAlways, ThreadUnlock, TRACE, ValidateHDWP, and xxxEndDeferWindowPosEx().

Referenced by ArrangeWindows(), EndDeferWindowPos(), MDIActivateDlgSize(), and xxxMDINext().

01868 { 01869 PSMWP psmwp; 01870 TL tlpsmp; 01871 01872 BEGINRECV(BOOL, FALSE); 01873 01874 ValidateHDWP(psmwp, hWinPosInfo); 01875 01876 ThreadLockAlways(psmwp, &tlpsmp); 01877 01878 retval = xxxEndDeferWindowPosEx( 01879 psmwp, 01880 fAsync); 01881 01882 ThreadUnlock(&tlpsmp); 01883 01884 TRACE("NtUserEndDeferWindowPosEx"); 01885 ENDRECV(); 01886 }

W32KAPI BOOL NtUserEndMenu VOID   ) 
 

Definition at line 5008 of file kernel/ntstubs.c.

References _PostMessage(), BEGINRECV, BOOL, ENDRECV, FALSE, tagMENUSTATE::fInsideMenuLoop, GetMenuStateWindow(), NULL, tagTHREADINFO::pMenuState, PtiCurrent, TRACEVOID, and TRUE.

05009 { 05010 PTHREADINFO ptiCurrent; 05011 PWND pwnd; 05012 05013 BEGINRECV(BOOL, FALSE); 05014 05015 ptiCurrent = PtiCurrent(); 05016 05017 /* 05018 * The menu might be in the middle of some callback, so calling xxxEndMenu 05019 * directly might screw things up. So we post it a message to signal it to 05020 * go away at a good moment 05021 */ 05022 if (ptiCurrent->pMenuState != NULL) { 05023 pwnd = GetMenuStateWindow(ptiCurrent->pMenuState); 05024 05025 if (pwnd != NULL) { 05026 _PostMessage(pwnd, MN_ENDMENU, 0, 0); 05027 } else { 05028 /* 05029 * Is this menu messed up? 05030 */ 05031 UserAssert(pwnd != NULL); 05032 ptiCurrent->pMenuState->fInsideMenuLoop = FALSE; 05033 } 05034 } 05035 05036 retval = TRUE; 05037 05038 TRACEVOID("NtUserEndMenu"); 05039 ENDRECV(); 05040 }

W32KAPI BOOL NtUserEndPaint IN HWND  hwnd,
IN CONST PAINTSTRUCT *  lpPaint
 

Definition at line 6575 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, BOOL, ENDRECV_HWNDLOCK, FALSE, MSGERROR, ProbeAndReadPaintStruct, StubExceptionHandler, TRACE, TRUE, and xxxEndPaint().

Referenced by ButtonWndProcWorker(), ComboBoxWndProcWorker(), ListBoxWndProcWorker(), MLEditWndProc(), SLEditWndProc(), and StaticWndProcWorker().

06578 { 06579 PAINTSTRUCT ps; 06580 06581 // 06582 // N.B. This function has implicit window handle translation. This 06583 // operation is performed in the User server API dispatcher. 06584 // 06585 06586 BEGINRECV_HWNDLOCK(BOOL, FALSE, hwnd); 06587 06588 /* 06589 * Probe arguments 06590 */ 06591 try { 06592 ps = ProbeAndReadPaintStruct(lpPaint); 06593 } except (StubExceptionHandler(TRUE)) { 06594 MSGERROR(0); 06595 } 06596 06597 retval = xxxEndPaint(pwnd, &ps); 06598 06599 TRACE("NtUserEndPaint"); 06600 ENDRECV_HWNDLOCK(); 06601 }

W32KAPI NTSTATUS NtUserEnumDisplayDevices IN PUNICODE_STRING  pstrDeviceName,
IN DWORD  iDevNum,
IN OUT LPDISPLAY_DEVICEW  lpDisplayDevice,
IN DWORD  dwFlags
 

Definition at line 9312 of file kernel/ntstubs.c.

References BEGINRECV, dwFlags, ENDRECV, FALSE, gpDispInfo, tagMONITOR::hDev, NTSTATUS(), tagDISPLAYINFO::pmdev, tagDISPLAYINFO::pMonitorPrimary, TRACE, TRUE, UserMode, and xxxUserResetDisplayDevice().

Referenced by EnumDisplayDevices().

09317 { 09318 BEGINRECV(NTSTATUS, STATUS_UNSUCCESSFUL); 09319 09320 // 09321 // Update the list of devices. 09322 // If the function returns FALSE (retry update), then we must 09323 // disable the current hdev, call back, and reanable the hdev. 09324 // 09325 09326 if (DrvUpdateGraphicsDeviceList(FALSE, FALSE) == FALSE) { 09327 09328 if (DrvDisableMDEV(gpDispInfo->pmdev, TRUE)) { 09329 09330 DrvUpdateGraphicsDeviceList(TRUE, FALSE); 09331 09332 DrvEnableMDEV(gpDispInfo->pmdev, TRUE); 09333 09334 // 09335 // Repaint the screen 09336 // 09337 09338 xxxUserResetDisplayDevice(); 09339 } 09340 } 09341 09342 /* 09343 * Address checking, etc., occurs in GRE. 09344 */ 09345 09346 retval = DrvEnumDisplayDevices(pstrDeviceName, 09347 gpDispInfo->pMonitorPrimary->hDev, 09348 iDevNum, 09349 lpDisplayDevice, 09350 dwFlags, 09351 UserMode); 09352 TRACE("NtUserEnumDisplayDevices"); 09353 ENDRECV(); 09354 }

W32KAPI BOOL NtUserEnumDisplayMonitors IN HDC  hdc,
IN LPCRECT  lprcClip,
IN MONITORENUMPROC  lpfnEnum,
IN LPARAM  dwData
 

Definition at line 13138 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, MSGERROR, ProbeAndReadRect, StubExceptionHandler, TRACE, TRUE, and xxxEnumDisplayMonitors().

Referenced by ArrangeWindows().

13143 { 13144 RECT rc; 13145 LPRECT lprc = (LPRECT) lprcClip; 13146 13147 BEGINRECV(BOOL, FALSE); 13148 13149 /* 13150 * Probe arguments 13151 */ 13152 if (ARGUMENT_PRESENT(lprc)) { 13153 try { 13154 rc = ProbeAndReadRect(lprc); 13155 lprc = &rc; 13156 } except (StubExceptionHandler(TRUE)) { 13157 MSGERROR(0); 13158 } 13159 } 13160 13161 retval = xxxEnumDisplayMonitors( 13162 hdc, 13163 lprc, 13164 lpfnEnum, 13165 dwData, 13166 FALSE); 13167 13168 TRACE("NtUserEnumDisplayMonitors"); 13169 ENDRECV(); 13170 }

W32KAPI NTSTATUS NtUserEnumDisplaySettings IN PUNICODE_STRING  pstrDeviceName,
IN DWORD  iModeNum,
OUT LPDEVMODEW  lpDevMode,
IN DWORD  dwFlags
 

Definition at line 9357 of file kernel/ntstubs.c.

References BEGINRECV, dwFlags, ENDRECV, gpDispInfo, tagMONITOR::hDev, NTSTATUS(), tagDISPLAYINFO::pMonitorPrimary, and TRACE.

Referenced by EnumDisplaySettingsEx(), and InitializeFullScreen().

09362 { 09363 BEGINRECV(NTSTATUS, STATUS_UNSUCCESSFUL); 09364 09365 /* 09366 * Address checking, etc., occurs in GRE. 09367 */ 09368 09369 retval = DrvEnumDisplaySettings(pstrDeviceName, 09370 gpDispInfo->pMonitorPrimary->hDev, 09371 iModeNum, 09372 lpDevMode, 09373 dwFlags); 09374 09375 TRACE("NtUserEnumDisplaySettings"); 09376 ENDRECV(); 09377 }

W32KAPI DWORD NtUserEvent IN PEVENT_PACKET  pep  ) 
 

Definition at line 2956 of file kernel/ntstubs.c.

References BEGINRECV, DATAALIGN, DWORD, ENDRECV, FALSE, MSGERROR, pep, ProbeForRead, StubExceptionHandler, TRACE, and xxxCsEvent().

Referenced by Event().

02958 { 02959 WORD cbEventData; 02960 BEGINRECV(DWORD, 0); 02961 02962 /* 02963 * Probe arguments 02964 */ 02965 try { 02966 ProbeForRead(pep, sizeof(*pep), DATAALIGN); 02967 /* 02968 * capture so that another thread can't change it after the probe. 02969 */ 02970 cbEventData = pep->cbEventData; 02971 ProbeForRead(&pep->Data, cbEventData, DATAALIGN); 02972 } except (StubExceptionHandler(FALSE)) { 02973 MSGERROR(0); 02974 } 02975 02976 /* 02977 * The buffer is captured within a try/except in xxxCsEvent. 02978 */ 02979 02980 retval = xxxCsEvent((PEVENT_PACKET)pep, cbEventData); 02981 02982 TRACE("NtUserEvent"); 02983 ENDRECV(); 02984 }

W32KAPI int NtUserExcludeUpdateRgn IN HDC  hDC,
IN HWND  hwnd
 

Definition at line 6603 of file kernel/ntstubs.c.

References _ExcludeUpdateRgn(), BEGINRECV_HWND, ENDRECV_HWND, MSGERROR, NULL, and TRACE.

06606 { 06607 06608 // 06609 // N.B. This function has implicit window handle translation. This 06610 // operation is performed in the User server API dispatcher. 06611 // 06612 06613 BEGINRECV_HWND(int, ERROR, hwnd); 06614 06615 if (hdc == NULL) 06616 MSGERROR(0); 06617 06618 retval = _ExcludeUpdateRgn(hdc, pwnd); 06619 06620 TRACE("NtUserExcludeUpdateRgn"); 06621 ENDRECV_HWND(); 06622 }

W32KAPI BOOL NtUserFillWindow IN HWND  hwndBrush,
IN HWND  hwndPaint,
IN HDC  hdc,
IN HBRUSH  hbr
 

Definition at line 2986 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, BOOL, DWORD, ENDRECV_HWNDLOCK, MSGERROR, NULL, ThreadLockWithPti, ThreadUnlock, TRACE, ValidateHWNDOPT, and xxxFillWindow().

02991 { 02992 02993 // 02994 // N.B. This function has implicit window translation and thread locking 02995 // enabled. These operations are performed in the User server API 02996 // dispatcher. 02997 // 02998 02999 PWND pwndBrush; 03000 TL tlpwndBrush; 03001 03002 BEGINRECV_HWNDLOCK(DWORD, 0, hwndPaint); 03003 03004 if (hdc == NULL) 03005 MSGERROR(0); 03006 03007 ValidateHWNDOPT(pwndBrush, hwndBrush); 03008 03009 ThreadLockWithPti(ptiCurrent, pwndBrush, &tlpwndBrush); 03010 03011 retval = xxxFillWindow( 03012 pwndBrush, 03013 pwnd, 03014 hdc, 03015 hbr); 03016 03017 ThreadUnlock(&tlpwndBrush); 03018 03019 TRACE("NtUserFillWindow"); 03020 ENDRECV_HWNDLOCK(); 03021 }

W32KAPI HCURSOR NtUserFindExistingCursorIcon IN PUNICODE_STRING  pstrModName,
IN PUNICODE_STRING  pstrResName,
IN PCURSORFIND  pcfSearch
 

Definition at line 7243 of file kernel/ntstubs.c.

References _FindExistingCursorIcon(), BEGINRECV_SHARED, CURSORFIND, ENDRECV_SHARED, tagCURSORFIND::hcur, MSGERROR, NULL, ProbeAndReadCursorFind, ProbeAndReadUnicodeString, ProbeForReadUnicodeStringBuffer, ProbeForReadUnicodeStringBufferOrId, PtoH, StubExceptionHandler, TRACE, TRUE, UserFindAtom(), and ValidateHCURSOROPT.

Referenced by FindExistingCursorIcon().

07247 { 07248 ATOM atomModName; 07249 UNICODE_STRING strModName; 07250 UNICODE_STRING strResName; 07251 PCURSOR pcurSrc; 07252 CURSORFIND cfSearch; 07253 07254 BEGINRECV_SHARED(HCURSOR, NULL); 07255 07256 /* 07257 * Probe arguments 07258 */ 07259 try { 07260 07261 cfSearch = ProbeAndReadCursorFind(pcfSearch); 07262 07263 ValidateHCURSOROPT(pcurSrc, cfSearch.hcur); 07264 07265 strModName = ProbeAndReadUnicodeString(pstrModName); 07266 ProbeForReadUnicodeStringBuffer(strModName); 07267 07268 strResName = ProbeAndReadUnicodeString(pstrResName); 07269 ProbeForReadUnicodeStringBufferOrId(strResName); 07270 07271 } except (StubExceptionHandler(TRUE)) { 07272 MSGERROR(0); 07273 } 07274 07275 /* 07276 * The ModName buffer is client-side, but UserFindAtom protects 07277 * access. 07278 */ 07279 07280 atomModName = UserFindAtom(strModName.Buffer); 07281 07282 if (atomModName) { 07283 07284 /* 07285 * The ResName buffer is client-side. FindExistincCursorIcon 07286 * protects access. 07287 */ 07288 retval = (HCURSOR)_FindExistingCursorIcon(atomModName, 07289 &strResName, 07290 pcurSrc, 07291 &cfSearch); 07292 07293 retval = (HCURSOR)PtoH((PCURSOR)retval); 07294 07295 } else { 07296 07297 retval = 0; 07298 } 07299 07300 07301 TRACE("NtUserFindExistingCursorIcon"); 07302 ENDRECV_SHARED(); 07303 }

W32KAPI HWND NtUserFindWindowEx IN HWND  hwndParent,
IN HWND  hwndChild,
IN PUNICODE_STRING pstrClassName  OPTIONAL,
IN PUNICODE_STRING pstrWindowName  OPTIONAL,
IN DWORD  dwType
 

W32KAPI BOOL NtUserFlashWindowEx IN PFLASHWINFO  pfwi  ) 
 

Definition at line 13325 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, DBG_THREADLOCK_END, DBG_THREADLOCK_START, ENDRECV, FALSE, FlashWindowEx, MSGERROR, NULL, ProbeAndReadStructure, PtiCurrent, StubExceptionHandler, ThreadLockAlwaysWithPti, ThreadUnlock, TRACE, TRUE, ValidateHwnd, and xxxFlashWindow().

Referenced by FlashWindow().

13327 { 13328 FLASHWINFO fwiInternal; 13329 TL tlpwnd; 13330 PWND pwnd; 13331 13332 BEGINRECV(BOOL, FALSE); 13333 DBG_THREADLOCK_START(FlashWindowEx); 13334 13335 /* 13336 * Probe arguments 13337 */ 13338 try { 13339 fwiInternal = ProbeAndReadStructure(pfwi, FLASHWINFO); 13340 13341 } except (StubExceptionHandler(TRUE)) { 13342 MSGERROR(0); 13343 } 13344 13345 if ((pwnd = ValidateHwnd(fwiInternal.hwnd)) == NULL || 13346 fwiInternal.cbSize != sizeof(FLASHWINFO) || 13347 fwiInternal.dwFlags & ~FLASHW_VALID) { 13348 13349 RIPMSG0(RIP_WARNING, "NtUserFlashWindowEx: Invalid Parameter"); 13350 MSGERROR(ERROR_INVALID_PARAMETER); 13351 } 13352 else { 13353 ThreadLockAlwaysWithPti(PtiCurrent(), pwnd, &tlpwnd); 13354 retval = xxxFlashWindow(pwnd, 13355 MAKELONG(fwiInternal.dwFlags, fwiInternal.uCount), 13356 fwiInternal.dwTimeout); 13357 ThreadUnlock(&tlpwnd); 13358 } 13359 13360 DBG_THREADLOCK_END(FlashWindowEx); 13361 13362 TRACE("NtUserFlashWindowEx"); 13363 ENDRECV(); 13364 }

W32KAPI BOOL NtUserGetAltTabInfo IN HWND  hwnd,
IN int  iItem,
IN OUT PALTTABINFO  pati,
OUT LPWSTR  lpszItemText,
IN UINT  cchItemText,
IN BOOL  bAnsi
 

W32KAPI HWND NtUserGetAncestor IN HWND  hwnd,
IN UINT  gaFlags
 

Definition at line 3698 of file kernel/ntstubs.c.

References _GetAncestor(), BEGINRECV_HWND_SHARED, ENDRECV_HWND_SHARED, MSGERROR, NULL, PtoH, and TRACE.

03699 { 03700 BEGINRECV_HWND_SHARED(HWND, NULL, hwndChild); 03701 03702 if ((gaFlags < GA_MIN) || (gaFlags > GA_MAX)) { 03703 RIPERR3(ERROR_INVALID_PARAMETER, RIP_WARNING, 03704 "NtUserGetAncestor: Invalid gaFlags parameter %d, not %d - %d", 03705 gaFlags, GA_MIN, GA_MAX); 03706 MSGERROR(0); 03707 } 03708 retval = (HWND)_GetAncestor(pwnd, gaFlags); 03709 retval = PtoH((PVOID)retval); 03710 03711 TRACE("NtUserGetAncestor"); 03712 ENDRECV_HWND_SHARED(); 03713 }

W32KAPI SHORT NtUserGetAsyncKeyState IN int  vKey  ) 
 

Definition at line 4907 of file kernel/ntstubs.c.

References _GetAsyncKeyState(), _CLIENTINFO::afAsyncKeyState, _CLIENTINFO::afAsyncKeyStateRecentDown, tagTHREADINFO::amdesk, BEGINRECV_SHARED, CBASYNCKEYCACHE, _CLIENTINFO::dwAsyncKeyCache, tagWINDOWSTATION::dwWSF_Flags, ENDRECV_SHARED, gafAsyncKeyState, gafAsyncKeyStateRecentDown, gpsi, gptiForeground, grpdeskRitInput, MSGERROR, NULL, tagTHREADINFO::pClientInfo, tagTHREADINFO::ppi, PpiCurrent, PtiCurrentShared, tagTHREADINFO::rpdesk, tagDESKTOP::rpwinstaParent, RtlAreAnyAccessesGranted(), SHORT, TRACE, and WSF_NOIO.

Referenced by GetAsyncKeyState().

04909 { 04910 04911 PTHREADINFO ptiCurrent; 04912 BEGINRECV_SHARED(SHORT, 0); 04913 04914 04915 ptiCurrent = PtiCurrentShared(); 04916 UserAssert(ptiCurrent); 04917 04918 /* 04919 * Don't allow other processes to spy on other deskops or a process 04920 * to spy on the foreground if the desktop does not allow input spying 04921 */ 04922 if ((ptiCurrent->rpdesk != grpdeskRitInput) || 04923 ( ((gptiForeground == NULL) || (PpiCurrent() != gptiForeground->ppi)) && 04924 !RtlAreAnyAccessesGranted(ptiCurrent->amdesk, (DESKTOP_HOOKCONTROL | DESKTOP_JOURNALRECORD)))) { 04925 RIPERR0(ERROR_ACCESS_DENIED, RIP_WARNING, "GetAysncKeyState: not" 04926 " foreground desktop or no desktop hooking (input spying)"); 04927 MSGERROR(0); 04928 } 04929 UserAssert(!(ptiCurrent->rpdesk->rpwinstaParent->dwWSF_Flags & WSF_NOIO)); 04930 04931 retval = _GetAsyncKeyState(vKey); 04932 04933 /* 04934 * Update the client side key state cache. 04935 */ 04936 ptiCurrent->pClientInfo->dwAsyncKeyCache = gpsi->dwAsyncKeyCache; 04937 RtlCopyMemory(ptiCurrent->pClientInfo->afAsyncKeyState, 04938 gafAsyncKeyState, 04939 CBASYNCKEYCACHE); 04940 RtlCopyMemory(ptiCurrent->pClientInfo->afAsyncKeyStateRecentDown, 04941 gafAsyncKeyStateRecentDown, 04942 CBASYNCKEYCACHE); 04943 04944 TRACE("NtUserGetAsyncKeyState"); 04945 ENDRECV_SHARED(); 04946 }

W32KAPI UINT NtUserGetCaretBlinkTime VOID   ) 
 

Definition at line 5082 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, CheckGrantedAccess(), ENDRECV_SHARED, gpepCSRSS, gpsi, MSGERROR, PpiCurrent, TRACE, and UINT.

05083 { 05084 BEGINRECV_SHARED(UINT, 0); 05085 05086 /* 05087 * Blow it off if the caller doesn't have the proper access rights. However, allow the 05088 * CSR process to use this value internally to the server. Note that if the client 05089 * tries to retrieve this value itself, the access check will function normally. 05090 */ 05091 if ((PpiCurrent()->Process != gpepCSRSS) && 05092 (!CheckGrantedAccess(PpiCurrent()->amwinsta, WINSTA_READATTRIBUTES))) { 05093 MSGERROR(0); 05094 } 05095 05096 retval = gpsi->dtCaretBlink; 05097 05098 TRACE("NtUserGetCaretBlinkTime"); 05099 ENDRECV_SHARED(); 05100 }

W32KAPI BOOL NtUserGetCaretPos OUT LPPOINT  lpPoint  ) 
 

Definition at line 7458 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, BOOL, tagQ::caret, ENDRECV_SHARED, FALSE, MSGERROR, tagTHREADINFO::pq, ProbeForWritePoint, PtiCurrentShared, StubExceptionHandler, TRACE, TRUE, tagCARET::x, and tagCARET::y.

Referenced by ECEnableDisableIME(), ECSize(), and EditWndProc().

07460 { 07461 07462 // 07463 // N.B. This function has implicit window handle translation. This 07464 // operation is performed in the User server API dispatcher. 07465 // 07466 07467 PTHREADINFO pti; 07468 PQ pq; 07469 BEGINRECV_SHARED(BOOL, FALSE); 07470 07471 /* 07472 * Probe arguments 07473 */ 07474 try { 07475 ProbeForWritePoint(lpPoint); 07476 07477 pti = PtiCurrentShared(); 07478 pq = pti->pq; 07479 lpPoint->x = pq->caret.x; 07480 lpPoint->y = pq->caret.y; 07481 retval = TRUE; 07482 } except (StubExceptionHandler(TRUE)) { 07483 MSGERROR(0); 07484 } 07485 07486 TRACE("NtUserGetCaretPos"); 07487 ENDRECV_SHARED(); 07488 }

W32KAPI BOOL NtUserGetClassInfo IN HINSTANCE hInstance  OPTIONAL,
IN PUNICODE_STRING  pstrClassName,
IN OUT LPWNDCLASSEXW  lpWndClass,
OUT LPWSTR *  ppszMenuName,
IN BOOL  bAnsi
 

Definition at line 8817 of file kernel/ntstubs.c.

References _GetClassInfoEx(), BEGINRECV, BOOL, DATAALIGN, ENDRECV, FALSE, MSGERROR, ProbeAndReadUnicodeString, ProbeForReadUnicodeStringBufferOrId, ProbeForWrite(), ProbeForWriteUlong, StubExceptionHandler, TRACE, and TRUE.

Referenced by GetClassInfo(), and GetClassInfoEx().

08823 { 08824 UNICODE_STRING strClassName; 08825 08826 LPWSTR pszMenuName; 08827 WNDCLASSEXW wc; 08828 BEGINRECV(BOOL, FALSE); 08829 08830 /* 08831 * Probe arguments 08832 */ 08833 try { 08834 strClassName = ProbeAndReadUnicodeString(pstrClassName); 08835 08836 /* 08837 * The class name may either be a string or an atom. Only 08838 * probe strings. 08839 */ 08840 ProbeForReadUnicodeStringBufferOrId(strClassName); 08841 ProbeForWrite(lpWndClass, sizeof(*lpWndClass), DATAALIGN); 08842 ProbeForWriteUlong((PULONG)ppszMenuName); 08843 RtlCopyMemory(&wc, lpWndClass, sizeof(WNDCLASSEXW)); 08844 } except (StubExceptionHandler(TRUE)) { 08845 MSGERROR(0); 08846 } 08847 08848 /* 08849 * The class name buffer is client-side. 08850 */ 08851 retval = _GetClassInfoEx( 08852 hInstance, 08853 (LPTSTR)strClassName.Buffer, 08854 &wc, 08855 &pszMenuName, 08856 bAnsi); 08857 08858 try { 08859 RtlCopyMemory(lpWndClass, &wc, sizeof(WNDCLASSEXW)); 08860 *ppszMenuName = pszMenuName; 08861 } except (StubExceptionHandler(TRUE)) { 08862 MSGERROR(0); 08863 } 08864 TRACE("NtUserGetClassInfo"); 08865 ENDRECV(); 08866 }

W32KAPI int NtUserGetClassName IN HWND  hwnd,
IN BOOL  bReal,
IN OUT PUNICODE_STRING  pstrClassName
 

Definition at line 8904 of file kernel/ntstubs.c.

References ARRAY_SIZE, tagSERVERINFO::atomSysClass, BEGINRECV_HWND_SHARED, BYTE, DWORD, ENDRECV_HWND_SHARED, FNID_END, FNID_START, gaFNIDtoICLS, GETFNID, gpsi, ICLS_MAX, MSGERROR, ProbeAndReadUnicodeString, ProbeForWrite(), StubExceptionHandler, TRACE, TRUE, and UserGetAtomName().

Referenced by GetClassNameW(), and RealGetWindowClass().

08908 { 08909 UNICODE_STRING strClassName; 08910 ATOM atom; 08911 08912 // 08913 // N.B. This function has implicit window handle translation. This 08914 // operation is performed in the User server API dispatcher. 08915 // 08916 08917 BEGINRECV_HWND_SHARED(DWORD, 0, hwnd); 08918 08919 /* 08920 * Probe arguments 08921 */ 08922 try { 08923 strClassName = ProbeAndReadUnicodeString(pstrClassName); 08924 #if defined(_X86_) 08925 ProbeForWrite(strClassName.Buffer, strClassName.MaximumLength, 08926 sizeof(BYTE)); 08927 #else 08928 ProbeForWrite(strClassName.Buffer, strClassName.MaximumLength, 08929 sizeof(WCHAR)); 08930 #endif 08931 08932 atom = pwnd->pcls->atomClassName; 08933 UserAssert(ARRAY_SIZE(gaFNIDtoICLS) == FNID_END - FNID_START + 1); 08934 08935 if (bReal) { 08936 DWORD dwFnid; 08937 DWORD dwClass; 08938 dwFnid = GETFNID(pwnd); 08939 if (dwFnid) { 08940 dwFnid -= FNID_START; 08941 if ((dwFnid < ARRAY_SIZE(gaFNIDtoICLS)) && (dwFnid >= 0)) { 08942 dwClass = gaFNIDtoICLS[dwFnid]; 08943 if (dwClass != ICLS_MAX) { 08944 atom = gpsi->atomSysClass[dwClass]; 08945 } 08946 } 08947 } 08948 } 08949 retval = UserGetAtomName( 08950 atom, 08951 strClassName.Buffer, 08952 strClassName.MaximumLength / sizeof(WCHAR)); 08953 08954 } except (StubExceptionHandler(TRUE)) { 08955 MSGERROR(0); 08956 } 08957 08958 TRACE("NtUserGetClassName"); 08959 ENDRECV_HWND_SHARED(); 08960 }

W32KAPI HANDLE NtUserGetClipboardData IN UINT  fmt,
OUT PGETCLIPBDATA  pgcd
 

Definition at line 4050 of file kernel/ntstubs.c.

References BEGINRECV, CheckClipboardAccess(), CLEANUPRECV, ENDRECV, GETCLIPBDATA, IS_THREAD_RESTRICTED, MSGERROR, MSGERRORCLEANUP, NULL, PGETCLIPBDATA, ProbeAndWriteStructure, PtiCurrent, StubExceptionHandler, ThreadLockWinSta, ThreadUnlockWinSta, TRACE, TRUE, tagGETCLIPBDATA::uFmtRet, and xxxGetClipboardData().

Referenced by GetClipboardData().

04053 { 04054 PTHREADINFO ptiCurrent; 04055 TL tlpwinsta; 04056 PWINDOWSTATION pwinsta; 04057 GETCLIPBDATA gcd; 04058 04059 BEGINRECV(HANDLE, NULL); 04060 04061 ptiCurrent = PtiCurrent(); 04062 if ((pwinsta = CheckClipboardAccess()) == NULL) 04063 MSGERROR(0); 04064 04065 /* 04066 * Check for jobs with JOB_OBJECT_UILIMIT_READCLIPBOARD 04067 */ 04068 if (IS_THREAD_RESTRICTED(ptiCurrent, JOB_OBJECT_UILIMIT_READCLIPBOARD)) { 04069 RIPERR0(ERROR_ACCESS_DENIED, RIP_WARNING, "NtUserGetClipboardData failed for restricted thread"); 04070 MSGERROR(0); 04071 } 04072 04073 ThreadLockWinSta(ptiCurrent, pwinsta, &tlpwinsta); 04074 04075 /* 04076 * Start out assuming the format requested 04077 * will be the format returned. 04078 */ 04079 gcd.uFmtRet = fmt; 04080 04081 retval = xxxGetClipboardData(pwinsta, fmt, &gcd); 04082 04083 /* 04084 * Probe arguments 04085 */ 04086 try { 04087 ProbeAndWriteStructure(pgcd, gcd, GETCLIPBDATA); 04088 } except (StubExceptionHandler(TRUE)) { 04089 MSGERRORCLEANUP(0); 04090 } 04091 04092 CLEANUPRECV(); 04093 ThreadUnlockWinSta(ptiCurrent, &tlpwinsta); 04094 04095 TRACE("NtUserGetClipboardData"); 04096 ENDRECV(); 04097 04098 }

W32KAPI int NtUserGetClipboardFormatName IN UINT  format,
OUT LPWSTR  lpszFormatName,
IN UINT  chMax
 

Definition at line 8962 of file kernel/ntstubs.c.

References BEGINRECV_NOCRIT, CHARALIGN, ENDRECV_NOCRIT, format, MSGERROR, ProbeForWriteBuffer, StubExceptionHandler, TRACE, TRUE, and UserGetAtomName().

Referenced by GetClipboardFormatName().

08966 { 08967 BEGINRECV_NOCRIT(int, 0); 08968 08969 /* 08970 * Probe arguments 08971 */ 08972 try { 08973 ProbeForWriteBuffer(lpszFormatName, chMax, CHARALIGN); 08974 } except (StubExceptionHandler(TRUE)) { 08975 MSGERROR(0); 08976 } 08977 08978 if ((ATOM)format < MAXINTATOM) { 08979 MSGERROR(ERROR_INVALID_PARAMETER); 08980 } else { 08981 /* 08982 * UserGetAtomName (actually RtlQueryAtomInAtomTable) protects access 08983 * within a try block, and sets last error appropriately. 08984 */ 08985 retval = UserGetAtomName((ATOM)format, lpszFormatName, chMax); 08986 } 08987 08988 TRACE("NtUserGetClipboardFormatName"); 08989 ENDRECV_NOCRIT(); 08990 }

W32KAPI HWND NtUserGetClipboardOwner VOID   ) 
 

Definition at line 5102 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, CheckClipboardAccess(), ENDRECV_SHARED, MSGERROR, NULL, PtoH, tagWINDOWSTATION::spwndClipOwner, and TRACE.

05104 { 05105 PWINDOWSTATION pwinsta; 05106 05107 BEGINRECV_SHARED(HWND, NULL); 05108 05109 /* 05110 * Blow it off if the caller doesn't have the proper access rights 05111 */ 05112 if ((pwinsta = CheckClipboardAccess()) == NULL) { 05113 MSGERROR(0); 05114 } 05115 05116 retval = PtoH(pwinsta->spwndClipOwner); 05117 05118 TRACE("NtUserGetClipboardOwner"); 05119 ENDRECV_SHARED(); 05120 }

W32KAPI DWORD NtUserGetClipboardSequenceNumber VOID   ) 
 

Definition at line 5062 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, CheckClipboardAccess(), DWORD, ENDRECV_SHARED, tagWINDOWSTATION::iClipSequenceNumber, MSGERROR, NULL, and TRACE.

05064 { 05065 PWINDOWSTATION pwinsta; 05066 05067 BEGINRECV_SHARED(DWORD, 0); 05068 05069 /* 05070 * Blow it off if the caller doesn't have the proper access rights 05071 */ 05072 if ((pwinsta = CheckClipboardAccess()) == NULL) { 05073 MSGERROR(0); 05074 } 05075 05076 retval = pwinsta->iClipSequenceNumber; 05077 05078 TRACE("NtUserGetClipboardSequenceNumber"); 05079 ENDRECV_SHARED(); 05080 }

DWORD NtUserGetClipboardSerialNumber VOID   ) 
 

W32KAPI HWND NtUserGetClipboardViewer VOID   ) 
 

Definition at line 5122 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, CheckClipboardAccess(), ENDRECV_SHARED, MSGERROR, NULL, PtoH, tagWINDOWSTATION::spwndClipViewer, and TRACE.

05124 { 05125 PWINDOWSTATION pwinsta; 05126 05127 BEGINRECV_SHARED(HWND, NULL); 05128 05129 /* 05130 * Blow it off if the caller doesn't have the proper access rights 05131 */ 05132 if ((pwinsta = CheckClipboardAccess()) == NULL) { 05133 MSGERROR(0); 05134 } 05135 05136 retval = PtoH(pwinsta->spwndClipViewer); 05137 05138 TRACE("NtUserGetClipboardViewer"); 05139 ENDRECV_SHARED(); 05140 }

W32KAPI BOOL NtUserGetClipCursor OUT LPRECT  lpRect  ) 
 

Definition at line 4313 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, BOOL, ENDRECV_SHARED, FALSE, grcCursorClip, MSGERROR, PpiCurrent, ProbeForWriteRect, RETURN_IF_ACCESS_DENIED, StubExceptionHandler, TRACE, and TRUE.

04315 { 04316 /* 04317 * Check if the caller has the proper access rights: if not, this will 04318 * SetLastError to ERROR_ACCESS_DENIED and return FALSE. Do this *before* 04319 * BEGINRECV_SHARED, else we must use MSGERROR to release the critsect! 04320 */ 04321 RETURN_IF_ACCESS_DENIED(PpiCurrent()->amwinsta, 04322 WINSTA_READATTRIBUTES, 04323 FALSE); 04324 { 04325 BEGINRECV_SHARED(BOOL, FALSE); 04326 04327 /* 04328 * Probe arguments 04329 */ 04330 try { 04331 ProbeForWriteRect(lpRect); 04332 04333 *lpRect = grcCursorClip; 04334 retval = TRUE; 04335 } except (StubExceptionHandler(TRUE)) { 04336 MSGERROR(0); 04337 } 04338 04339 TRACE("NtUserGetClipCursor"); 04340 ENDRECV_SHARED(); 04341 } 04342 }

W32KAPI BOOL NtUserGetComboBoxInfo IN HWND  hwnd,
IN OUT PCOMBOBOXINFO  pcbi
 

Definition at line 3564 of file kernel/ntstubs.c.

References _GetComboBoxInfo(), BEGINRECV_HWND_SHARED, BOOL, DATAALIGN, ENDRECV_HWND_SHARED, FALSE, MSGERROR, ProbeForWrite(), StubExceptionHandler, TRACE, and TRUE.

03565 { 03566 COMBOBOXINFO cbi; 03567 03568 BEGINRECV_HWND_SHARED(BOOL, FALSE, hwnd); 03569 03570 /* 03571 * Probe arguments and copy out results 03572 */ 03573 try { 03574 ProbeForWrite(pcbi, sizeof(*pcbi), DATAALIGN); 03575 cbi.cbSize = pcbi->cbSize; 03576 } except (StubExceptionHandler(TRUE)) { 03577 MSGERROR(0); 03578 } 03579 03580 /* 03581 * Get the combobox info 03582 */ 03583 retval = _GetComboBoxInfo(pwnd, &cbi); 03584 03585 if (retval) { 03586 try { 03587 *pcbi = cbi; 03588 } except (StubExceptionHandler(TRUE)) { 03589 MSGERROR(0); 03590 } 03591 } 03592 03593 TRACE("NtUserGetComboBoxInfo"); 03594 ENDRECV_HWND_SHARED(); 03595 }

W32KAPI HBRUSH NtUserGetControlBrush IN HWND  hwnd,
IN HDC  hdc,
IN UINT  msg
 

Definition at line 4948 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, ENDRECV_HWNDLOCK, msg, MSGERROR, NULL, TRACE, and xxxGetControlBrush().

04952 { 04953 04954 // 04955 // N.B. This function has implicit window translation and thread locking 04956 // enabled. These operations are performed in the User server API 04957 // dispatcher. 04958 // 04959 04960 BEGINRECV_HWNDLOCK(HBRUSH, NULL, hwnd); 04961 04962 if (hdc == NULL) 04963 MSGERROR(0); 04964 04965 retval = xxxGetControlBrush( 04966 pwnd, 04967 hdc, 04968 msg); 04969 04970 TRACE("NtUserGetControlBrush"); 04971 ENDRECV_HWNDLOCK(); 04972 }

W32KAPI HBRUSH NtUserGetControlColor IN HWND  hwndParent,
IN HWND  hwndCtl,
IN HDC  hdc,
IN UINT  msg
 

Definition at line 4974 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, ENDRECV_HWNDLOCK, msg, NULL, ThreadLockAlwaysWithPti, ThreadUnlock, TRACE, ValidateHWND, and xxxGetControlColor().

04979 { 04980 04981 // 04982 // N.B. This function has implicit window translation and thread locking 04983 // enabled. These operations are performed in the User server API 04984 // dispatcher. 04985 // 04986 04987 PWND pwndCtl; 04988 TL tlpwndCtl; 04989 04990 BEGINRECV_HWNDLOCK(HBRUSH, NULL, hwndParent); 04991 04992 ValidateHWND(pwndCtl, hwndCtl); 04993 04994 ThreadLockAlwaysWithPti(ptiCurrent, pwndCtl, &tlpwndCtl); 04995 04996 retval = xxxGetControlColor( 04997 pwnd, 04998 pwndCtl, 04999 hdc, 05000 msg); 05001 05002 ThreadUnlock(&tlpwndCtl); 05003 05004 TRACE("NtUserGetControlColor"); 05005 ENDRECV_HWNDLOCK(); 05006 }

W32KAPI ULONG_PTR NtUserGetCPD IN HWND  hwnd,
IN DWORD  options,
IN ULONG_PTR  dwData
 

Definition at line 8700 of file kernel/ntstubs.c.

References BEGINRECV_HWND, CPD_DIALOG, CPD_TRANSITION_TYPES, CPD_WND, CPD_WNDTOCLS, ENDRECV_HWND, GetCPD(), MSGERROR, and TRACE.

Referenced by GetCPD().

08704 { 08705 08706 // 08707 // N.B. This function has implicit window handle translation. This 08708 // operation is performed in the User server API dispatcher. 08709 // 08710 08711 BEGINRECV_HWND(ULONG_PTR, 0, hwnd); 08712 08713 switch (options & ~CPD_TRANSITION_TYPES) { 08714 case CPD_WND: 08715 case CPD_DIALOG: 08716 case CPD_WNDTOCLS: 08717 break; 08718 default: 08719 RIPMSG1(RIP_WARNING, "GetCPD: Invalid options %x", options); 08720 MSGERROR(0); 08721 } 08722 08723 retval = GetCPD(pwnd, options, dwData); 08724 08725 TRACE("NtUserGetCPD"); 08726 ENDRECV_HWND(); 08727 }

W32KAPI HCURSOR NtUserGetCursorFrameInfo IN HCURSOR  hcur,
IN int  iFrame,
OUT LPDWORD  pjifRate,
OUT LPINT  pccur
 

Definition at line 7184 of file kernel/ntstubs.c.

References _GetCursorFrameInfo(), BEGINRECV_SHARED, DWORD, ENDRECV_SHARED, FALSE, INT, MSGERROR, NULL, ProbeForWriteLong, ProbeForWriteUlong, PtoH, StubExceptionHandler, TRACE, and ValidateHCURSOR.

Referenced by GetCursorFrameInfo().

07189 { 07190 PCURSOR pcur; 07191 DWORD jifRate; 07192 INT ccur; 07193 07194 BEGINRECV_SHARED(HCURSOR, NULL); 07195 07196 ValidateHCURSOR(pcur, hcur); 07197 07198 /* 07199 * Probe arguments 07200 */ 07201 try { 07202 ProbeForWriteUlong(pjifRate); 07203 ProbeForWriteLong(pccur); 07204 } except (StubExceptionHandler(FALSE)) { 07205 MSGERROR(0); // don't SetLastError for private API 07206 } 07207 07208 retval = (HCURSOR)_GetCursorFrameInfo( 07209 pcur, 07210 iFrame, 07211 &jifRate, 07212 &ccur); 07213 retval = PtoH((PVOID)retval); 07214 try { 07215 *pjifRate = jifRate; 07216 *pccur = ccur; 07217 } except (StubExceptionHandler(FALSE)) { 07218 MSGERROR(0); // don't SetLastError for private API 07219 } 07220 07221 TRACE("NtUserGetCursorFrameInfo"); 07222 ENDRECV_SHARED(); 07223 }

W32KAPI BOOL NtUserGetCursorInfo IN OUT PCURSORINFO  pci  ) 
 

Definition at line 3622 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, BOOL, DATAALIGN, ENDRECV_SHARED, FALSE, gpcurLogCurrent, gpcurPhysCurrent, gpsi, MSGERROR, ProbeForWrite(), PtoH, StubExceptionHandler, TRACE, and TRUE.

03623 { 03624 CURSORINFO ci = {0}; 03625 03626 BEGINRECV_SHARED(BOOL, FALSE); 03627 03628 ci.ptScreenPos = gpsi->ptCursor; 03629 ci.flags = 0; 03630 03631 if (gpcurPhysCurrent) 03632 ci.flags |= CURSOR_SHOWING; 03633 03634 /* 03635 * Get the current LOGICAL cursor (the one apps actually see from LoadCursor()) 03636 */ 03637 ci.hCursor = (HCURSOR)PtoH(gpcurLogCurrent); 03638 03639 retval = TRUE; 03640 03641 /* 03642 * Probe arguments and copy out result 03643 */ 03644 try { 03645 ProbeForWrite(pci, sizeof(*pci), DATAALIGN); 03646 if (pci->cbSize != sizeof(CURSORINFO)) { 03647 RIPERR1(ERROR_INVALID_PARAMETER, RIP_WARNING, "CURSORINFO.cbSize %d is wrong", pci->cbSize); 03648 retval = FALSE; 03649 } else { 03650 *pci = ci; 03651 } 03652 03653 } except (StubExceptionHandler(TRUE)) { 03654 MSGERROR(0); 03655 } 03656 03657 TRACE("NtUserGetCursorInfo"); 03658 ENDRECV_SHARED(); 03659 }

W32KAPI HDC NtUserGetDC IN HWND  hwnd  ) 
 

Definition at line 6624 of file kernel/ntstubs.c.

References _GetDC(), BEGINATOMICRECV, BOOL, CreateEmptyRgn(), ENDATOMICRECV, FALSE, IS_CURRENT_THREAD_RESTRICTED, NULL, tagDESKTOP::pDeskInfo, PtiCurrent, PtoH, tagDESKTOPINFO::spwnd, TRACE, TRUE, ValidateHwnd, and ValidateHWNDOPT.

Referenced by ChopText(), CopyBitmap(), ECCalcMarginForDBCSFont(), ECGetEditDC(), ECSetFont(), LBGetDC(), StaticRepaint(), xxxBNGetDC(), xxxCBCalcControlRects(), xxxCBInternalUpdateEditWindow(), xxxInitActivateDlg(), xxxLBCreate(), and xxxLBSetFont().

06626 { 06627 PWND pwnd; 06628 BOOL bValid = TRUE; 06629 06630 BEGINATOMICRECV(HDC, NULL); 06631 06632 ValidateHWNDOPT(pwnd, hwnd); 06633 06634 if (IS_CURRENT_THREAD_RESTRICTED(JOB_OBJECT_UILIMIT_HANDLES) && pwnd == NULL) { 06635 06636 PDESKTOP pdesk = PtiCurrent()->rpdesk; 06637 06638 /* 06639 * make sure it has access to the desktop window 06640 */ 06641 if (!ValidateHwnd(PtoH(pdesk->pDeskInfo->spwnd))) { 06642 bValid = FALSE; 06643 } 06644 } 06645 06646 retval = _GetDC(pwnd); 06647 06648 if (!bValid) { 06649 06650 HRGN hrgn; 06651 06652 /* 06653 * Select a NULL visible region on this DC so that restricted 06654 * processes don't mess with GetDC(NULL) 06655 */ 06656 hrgn = CreateEmptyRgn(); 06657 06658 GreSelectVisRgn(retval, hrgn, SVR_DELETEOLD); 06659 } 06660 06661 TRACE("NtUserGetDC"); 06662 ENDATOMICRECV(); 06663 }

W32KAPI HDC NtUserGetDCEx IN HWND  hwnd,
IN HRGN  hrgnClip,
IN DWORD  flags
 

Definition at line 6665 of file kernel/ntstubs.c.

References _GetDCEx(), BEGINATOMICRECV, ENDATOMICRECV, IS_CURRENT_THREAD_RESTRICTED, MSGERROR, NULL, PtiCurrent, PtoH, TRACE, ValidateHwnd, and ValidateHWNDOPT.

Referenced by SoftModalMessageBox().

06669 { 06670 PWND pwnd; 06671 06672 BEGINATOMICRECV(HDC, NULL); 06673 06674 ValidateHWNDOPT(pwnd, hwnd); 06675 06676 if (pwnd == NULL) { 06677 pwnd = PtiCurrent()->rpdesk->pDeskInfo->spwnd; 06678 06679 if (IS_CURRENT_THREAD_RESTRICTED(JOB_OBJECT_UILIMIT_HANDLES)) { 06680 /* 06681 * make sure it has access to the desktop window 06682 */ 06683 if (!ValidateHwnd(PtoH(pwnd))) { 06684 RIPMSG0(RIP_WARNING, 06685 "NtUserGetDCEx fails desktop window validation"); 06686 MSGERROR(0); 06687 } 06688 } 06689 } 06690 06691 retval = _GetDCEx( 06692 pwnd, 06693 hrgnClip, 06694 flags); 06695 06696 TRACE("NtUserGetDCEx"); 06697 ENDATOMICRECV(); 06698 }

W32KAPI UINT NtUserGetDoubleClickTime VOID   ) 
 

Definition at line 5142 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, CheckGrantedAccess(), ENDRECV_SHARED, gdtDblClk, gpepCSRSS, MSGERROR, PpiCurrent, TRACE, and UINT.

05144 { 05145 BEGINRECV_SHARED(UINT, 0); 05146 05147 /* 05148 * Blow it off if the caller doesn't have the proper access rights. However, allow the 05149 * CSR process to use this value internally to the server. Note that if the client 05150 * tries to retrieve this value itself, the access check will function normally. 05151 */ 05152 if ((PpiCurrent()->Process != gpepCSRSS) && 05153 (!CheckGrantedAccess(PpiCurrent()->amwinsta, WINSTA_READATTRIBUTES))) { 05154 MSGERROR(0); 05155 } 05156 05157 retval = gdtDblClk; 05158 05159 TRACE("NtUserGetDoubleClickTime"); 05160 ENDRECV_SHARED(); 05161 }

W32KAPI HWND NtUserGetForegroundWindow VOID   ) 
 

Definition at line 5163 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, ENDRECV_SHARED, gpqForeground, tagWND::head, MSGERROR, NULL, PtiCurrentShared, PtoHq, tagQ::spwndActive, and TRACE.

Referenced by GetDialogMonitor(), SoftModalMessageBox(), and UnmaximizeChildWindows().

05165 { 05166 BEGINRECV_SHARED(HWND, NULL); 05167 05168 /* 05169 * Only return a window if there is a foreground queue and the 05170 * caller has access to the current desktop. 05171 */ 05172 if (gpqForeground == NULL || gpqForeground->spwndActive == NULL || 05173 PtiCurrentShared()->rpdesk != gpqForeground->spwndActive->head.rpdesk) { 05174 MSGERROR(0); 05175 } 05176 05177 retval = PtoHq(gpqForeground->spwndActive); 05178 05179 TRACE("NtUserGetForegroundWindow"); 05180 ENDRECV_SHARED(); 05181 }

W32KAPI DWORD NtUserGetGuiResources HANDLE  hProcess,
DWORD  dwFlags
 

Definition at line 2329 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, dwFlags, DWORD, ENDRECV_SHARED, gSessionId, MSGERROR, NT_SUCCESS, NTSTATUS(), NULL, ObDereferenceObject, ObReferenceObjectByHandle(), PsProcessType, _EPROCESS::SessionId, Status, TRACE, UserMode, and _EPROCESS::Win32Process.

02333 { 02334 PEPROCESS Process; 02335 PW32PROCESS pW32Process; 02336 BEGINRECV_SHARED(DWORD, 0); 02337 02338 /* 02339 * Probe arguments 02340 */ 02341 if (dwFlags > GR_MAXOBJECT) { 02342 RIPERR1(ERROR_INVALID_PARAMETER, RIP_VERBOSE, "GetGuiResources: invalid flag bits %x\n", 02343 dwFlags); 02344 MSGERROR(0); 02345 } 02346 02347 02348 if (hProcess == NtCurrentProcess()) { 02349 pW32Process = W32GetCurrentProcess(); 02350 } else { 02351 NTSTATUS Status; 02352 Status = ObReferenceObjectByHandle( 02353 hProcess, 02354 PROCESS_QUERY_INFORMATION, 02355 *PsProcessType, 02356 UserMode, 02357 &Process, 02358 NULL); 02359 02360 if (!NT_SUCCESS(Status)) { 02361 RIPERR2(ERROR_INVALID_PARAMETER, RIP_WARNING, "GetGuiResources: Failed with Process handle == %X, Status = %x\n", 02362 hProcess, Status); 02363 MSGERROR(0); 02364 } 02365 02366 /* 02367 * Make sure they are from the same session 02368 */ 02369 if (Process->SessionId != gSessionId) { 02370 RIPERR2(ERROR_INVALID_PARAMETER, RIP_VERBOSE, "GetGuiResources: Different session. Failed with Process handle == %X, Status = %x\n", 02371 hProcess, Status); 02372 ObDereferenceObject(Process); 02373 MSGERROR(0); 02374 } 02375 02376 pW32Process = Process->Win32Process; 02377 } 02378 02379 if (pW32Process) { 02380 switch(dwFlags) { 02381 case GR_GDIOBJECTS: 02382 retval = pW32Process->GDIHandleCount; 02383 break; 02384 case GR_USEROBJECTS: 02385 retval = pW32Process->UserHandleCount; 02386 break; 02387 } 02388 } else 02389 retval = 0; 02390 02391 if (hProcess != NtCurrentProcess()) { 02392 ObDereferenceObject(Process); 02393 } 02394 02395 TRACE("NtUserGetGuiResources"); 02396 ENDRECV_SHARED(); 02397 }

W32KAPI BOOL NtUserGetGUIThreadInfo IN DWORD  idThread,
IN OUT PGUITHREADINFO  pgui
 

Definition at line 3479 of file kernel/ntstubs.c.

References _GetGUIThreadInfo(), BEGINRECV_SHARED, BOOL, DATAALIGN, ENDRECV_SHARED, FALSE, MSGERROR, NULL, ProbeForWrite(), PtiFromThreadId(), StubExceptionHandler, TRACE, and TRUE.

03482 { 03483 PTHREADINFO ptiThread; 03484 GUITHREADINFO gui; 03485 03486 BEGINRECV_SHARED(BOOL, FALSE); 03487 03488 if (idThread) { 03489 ptiThread = PtiFromThreadId(idThread); 03490 if (ptiThread == NULL) { 03491 RIPERR0(ERROR_INVALID_PARAMETER, RIP_VERBOSE, "Bad thread id"); 03492 MSGERROR(0); 03493 } 03494 } else { 03495 ptiThread = NULL; 03496 } 03497 03498 /* 03499 * Probe arguments and copy results 03500 * C2: test pti & current thread on same desktop within _GetGUIThreadInfo 03501 */ 03502 try { 03503 ProbeForWrite(pgui, sizeof(*pgui), DATAALIGN); 03504 gui.cbSize = pgui->cbSize; 03505 } except (StubExceptionHandler(TRUE)) { 03506 MSGERROR(0); 03507 } 03508 03509 retval = _GetGUIThreadInfo(ptiThread, &gui); 03510 if (retval) { 03511 try { 03512 *pgui = gui; 03513 } except (StubExceptionHandler(TRUE)) { 03514 MSGERROR(0); 03515 } 03516 } 03517 03518 TRACE("NtUserGetGUIThreadInfo"); 03519 ENDRECV_SHARED(); 03520 }

W32KAPI BOOL NtUserGetIconInfo IN HICON  hicon,
OUT PICONINFO  piconinfo,
IN OUT OPTIONAL PUNICODE_STRING  pstrInstanceName,
IN OUT OPTIONAL PUNICODE_STRING  pstrResName,
OUT OPTIONAL LPDWORD  pbpp,
IN BOOL  fInternal
 

W32KAPI BOOL NtUserGetIconSize IN HICON  hIcon,
IN UINT  istepIfAniCur,
OUT int *  pcx,
OUT int *  pcy
 

Definition at line 1669 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, BOOL, CURSORF_ACON, ENDRECV_SHARED, FALSE, MSGERROR, pacon, ProbeAndWriteLong, StubExceptionHandler, TRACE, UINT, and ValidateHICON.

Referenced by CopyIcoCur(), DrawStateW(), xxxBNDrawText(), xxxSetStaticImage(), and xxxStaticPaint().

01674 { 01675 PCURSOR picon; 01676 01677 BEGINRECV_SHARED(BOOL, FALSE); 01678 01679 ValidateHICON(picon, hIcon); 01680 01681 if (picon->CURSORF_flags & CURSORF_ACON) { 01682 PACON pacon = (PACON)picon; 01683 if (istepIfAniCur < (UINT)pacon->cpcur) { 01684 picon = pacon->aspcur[pacon->aicur[istepIfAniCur]]; 01685 } else { 01686 RIPMSG2(RIP_WARNING, "NtUserGetIconSize: Invalid istepIfAniCur:%#lx. picon:%#p", 01687 istepIfAniCur, picon); 01688 MSGERROR(0); 01689 } 01690 } 01691 01692 /* 01693 * Probe arguments 01694 */ 01695 try { 01696 ProbeAndWriteLong(pcx, picon->cx); 01697 ProbeAndWriteLong(pcy, picon->cy); 01698 01699 retval = 1; 01700 } except (StubExceptionHandler(FALSE)) { 01701 MSGERROR(0); 01702 } 01703 01704 TRACE("NtUserGetIconSize"); 01705 ENDRECV_SHARED(); 01706 }

W32KAPI UINT NtUserGetInternalWindowPos IN HWND  hwnd,
OUT LPRECT lpRect  OPTIONAL,
OUT LPPOINT lpPoint  OPTIONAL
 

Definition at line 3049 of file kernel/ntstubs.c.

References _GetWindowPlacement(), BEGINRECV_HWND_SHARED, DWORD, ENDRECV_HWND_SHARED, FALSE, MSGERROR, ProbeForWritePoint, ProbeForWriteRect, StubExceptionHandler, TRACE, and UINT.

03053 { 03054 WINDOWPLACEMENT wp; 03055 03056 // 03057 // N.B. This function has implicit window handle translation. This 03058 // operation is performed in the User server API dispatcher. 03059 // 03060 03061 BEGINRECV_HWND_SHARED(DWORD, 0, hwnd); 03062 03063 /* 03064 * Probe arguments 03065 */ 03066 try { 03067 if (ARGUMENT_PRESENT(lpRect)) { 03068 ProbeForWriteRect(lpRect); 03069 } 03070 if (ARGUMENT_PRESENT(lpPoint)) { 03071 ProbeForWritePoint(lpPoint); 03072 } 03073 03074 } except (StubExceptionHandler(FALSE)) { 03075 MSGERROR(0); 03076 } 03077 03078 wp.length = sizeof(WINDOWPLACEMENT); 03079 03080 _GetWindowPlacement(pwnd, &wp); 03081 03082 retval = wp.showCmd; 03083 try { 03084 if (ARGUMENT_PRESENT(lpRect)) { 03085 RtlCopyMemory(lpRect, &wp.rcNormalPosition, sizeof (RECT)); 03086 } 03087 if (ARGUMENT_PRESENT(lpPoint)) { 03088 RtlCopyMemory(lpPoint, &wp.ptMinPosition, sizeof (POINT)); 03089 } 03090 03091 } except (StubExceptionHandler(FALSE)) { 03092 } 03093 03094 TRACE("NtUserGetInternalWindowPos"); 03095 ENDRECV_HWND_SHARED(); 03096 }

W32KAPI UINT NtUserGetKeyboardLayoutList IN UINT  nItems,
OUT HKL *  lpBuff
 

Definition at line 9058 of file kernel/ntstubs.c.

References _GetKeyboardLayoutList(), _GetProcessWindowStation(), BEGINRECV_SHARED, DATAALIGN, DWORD, ENDRECV_SHARED, MSGERROR, NULL, ProbeForWriteBuffer, StubExceptionHandler, TRACE, TRUE, and UINT.

Referenced by CliImmInitializeHotKeys().

09061 { 09062 PWINDOWSTATION pwinsta; 09063 09064 BEGINRECV_SHARED(UINT, 0); 09065 09066 /* 09067 * Probe arguments 09068 */ 09069 try { 09070 if (!lpBuff) { 09071 nItems = 0; 09072 } 09073 ProbeForWriteBuffer(lpBuff, nItems, DATAALIGN); 09074 pwinsta = _GetProcessWindowStation(NULL); 09075 09076 } except (StubExceptionHandler(TRUE)) { 09077 MSGERROR(0); 09078 } 09079 09080 /* 09081 * Access to the client-side buffer lpBuff is protected by try/except 09082 * inside _GetKeyboardLayoutList() 09083 */ 09084 retval = (DWORD)_GetKeyboardLayoutList(pwinsta, nItems, lpBuff); 09085 TRACE("NtUserGetKeyboardLayoutList"); 09086 ENDRECV_SHARED(); 09087 }

W32KAPI BOOL NtUserGetKeyboardLayoutName IN OUT PUNICODE_STRING  pstrKLID  ) 
 

Definition at line 9022 of file kernel/ntstubs.c.

References tagKBDFILE::awchKF, BEGINRECV_SHARED, BOOL, CHARALIGN, ENDRECV_SHARED, FALSE, MSGERROR, NULL, ProbeAndReadUnicodeString, ProbeForWrite(), PtiCurrentShared, tagKL::spkf, tagTHREADINFO::spklActive, StubExceptionHandler, TRACE, TRUE, and wcsncpycch().

Referenced by GetKeyboardLayoutName().

09024 { 09025 PTHREADINFO ptiCurrent; 09026 PKL pklActive; 09027 UNICODE_STRING strKLID; 09028 09029 BEGINRECV_SHARED(BOOL, FALSE); 09030 09031 ptiCurrent = PtiCurrentShared(); 09032 pklActive = ptiCurrent->spklActive; 09033 09034 if (pklActive == NULL) { 09035 MSGERROR(0); 09036 } 09037 /* 09038 * Probe arguments 09039 */ 09040 try { 09041 strKLID = ProbeAndReadUnicodeString(pstrKLID); 09042 ProbeForWrite(strKLID.Buffer, strKLID.MaximumLength, CHARALIGN); 09043 09044 wcsncpycch(strKLID.Buffer, 09045 pklActive->spkf->awchKF, 09046 strKLID.MaximumLength / sizeof(WCHAR)); 09047 09048 retval = TRUE; 09049 09050 } except (StubExceptionHandler(TRUE)) { 09051 MSGERROR(0); 09052 } 09053 09054 TRACE("NtUserGetKeyboardLayoutName"); 09055 ENDRECV_SHARED(); 09056 }

W32KAPI BOOL NtUserGetKeyboardState OUT PBYTE  pb  ) 
 

Definition at line 9565 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, BOOL, BYTE, ENDRECV_SHARED, MSGERROR, ProbeForWrite(), PtiCurrentShared, SHORT, StubExceptionHandler, TestKeyStateDown, TestKeyStateToggle, and TRUE.

09567 { 09568 int i; 09569 PQ pq; 09570 BEGINRECV_SHARED(SHORT, 0) 09571 09572 /* 09573 * Probe arguments 09574 */ 09575 try { 09576 ProbeForWrite(pb, 256, sizeof(BYTE)); 09577 09578 pq = PtiCurrentShared()->pq; 09579 09580 for (i = 0; i < 256; i++, pb++) { 09581 *pb = 0; 09582 if (TestKeyStateDown(pq, i)) 09583 *pb |= 0x80; 09584 09585 if (TestKeyStateToggle(pq, i)) 09586 *pb |= 0x01; 09587 } 09588 retval = TRUE; 09589 } except (StubExceptionHandler(TRUE)) { 09590 MSGERROR(0); 09591 } 09592 09593 ENDRECV_SHARED(); 09594 }

W32KAPI int NtUserGetKeyNameText IN LONG  lParam,
OUT LPWSTR  lpszKeyName,
IN UINT  chMax
 

Definition at line 8992 of file kernel/ntstubs.c.

References _GetKeyNameText(), BEGINRECV_SHARED, CHARALIGN, ENDRECV_SHARED, MSGERROR, ProbeForWriteBuffer, StubExceptionHandler, TRACE, and TRUE.

Referenced by GetKeyNameText().

08996 { 08997 BEGINRECV_SHARED(int, 0); 08998 08999 /* 09000 * Probe arguments 09001 */ 09002 try { 09003 ProbeForWriteBuffer(lpszKeyName, chMax, CHARALIGN); 09004 } except (StubExceptionHandler(TRUE)) { 09005 MSGERROR(0); 09006 } 09007 09008 /* 09009 * Note -- lpszKeyName is a client-side address. GetKeyNameText 09010 * protects uses with try blocks, and sets last error accordingly. 09011 */ 09012 09013 retval = _GetKeyNameText( 09014 lParam, 09015 lpszKeyName, 09016 chMax); 09017 09018 TRACE("NtUserGetKeyNameText"); 09019 ENDRECV_SHARED(); 09020 }

W32KAPI SHORT NtUserGetKeyState IN int  vk  ) 
 

Definition at line 9596 of file kernel/ntstubs.c.

References _GetKeyState(), _CLIENTINFO::afKeyState, tagQ::afKeyState, BEGINRECV_SHARED, CBKEYCACHE, ChangeAcquireResourceType(), _CLIENTINFO::dwKeyCache, ENDRECV_SHARED, gpsi, tagTHREADINFO::pClientInfo, PostUpdateKeyStateEvent(), tagTHREADINFO::pq, PtiCurrentShared, tagQ::QF_flags, QF_UPDATEKEYSTATE, and SHORT.

Referenced by GetKeyState().

09598 { 09599 PTHREADINFO ptiCurrent; 09600 BEGINRECV_SHARED(SHORT, 0) 09601 09602 ptiCurrent = PtiCurrentShared(); 09603 if (ptiCurrent->pq->QF_flags & QF_UPDATEKEYSTATE) { 09604 09605 /* 09606 * We are going to change the system state, so we 09607 * must have an exclusive lock 09608 */ 09609 ChangeAcquireResourceType(); 09610 09611 /* 09612 * If this thread needs a key state event, give one to it. There are 09613 * cases where any app may be looping looking at GetKeyState(), plus 09614 * calling PeekMessage(). Key state events don't get created unless 09615 * new hardware input comes along. If the app isn't receiving hardware 09616 * input, it won't get the new key state. So ResyncKeyState() will 09617 * ensure that if the app is looping on GetKeyState(), it'll get the 09618 * right key state. 09619 */ 09620 if (ptiCurrent->pq->QF_flags & QF_UPDATEKEYSTATE) { 09621 PostUpdateKeyStateEvent(ptiCurrent->pq); 09622 } 09623 } 09624 retval = _GetKeyState(vk); 09625 09626 /* 09627 * Update the client side key state cache. 09628 */ 09629 ptiCurrent->pClientInfo->dwKeyCache = gpsi->dwKeyCache; 09630 RtlCopyMemory(ptiCurrent->pClientInfo->afKeyState, 09631 ptiCurrent->pq->afKeyState, 09632 CBKEYCACHE); 09633 09634 ENDRECV_SHARED(); 09635 }

W32KAPI DWORD NtUserGetListBoxInfo IN HWND  hwnd  ) 
 

Definition at line 3603 of file kernel/ntstubs.c.

References _GetListBoxInfo(), BEGINRECV_HWND_SHARED, DWORD, ENDRECV_HWND_SHARED, and TRACE.

03604 { 03605 BEGINRECV_HWND_SHARED(DWORD, 0, hwnd); 03606 03607 /* 03608 * Get the listbox info 03609 */ 03610 retval = _GetListBoxInfo(pwnd); 03611 03612 TRACE("NtUserGetListBoxInfo"); 03613 ENDRECV_HWND_SHARED(); 03614 }

LRESULT NtUserGetListboxString IN HWND  hwnd,
IN UINT  msg,
IN WPARAM  wParam,
IN PLARGE_STRING  pString,
IN ULONG_PTR  xParam,
IN DWORD  xpfn,
IN PBOOL  pbNotString
 

W32KAPI BOOL NtUserGetMenuBarInfo IN HWND  hwnd,
IN long  idObject,
IN long  idItem,
IN OUT PMENUBARINFO  pmbi
 

Definition at line 3785 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, BOOL, BYTE, DWORD, ENDRECV_HWNDLOCK, FALSE, MSGERROR, ProbeForWrite(), StubExceptionHandler, TRACE, TRUE, and xxxGetMenuBarInfo().

03790 { 03791 MENUBARINFO mbi; 03792 03793 BEGINRECV_HWNDLOCK(BOOL, FALSE, hwnd); 03794 03795 /* 03796 * Probe arguments 03797 */ 03798 try { 03799 #if defined(_X86_) 03800 ProbeForWrite(pmbi, sizeof(*pmbi), sizeof(BYTE)); 03801 #else 03802 ProbeForWrite(pmbi, sizeof(*pmbi), sizeof(DWORD)); 03803 #endif 03804 mbi.cbSize = pmbi->cbSize; 03805 } except (StubExceptionHandler(TRUE)) { 03806 MSGERROR(0); 03807 } 03808 03809 /* 03810 * Get the menubar info 03811 */ 03812 retval = xxxGetMenuBarInfo(pwnd, idObject, idItem, &mbi); 03813 03814 if (retval) { 03815 try { 03816 *pmbi = mbi; 03817 } except (StubExceptionHandler(TRUE)) { 03818 MSGERROR(0); 03819 } 03820 } 03821 03822 TRACE("NtUserGetMenuBarInfo"); 03823 ENDRECV_HWNDLOCK(); 03824 }

W32KAPI DWORD NtUserGetMenuIndex IN HMENU  hMenu,
IN HMENU  hSubMenu
 

Definition at line 4462 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, tagMENU::cItems, DWORD, ENDRECV_SHARED, tagMENU::rgItems, tagITEM::spSubMenu, TRACE, and ValidateHMENU.

Referenced by UserRegisterWowHandlers().

04465 { 04466 04467 PMENU pmenu; 04468 PMENU psubmenu; 04469 DWORD idx; 04470 04471 BEGINRECV_SHARED(DWORD, 0); 04472 04473 ValidateHMENU(pmenu, hMenu); 04474 ValidateHMENU(psubmenu, hSubMenu); 04475 04476 retval = (DWORD)-1; 04477 04478 if (pmenu && psubmenu) { 04479 for (idx=0; idx<pmenu->cItems; idx++) 04480 if ((pmenu->rgItems[idx].spSubMenu == psubmenu)) { 04481 retval = idx; 04482 break; 04483 } 04484 } 04485 04486 TRACE("NtUserGetMenuIndex"); 04487 ENDRECV_SHARED(); 04488 }

W32KAPI BOOL NtUserGetMenuItemRect IN HWND  hwnd,
IN HMENU  hMenu,
IN UINT  uItem,
OUT LPRECT  lprcItem
 

Definition at line 7381 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK_OPT, BOOL, CLEANUPRECV, DWORD, ENDRECV_HWNDLOCK_OPT, MSGERRORCLEANUP, ProbeAndWriteStructure, StubExceptionHandler, ThreadLockAlwaysWithPti, ThreadUnlock, TRACE, TRUE, ValidateHMENU, and xxxGetMenuItemRect().

07386 { 07387 07388 // 07389 // N.B. This function has implicit window translation and thread locking 07390 // enabled. These operations are performed in the User server API 07391 // dispatcher. 07392 // 07393 07394 PMENU pmenu; 07395 TL tlpmenu; 07396 RECT rcItem; 07397 07398 BEGINRECV_HWNDLOCK_OPT(DWORD, 0, hwnd); 07399 07400 ValidateHMENU(pmenu, hMenu); 07401 07402 ThreadLockAlwaysWithPti(ptiCurrent, pmenu, &tlpmenu); 07403 07404 retval = xxxGetMenuItemRect( 07405 pwnd, 07406 pmenu, 07407 uItem, 07408 &rcItem); 07409 /* 07410 * Probe arguments 07411 */ 07412 try { 07413 ProbeAndWriteStructure(lprcItem, rcItem, RECT); 07414 } except (StubExceptionHandler(TRUE)) { 07415 MSGERRORCLEANUP(0); 07416 } 07417 07418 CLEANUPRECV(); 07419 07420 ThreadUnlock(&tlpmenu); 07421 07422 TRACE("NtUserGetMenuItemRect"); 07423 ENDRECV_HWNDLOCK_OPT(); 07424 }

W32KAPI BOOL NtUserGetMessage OUT LPMSG  pmsg,
IN HWND  hwnd,
IN UINT  wMsgFilterMin,
IN UINT  wMsgFilterMax
 

Definition at line 1888 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, msg, MSGERROR, ProbeAndWriteStructure, StubExceptionHandler, TRACE, TRUE, and xxxGetMessage.

Referenced by GetMessage().

01893 { 01894 MSG msg; 01895 01896 BEGINRECV(BOOL, FALSE); 01897 01898 retval = xxxGetMessage( 01899 &msg, 01900 hwnd, 01901 wMsgFilterMin, 01902 wMsgFilterMax); 01903 01904 /* 01905 * Probe arguments 01906 */ 01907 try { 01908 ProbeAndWriteStructure(pmsg, msg, MSG); 01909 } except (StubExceptionHandler(TRUE)) { 01910 MSGERROR(0); 01911 } 01912 01913 TRACE("NtUserGetMessage"); 01914 ENDRECV(); 01915 }

W32KAPI int NtUserGetMouseMovePointsEx IN UINT  cbSize,
IN CONST MOUSEMOVEPOINT *  lppt,
OUT MOUSEMOVEPOINT *  lpptBuf,
IN UINT  nBufPoints,
IN DWORD  resolution
 

Definition at line 6914 of file kernel/ntstubs.c.

References _GetMouseMovePointsEx(), BEGINRECV, DATAALIGN, ENDRECV, MAX_MOUSEPOINTS, MSGERROR, ProbeAndReadStructure, ProbeForWriteBuffer, StubExceptionHandler, TRACE, and TRUE.

06920 { 06921 MOUSEMOVEPOINT mmp; 06922 BEGINRECV(int, -1); 06923 06924 if (cbSize != sizeof(MOUSEMOVEPOINT) || nBufPoints > MAX_MOUSEPOINTS) { 06925 06926 RIPERR2(ERROR_INVALID_PARAMETER, RIP_VERBOSE, 06927 "GetMouseMovePointsEx: invalid cbSize %d or nBufPoints %d", 06928 cbSize, nBufPoints); 06929 MSGERROR(0); 06930 } 06931 06932 /* 06933 * Probe arguments 06934 */ 06935 try { 06936 mmp = ProbeAndReadStructure(lppt, MOUSEMOVEPOINT); 06937 ProbeForWriteBuffer(lpptBuf, nBufPoints, DATAALIGN); 06938 } except (StubExceptionHandler(TRUE)) { 06939 MSGERROR(0); 06940 } 06941 06942 /* 06943 * GetMouseMovePointsEx protects itself with a try block. 06944 * No it doesn't! 06945 */ 06946 06947 retval = _GetMouseMovePointsEx(&mmp, lpptBuf, nBufPoints, resolution); 06948 06949 TRACE("NtUserGetMouseMovePointsEx"); 06950 ENDRECV(); 06951 }

W32KAPI BOOL NtUserGetObjectInformation IN HANDLE  hObject,
IN int  nIndex,
OUT PVOID  pvInfo,
IN DWORD  nLength,
OUT LPDWORD  pnLengthNeeded
 

W32KAPI HWND NtUserGetOpenClipboardWindow VOID   ) 
 

Definition at line 5183 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, CheckClipboardAccess(), ENDRECV_SHARED, MSGERROR, NULL, PtoH, tagWINDOWSTATION::spwndClipOpen, and TRACE.

05185 { 05186 PWINDOWSTATION pwinsta; 05187 05188 BEGINRECV_SHARED(HWND, NULL); 05189 05190 /* 05191 * Blow it off if the caller doesn't have the proper access rights 05192 */ 05193 if ((pwinsta = CheckClipboardAccess()) == NULL) { 05194 MSGERROR(0); 05195 } 05196 05197 retval = PtoH(pwinsta->spwndClipOpen); 05198 05199 TRACE("NtUserGetOpenClipboardWindow"); 05200 ENDRECV_SHARED(); 05201 }

W32KAPI int NtUserGetPriorityClipboardFormat OUT UINT *  paFormatPriorityList,
IN int  cFormats
 

W32KAPI HWINSTA NtUserGetProcessWindowStation VOID   ) 
 

Definition at line 1150 of file kernel/ntstubs.c.

References _GetProcessWindowStation(), BEGINRECV_SHARED, ENDRECV_SHARED, NULL, and TRACE.

Referenced by CommonCreateDesktop(), and CommonOpenDesktop().

01152 { 01153 BEGINRECV_SHARED(HWINSTA, NULL); 01154 01155 _GetProcessWindowStation(&retval); 01156 01157 TRACE("NtUserGetProcessWindowStation"); 01158 ENDRECV_SHARED(); 01159 }

W32KAPI BOOL NtUserGetScrollBarInfo IN HWND  hwnd,
IN LONG  idObject,
IN OUT PSCROLLBARINFO  ptbi
 

Definition at line 3666 of file kernel/ntstubs.c.

References _GetScrollBarInfo(), BEGINRECV_HWND_SHARED, BOOL, DATAALIGN, ENDRECV_HWND_SHARED, FALSE, MSGERROR, ProbeForWrite(), StubExceptionHandler, TRACE, and TRUE.

03667 { 03668 SCROLLBARINFO sbi; 03669 03670 BEGINRECV_HWND_SHARED(BOOL, FALSE, hwnd); 03671 03672 /* 03673 * Probe arguments and copy out results 03674 */ 03675 try { 03676 ProbeForWrite(psbi, sizeof(*psbi), DATAALIGN); 03677 sbi.cbSize = psbi->cbSize; 03678 } except (StubExceptionHandler(TRUE)) { 03679 MSGERROR(0); 03680 } 03681 /* 03682 * Get the scrollbar info 03683 */ 03684 retval = _GetScrollBarInfo(pwnd, idObject, &sbi); 03685 03686 if (retval) { 03687 try { 03688 *psbi = sbi; 03689 } except (StubExceptionHandler(TRUE)) { 03690 MSGERROR(0); 03691 } 03692 } 03693 03694 TRACE("NtUserGetScrollBarInfo"); 03695 ENDRECV_HWND_SHARED(); 03696 }

W32KAPI HMENU NtUserGetSystemMenu IN HWND  hwnd,
IN BOOL  bRevert
 

Definition at line 5226 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, ENDRECV_HWNDLOCK, NULL, PtoH, TRACE, and xxxGetSystemMenu().

Referenced by DefFrameProcWorker(), DefMDIChildProcWorker(), InternalCreateDialog(), MB_DlgProcWorker(), and MDIClientWndProcWorker().

05229 { 05230 05231 // 05232 // N.B. This function has implicit window handle translation. This 05233 // operation is performed in the User server API dispatcher. 05234 // 05235 05236 BEGINRECV_HWNDLOCK(HMENU, NULL, hwnd); 05237 05238 retval = (HMENU)xxxGetSystemMenu(pwnd, bRevert); 05239 retval = PtoH((PVOID)retval); 05240 05241 TRACE("NtUserGetSystemMenu"); 05242 ENDRECV_HWNDLOCK(); 05243 }

W32KAPI HDESK NtUserGetThreadDesktop IN DWORD  dwThreadId,
IN HDESK  hdeskConsole
 

Definition at line 1455 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, ENDRECV_SHARED, NULL, TRACE, UserMode, and xxxGetThreadDesktop().

Referenced by ClientThreadSetup(), and GetThreadDesktop().

01458 { 01459 BEGINRECV_SHARED(HDESK, NULL); 01460 01461 retval = xxxGetThreadDesktop(dwThreadId, hdeskConsole, UserMode); 01462 01463 TRACE("NtUserGetThreadDesktop"); 01464 ENDRECV_SHARED(); 01465 }

W32KAPI ULONG_PTR NtUserGetThreadState IN USERTHREADSTATECLASS  ThreadState  ) 
 

Definition at line 7799 of file kernel/ntstubs.c.

References _GetInputState(), BEGINRECV_SHARED, tagDESKTOP::dwConsoleIMEThreadId, tagPROCESSINFO::dwImeCompatFlags, DWORD, ENDRECV_SHARED, tagQ::ExtraInfo, FALSE, tagCLIENTTHREADINFO::fsChangeBits, GetCurrentProcessId, gpidLogon, gpqForeground, tagTHREADINFO::hklPrev, HW, MSGERROR, NULL, tagTHREADINFO::pcti, tagTHREADINFO::ppi, tagTHREADINFO::pq, tagTHREADINFO::psmsCurrent, PtiCurrentShared, PtiFromThreadId(), PtoH, tagTHREADINFO::rpdesk, SET_TIME_LAST_READ, SMF_CB_REPLY, SMF_CB_REQUEST, SMF_REPLY, tagQ::spcurCurrent, tagTHREADINFO::spDefaultImc, tagQ::spwndActive, tagQ::spwndCapture, tagTHREADINFO::spwndDefaultIme, tagQ::spwndFocus, tagTHREADINFO::timeLast, and TRUE.

Referenced by GetActiveWindow(), GetCapture(), GetCursor(), GetFocus(), GetInputState(), GetMessageExtraInfo(), GetMessageTime(), IMENonIMEToggle(), ImeSetContextHandler(), ImmCreateContext(), ImmDllInitialize(), ImmEnableIME(), ImmGetDefaultIMEWnd(), ImmGetSaveContext(), ImmLockClientImc(), InquireIme(), InSendMessage(), InSendMessageEx(), and PeekMessage().

07801 { 07802 PTHREADINFO ptiCurrent = PtiCurrentShared(); 07803 07804 BEGINRECV_SHARED(ULONG_PTR, 0); 07805 07806 switch (ThreadState) { 07807 case UserThreadStateFocusWindow: 07808 retval = (ULONG_PTR)HW(ptiCurrent->pq->spwndFocus); 07809 break; 07810 case UserThreadStateActiveWindow: 07811 retval = (ULONG_PTR)HW(ptiCurrent->pq->spwndActive); 07812 break; 07813 case UserThreadStateCaptureWindow: 07814 retval = (ULONG_PTR)HW(ptiCurrent->pq->spwndCapture); 07815 break; 07816 case UserThreadStateDefaultImeWindow: 07817 retval = (ULONG_PTR)HW(ptiCurrent->spwndDefaultIme); 07818 break; 07819 case UserThreadStateDefaultInputContext: 07820 retval = (ULONG_PTR)PtoH(ptiCurrent->spDefaultImc); 07821 break; 07822 case UserThreadStateImeCompatFlags: 07823 UserAssert(ptiCurrent->ppi != NULL); 07824 retval = (DWORD)(ptiCurrent->ppi->dwImeCompatFlags); 07825 break; 07826 case UserThreadStatePreviousKeyboardLayout: 07827 retval = (ULONG_PTR)(ptiCurrent->hklPrev); 07828 break; 07829 case UserThreadStateIsWinlogonThread: 07830 // Client IMM checks if the process is Login; 07831 // to prevent switching dictionaries, etc. 07832 // LATER: gpidLogin per WinStation ? 07833 retval = (DWORD)(GetCurrentProcessId() == gpidLogon); 07834 break; 07835 case UserThreadStateIsConImeThread: 07836 UserAssert(ptiCurrent->rpdesk != NULL); 07837 retval = (DWORD)(PtiFromThreadId(ptiCurrent->rpdesk->dwConsoleIMEThreadId) == ptiCurrent); 07838 break; 07839 case UserThreadStateInputState: 07840 retval = (DWORD)_GetInputState(); 07841 break; 07842 case UserThreadStateCursor: 07843 retval = (ULONG_PTR)PtoH(ptiCurrent->pq->spcurCurrent); 07844 break; 07845 case UserThreadStateChangeBits: 07846 retval = ptiCurrent->pcti->fsChangeBits; 07847 break; 07848 case UserThreadStatePeekMessage: 07849 /* 07850 * Update the last read time so that hung app painting won't occur. 07851 */ 07852 SET_TIME_LAST_READ(ptiCurrent); 07853 retval = (DWORD)FALSE; 07854 break; 07855 case UserThreadStateExtraInfo: 07856 retval = ptiCurrent->pq->ExtraInfo; 07857 break; 07858 07859 case UserThreadStateInSendMessage: 07860 if (ptiCurrent->psmsCurrent != NULL) { 07861 if (ptiCurrent->psmsCurrent->ptiSender != NULL) { 07862 retval = ISMEX_SEND; 07863 } else if (ptiCurrent->psmsCurrent->flags & (SMF_CB_REQUEST | SMF_CB_REPLY)) { 07864 retval = ISMEX_CALLBACK; 07865 } else { 07866 retval = ISMEX_NOTIFY; 07867 } 07868 07869 if (ptiCurrent->psmsCurrent->flags & SMF_REPLY) { 07870 retval |= ISMEX_REPLIED; 07871 } 07872 } else { 07873 retval = ISMEX_NOSEND; 07874 } 07875 break; 07876 07877 case UserThreadStateMessageTime: 07878 retval = ptiCurrent->timeLast; 07879 break; 07880 case UserThreadStateIsForeground: 07881 retval = (ptiCurrent->pq == gpqForeground); 07882 break; 07883 case UserThreadConnect: 07884 retval = TRUE; 07885 break; 07886 default: 07887 RIPMSG1(RIP_WARNING, "NtUserGetThreadState invalid ThreadState:%#x", ThreadState); 07888 MSGERROR(0); 07889 } 07890 07891 ENDRECV_SHARED(); 07892 }

W32KAPI BOOL NtUserGetTitleBarInfo IN HWND  hwnd,
IN OUT PTITLEBARINFO  ptbi
 

Definition at line 3527 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, BOOL, DATAALIGN, ENDRECV_HWNDLOCK, FALSE, MSGERROR, ProbeForWrite(), StubExceptionHandler, TRACE, TRUE, and xxxGetTitleBarInfo().

03528 { 03529 TITLEBARINFO tbi; 03530 03531 BEGINRECV_HWNDLOCK(BOOL, FALSE, hwnd); 03532 03533 /* 03534 * Probe arguments and copy out results 03535 */ 03536 try { 03537 ProbeForWrite(ptbi, sizeof(*ptbi), DATAALIGN); 03538 tbi.cbSize = ptbi->cbSize; 03539 } except (StubExceptionHandler(TRUE)) { 03540 MSGERROR(0); 03541 } 03542 /* 03543 * Get the titlebar info 03544 */ 03545 retval = xxxGetTitleBarInfo(pwnd, &tbi); 03546 if (retval) { 03547 try { 03548 *ptbi = tbi; 03549 } except (StubExceptionHandler(TRUE)) { 03550 MSGERROR(0); 03551 } 03552 } 03553 03554 TRACE("NtUserGetTitleBarInfo"); 03555 ENDRECV_HWNDLOCK(); 03556 }

W32KAPI BOOL NtUserGetUpdateRect IN HWND  hwnd,
IN LPRECT prect  OPTIONAL,
IN BOOL  bErase
 

Definition at line 5245 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, BOOL, DWORD, ENDRECV_HWNDLOCK, MSGERROR, ProbeAndWriteStructure, StubExceptionHandler, TRACE, TRUE, and xxxGetUpdateRect().

Referenced by GetUpdateRect().

05249 { 05250 05251 // 05252 // N.B. This function has implicit window translation and thread locking 05253 // enabled. These operations are performed in the User server API 05254 // dispatcher. 05255 // 05256 05257 RECT rect2; 05258 BEGINRECV_HWNDLOCK(DWORD, 0, hwnd); 05259 05260 retval = xxxGetUpdateRect( 05261 pwnd, 05262 prect? &rect2:NULL, 05263 bErase); 05264 /* 05265 * Probe arguments 05266 */ 05267 if (ARGUMENT_PRESENT(prect)) { 05268 try { 05269 ProbeAndWriteStructure(prect, rect2, RECT); 05270 } except (StubExceptionHandler(TRUE)) { 05271 MSGERROR(0); 05272 } 05273 } 05274 05275 TRACE("NtUserGetUpdateRect"); 05276 ENDRECV_HWNDLOCK(); 05277 }

W32KAPI int NtUserGetUpdateRgn IN HWND  hwnd,
IN HRGN  hRgn,
IN BOOL  bErase
 

Definition at line 6715 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, ENDRECV_HWNDLOCK, TRACE, and xxxGetUpdateRgn().

Referenced by GetUpdateRgn().

06719 { 06720 06721 // 06722 // N.B. This function has implicit window translation and thread locking 06723 // enabled. These operations are performed in the User server API 06724 // dispatcher. 06725 // 06726 06727 BEGINRECV_HWNDLOCK(int, ERROR, hwnd); 06728 06729 retval = xxxGetUpdateRgn( 06730 pwnd, 06731 hrgn, 06732 bErase); 06733 06734 TRACE("NtUserGetUpdateRgn"); 06735 ENDRECV_HWNDLOCK(); 06736 }

W32KAPI HDC NtUserGetWindowDC IN HWND  hwnd  ) 
 

Definition at line 6700 of file kernel/ntstubs.c.

References _GetWindowDC(), BEGINATOMICRECV, ENDATOMICRECV, NULL, TRACE, and ValidateHWNDOPT.

06702 { 06703 PWND pwnd; 06704 06705 BEGINATOMICRECV(HDC, NULL); 06706 06707 ValidateHWNDOPT(pwnd, hwnd); 06708 06709 retval = _GetWindowDC(pwnd); 06710 06711 TRACE("NtUserGetWindowDC"); 06712 ENDATOMICRECV(); 06713 }

W32KAPI BOOL NtUserGetWindowPlacement IN HWND  hwnd,
OUT PWINDOWPLACEMENT  pwp
 

Definition at line 4208 of file kernel/ntstubs.c.

References _GetWindowPlacement(), BEGINRECV_HWND, BOOL, DWORD, ENDRECV_HWND, MSGERROR, ProbeForWriteWindowPlacement, StubExceptionHandler, TestWF, TRACE, TRUE, and WFWIN40COMPAT.

04211 { 04212 04213 // 04214 // N.B. This function has implicit window handle translation. This 04215 // operation is performed in the User server API dispatcher. 04216 // 04217 04218 /* 04219 * Note -- this routine updates the checkpoint, so it needs exclusive 04220 * use of the crit sect. 04221 */ 04222 04223 WINDOWPLACEMENT wp; 04224 BEGINRECV_HWND(DWORD, 0, hwnd); 04225 04226 /* 04227 * Probe arguments 04228 */ 04229 try { 04230 ProbeForWriteWindowPlacement(pwp); 04231 wp.length = pwp->length; 04232 #ifdef LATER 04233 if (pwp->length != sizeof(WINDOWPLACEMENT)) { 04234 if (TestWF(pwnd, WFWIN40COMPAT)) { 04235 RIPERR1(ERROR_INVALID_PARAMETER, RIP_WARNING, "GetWindowPlacement: invalid length %lX", pwp->length); 04236 MSGERROR(0); 04237 } else { 04238 RIPMSG1(RIP_WARNING, "GetWindowPlacement: invalid length %lX", pwp->length); 04239 pwp->length = sizeof(WINDOWPLACEMENT); 04240 } 04241 } 04242 #endif 04243 04244 } except (StubExceptionHandler(TRUE)) { 04245 MSGERROR(0); 04246 } 04247 04248 retval = _GetWindowPlacement(pwnd, &wp); 04249 04250 try { 04251 RtlCopyMemory(pwp, &wp, sizeof (WINDOWPLACEMENT)); 04252 } except (StubExceptionHandler(TRUE)) { 04253 MSGERROR(0); 04254 } 04255 04256 TRACE("NtUserGetWindowPlacement"); 04257 ENDRECV_HWND(); 04258 }

W32KAPI PCLS NtUserGetWOWClass IN HINSTANCE  hInstance,
IN PUNICODE_STRING  pString
 

Definition at line 3023 of file kernel/ntstubs.c.

References _GetWOWClass(), BEGINRECV_SHARED, ENDRECV_SHARED, FALSE, MSGERROR, NULL, ProbeAndReadUnicodeString, ProbeForReadUnicodeStringBuffer, StubExceptionHandler, and TRACE.

Referenced by GetClassWOWWords().

03026 { 03027 UNICODE_STRING strClassName; 03028 03029 BEGINRECV_SHARED(PCLS, NULL); 03030 03031 /* 03032 * Probe arguments 03033 */ 03034 try { 03035 strClassName = ProbeAndReadUnicodeString(pString); 03036 ProbeForReadUnicodeStringBuffer(strClassName); 03037 } except (StubExceptionHandler(FALSE)) { 03038 MSGERROR(0); 03039 } 03040 03041 retval = _GetWOWClass( 03042 hInstance, 03043 strClassName.Buffer); 03044 03045 TRACE("NtUserGetWOWClass"); 03046 ENDRECV_SHARED(); 03047 }

W32KAPI UINT NtUserHardErrorControl IN HARDERRORCONTROL  dwCmd,
IN HANDLE handle  OPTIONAL,
OUT PDESKRESTOREDATA pdrdRestore  OPTIONAL
 

Definition at line 643 of file kernel/ntstubs.c.

References BEGINRECVCSRSS, BOOL, DWORD, ENDRECVCSRSS, ProbeForWrite(), TRACE, UINT, and xxxHardErrorControl().

Referenced by BoostHardError(), CheckDefaultDesktop(), and HardErrorHandler().

00647 { 00648 BEGINRECVCSRSS(BOOL, HEC_ERROR); 00649 00650 #if DBG 00651 if (ARGUMENT_PRESENT(pdrdRestore)) { 00652 ProbeForWrite(pdrdRestore, sizeof(DESKRESTOREDATA), sizeof(DWORD)); 00653 } 00654 #endif 00655 00656 retval = xxxHardErrorControl(dwCmd, handle, pdrdRestore); 00657 00658 TRACE("NtUserHardErrorControl"); 00659 ENDRECVCSRSS(); 00660 }

W32KAPI BOOL NtUserHideCaret IN HWND  hwnd  ) 
 

Definition at line 5279 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, TRACE, ValidateHWNDOPT, and zzzHideCaret().

Referenced by ECGetEditDC(), ECInOutReconversionMode(), ECSetCaretHandler(), ECSetFont(), MLChangeSelection(), MLDrawText(), MLEditWndProc(), SLChangeSelection(), SLEditWndProc(), and SLPaint().

05281 { 05282 PWND pwnd; 05283 05284 BEGINRECV(BOOL, FALSE); 05285 05286 ValidateHWNDOPT(pwnd, hwnd); 05287 05288 retval = zzzHideCaret(pwnd); 05289 05290 TRACE("NtUserHideCaret"); 05291 ENDRECV(); 05292 }

W32KAPI BOOL NtUserHiliteMenuItem IN HWND  hwnd,
IN HMENU  hMenu,
IN UINT  uIDHiliteItem,
IN UINT  uHilite
 

Definition at line 5294 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, BOOL, DWORD, ENDRECV_HWNDLOCK, TESTFLAGS, ThreadLockAlwaysWithPti, ThreadUnlock, TRACE, ValidateHMENUMODIFY, and xxxHiliteMenuItem().

05299 { 05300 05301 // 05302 // N.B. This function has implicit window translation and thread locking 05303 // enabled. These operations are performed in the User server API 05304 // dispatcher. 05305 // 05306 05307 PMENU pmenu; 05308 TL tlpmenu; 05309 05310 BEGINRECV_HWNDLOCK(DWORD, 0, hwnd); 05311 05312 TESTFLAGS(uHilite, MF_VALID); 05313 05314 ValidateHMENUMODIFY(pmenu, hMenu); 05315 05316 ThreadLockAlwaysWithPti(ptiCurrent, pmenu, &tlpmenu); 05317 05318 retval = xxxHiliteMenuItem( 05319 pwnd, 05320 pmenu, 05321 uIDHiliteItem, 05322 uHilite); 05323 05324 ThreadUnlock(&tlpmenu); 05325 05326 TRACE("NtUserHiliteMenuItem"); 05327 ENDRECV_HWNDLOCK(); 05328 }

W32KAPI BOOL NtUserImpersonateDdeClientWindow IN HWND  hwndClient,
IN HWND  hwndServer
 

Definition at line 8670 of file kernel/ntstubs.c.

References _ImpersonateDdeClientWindow(), BEGINATOMICRECV_HWND, BOOL, ENDATOMICRECV_HWND, FALSE, GETPTI, GETPWNDPPI, MSGERROR, PtiCurrent, TRACE, TRUE, and ValidateHWND.

Referenced by DdeImpersonateClient().

08673 { 08674 08675 // 08676 // N.B. This function has implicit window handle translation. This 08677 // operation is performed in the User server API dispatcher. 08678 // 08679 08680 PWND pwndServer; 08681 08682 BEGINATOMICRECV_HWND(BOOL, FALSE, hwndClient); 08683 08684 ValidateHWND(pwndServer, hwndServer); 08685 if (GETPTI(pwndServer) != PtiCurrent()) { 08686 RIPERR0(ERROR_INVALID_PARAMETER, RIP_VERBOSE, ""); 08687 MSGERROR(0); 08688 } 08689 08690 if (GETPWNDPPI(pwnd) == GETPWNDPPI(pwndServer)) { 08691 retval = TRUE; // impersonating self is a NOOP 08692 } else { 08693 retval = _ImpersonateDdeClientWindow(pwnd, pwndServer); 08694 } 08695 08696 TRACE("NtUserImpersonateDdeClientWindow"); 08697 ENDATOMICRECV_HWND(); 08698 }

W32KAPI NTSTATUS NtUserInitialize IN DWORD  dwVersion,
IN HANDLE  hPowerRequestEvent,
IN HANDLE  hMediaRequestEvent
 

Definition at line 2713 of file kernel/server.c.

References gbRemoteSession, gpepCSRSS, gSessionId, InitializeMediaChange(), InitializePowerRequestList(), KeBugCheckEx(), NT_SUCCESS, NTSTATUS(), NULL, PsGetCurrentProcess, Status, TellGdiToGetReady(), TRACE_INIT, TRUE, USERCURRENTVERSION, UserInitialize(), and _EPROCESS::Win32Process.

Referenced by UserServerDllInitialization().

02717 { 02718 NTSTATUS Status; 02719 02720 TRACE_INIT(("Entering NtUserInitialize\n")); 02721 02722 /* 02723 * Make sure we're not trying to load this twice. 02724 */ 02725 if (gpepCSRSS != NULL) { 02726 RIPMSG0(RIP_ERROR, "Can't initialize more than once"); 02727 return STATUS_UNSUCCESSFUL; 02728 } 02729 02730 /* 02731 * Check version number 02732 */ 02733 if (dwVersion != USERCURRENTVERSION) { 02734 KeBugCheckEx(WIN32K_INIT_OR_RIT_FAILURE, 02735 0, 02736 0, 02737 dwVersion, 02738 USERCURRENTVERSION); 02739 } 02740 02741 /* 02742 * Get the session ID from the EPROCESS structure 02743 */ 02744 gSessionId = PsGetCurrentProcess()->SessionId; 02745 02746 UserAssert(gSessionId == 0 || gbRemoteSession == TRUE); 02747 02748 /* 02749 * Initialize the power request list. 02750 */ 02751 Status = InitializePowerRequestList(hPowerRequestEvent); 02752 if (!NT_SUCCESS(Status)) { 02753 return Status; 02754 } 02755 02756 InitializeMediaChange(hMediaRequestEvent); 02757 02758 /* 02759 * Save the system process structure. 02760 */ 02761 gpepCSRSS = PsGetCurrentProcess(); 02762 02763 if (!TellGdiToGetReady()) 02764 { 02765 RIPMSG0(RIP_WARNING, "TellGdiToGetReady failed"); 02766 Status = STATUS_UNSUCCESSFUL; 02767 return Status; 02768 } 02769 02770 /* 02771 * Allow CSR to read the screen 02772 */ 02773 ((PW32PROCESS)gpepCSRSS->Win32Process)->W32PF_Flags |= (W32PF_READSCREENACCESSGRANTED|W32PF_IOWINSTA); 02774 02775 02776 Status = UserInitialize(); 02777 02778 TRACE_INIT(("Leaving NtUserInitialize\n")); 02779 return Status; 02780 }

W32KAPI NTSTATUS NtUserInitializeClientPfnArrays IN CONST PFNCLIENT *ppfnClientA  OPTIONAL,
IN CONST PFNCLIENT *ppfnClientW  OPTIONAL,
IN CONST PFNCLIENTWORKER *ppfnClientWorker  OPTIONAL,
IN HANDLE  hModUser
 

Definition at line 1508 of file kernel/ntstubs.c.

References BEGINRECV, DWORD, ENDRECV, FALSE, InitializeClientPfnArrays(), MSGERROR, NTSTATUS(), ProbeForRead, StubExceptionHandler, and TRACE.

Referenced by ClientThreadSetup().

01513 { 01514 BEGINRECV(NTSTATUS, STATUS_UNSUCCESSFUL); 01515 01516 /* 01517 * Probe all read arguments 01518 */ 01519 try { 01520 if (ARGUMENT_PRESENT(ppfnClientA)) { 01521 ProbeForRead(ppfnClientA, sizeof(*ppfnClientA), sizeof(DWORD)); 01522 } 01523 if (ARGUMENT_PRESENT(ppfnClientW)) { 01524 ProbeForRead(ppfnClientW, sizeof(*ppfnClientW), sizeof(DWORD)); 01525 } 01526 01527 if (ARGUMENT_PRESENT(ppfnClientWorker)) { 01528 ProbeForRead(ppfnClientWorker, sizeof(*ppfnClientWorker), sizeof(DWORD)); 01529 } 01530 01531 retval = InitializeClientPfnArrays( 01532 ppfnClientA, ppfnClientW, ppfnClientWorker, hModUser); 01533 } except (StubExceptionHandler(FALSE)) { 01534 MSGERROR(0); 01535 } 01536 01537 TRACE("NtUserInitializeThreadInfo"); 01538 ENDRECV(); 01539 }

W32KAPI NTSTATUS NtUserInitTask IN UINT  dwExpWinVer,
IN DWORD  dwAppCompatFlags,
IN PUNICODE_STRING  pstrModName,
IN PUNICODE_STRING  pstrBaseFileName,
IN DWORD  hTaskWow,
IN DWORD  dwHotkey,
IN DWORD  idTask,
IN DWORD  dwX,
IN DWORD  dwY,
IN DWORD  dwXSize,
IN DWORD  dwYSize
 

Definition at line 3098 of file kernel/ntstubs.c.

References BEGINRECV, ENDRECV, FALSE, MSGERROR, NTSTATUS(), NULL, PpiCurrent, ProbeAndReadUnicodeString, ProbeForReadUnicodeStringBuffer, StubExceptionHandler, TRACE, and zzzInitTask().

Referenced by InitTask().

03110 { 03111 UNICODE_STRING strModName; 03112 UNICODE_STRING strBaseFileName; 03113 03114 BEGINRECV(NTSTATUS, STATUS_UNSUCCESSFUL); 03115 03116 /* 03117 * Make sure this is really a WOW process. 03118 */ 03119 if (PpiCurrent()->pwpi == NULL) { 03120 MSGERROR(0); 03121 } 03122 03123 /* 03124 * Probe arguments 03125 */ 03126 try { 03127 strModName = ProbeAndReadUnicodeString(pstrModName); 03128 /* 03129 * pstrModName->Buffer has a UNICODE_NULL that's not counted in 03130 * the length, but we want to include it for convenience. The 03131 * probe routine does this. 03132 */ 03133 ProbeForReadUnicodeStringBuffer(strModName); 03134 03135 if (pstrBaseFileName) { 03136 strBaseFileName = ProbeAndReadUnicodeString(pstrBaseFileName); 03137 ProbeForReadUnicodeStringBuffer(strBaseFileName); 03138 } 03139 03140 } except (StubExceptionHandler(FALSE)) { 03141 MSGERROR(0); 03142 } 03143 03144 retval = zzzInitTask( 03145 dwExpWinVer, 03146 dwAppCompatFlags, 03147 &strModName, 03148 pstrBaseFileName ? &strBaseFileName : NULL, 03149 hTaskWow, 03150 dwHotkey, 03151 idTask, 03152 dwX, 03153 dwY, 03154 dwXSize, 03155 dwYSize); 03156 03157 TRACE("NtUserInitTask"); 03158 ENDRECV(); 03159 }

W32KAPI int NtUserInternalGetWindowText IN HWND  hwnd,
OUT LPWSTR  lpString,
IN int  nMaxCount
 

Definition at line 6874 of file kernel/ntstubs.c.

References BEGINRECV_HWND_SHARED, CHARALIGN, DWORD, ENDRECV_HWND_SHARED, FALSE, MSGERROR, ProbeForWriteBuffer, StubExceptionHandler, TextCopy(), and TRACE.

Referenced by InternalGetWindowText().

06878 { 06879 06880 // 06881 // N.B. This function has implicit window handle translation. This 06882 // operation is performed in the User server API dispatcher. 06883 // 06884 06885 BEGINRECV_HWND_SHARED(DWORD, 0, hwnd); 06886 06887 if (nMaxCount) { 06888 /* 06889 * Probe arguments 06890 */ 06891 try { 06892 ProbeForWriteBuffer(lpString, nMaxCount, CHARALIGN); 06893 /* 06894 * Initialize string empty. 06895 */ 06896 *lpString = TEXT('\0'); 06897 if (pwnd->strName.Length) { 06898 retval = TextCopy(&pwnd->strName, lpString, nMaxCount); 06899 } else { 06900 retval = 0; 06901 } 06902 06903 } except (StubExceptionHandler(FALSE)) { 06904 MSGERROR(0); // private API, don't SetLastError 06905 } 06906 } else { 06907 MSGERROR(0); 06908 } 06909 06910 TRACE("NtUserInternalGetWindowText"); 06911 ENDRECV_HWND_SHARED(); 06912 }

W32KAPI BOOL NtUserInvalidateRect IN HWND  hwnd,
IN CONST RECT *prect  OPTIONAL,
IN BOOL  bErase
 

Definition at line 5330 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, MSGERROR, ProbeAndReadRect, StubExceptionHandler, ThreadLock, ThreadUnlock, TRACE, TRUE, ValidateHWNDOPT, and xxxInvalidateRect().

Referenced by BNSetFont(), ButtonWndProcWorker(), ComboBoxWndProcWorker(), ECInvalidateClient(), ECSize(), ListBoxWndProcWorker(), MLDeleteText(), MLDrawText(), MLInsertText(), MLScroll(), MLSetTabStops(), SLKillFocus(), StaticWndProcWorker(), xxxCBHideListBoxWindow(), xxxCBSetFontHandler(), xxxCBShowListBoxWindow(), xxxDlgDirListHelper(), xxxLBInvalidateRect(), xxxLBResetContent(), xxxLBSize(), xxxNextAniIconStep(), xxxPressButton(), and xxxSetStaticImage().

05334 { 05335 PWND pwnd; 05336 TL tlpwnd; 05337 RECT rc; 05338 05339 BEGINRECV(BOOL, FALSE); 05340 05341 ValidateHWNDOPT(pwnd, hwnd); 05342 05343 /* 05344 * Probe arguments 05345 */ 05346 if (ARGUMENT_PRESENT(prect)) { 05347 try { 05348 rc = ProbeAndReadRect(prect); 05349 prect = &rc; 05350 } except (StubExceptionHandler(TRUE)) { 05351 MSGERROR(0); 05352 } 05353 } 05354 05355 ThreadLock(pwnd, &tlpwnd); 05356 05357 retval = xxxInvalidateRect( 05358 pwnd, 05359 (PRECT)prect, 05360 bErase); 05361 05362 ThreadUnlock(&tlpwnd); 05363 05364 TRACE("NtUserInvalidateRect"); 05365 ENDRECV(); 05366 }

W32KAPI BOOL NtUserInvalidateRgn IN HWND  hwnd,
IN HRGN  hRgn,
IN BOOL  bErase
 

Definition at line 6778 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, BOOL, ENDRECV_HWNDLOCK, FALSE, TRACE, and xxxInvalidateRgn().

06782 { 06783 06784 // 06785 // N.B. This function has implicit window translation and thread locking 06786 // enabled. These operations are performed in the User server API 06787 // dispatcher. 06788 // 06789 06790 BEGINRECV_HWNDLOCK(BOOL, FALSE, hwnd); 06791 06792 retval = xxxInvalidateRgn( 06793 pwnd, 06794 hrgn, 06795 bErase); 06796 06797 TRACE("NtUserInvalidateRgn"); 06798 ENDRECV_HWNDLOCK(); 06799 }

W32KAPI BOOL NtUserIsClipboardFormatAvailable IN UINT  nFormat  ) 
 

Definition at line 5368 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, BOOL, CheckClipboardAccess(), ENDRECV_SHARED, FALSE, FindClipFormat(), MSGERROR, NULL, and TRACE.

Referenced by ECMenu().

05370 { 05371 PWINDOWSTATION pwinsta; 05372 05373 BEGINRECV_SHARED(BOOL, FALSE); 05374 05375 /* 05376 * Blow it off if the caller doesn't have the proper access rights 05377 */ 05378 if ((pwinsta = CheckClipboardAccess()) == NULL) { 05379 MSGERROR(0); 05380 } 05381 05382 retval = (FindClipFormat(pwinsta, nFormat) != NULL); 05383 05384 TRACE("NtUserIsClipboardFormatAvailable"); 05385 ENDRECV_SHARED(); 05386 }

W32KAPI BOOL NtUserKillTimer IN HWND  hwnd,
IN UINT_PTR  nIDEvent
 

Definition at line 5388 of file kernel/ntstubs.c.

References _KillTimer(), BEGINATOMICRECV, BOOL, ENDATOMICRECV, FALSE, TRACE, and ValidateHWNDOPT.

Referenced by DdeClientTransaction(), ListBoxWndProcWorker(), ReaderWndProc(), StaticWndProcWorker(), xxxCaretDestroy(), xxxLBButtonUp(), xxxLBoxCtlKeyInput(), xxxNextAniIconStep(), xxxSetStaticImage(), and xxxTrackMouse().

05391 { 05392 PWND pwnd; 05393 05394 BEGINATOMICRECV(BOOL, FALSE); 05395 05396 ValidateHWNDOPT(pwnd, hwnd); 05397 05398 retval = _KillTimer( 05399 pwnd, 05400 nIDEvent); 05401 05402 TRACE("NtUserKillTimer"); 05403 ENDATOMICRECV(); 05404 }

HANDLE NtUserLoadIcoCur HANDLE  hIcon,
DWORD  cxNew,
DWORD  cyNew,
DWORD  LR_flags
 

W32KAPI HKL NtUserLoadKeyboardLayoutEx IN HANDLE  hFile,
IN DWORD  offTable,
IN HKL  hkl,
IN PUNICODE_STRING  pstrKLID,
IN UINT  KbdInputLocale,
IN UINT  Flags
 

Definition at line 8449 of file kernel/ntstubs.c.

References _GetProcessWindowStation(), BEGINRECV, CHARALIGN, ENDRECV, min, MSGERROR, NULL, ProbeAndReadUnicodeString, ProbeForRead, StubExceptionHandler, TESTFLAGS, TRACE, TRUE, UINT, and xxxLoadKeyboardLayoutEx().

Referenced by _LoadKeyboardLayoutEx().

08456 { 08457 UNICODE_STRING strKLID; 08458 PWINDOWSTATION pwinsta; 08459 WCHAR awchKF[sizeof(((PKL)0)->spkf->awchKF)]; 08460 UINT chMax; 08461 08462 BEGINRECV(HKL, NULL); 08463 08464 TESTFLAGS(Flags, KLF_VALID); 08465 08466 pwinsta = _GetProcessWindowStation(NULL); 08467 08468 /* 08469 * Probe arguments 08470 */ 08471 try { 08472 strKLID = ProbeAndReadUnicodeString(pstrKLID); 08473 ProbeForRead(strKLID.Buffer, strKLID.Length, CHARALIGN); 08474 chMax = min(sizeof(awchKF) - sizeof(WCHAR), strKLID.Length) / sizeof(WCHAR); 08475 wcsncpy(awchKF, strKLID.Buffer, chMax); 08476 awchKF[chMax] = 0; 08477 } except (StubExceptionHandler(TRUE)) { 08478 MSGERROR(0); 08479 } 08480 08481 retval = xxxLoadKeyboardLayoutEx( 08482 pwinsta, 08483 hFile, 08484 hkl, 08485 offTable, 08486 awchKF, 08487 KbdInputLocale, 08488 Flags); 08489 08490 TRACE("NtUserLoadKeyboardLayoutEx"); 08491 ENDRECV(); 08492 }

W32KAPI UINT NtUserLockWindowStation IN HWINSTA  hWindowStation  ) 
 

Definition at line 7070 of file kernel/ntstubs.c.

References _LockWindowStation(), BEGINRECV, ENDRECV, MSGERROR, NT_SUCCESS, NTSTATUS(), ObDereferenceObject, Status, TRACE, UINT, UserMode, and ValidateHwinsta().

07072 { 07073 PWINDOWSTATION pwinsta; 07074 NTSTATUS Status; 07075 07076 BEGINRECV(UINT, 0); 07077 07078 Status = ValidateHwinsta(hwinsta, UserMode, 0, &pwinsta); 07079 if (!NT_SUCCESS(Status)) 07080 MSGERROR(0); 07081 07082 retval = _LockWindowStation(pwinsta); 07083 07084 ObDereferenceObject(pwinsta); 07085 07086 TRACE("NtUserLockWindowStation"); 07087 ENDRECV(); 07088 }

W32KAPI BOOL NtUserLockWindowUpdate IN HWND  hwnd  ) 
 

Definition at line 4298 of file kernel/ntstubs.c.

References BEGINATOMICRECV, BOOL, ENDATOMICRECV, FALSE, LockWindowUpdate2(), TRACE, and ValidateHWNDOPT.

Referenced by UnmaximizeChildWindows().

04300 { 04301 PWND pwnd; 04302 04303 BEGINATOMICRECV(BOOL, FALSE); 04304 04305 ValidateHWNDOPT(pwnd, hwnd); 04306 04307 retval = LockWindowUpdate2(pwnd, FALSE); 04308 04309 TRACE("NtUserLockWindowUpdate"); 04310 ENDATOMICRECV(); 04311 }

W32KAPI BOOL NtUserLockWorkStation VOID   ) 
 

Definition at line 1161 of file kernel/ntstubs.c.

References _LockWorkStation(), BEGINRECV, BOOL, ENDRECV, FALSE, and TRACE.

01163 { 01164 BEGINRECV(BOOL, FALSE); 01165 01166 retval = _LockWorkStation(); 01167 01168 TRACE("NtUserLockWorkStation"); 01169 ENDRECV(); 01170 }

W32KAPI UINT NtUserMapVirtualKeyEx IN UINT  uCode,
IN UINT  uMapType,
IN ULONG_PTR  dwHKLorPKL,
IN BOOL  bHKL
 

Definition at line 9089 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, ENDRECV_SHARED, HKLtoPKL(), InternalMapVirtualKeyEx(), NULL, tagKBDFILE::pKbdTbl, PtiCurrentShared, tagKL::spkf, TRACE, and UINT.

Referenced by MapVirtualKey(), and MapVirtualKeyEx().

09094 { 09095 PKL pkl; 09096 09097 BEGINRECV_SHARED(UINT, 0); 09098 09099 /* 09100 * See if we need to convert an HKL to a PKL. MapVirtualKey passes a PKL and 09101 * MapVirtualKeyEx passes an HKL. The conversion must be done in the kernel. 09102 */ 09103 if (bHKL) { 09104 pkl = HKLtoPKL(PtiCurrentShared(), (HKL)dwHKLorPKL); 09105 } else { 09106 pkl = PtiCurrentShared()->spklActive; 09107 } 09108 09109 if (pkl == NULL) { 09110 retval = 0; 09111 } else { 09112 retval = InternalMapVirtualKeyEx(uCode, uMapType, pkl->spkf->pKbdTbl); 09113 } 09114 09115 TRACE("NtUserMapVirtualKeyEx"); 09116 ENDRECV_SHARED(); 09117 }

W32KAPI int NtUserMenuItemFromPoint IN HWND  hwnd,
IN HMENU  hMenu,
IN POINT  ptScreen
 

Definition at line 7426 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK_OPT, DWORD, ENDRECV_HWNDLOCK_OPT, ThreadLockAlwaysWithPti, ThreadUnlock, TRACE, ValidateHMENU, and xxxMenuItemFromPoint().

07430 { 07431 07432 // 07433 // N.B. This function has implicit window translation and thread locking 07434 // enabled. These operations are performed in the User server API 07435 // dispatcher. 07436 // 07437 07438 PMENU pmenu; 07439 TL tlpmenu; 07440 07441 BEGINRECV_HWNDLOCK_OPT(DWORD, -1, hwnd); 07442 07443 ValidateHMENU(pmenu, hMenu); 07444 07445 ThreadLockAlwaysWithPti(ptiCurrent, pmenu, &tlpmenu); 07446 07447 retval = xxxMenuItemFromPoint( 07448 pwnd, 07449 pmenu, 07450 ptScreen); 07451 07452 ThreadUnlock(&tlpmenu); 07453 07454 TRACE("NtUserMenuItemFromPoint"); 07455 ENDRECV_HWNDLOCK_OPT(); 07456 }

W32KAPI LRESULT NtUserMessageCall IN HWND  hwnd,
IN UINT  msg,
IN WPARAM  wParam,
IN LPARAM  lParam,
IN ULONG_PTR  xParam,
IN DWORD  xpfnProc,
IN BOOL  bAnsi
 

Definition at line 9804 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, CALLPROC, ENDRECV_HWNDLOCK, tagMSG_TABLE_ENTRY::iFunction, MessageTable, msg, MSGFLAG_MASK, and TRACE.

Referenced by MESSAGECALL().

09812 { 09813 BEGINRECV_HWNDLOCK(LRESULT, 0, hwnd); 09814 09815 if ((msg & ~MSGFLAG_MASK) >= WM_USER) { 09816 retval = CALLPROC(xpfnProc)( 09817 pwnd, 09818 msg, 09819 wParam, 09820 lParam, 09821 xParam); 09822 } else { 09823 retval = gapfnMessageCall[MessageTable[(msg & ~MSGFLAG_MASK)].iFunction]( 09824 pwnd, 09825 msg, 09826 wParam, 09827 lParam, 09828 xParam, 09829 xpfnProc, 09830 bAnsi); 09831 } 09832 09833 TRACE("NtUserMessageCall"); 09834 ENDRECV_HWNDLOCK(); 09835 }

W32KAPI HWND NtUserMinMaximize IN HWND  hwnd,
IN UINT  nCmdShow,
IN BOOL  fKeepHidden
 

Definition at line 5406 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK_ND, ENDRECV_HWNDLOCK_ND, MINMAX_KEEPHIDDEN, NULL, PtoH, PUDF_ANIMATE, TEST_PUDF, TRACE, and xxxMinMaximize().

Referenced by CreateMDIChild(), and xxxChildResize().

05410 { 05411 BEGINRECV_HWNDLOCK_ND(HWND, NULL, hwnd); 05412 05413 retval = (HWND)xxxMinMaximize( 05414 pwndND, 05415 nCmdShow, 05416 ((fKeepHidden) ? MINMAX_KEEPHIDDEN : 0) | TEST_PUDF(PUDF_ANIMATE)); 05417 retval = PtoH((PVOID)retval); 05418 05419 TRACE("NtUserMinMaximize"); 05420 ENDRECV_HWNDLOCK_ND(); 05421 }

W32KAPI BOOL NtUserMNDragLeave VOID   ) 
 

Definition at line 5473 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, TRACE, and xxxMNDragLeave().

Referenced by mndtDragLeave().

05474 { 05475 BEGINRECV(BOOL, FALSE); 05476 retval = xxxMNDragLeave(); 05477 TRACE("NtUserMNDragLeave"); 05478 ENDRECV(); 05479 }

W32KAPI BOOL NtUserMNDragOver IN POINT *  ppt,
OUT PMNDRAGOVERINFO  pmndoi
 

Definition at line 5432 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, MSGERROR, ProbeAndReadPoint, ProbeAndWriteStructure, StubExceptionHandler, TRACE, and xxxMNDragOver().

Referenced by mndtDragOver().

05435 { 05436 POINT pt; 05437 MNDRAGOVERINFO mndoi; 05438 05439 BEGINRECV(BOOL, FALSE); 05440 05441 /* 05442 * No need to SetLastError since ppt and pmndoi are always addresses of 05443 * local stack variables in USER, not addresses from an application 05444 */ 05445 try { 05446 pt = ProbeAndReadPoint(ppt); 05447 } except (StubExceptionHandler(FALSE)) { 05448 RIPMSG1(RIP_WARNING, "NtUserMNDragOver: Exception:%#lx", GetExceptionCode()); 05449 MSGERROR(0); 05450 } 05451 05452 retval = xxxMNDragOver(&pt, &mndoi); 05453 05454 if (retval) { 05455 try { 05456 ProbeAndWriteStructure(pmndoi, mndoi, MNDRAGOVERINFO); 05457 } except (StubExceptionHandler(FALSE)) { 05458 RIPMSG1(RIP_WARNING, "NtUserMNDragOver: Exception:%#lx", GetExceptionCode()); 05459 MSGERROR(0); 05460 } 05461 } 05462 05463 TRACE("NtUserMNDragOver"); 05464 ENDRECV(); 05465 }

W32KAPI VOID NtUserModifyUserStartupInfoFlags IN DWORD  dwMask,
IN DWORD  dwFlags
 

Definition at line 7703 of file kernel/ntstubs.c.

References BEGINRECV_VOID, dwFlags, ENDRECV_VOID, PpiCurrent, TRACEVOID, and VOID().

Referenced by MessageBoxWorker().

07706 { 07707 BEGINRECV_VOID(); 07708 07709 PpiCurrent()->usi.dwFlags = (PpiCurrent()->usi.dwFlags & ~dwMask) | (dwFlags & dwMask); 07710 07711 TRACEVOID("NtUserModifyUserStartupInfoFlags"); 07712 ENDRECV_VOID(); 07713 }

W32KAPI BOOL NtUserMoveWindow IN HWND  hwnd,
IN int  x,
IN int  y,
IN int  cx,
IN int  cy,
IN BOOL  fRepaint
 

Definition at line 1917 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK_ND, BOOL, cy, ENDRECV_HWNDLOCK_ND, FALSE, MSGERROR, TRACE, and xxxMoveWindow().

Referenced by DefFrameProcWorker(), MDIClientWndProcWorker(), xxxCBPosition(), xxxCBSetDroppedSize(), xxxCBSetEditItemHeight(), and xxxLBCreate().

01924 { 01925 BEGINRECV_HWNDLOCK_ND(BOOL, FALSE, hwnd); 01926 01927 /* 01928 * Make sure the window coordinates can fit in WORDs. 01929 */ 01930 if (x > SHRT_MAX) { 01931 x = SHRT_MAX; 01932 } else if (x < SHRT_MIN) { 01933 x = SHRT_MIN; 01934 } 01935 if (y > SHRT_MAX) { 01936 y = SHRT_MAX; 01937 } else if (y < SHRT_MIN) { 01938 y = SHRT_MIN; 01939 } 01940 01941 /* 01942 * Actually, if we were going to be really strict about this we'd 01943 * make sure that x + cx < SHRT_MAX, etc but since we do maintain 01944 * signed 32-bit coords internally this case doesn't cause a problem. 01945 */ 01946 if (cx < 0) { 01947 cx = 0; 01948 } else if (cx > SHRT_MAX) { 01949 cx = SHRT_MAX; 01950 } 01951 if (cy < 0) { 01952 cy = 0; 01953 } else if (cy > SHRT_MAX) { 01954 cy = SHRT_MAX; 01955 } 01956 01957 #ifdef NEVER 01958 // 01959 // do not fail these conditions because real apps use them. 01960 // 01961 if (x > SHRT_MAX || x < SHRT_MIN || 01962 y > SHRT_MAX || y < SHRT_MIN) { 01963 RIPERR0(ERROR_INVALID_PARAMETER, RIP_WARNING, "Invalid coordinate passed to MoveWindow"); 01964 MSGERROR(0); 01965 } 01966 01967 /* 01968 * Actually, if we were going to be really strict about this we'd 01969 * make sure that x + cx < SHRT_MAX, etc but since we do maintain 01970 * signed 32-bit coords internally this case doesn't cause a problem. 01971 */ 01972 if (cx < 0 || cx > SHRT_MAX || 01973 cy < 0 || cy > SHRT_MAX) { 01974 RIPERR0(ERROR_INVALID_PARAMETER, RIP_WARNING, "Invalid width/height passed to MoveWindow"); 01975 MSGERROR(0); 01976 } 01977 #endif 01978 01979 retval = xxxMoveWindow( 01980 pwndND, 01981 x, 01982 y, 01983 cx, 01984 cy, 01985 fRepaint); 01986 01987 TRACE("NtUserMoveWindow"); 01988 ENDRECV_HWNDLOCK_ND(); 01989 }

W32KAPI BOOL NtUserNotifyProcessCreate IN DWORD  dwProcessId,
IN DWORD  dwParentThreadId,
IN ULONG_PTR  dwData,
IN DWORD  dwFlags
 

Definition at line 7631 of file kernel/ntstubs.c.

References BEGINRECVCSRSS, BOOL, dwFlags, DWORD, ENDRECVCSRSS, FALSE, TRACE, and xxxUserNotifyProcessCreate().

Referenced by UserServerDllInitialization().

07636 { 07637 extern BOOL xxxUserNotifyProcessCreate(DWORD idProcess, DWORD idParentThread, 07638 ULONG_PTR dwData, DWORD dwFlags); 07639 07640 BEGINRECVCSRSS(BOOL, FALSE); 07641 07642 retval = xxxUserNotifyProcessCreate(dwProcessId, 07643 dwParentThreadId, 07644 dwData, 07645 dwFlags); 07646 07647 TRACE("NtUserNotifyProcessCreate"); 07648 ENDRECVCSRSS(); 07649 }

W32KAPI VOID NtUserNotifyWinEvent IN DWORD  event,
IN HWND  hwnd,
IN LONG  idObject,
IN LONG  idChild
 

Definition at line 3461 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK_VOID, ENDRECV_HWNDLOCK_VOID, FWINABLE, MSGERROR_VOID, TRACEVOID, VOID(), WEF_USEPWNDTHREAD, and xxxWindowEvent().

Referenced by NotifyWinEvent().

03466 { 03467 BEGINRECV_HWNDLOCK_VOID(hwnd); 03468 03469 if (!FWINABLE()) { 03470 MSGERROR_VOID(); 03471 } 03472 xxxWindowEvent(event, pwnd, idObject, idChild, WEF_USEPWNDTHREAD); 03473 03474 TRACEVOID("NtUserNotifyWinEvent"); 03475 ENDRECV_HWNDLOCK_VOID(); 03476 }

W32KAPI BOOL NtUserOpenClipboard IN HWND  hwnd,
OUT PBOOL  pfEmptyClient
 

Definition at line 5481 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, MSGERROR, ProbeAndWriteUlong, StubExceptionHandler, ThreadLock, ThreadUnlock, TRACE, ValidateHWNDOPT, and xxxOpenClipboard().

Referenced by OpenClipboard().

05484 { 05485 PWND pwnd; 05486 TL tlpwnd; 05487 BOOL fEmptyClient; 05488 05489 BEGINRECV(BOOL, FALSE); 05490 05491 ValidateHWNDOPT(pwnd, hwnd); 05492 05493 ThreadLock(pwnd, &tlpwnd); 05494 05495 retval = xxxOpenClipboard(pwnd, &fEmptyClient); 05496 05497 ThreadUnlock(&tlpwnd); 05498 05499 /* 05500 * Probe arguments 05501 * No need to SetLastError since pfEmptyClient is the address of a local 05502 * variable in USER client code, not an application address. 05503 */ 05504 try { 05505 ProbeAndWriteUlong(pfEmptyClient, fEmptyClient); 05506 } except (StubExceptionHandler(FALSE)) { 05507 MSGERROR(0); 05508 } 05509 05510 TRACE("NtUserOpenClipboard"); 05511 ENDRECV(); 05512 }

W32KAPI HDESK NtUserOpenDesktop IN POBJECT_ATTRIBUTES  pObja,
IN DWORD  dwFlags,
IN ACCESS_MASK  amRequest
 

Definition at line 1219 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, dwFlags, ENDRECV, NULL, TRACE, UserMode, and xxxOpenDesktop().

Referenced by CommonOpenDesktop().

01223 { 01224 BOOL bShutDown; 01225 01226 BEGINRECV(HDESK, NULL); 01227 01228 retval = xxxOpenDesktop(pObja, UserMode, dwFlags, amRequest, &bShutDown); 01229 01230 TRACE("NtUserOpenDesktop"); 01231 ENDRECV(); 01232 }

W32KAPI HDESK NtUserOpenInputDesktop IN DWORD  dwFlags,
IN BOOL  fInherit,
IN DWORD  amRequest
 

Definition at line 1235 of file kernel/ntstubs.c.

References _GetProcessWindowStation(), BEGINRECV, BOOL, CloseProtectedHandle(), dwFlags, tagWINDOWSTATION::dwWSF_Flags, ENDRECV, ExDesktopObjectType, gbDesktopLocked, grpdeskRitInput, gspdeskShouldBeForeground, HF_PROTECTED, MSGERROR, NT_SUCCESS, NTSTATUS(), NULL, ObOpenObjectByPointer(), OpenDesktopCompletion(), SetHandleFlag(), Status, TRACE, TRUE, UserMode, and WSF_NOIO.

01239 { 01240 HWINSTA hwinsta; 01241 PWINDOWSTATION pwinsta; 01242 PDESKTOP pdesk; 01243 NTSTATUS Status; 01244 01245 BEGINRECV(HDESK, NULL); 01246 01247 if (grpdeskRitInput == NULL) { 01248 MSGERROR(ERROR_OPEN_FAILED); 01249 } else { 01250 pwinsta = _GetProcessWindowStation(&hwinsta); 01251 if (pwinsta == NULL) { 01252 MSGERROR(ERROR_ACCESS_DENIED); 01253 } 01254 if (pwinsta->dwWSF_Flags & WSF_NOIO) { 01255 MSGERROR(ERROR_INVALID_FUNCTION); 01256 } else { 01257 01258 /* 01259 * We should never return the 'Disconnect' desktop to 01260 * an app. We should return instead the desktop that we will 01261 * restore to from the Disconnect desktop. 01262 */ 01263 01264 pdesk = (gbDesktopLocked ? gspdeskShouldBeForeground : grpdeskRitInput); 01265 01266 /* 01267 * Require read/write access 01268 */ 01269 amRequest |= DESKTOP_READOBJECTS | DESKTOP_WRITEOBJECTS; 01270 01271 Status = ObOpenObjectByPointer( 01272 pdesk, 01273 fInherit ? OBJ_INHERIT : 0, 01274 NULL, 01275 amRequest, 01276 *ExDesktopObjectType, 01277 UserMode, 01278 &retval); 01279 if (NT_SUCCESS(Status)) { 01280 01281 BOOL bShutDown; 01282 /* 01283 * Complete the desktop open 01284 */ 01285 if (!OpenDesktopCompletion(pdesk, retval, 01286 dwFlags, &bShutDown)) { 01287 01288 CloseProtectedHandle(retval); 01289 retval = NULL; 01290 } else { 01291 SetHandleFlag(retval, HF_PROTECTED, TRUE); 01292 } 01293 } else 01294 retval = NULL; 01295 } 01296 } 01297 01298 TRACE("NtUserOpenInputDesktop"); 01299 ENDRECV(); 01300 }

W32KAPI HWINSTA NtUserOpenWindowStation IN POBJECT_ATTRIBUTES  pObja,
IN ACCESS_MASK  amRequest
 

W32KAPI BOOL NtUserPaintDesktop IN HDC  hdc  ) 
 

Definition at line 4883 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, MSGERROR, NULL, tagDESKTOP::pDeskInfo, PtiCurrent, tagTHREADINFO::rpdesk, tagDESKTOPINFO::spwnd, ThreadLockWithPti, ThreadUnlock, TRACE, TRUE, and xxxInternalPaintDesktop().

04885 { 04886 PTHREADINFO ptiCurrent; 04887 PWND pwndDesk; 04888 TL tlpwndDesk; 04889 04890 BEGINRECV(BOOL, FALSE); 04891 04892 ptiCurrent = PtiCurrent(); 04893 04894 if (ptiCurrent->rpdesk != NULL) { 04895 pwndDesk = ptiCurrent->rpdesk->pDeskInfo->spwnd; 04896 ThreadLockWithPti(ptiCurrent, pwndDesk, &tlpwndDesk); 04897 retval = xxxInternalPaintDesktop(pwndDesk, hdc, TRUE); 04898 ThreadUnlock(&tlpwndDesk); 04899 } else { 04900 MSGERROR(0); 04901 } 04902 04903 TRACE("NtUserPaintDesktop"); 04904 ENDRECV(); 04905 }

W32KAPI BOOL NtUserPeekMessage OUT LPMSG  pmsg,
IN HWND  hwnd,
IN UINT  wMsgFilterMin,
IN UINT  wMsgFilterMax,
IN UINT  wRemoveMsg
 

Definition at line 5514 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, msg, MSGERROR, ProbeAndWriteStructure, StubExceptionHandler, TESTFLAGS, TRACE, TRUE, and xxxPeekMessage.

Referenced by _PeekMessage().

05520 { 05521 MSG msg; 05522 05523 BEGINRECV(BOOL, FALSE); 05524 05525 TESTFLAGS(wRemoveMsg, PM_VALID); 05526 05527 retval = xxxPeekMessage( 05528 &msg, 05529 hwnd, 05530 wMsgFilterMin, 05531 wMsgFilterMax, 05532 wRemoveMsg); 05533 05534 /* 05535 * Probe and write arguments only if PeekMessage suceeds otherwise 05536 * we want to leave MSG undisturbed (bug 16224) to be compatible. 05537 */ 05538 if (retval) { 05539 try { 05540 ProbeAndWriteStructure(pmsg, msg, MSG); 05541 } except (StubExceptionHandler(TRUE)) { 05542 MSGERROR(0); 05543 } 05544 } 05545 05546 TRACE("NtUserPeekMessage"); 05547 ENDRECV(); 05548 }

W32KAPI BOOL NtUserPostMessage IN HWND  hwnd,
IN UINT  msg,
IN WPARAM  wParam,
IN LPARAM  lParam
 

Definition at line 5550 of file kernel/ntstubs.c.

References _PostMessage(), BEGINRECV, BOOL, ENDRECV, FALSE, msg, MSGERROR, MSGFLAG_MASK, NULL, PWND_BROADCAST, TRACE, and ValidateHwnd.

Referenced by PostMessage().

05555 { 05556 PWND pwnd; 05557 05558 BEGINRECV(BOOL, FALSE); 05559 05560 /* 05561 * Prevent apps from setting hi 16 bits so we can use them internally. 05562 */ 05563 if (msg & MSGFLAG_MASK) { 05564 RIPERR0(ERROR_INVALID_PARAMETER, RIP_WARNING, "Invalid message"); 05565 MSGERROR(0); 05566 } 05567 05568 switch ((ULONG_PTR)hwnd) { 05569 case -1: 05570 case 0x0000FFFF: 05571 pwnd = PWND_BROADCAST; 05572 break; 05573 05574 case 0: 05575 pwnd = NULL; 05576 break; 05577 05578 default: 05579 if ((pwnd = ValidateHwnd(hwnd)) == NULL) { 05580 /* 05581 * We fake terminates to dead windows! (SAS) 05582 */ 05583 errret = (msg == WM_DDE_TERMINATE); 05584 MSGERROR(0); 05585 } 05586 break; 05587 } 05588 05589 retval = _PostMessage( 05590 pwnd, 05591 msg, 05592 wParam, 05593 lParam); 05594 05595 TRACE("NtUserPostMessage"); 05596 ENDRECV(); 05597 }

W32KAPI BOOL NtUserPostThreadMessage IN DWORD  id,
IN UINT  msg,
IN WPARAM  wParam,
IN LPARAM  lParam
 

Definition at line 3161 of file kernel/ntstubs.c.

References _PostThreadMessage(), BEGINRECV, BOOL, ENDRECV, FALSE, GetDesktopView(), GetProcessLuid(), gpwpiFirstWow, tagTDB::hTaskWow, msg, MSGERROR, MSGFLAG_MASK, NT_SUCCESS, NULL, tagTHREADINFO::ppi, tagTDB::ptdbNext, tagTDB::pti, PtiCurrent, PtiFromThreadId(), tagWOWPROCESSINFO::pwpiNext, tagTHREADINFO::rpdesk, RtlEqualLuid(), TIF_CSRSSTHREAD, tagTHREADINFO::TIF_flags, and TRACE.

Referenced by PostThreadMessage().

03166 { 03167 PTHREADINFO ptiCurrent, pti; 03168 03169 BEGINRECV(BOOL, FALSE); 03170 03171 /* 03172 * Prevent apps from setting hi 16 bits so we can use them internally. 03173 */ 03174 if (msg & MSGFLAG_MASK) { 03175 RIPERR0(ERROR_INVALID_PARAMETER, RIP_WARNING, "Invalid message"); 03176 MSGERROR(0); 03177 } 03178 03179 pti = PtiFromThreadId(id); 03180 if (pti == NULL) { 03181 struct tagWOWPROCESSINFO *pwpi; 03182 PTDB ptdb; 03183 03184 for (pwpi=gpwpiFirstWow; pwpi; pwpi=pwpi->pwpiNext) { 03185 for (ptdb=pwpi->ptdbHead; ptdb; ptdb=ptdb->ptdbNext) { 03186 if (ptdb->hTaskWow == id) { 03187 pti=ptdb->pti; 03188 goto PTM_DoIt; 03189 } 03190 } 03191 } 03192 03193 RIPERR0(ERROR_INVALID_THREAD_ID, RIP_VERBOSE, ""); 03194 MSGERROR(0); 03195 } 03196 03197 PTM_DoIt: 03198 03199 /* 03200 * Should be OK if any of the following are true 03201 * threads are running on the same desktop 03202 * request is on behalf of a system process 03203 * this process owns the desktop the thread is running in 03204 * the LUIDs match 03205 */ 03206 ptiCurrent = PtiCurrent(); 03207 if ( !(ptiCurrent->rpdesk == pti->rpdesk) && 03208 !(ptiCurrent->TIF_flags & TIF_CSRSSTHREAD) && 03209 !(GetDesktopView(ptiCurrent->ppi, pti->rpdesk))) { 03210 03211 LUID luidCurrent, luidTo; 03212 03213 if (!NT_SUCCESS(GetProcessLuid(ptiCurrent->pEThread, &luidCurrent)) || 03214 !NT_SUCCESS(GetProcessLuid(pti->pEThread, &luidTo)) || 03215 !RtlEqualLuid(&luidCurrent, &luidTo)) { 03216 RIPERR3(ERROR_INVALID_THREAD_ID, 03217 RIP_WARNING, 03218 "NtUserPostThreadMessage failed LUID check: msg(%lx), t1(%#p) -> t2(%#p)", 03219 msg, ptiCurrent, pti); 03220 MSGERROR(0); 03221 } 03222 } 03223 03224 retval = _PostThreadMessage( 03225 pti, 03226 msg, 03227 wParam, 03228 lParam); 03229 03230 TRACE("NtUserPostThreadMessage"); 03231 ENDRECV(); 03232 }

W32KAPI NTSTATUS NtUserProcessConnect IN HANDLE  hProcess,
IN OUT PVOID  pConnectInfo,
IN ULONG  cbConnectInfo
 

Definition at line 2788 of file kernel/server.c.

References _USERCONNECT::dwDispatchCount, DWORD, FALSE, gDispatchTableValues, GetCurrentProcessId, InitMapSharedSection(), NT_SUCCESS, NTSTATUS(), NULL, ObDereferenceObject, ObReferenceObjectByHandle(), ProbeForWrite(), PsProcessType, Status, TRACE_INIT, _USERCONNECT::ulVersion, USERCONNECT, USERCURRENTVERSION, and UserMode.

Referenced by ClientThreadSetup(), and UserClientConnect().

02792 { 02793 PEPROCESS Process; 02794 PUSERCONNECT pucConnect = (PUSERCONNECT)pConnectInfo; 02795 USERCONNECT ucLocal; 02796 NTSTATUS Status = STATUS_SUCCESS; 02797 02798 02799 TRACE_INIT(("Entering NtUserProcessConnect\n")); 02800 02801 if (!pucConnect || (cbConnectInfo != sizeof(USERCONNECT))) { 02802 return STATUS_UNSUCCESSFUL; 02803 } 02804 02805 try { 02806 ProbeForWrite(pucConnect, cbConnectInfo, sizeof(DWORD)); 02807 02808 ucLocal = *pucConnect; 02809 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 02810 return GetExceptionCode(); 02811 } 02812 02813 /* 02814 * Check client/server versions. 02815 */ 02816 if (ucLocal.ulVersion != USERCURRENTVERSION) { 02817 02818 RIPMSG2(RIP_ERROR, 02819 "Client version %lx > server version %lx\n", 02820 ucLocal.ulVersion, USERCURRENTVERSION); 02821 return STATUS_UNSUCCESSFUL; 02822 } 02823 02824 02825 02826 if (ucLocal.dwDispatchCount != gDispatchTableValues) { 02827 RIPMSG2(RIP_ERROR, 02828 "!!!! Client Dispatch info %lX != Server %lX\n", 02829 ucLocal.dwDispatchCount, gDispatchTableValues); 02830 } 02831 02832 02833 /* 02834 * Reference the process. 02835 */ 02836 Status = ObReferenceObjectByHandle(hProcess, 02837 PROCESS_VM_OPERATION, 02838 *PsProcessType, 02839 UserMode, 02840 &Process, 02841 NULL); 02842 if (!NT_SUCCESS(Status)) 02843 return Status; 02844 /* 02845 * Return client's view of shared data. 02846 */ 02847 Status = InitMapSharedSection(Process, &ucLocal); 02848 02849 if (!NT_SUCCESS(Status) && 02850 (Status != STATUS_NO_MEMORY) && 02851 (Status != STATUS_PROCESS_IS_TERMINATING) && 02852 (Status != STATUS_QUOTA_EXCEEDED) && 02853 (Status != STATUS_COMMITMENT_LIMIT)) { 02854 02855 RIPMSG2(RIP_ERROR, 02856 "Failed to map shared data into client %x, status = %x\n", 02857 GetCurrentProcessId(), Status); 02858 } 02859 02860 ObDereferenceObject(Process); 02861 02862 if (NT_SUCCESS(Status)) { 02863 02864 try { 02865 *pucConnect = ucLocal; 02866 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 02867 Status = GetExceptionCode(); 02868 } 02869 } 02870 02871 TRACE_INIT(("Leaving NtUserProcessConnect\n")); 02872 02873 return Status; 02874 }

W32KAPI NTSTATUS NtUserQueryInformationThread IN HANDLE  hThread,
IN USERTHREADINFOCLASS  ThreadInfoClass,
OUT PVOID  ThreadInformation,
IN ULONG  ThreadInformationLength,
IN OUT PULONG ReturnLength  OPTIONAL
 

Definition at line 7532 of file kernel/ntstubs.c.

References BEGINRECVCSRSS, ENDRECVCSRSS, NTSTATUS(), ProbeForWrite(), ProbeForWriteBoolean, ProbeForWriteUlong, TRACE, and xxxQueryInformationThread().

Referenced by GetApplicationText(), GetInputWindow(), ThreadShutdownNotify(), UserClientShutdown(), and WowExitTask().

07538 { 07539 BEGINRECVCSRSS(NTSTATUS, STATUS_UNSUCCESSFUL); 07540 /* 07541 * note -- QueryInformationThread can call xxxSwitchDesktop, so it is not sharable 07542 */ 07543 07544 /* 07545 * Probe arguments -- no try/except 07546 */ 07547 07548 #if DBG 07549 if (ARGUMENT_PRESENT(ThreadInformation)) { 07550 switch (ThreadInfoClass) { 07551 case UserThreadShutdownInformation: 07552 case UserThreadFlags: 07553 case UserThreadWOWInformation: 07554 case UserThreadHungStatus: 07555 ProbeForWriteBoolean((PBOOLEAN)ThreadInformation); 07556 break; 07557 case UserThreadTaskName: 07558 ProbeForWrite(ThreadInformation, ThreadInformationLength, 07559 sizeof(WCHAR)); 07560 break; 07561 } 07562 } 07563 if (ARGUMENT_PRESENT(ReturnLength)) 07564 ProbeForWriteUlong(ReturnLength); 07565 #endif 07566 07567 retval = xxxQueryInformationThread(hThread, 07568 ThreadInfoClass, ThreadInformation, 07569 ThreadInformationLength, ReturnLength); 07570 07571 TRACE("NtUserQueryInformationThread"); 07572 ENDRECVCSRSS(); 07573 }

W32KAPI BOOL NtUserQuerySendMessage OUT PMSG  pmsg  ) 
 

Definition at line 8580 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, BOOL, ENDRECV_SHARED, FALSE, HW, MSGERROR, NULL, ProbeForWriteMessage, PSMS, PtiCurrentShared, StubExceptionHandler, TRACE, and TRUE.

08582 { 08583 PSMS psms; 08584 BEGINRECV_SHARED(BOOL, FALSE); 08585 08586 /* 08587 * This function looks like dead code. If it's not, it can be optimized 08588 * by using the CTIF_INSENDMESSAGE flag from user mode. - JerrySh 08589 */ 08590 RIPMSG0(RIP_ERROR, "I don't think QuerySendMessage ever gets called. Remove this assert if it does."); 08591 08592 if ((psms = PtiCurrentShared()->psmsCurrent) == NULL) { 08593 MSGERROR(0); 08594 } 08595 08596 retval = TRUE; 08597 if (ARGUMENT_PRESENT(pmsg)) { 08598 try { 08599 ProbeForWriteMessage(pmsg); 08600 pmsg->hwnd = HW(psms->spwnd); 08601 pmsg->message = psms->message; 08602 pmsg->wParam = psms->wParam; 08603 pmsg->lParam = psms->lParam; 08604 pmsg->time = psms->tSent; 08605 pmsg->pt.x = 0; 08606 pmsg->pt.y = 0; 08607 retval = TRUE; 08608 } except (StubExceptionHandler(FALSE)) { 08609 MSGERROR(0); 08610 } 08611 } 08612 08613 TRACE("NtUserQuerySendMessage"); 08614 ENDRECV_SHARED(); 08615 }

W32KAPI BOOL NtUserQueryUserCounters IN DWORD  dwQueryType,
IN LPVOID  pvIn,
IN DWORD  dwInSize,
OUT LPVOID  pvResult,
IN DWORD  dwOutSize
 

Definition at line 13179 of file kernel/ntstubs.c.

References _QueryUserHandles(), BEGINRECV, BOOL, _tagCSStatistics::cExclusive, CLEANUPRECV, _tagCSStatistics::cShared, DWORD, ENDRECV, ExRaiseStatus(), FALSE, _tagCSStatistics::i64TimeExclusive, MSGERROR, MSGERROR_VOID, MSGERRORCLEANUP, NULL, ProbeForRead, ProbeForWrite(), StubExceptionHandler, TRACE, TRUE, and TYPE_CTYPES.

13185 { 13186 PDWORD pdwInternalIn = NULL; 13187 PDWORD pdwInternalResult = NULL; 13188 13189 BEGINRECV(BOOL, FALSE); 13190 13191 #if defined (USER_PERFORMANCE) 13192 if (dwQueryType == QUERYUSER_CS) { 13193 CSSTATISTICS* pcsData; 13194 13195 if (dwOutSize != sizeof(CSSTATISTICS)) { 13196 MSGERROR(0); 13197 } 13198 try { 13199 ProbeForWrite((PDWORD)pvResult, dwOutSize, sizeof(DWORD)); 13200 13201 /* 13202 * Checking for overflow on these counters is caller responsability 13203 */ 13204 pcsData = (CSSTATISTICS*)pvResult; 13205 pcsData->cExclusive = gCSStatistics.cExclusive; 13206 pcsData->cShared = gCSStatistics.cShared; 13207 pcsData->i64TimeExclusive = gCSStatistics.i64TimeExclusive; 13208 13209 } except (StubExceptionHandler(FALSE)) { 13210 MSGERROR(0); 13211 } 13212 retval = TRUE; 13213 MSGERROR_VOID(); 13214 } 13215 else 13216 #endif // USER_PERFORMANCE 13217 13218 if (dwQueryType == QUERYUSER_HANDLES) { 13219 13220 /* 13221 * Probe arguments, dwInSize should be multiple of 4 13222 */ 13223 if (dwInSize & (sizeof(DWORD)-1) || 13224 dwOutSize != TYPE_CTYPES*dwInSize) { 13225 13226 MSGERROR(0) 13227 } 13228 13229 try { 13230 ProbeForRead((PDWORD)pvIn, dwInSize, sizeof(DWORD)); 13231 pdwInternalIn = UserAllocPoolWithQuota(dwInSize, TAG_SYSTEM); 13232 if (!pdwInternalIn) { 13233 ExRaiseStatus(STATUS_NO_MEMORY); 13234 } 13235 RtlCopyMemory(pdwInternalIn, pvIn, dwInSize); 13236 13237 ProbeForWrite(pvResult, dwOutSize, sizeof(DWORD)); 13238 pdwInternalResult = UserAllocPoolWithQuota(dwOutSize, TAG_SYSTEM); 13239 if (!pdwInternalResult) { 13240 ExRaiseStatus(STATUS_NO_MEMORY); 13241 } 13242 13243 } except (StubExceptionHandler(FALSE)) { 13244 MSGERRORCLEANUP(0); 13245 } 13246 13247 _QueryUserHandles(pdwInternalIn, 13248 dwInSize/sizeof(DWORD), 13249 (DWORD (*)[TYPE_CTYPES])pdwInternalResult); 13250 retval = TRUE; 13251 13252 try { 13253 RtlCopyMemory(pvResult, pdwInternalResult, dwOutSize); 13254 13255 } except (StubExceptionHandler(FALSE)) { 13256 MSGERRORCLEANUP(0); 13257 } 13258 } 13259 13260 else { 13261 13262 MSGERROR(0); 13263 } 13264 13265 CLEANUPRECV(); 13266 if (pdwInternalIn) { 13267 UserFreePool(pdwInternalIn); 13268 } 13269 if (pdwInternalResult) { 13270 UserFreePool(pdwInternalResult); 13271 } 13272 13273 TRACE("NtUserQueryCounters"); 13274 ENDRECV(); 13275 }

W32KAPI HANDLE NtUserQueryWindow IN HWND  hwnd,
IN WINDOWINFOCLASS  WindowInfo
 

Definition at line 9643 of file kernel/ntstubs.c.

References _GetWindowLong, BEGINRECV_HWND_SHARED, CMSHUNGAPPTIMEOUT, ENDRECV_HWND_SHARED, FHungApp(), gatomConsoleClass, GETPTI, gpqForeground, tagWND::head, HW, NULL, tagTHREADINFO::pq, PtiCurrentShared, PtoH, PtoHq, tagTHREADINFO::spDefaultImc, tagQ::spwndActive, tagTHREADINFO::spwndDefaultIme, tagQ::spwndFocus, TIF_CSRSSTHREAD, and tagTHREADINFO::TIF_flags.

Referenced by GetWindowThreadProcessId(), ImeSetContextHandler(), ImmAssociateContext(), ImmAssociateContextEx(), ImmGetDefaultIMEWnd(), ImmGetSaveContext(), ImmSendMessageToActiveDefImeWndW(), IsHungAppWindow(), xxxChildResize(), and xxxMDIActivate().

09646 { 09647 PTHREADINFO ptiWnd; 09648 09649 BEGINRECV_HWND_SHARED(HANDLE, NULL, hwnd); 09650 09651 ptiWnd = GETPTI(pwnd); 09652 09653 switch (WindowInfo) { 09654 case WindowProcess: 09655 09656 /* 09657 * Special case console windows 09658 */ 09659 if (ptiWnd->TIF_flags & TIF_CSRSSTHREAD && 09660 pwnd->pcls->atomClassName == gatomConsoleClass) { 09661 retval = (HANDLE)LongToHandle( _GetWindowLong(pwnd, 0) ); 09662 } else { 09663 retval = (HANDLE)ptiWnd->pEThread->Cid.UniqueProcess; 09664 } 09665 break; 09666 case WindowThread: 09667 09668 /* 09669 * Special case console windows 09670 */ 09671 if (ptiWnd->TIF_flags & TIF_CSRSSTHREAD && 09672 pwnd->pcls->atomClassName == gatomConsoleClass) { 09673 retval = (HANDLE)LongToHandle( _GetWindowLong(pwnd, 4) ); 09674 } else { 09675 retval = (HANDLE)ptiWnd->pEThread->Cid.UniqueThread; 09676 } 09677 break; 09678 case WindowActiveWindow: 09679 retval = (HANDLE)HW(ptiWnd->pq->spwndActive); 09680 break; 09681 case WindowFocusWindow: 09682 retval = (HANDLE)HW(ptiWnd->pq->spwndFocus); 09683 break; 09684 case WindowIsHung: 09685 retval = (HANDLE)IntToPtr( FHungApp(ptiWnd, CMSHUNGAPPTIMEOUT) ); 09686 break; 09687 case WindowIsForegroundThread: 09688 retval = (HANDLE)IntToPtr( (ptiWnd->pq == gpqForeground) ); 09689 break; 09690 case WindowDefaultImeWindow: 09691 retval = (HANDLE)HW(ptiWnd->spwndDefaultIme); 09692 break; 09693 case WindowDefaultInputContext: 09694 retval = (HANDLE)PtoH(ptiWnd->spDefaultImc); 09695 break; 09696 case WindowActiveDefaultImeWindow: 09697 /* 09698 * Only return a window if there is a foreground queue and the 09699 * caller has access to the current desktop. 09700 */ 09701 retval = NULL; 09702 if (gpqForeground && gpqForeground->spwndActive && 09703 PtiCurrentShared()->rpdesk == gpqForeground->spwndActive->head.rpdesk) { 09704 PWND pwndFG = gpqForeground->spwndActive; 09705 09706 if (pwndFG && pwndFG->head.pti) { 09707 retval = (HANDLE)PtoHq(pwndFG->head.pti->spwndDefaultIme); 09708 } 09709 } 09710 break; 09711 default: 09712 retval = (HANDLE)NULL; 09713 break; 09714 } 09715 09716 ENDRECV_HWND_SHARED(); 09717 }

W32KAPI HWND NtUserRealChildWindowFromPoint IN HWND  hwndParent,
IN POINT  pt
 

Definition at line 3715 of file kernel/ntstubs.c.

References _RealChildWindowFromPoint(), BEGINRECV_HWND_SHARED, ENDRECV_HWND_SHARED, NULL, PtoH, and TRACE.

03716 { 03717 BEGINRECV_HWND_SHARED(HWND, NULL, hwndParent); 03718 03719 retval = (HWND)_RealChildWindowFromPoint(pwnd, pt); 03720 retval = PtoH((PVOID)retval); 03721 03722 TRACE("NtUserRealChildWindowFromPoint"); 03723 ENDRECV_HWND_SHARED(); 03724 }

W32KAPI BOOL NtUserRedrawWindow IN HWND  hwnd,
IN CONST RECT *lprcUpdate  OPTIONAL,
IN HRGN  hrgnUpdate,
IN UINT  flags
 

Definition at line 6738 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK_OPT, BOOL, ENDRECV_HWNDLOCK_OPT, FALSE, MSGERROR, ProbeAndReadRect, StubExceptionHandler, TESTFLAGS, TRACE, TRUE, and xxxRedrawWindow().

06743 { 06744 RECT rc; 06745 06746 // 06747 // N.B. This function has implicit window translation and thread locking 06748 // enabled. These operations are performed in the User server API 06749 // dispatcher. 06750 // 06751 06752 BEGINRECV_HWNDLOCK_OPT(BOOL, FALSE, hwnd); 06753 06754 /* 06755 * Probe arguments 06756 */ 06757 if (ARGUMENT_PRESENT(lprcUpdate)) { 06758 try { 06759 rc = ProbeAndReadRect(lprcUpdate); 06760 lprcUpdate = &rc; 06761 } except (StubExceptionHandler(TRUE)) { 06762 MSGERROR(0); 06763 } 06764 } 06765 06766 TESTFLAGS(flags, RDW_VALIDMASK); 06767 06768 retval = xxxRedrawWindow( 06769 pwnd, 06770 (PRECT)lprcUpdate, 06771 hrgnUpdate, 06772 flags); 06773 06774 TRACE("NtUserRedrawWindow"); 06775 ENDRECV_HWNDLOCK_OPT(); 06776 }

W32KAPI ATOM NtUserRegisterClassExWOW IN WNDCLASSEX *  lpWndClass,
IN PUNICODE_STRING  pstrClassName,
IN PCLSMENUNAME  pcmn,
IN WORD  fnid,
IN DWORD  dwFlags,
IN LPDWORD pdwWOWstuff  OPTIONAL
 

Definition at line 9119 of file kernel/ntstubs.c.

References BEGINRECV, BYTE, CSF_VALID, dwFlags, ENDRECV, MSGERROR, ProbeAndReadStructure, ProbeAndReadUnicodeString, ProbeForRead, ProbeForReadUnicodeStringBufferOrId, tagCLSMENUNAME::pusMenuName, StubExceptionHandler, TESTFLAGS, TRACE, TRUE, and xxxRegisterClassEx().

09126 { 09127 UNICODE_STRING strClassName; 09128 UNICODE_STRING strMenuName; 09129 WNDCLASSEX WndClass; 09130 WC WowCls; 09131 CLSMENUNAME cmn; 09132 09133 BEGINRECV(ATOM, 0); 09134 09135 TESTFLAGS(dwFlags, CSF_VALID); 09136 09137 /* 09138 * Probe arguments 09139 */ 09140 try { 09141 strClassName = ProbeAndReadUnicodeString(pstrClassName); 09142 cmn = ProbeAndReadStructure(pcmn, CLSMENUNAME); 09143 strMenuName = ProbeAndReadUnicodeString(cmn.pusMenuName); 09144 WndClass = ProbeAndReadStructure(lpWndClass, WNDCLASSEX); 09145 ProbeForReadUnicodeStringBufferOrId(strClassName); 09146 ProbeForReadUnicodeStringBufferOrId(strMenuName); 09147 if (ARGUMENT_PRESENT(pdwWOWstuff)) { 09148 ProbeForRead(pdwWOWstuff, sizeof(WC), sizeof(BYTE)); 09149 RtlCopyMemory(&WowCls, pdwWOWstuff, sizeof(WC)); 09150 pdwWOWstuff = (PDWORD)&WowCls; 09151 } 09152 WndClass.lpszClassName = strClassName.Buffer; 09153 WndClass.lpszMenuName = strMenuName.Buffer; 09154 } except (StubExceptionHandler(TRUE)) { 09155 MSGERROR(0); 09156 } 09157 09158 /* 09159 * ClassName and MenuName in WndClass are client-side pointers. 09160 */ 09161 09162 retval = xxxRegisterClassEx( 09163 &WndClass, 09164 &cmn, 09165 fnid, 09166 dwFlags, 09167 pdwWOWstuff); 09168 09169 TRACE("NtUserRegisterClassExWOW"); 09170 ENDRECV(); 09171 }

W32KAPI BOOL NtUserRegisterHotKey IN HWND  hwnd,
IN int  id,
IN UINT  fsModifiers,
IN UINT  vk
 

Definition at line 5690 of file kernel/ntstubs.c.

References _RegisterHotKey(), BEGINATOMICRECV, BOOL, ENDATOMICRECV, FALSE, TESTFLAGS, TRACE, and ValidateHWNDOPT.

05695 { 05696 PWND pwnd; 05697 05698 BEGINATOMICRECV(BOOL, FALSE); 05699 05700 TESTFLAGS(fsModifiers, MOD_VALID); 05701 05702 ValidateHWNDOPT(pwnd, hwnd); 05703 05704 retval = _RegisterHotKey( 05705 pwnd, 05706 id, 05707 fsModifiers, 05708 vk 05709 ); 05710 05711 TRACE("NtUserRegisterHotKey"); 05712 ENDATOMICRECV(); 05713 }

W32KAPI BOOL NtUserRegisterTasklist IN HWND  hwndTasklist  ) 
 

Definition at line 3234 of file kernel/ntstubs.c.

References _RegisterTasklist(), BEGINRECV_HWND, BOOL, DWORD, ENDRECV_HWND, and TRACE.

03236 { 03237 03238 // 03239 // N.B. This function has implicit window handle translation. This 03240 // operation is performed in the User server API dispatcher. 03241 // 03242 03243 BEGINRECV_HWND(DWORD, 0, hwnd); 03244 03245 retval = _RegisterTasklist( 03246 pwnd); 03247 03248 TRACE("NtUserRegisterTasklist"); 03249 ENDRECV_HWND(); 03250 }

W32KAPI UINT NtUserRegisterWindowMessage IN PUNICODE_STRING  pstrMessage  ) 
 

Definition at line 9173 of file kernel/ntstubs.c.

References BEGINRECV_NOCRIT, ENDRECV_NOCRIT, FALSE, MSGERROR, ProbeAndReadUnicodeString, ProbeForReadUnicodeStringBuffer, StubExceptionHandler, TRACE, TRUE, UINT, and UserAddAtom().

Referenced by RegisterWindowMessage().

09175 { 09176 UNICODE_STRING strMessage; 09177 09178 BEGINRECV_NOCRIT(UINT, 0); 09179 09180 /* 09181 * Probe arguments 09182 */ 09183 try { 09184 strMessage = ProbeAndReadUnicodeString(pstrMessage); 09185 ProbeForReadUnicodeStringBuffer(strMessage); 09186 } except (StubExceptionHandler(TRUE)) { 09187 MSGERROR(0); 09188 } 09189 09190 /* 09191 * The buffer is in client-side memory. 09192 * Rtl atom routines protect accesses to strings with their 09193 * own try/except blocks, UserAddAtom sets last error accordingly. 09194 */ 09195 retval = UserAddAtom( 09196 strMessage.Buffer, FALSE); 09197 09198 TRACE("NtUserRegisterWindowMessage"); 09199 ENDRECV_NOCRIT(); 09200 }

W32KAPI NTSTATUS NtUserRemoteConnect IN PDOCONNECTDATA  pDoConnectData,
IN ULONG  DisplayDriverNameLength,
IN PWCHAR  DisplayDriverName
 

Definition at line 521 of file kernel/ntstubs.c.

References BEGINRECVCSRSS, BYTE, DOCONNECTDATA, ENDRECVCSRSS, ISTS, MSGERROR, NTSTATUS(), ProbeForRead, RemoteConnect(), and TRACE.

Referenced by W32WinStationDoConnect().

00525 { 00526 BEGINRECVCSRSS(NTSTATUS, STATUS_UNSUCCESSFUL); 00527 if (!ISTS()) { 00528 errret = STATUS_ACCESS_DENIED; 00529 MSGERROR(0); 00530 } 00531 00532 /* 00533 * Probe all read arguments -- no try block. 00534 */ 00535 #if DBG 00536 ProbeForRead(DisplayDriverName, DisplayDriverNameLength, sizeof(BYTE)); 00537 ProbeForRead(pDoConnectData, sizeof(DOCONNECTDATA), sizeof(BYTE)); 00538 #endif 00539 00540 retval = RemoteConnect( 00541 pDoConnectData, 00542 DisplayDriverNameLength, 00543 DisplayDriverName); 00544 00545 00546 TRACE("NtUserRemoteConnect"); 00547 ENDRECVCSRSS(); 00548 00549 }

W32KAPI NTSTATUS NtUserRemoteRedrawRectangle IN WORD  Left,
IN WORD  Top,
IN WORD  Right,
IN WORD  Bottom
 

Definition at line 552 of file kernel/ntstubs.c.

References BEGINRECVCSRSS, ENDRECVCSRSS, ISTS, MSGERROR, NTSTATUS(), RemoteRedrawRectangle(), and TRACE.

Referenced by Win32CommandChannelThread().

00557 { 00558 BEGINRECVCSRSS(NTSTATUS, STATUS_UNSUCCESSFUL); 00559 if (!ISTS()) { 00560 errret = STATUS_ACCESS_DENIED; 00561 MSGERROR(0); 00562 } 00563 00564 retval = RemoteRedrawRectangle( 00565 Left, 00566 Top, 00567 Right, 00568 Bottom); 00569 00570 TRACE("NtUserRemoteRedrawRectangle"); 00571 ENDRECVCSRSS(); 00572 }

W32KAPI NTSTATUS NtUserRemoteRedrawScreen VOID   ) 
 

Definition at line 576 of file kernel/ntstubs.c.

References BEGINRECVCSRSS, ENDRECVCSRSS, gbConnected, gnShadowers, ISTS, MSGERROR, NTSTATUS(), RemoteRedrawScreen(), and TRACE.

Referenced by Win32CommandChannelThread().

00578 { 00579 BEGINRECVCSRSS(NTSTATUS, STATUS_UNSUCCESSFUL); 00580 if (!ISTS()) { 00581 errret = STATUS_ACCESS_DENIED; 00582 MSGERROR(0); 00583 } 00584 00585 /* 00586 * If there are any shadow connections, or it's not disconnected 00587 */ 00588 if (gnShadowers > 0 || gbConnected) 00589 retval = RemoteRedrawScreen(); 00590 else 00591 retval = STATUS_UNSUCCESSFUL; 00592 00593 TRACE("NtUserRemoteRedrawScreen"); 00594 ENDRECVCSRSS(); 00595 }

W32KAPI NTSTATUS NtUserRemoteStopScreenUpdates VOID   ) 
 

Definition at line 599 of file kernel/ntstubs.c.

References BEGINRECVCSRSS, ENDRECVCSRSS, ISTS, MSGERROR, NTSTATUS(), TRACE, TRUE, and xxxRemoteStopScreenUpdates().

Referenced by Win32CommandChannelThread().

00601 { 00602 BEGINRECVCSRSS(NTSTATUS, STATUS_UNSUCCESSFUL); 00603 if (!ISTS()) { 00604 errret = STATUS_ACCESS_DENIED; 00605 MSGERROR(0); 00606 } 00607 00608 retval = xxxRemoteStopScreenUpdates(TRUE); 00609 00610 TRACE("NtUserRemoteStopScreenUpdates"); 00611 ENDRECVCSRSS(); 00612 }

W32KAPI BOOL NtUserRemoveMenu IN HMENU  hmenu,
IN UINT  nPosition,
IN UINT  dwFlags
 

Definition at line 5715 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, dwFlags, ENDRECV, FALSE, TESTFLAGS, ThreadLock, ThreadUnlock, TRACE, ValidateHMENUMODIFY, and xxxRemoveMenu().

Referenced by ChangeMenuA(), ChangeMenuW(), MDIAddSysMenu(), MDIRemoveSysMenu(), and SwitchWindowsMenus().

05719 { 05720 PMENU pmenu; 05721 TL tlpmenu; 05722 05723 BEGINRECV(BOOL, FALSE); 05724 05725 TESTFLAGS(dwFlags, MF_VALID); 05726 05727 ValidateHMENUMODIFY(pmenu, hmenu); 05728 05729 ThreadLock( pmenu, &tlpmenu); 05730 retval = xxxRemoveMenu( 05731 pmenu, 05732 nPosition, 05733 dwFlags); 05734 ThreadUnlock(&tlpmenu); 05735 05736 TRACE("NtUserRemoveMenu"); 05737 ENDRECV(); 05738 }

W32KAPI HANDLE NtUserRemoveProp IN HWND  hwnd,
IN DWORD  dwProp
 

Definition at line 9202 of file kernel/ntstubs.c.

References BEGINRECV_HWND, ENDRECV_HWND, FALSE, InternalRemoveProp(), NULL, and TRACE.

Referenced by RemoveProp().

09205 { 09206 09207 // 09208 // N.B. This function has implicit window handle translation. This 09209 // operation is performed in the User server API dispatcher. 09210 // 09211 09212 BEGINRECV_HWND(HANDLE, NULL, hwnd); 09213 09214 retval = InternalRemoveProp(pwnd, (LPWSTR)LOWORD(dwProp), FALSE); 09215 09216 TRACE("NtUserRemoveProp"); 09217 ENDRECV_HWND(); 09218 }

W32KAPI HDESK NtUserResolveDesktop IN HANDLE  hProcess,
IN PUNICODE_STRING  pstrDesktop,
IN BOOL  fInherit,
OUT HWINSTA *  phwinsta
 

Definition at line 1365 of file kernel/ntstubs.c.

References _CloseWindowStation(), BEGINRECV, BOOL, CLEANUPRECV, ENDRECV, ExRaiseStatus(), FALSE, KernelMode, MSGERROR, MSGERRORCLEANUP, NULL, ProbeAndReadUnicodeString, ProbeAndWriteHandle, ProbeForReadUnicodeStringBuffer, PtiCurrent, StubExceptionHandler, ThreadLockPool, ThreadUnlockAndFreePool, TRACE, TRUE, xxxCloseDesktop(), and xxxResolveDesktop().

Referenced by SetUpConsole().

01370 { 01371 UNICODE_STRING strDesktop; 01372 HWINSTA hwinsta = NULL; 01373 PTHREADINFO pti; 01374 TL tlBuffer; 01375 BOOL fFreeBuffer = FALSE; 01376 BOOL bShutDown = FALSE; 01377 01378 BEGINRECV(HDESK, NULL); 01379 01380 pti = PtiCurrent(); 01381 /* 01382 * Probe and capture desktop path 01383 */ 01384 try { 01385 strDesktop = ProbeAndReadUnicodeString(pstrDesktop); 01386 if (strDesktop.Length > 0) { 01387 PWSTR pszCapture = strDesktop.Buffer; 01388 ProbeForReadUnicodeStringBuffer(strDesktop); 01389 strDesktop.Buffer = UserAllocPoolWithQuota(strDesktop.Length, TAG_TEXT2); 01390 if (strDesktop.Buffer) { 01391 fFreeBuffer = TRUE; 01392 ThreadLockPool(pti, strDesktop.Buffer, &tlBuffer); 01393 RtlCopyMemory(strDesktop.Buffer, pszCapture, strDesktop.Length); 01394 } else 01395 ExRaiseStatus(STATUS_NO_MEMORY); 01396 } else { 01397 strDesktop.Buffer = NULL; 01398 } 01399 } except (StubExceptionHandler(TRUE)) { 01400 MSGERRORCLEANUP(0); 01401 } 01402 01403 retval = xxxResolveDesktop(hProcess, &strDesktop, &hwinsta, 01404 fInherit, &bShutDown); 01405 01406 CLEANUPRECV(); 01407 if (fFreeBuffer) 01408 ThreadUnlockAndFreePool(pti, &tlBuffer); 01409 01410 try { 01411 ProbeAndWriteHandle((PHANDLE)phwinsta, hwinsta); 01412 } except (StubExceptionHandler(TRUE)) { 01413 xxxCloseDesktop(retval, KernelMode); 01414 if (hwinsta) 01415 _CloseWindowStation(hwinsta); 01416 MSGERROR(0); 01417 } 01418 01419 TRACE("NtUserResolveDesktop"); 01420 ENDRECV(); 01421 }

W32KAPI NTSTATUS NtUserResolveDesktopForWOW IN OUT PUNICODE_STRING  pstrDesktop  ) 
 

Definition at line 1303 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, CLEANUPRECV, ENDRECV, ExRaiseStatus(), FALSE, MSGERRORCLEANUP, NT_SUCCESS, NTSTATUS(), NULL, ProbeAndReadUnicodeString, ProbeForReadUnicodeStringFullBuffer, PtiCurrent, RtlCopyUnicodeString(), StubExceptionHandler, ThreadLockPool, ThreadUnlockAndFreePool, TRACE, TRUE, and xxxResolveDesktopForWOW().

01305 { 01306 UNICODE_STRING strDesktop, strDesktop2; 01307 PTHREADINFO ptiCurrent; 01308 TL tlBuffer; 01309 LPWSTR lpBuffer = NULL; 01310 BOOL fFreeBuffer = FALSE; 01311 BEGINRECV(NTSTATUS, STATUS_UNSUCCESSFUL); 01312 01313 retval = STATUS_SUCCESS; 01314 01315 ptiCurrent = PtiCurrent(); 01316 /* 01317 * Probe arguments 01318 */ 01319 try { 01320 strDesktop = ProbeAndReadUnicodeString(pstrDesktop); 01321 ProbeForReadUnicodeStringFullBuffer(strDesktop); 01322 RtlCopyMemory(&strDesktop2, &strDesktop, sizeof strDesktop); 01323 if (strDesktop.MaximumLength > 0) { 01324 PWSTR pszCapture = strDesktop.Buffer; 01325 strDesktop.Buffer = UserAllocPoolWithQuota(strDesktop.MaximumLength, TAG_TEXT2); 01326 if (strDesktop.Buffer) { 01327 fFreeBuffer = TRUE; 01328 ThreadLockPool(ptiCurrent, strDesktop.Buffer, &tlBuffer); 01329 RtlCopyMemory(strDesktop.Buffer, pszCapture, strDesktop.Length); 01330 } else 01331 ExRaiseStatus(STATUS_NO_MEMORY); 01332 01333 } else { 01334 strDesktop.Buffer = NULL; 01335 } 01336 } except (StubExceptionHandler(FALSE)) { 01337 MSGERRORCLEANUP(0); 01338 } 01339 01340 retval = xxxResolveDesktopForWOW(&strDesktop); 01341 01342 if (NT_SUCCESS(retval)) { 01343 try { 01344 /* 01345 * The string structure at pstrDesktop could have changed 01346 * so we will ignore it and drop the one we have already 01347 * probed down on top of it. We have already performed the 01348 * ResolveDesktopForWOW action, so we should not return an 01349 * error if this copy fails. 01350 */ 01351 01352 RtlCopyUnicodeString(&strDesktop2, &strDesktop); 01353 RtlCopyMemory(pstrDesktop, &strDesktop2, sizeof strDesktop2); 01354 } except (StubExceptionHandler(FALSE)) { 01355 } 01356 } 01357 01358 CLEANUPRECV(); 01359 if (fFreeBuffer) 01360 ThreadUnlockAndFreePool(ptiCurrent, &tlBuffer); 01361 TRACE("NtUserResolveDesktopForWOW"); 01362 ENDRECV(); 01363 }

W32KAPI BOOL NtUserSBGetParms IN HWND  hwnd,
IN int  code,
IN PSBDATA  pw,
IN OUT LPSCROLLINFO  lpsi
 

Definition at line 9719 of file kernel/ntstubs.c.

References _SBGetParms(), BEGINRECV_HWND_SHARED, BOOL, DWORD, ENDRECV_HWND_SHARED, FALSE, MSGERROR, ProbeForRead, ProbeForWriteScrollInfo, PSBDATA, StubExceptionHandler, and TRUE.

Referenced by GetScrollInfo(), and ScrollBarWndProcWorker().

09724 { 09725 SBDATA sbd; 09726 SCROLLINFO si; 09727 BEGINRECV_HWND_SHARED(BOOL, FALSE, hwnd); 09728 09729 /* 09730 * Probe arguments 09731 */ 09732 try { 09733 ProbeForWriteScrollInfo(lpsi); 09734 09735 /* 09736 * Probe the 4 DWORDS (MIN, MAX, PAGE, POS) 09737 */ 09738 ProbeForRead(pw, sizeof(SBDATA), sizeof(DWORD)); 09739 RtlCopyMemory(&sbd, pw, sizeof(sbd)); 09740 RtlCopyMemory(&si, lpsi, sizeof(SCROLLINFO)); 09741 } except (StubExceptionHandler(TRUE)) { 09742 MSGERROR(0); 09743 } 09744 09745 retval = _SBGetParms(pwnd, code, &sbd, &si); 09746 try { 09747 RtlCopyMemory(lpsi, &si, sizeof(SCROLLINFO)); 09748 } except (StubExceptionHandler(TRUE)) { 09749 MSGERROR(0); 09750 } 09751 09752 ENDRECV_HWND_SHARED(); 09753 }

W32KAPI BOOL NtUserScrollDC IN HDC  hDC,
IN int  dx,
IN int  dy,
IN CONST RECT *lprcScroll  OPTIONAL,
IN CONST RECT *lprcClip  OPTIONAL,
IN HRGN  hrgnUpdate,
OUT LPRECT lprcUpdate  OPTIONAL
 

W32KAPI BOOL NtUserScrollWindowEx IN HWND  hwnd,
IN int  XAmount,
IN int  YAmount,
IN CONST RECT *pRect  OPTIONAL,
IN CONST RECT *pClipRect  OPTIONAL,
IN HRGN  hrgnUpdate,
OUT LPRECT prcUpdate  OPTIONAL,
IN UINT  flags
 

W32KAPI HPALETTE NtUserSelectPalette IN HDC  hdc,
IN HPALETTE  hpalette,
IN BOOL  fForceBackground
 

Definition at line 9788 of file kernel/ntstubs.c.

References _SelectPalette(), BEGINRECV, ENDRECV, and NULL.

09792 { 09793 BEGINRECV(HPALETTE, NULL) 09794 09795 retval = _SelectPalette(hdc, hpalette, fForceBackground); 09796 09797 ENDRECV(); 09798 }

W32KAPI UINT NtUserSendInput IN UINT  cInputs,
IN CONST INPUT *  pInputs,
IN int  cbSize
 

Definition at line 8617 of file kernel/ntstubs.c.

References BEGINRECV, CLEANUPRECV, DATAALIGN, DWORD, ENDRECV, ExRaiseStatus(), MSGERROR, MSGERRORCLEANUP, NULL, ProbeForReadBuffer, PtiCurrent, StubExceptionHandler, ThreadLockPool, ThreadUnlockPool, TRACE, TRUE, UINT, and xxxSendInput().

Referenced by keybd_event(), and mouse_event().

08621 { 08622 LPINPUT pInput2 = NULL; 08623 PTHREADINFO ptiCurrent; 08624 TL tlInput; 08625 DWORD dwArgumentError = ERROR_INVALID_PARAMETER; 08626 08627 BEGINRECV(UINT, 0); 08628 08629 if (sizeof(INPUT) != cbSize || cInputs == 0) { 08630 MSGERROR(dwArgumentError); 08631 } 08632 08633 ptiCurrent = PtiCurrent(); 08634 08635 /* 08636 * Probe arguments 08637 */ 08638 try { 08639 ProbeForReadBuffer(pInputs, cInputs, DATAALIGN); 08640 08641 pInput2 = UserAllocPoolWithQuota(cInputs * sizeof(*pInputs), TAG_SENDINPUT); 08642 if (pInput2 == NULL) { 08643 ExRaiseStatus(STATUS_NO_MEMORY); 08644 } 08645 RtlCopyMemory(pInput2, pInputs, cInputs * sizeof(*pInputs)); 08646 } except (StubExceptionHandler(TRUE)) { 08647 MSGERRORCLEANUP(0); 08648 } 08649 08650 ThreadLockPool(ptiCurrent, pInput2, &tlInput); 08651 retval = xxxSendInput(cInputs, pInput2); 08652 ThreadUnlockPool(ptiCurrent, &tlInput); 08653 CLEANUPRECV(); 08654 if (pInput2) { 08655 UserFreePool(pInput2); 08656 } 08657 TRACE("NtUserSendInput"); 08658 ENDRECV(); 08659 }

W32KAPI BOOL NtUserSendMessageCallback IN HWND  hwnd,
IN UINT  wMsg,
IN WPARAM  wParam,
IN LPARAM  lParam,
IN SENDASYNCPROC  lpResultCallBack,
IN ULONG_PTR  dwData
 

Definition at line 5648 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, MSGERROR, MSGFLAG_MASK, PWND_BROADCAST, ThreadLockAlways, ThreadUnlock, TRACE, TRUE, ValidateHWNDFF, and xxxSendMessageCallback().

Referenced by SendMessageCallback().

05655 { 05656 PWND pwnd; 05657 TL tlpwnd; 05658 05659 BEGINRECV(BOOL, FALSE); 05660 05661 /* 05662 * Prevent apps from setting hi 16 bits so we can use them internally. 05663 */ 05664 if (wMsg & MSGFLAG_MASK) { 05665 RIPERR0(ERROR_INVALID_PARAMETER, RIP_WARNING, "Invalid message"); 05666 MSGERROR(0); 05667 } 05668 05669 ValidateHWNDFF(pwnd, hwnd); 05670 05671 if (pwnd != PWND_BROADCAST) 05672 ThreadLockAlways(pwnd, &tlpwnd); 05673 05674 retval = xxxSendMessageCallback( 05675 pwnd, 05676 wMsg, 05677 wParam, 05678 lParam, 05679 lpResultCallBack, 05680 dwData, 05681 TRUE ); 05682 05683 if (pwnd != PWND_BROADCAST) 05684 ThreadUnlock(&tlpwnd); 05685 05686 TRACE("NtUserSendMessageCallback"); 05687 ENDRECV(); 05688 }

W32KAPI BOOL NtUserSendNotifyMessage IN HWND  hwnd,
IN UINT  Msg,
IN WPARAM  wParam,
IN LPARAM lParam  OPTIONAL
 

Definition at line 5599 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, MSGERROR, MSGFLAG_MASK, ProbeAndReadLargeString, ProbeForReadUnicodeStringBuffer, PWND_BROADCAST, StubExceptionHandler, ThreadLockAlways, ThreadUnlock, TRACE, TRUE, ValidateHWNDFF, and xxxSendNotifyMessage().

Referenced by SendNotifyMessage().

05604 { 05605 PWND pwnd; 05606 TL tlpwnd; 05607 LARGE_STRING strLParam; 05608 05609 BEGINRECV(BOOL, FALSE); 05610 05611 /* 05612 * Prevent apps from setting hi 16 bits so we can use them internally. 05613 */ 05614 if (Msg & MSGFLAG_MASK) { 05615 RIPERR0(ERROR_INVALID_PARAMETER, RIP_WARNING, "Invalid message"); 05616 MSGERROR(0); 05617 } 05618 05619 if ((Msg == WM_WININICHANGE || Msg == WM_DEVMODECHANGE) && 05620 ARGUMENT_PRESENT(lParam)) { 05621 try { 05622 strLParam = ProbeAndReadLargeString((PLARGE_STRING)lParam); 05623 ProbeForReadUnicodeStringBuffer(strLParam); 05624 lParam = (LPARAM)&strLParam; 05625 } except (StubExceptionHandler(TRUE)) { 05626 MSGERROR(0); 05627 } 05628 } 05629 05630 ValidateHWNDFF(pwnd, hwnd); 05631 05632 if (pwnd != PWND_BROADCAST) 05633 ThreadLockAlways(pwnd, &tlpwnd); 05634 05635 retval = xxxSendNotifyMessage( 05636 pwnd, 05637 Msg, 05638 wParam, 05639 lParam ); 05640 05641 if (pwnd != PWND_BROADCAST) 05642 ThreadUnlock(&tlpwnd); 05643 05644 TRACE("NtUserSendNotifyMessage"); 05645 ENDRECV(); 05646 }

W32KAPI HWND NtUserSetActiveWindow IN HWND  hwnd  ) 
 

Definition at line 5801 of file kernel/ntstubs.c.

References BEGINRECV, ENDRECV, NULL, PtoH, ThreadLock, ThreadUnlock, TRACE, ValidateHWNDOPT, and xxxSetActiveWindow().

Referenced by EndDialog().

05803 { 05804 PWND pwnd; 05805 TL tlpwnd; 05806 05807 BEGINRECV(HWND, NULL); 05808 05809 ValidateHWNDOPT(pwnd, hwnd); 05810 05811 ThreadLock(pwnd, &tlpwnd); 05812 05813 retval = (HWND)xxxSetActiveWindow(pwnd); 05814 retval = PtoH((PVOID)retval); 05815 05816 ThreadUnlock(&tlpwnd); 05817 05818 TRACE("NtUserSetActiveWindow"); 05819 ENDRECV(); 05820 }

W32KAPI HWND NtUserSetCapture IN HWND  hwnd  ) 
 

Definition at line 5822 of file kernel/ntstubs.c.

References BEGINRECV, ENDRECV, NULL, PtoH, ThreadLock, ThreadUnlock, TRACE, ValidateHWNDOPT, and xxxSetCapture().

Referenced by ComboBoxWndProcWorker(), ListBoxWndProcWorker(), MLMouseMotion(), ReaderWndProc(), SLMouseMotion(), xxxBNSetCapture(), and xxxTrackMouse().

05824 { 05825 PWND pwnd; 05826 TL tlpwnd; 05827 05828 BEGINRECV(HWND, NULL); 05829 05830 ValidateHWNDOPT(pwnd, hwnd); 05831 05832 ThreadLock(pwnd, &tlpwnd); 05833 05834 retval = (HWND)xxxSetCapture(pwnd); 05835 retval = PtoH((PVOID)retval); 05836 05837 ThreadUnlock(&tlpwnd); 05838 05839 TRACE("NtUserSetCapture"); 05840 ENDRECV(); 05841 }

W32KAPI LONG NtUserSetClassLong IN HWND  hwnd,
IN int  nIndex,
IN LONG  dwNewLong,
IN BOOL  bAnsi
 

W32KAPI WORD NtUserSetClassWord IN HWND  hwnd,
IN int  nIndex,
IN WORD  wNewWord
 

Definition at line 5843 of file kernel/ntstubs.c.

References _SetClassWord(), BEGINRECV_HWND, ENDRECV_HWND, and TRACE.

05847 { 05848 05849 // 05850 // N.B. This function has implicit window handle translation. This 05851 // operation is performed in the User server API dispatcher. 05852 // 05853 05854 BEGINRECV_HWND(WORD, 0, hwnd); 05855 05856 retval = _SetClassWord( 05857 pwnd, 05858 nIndex, 05859 wNewWord); 05860 05861 TRACE("NtUserSetClassWord"); 05862 ENDRECV_HWND(); 05863 }

W32KAPI BOOL NtUserSetClipboardData IN UINT  wFmt,
IN HANDLE  hMem,
IN PSETCLIPBDATA  scd
 

Definition at line 3274 of file kernel/ntstubs.c.

References _SetClipboardData(), BEGINRECV, BOOL, ENDRECV, FALSE, tagSETCLIPBDATA::fGlobalHandle, tagSETCLIPBDATA::fIncSerialNumber, IS_CURRENT_THREAD_RESTRICTED, MSGERROR, ProbeAndReadSetClipBData, PSETCLIPBDATA, SETCLIPBDATA, StubExceptionHandler, TRACE, and TRUE.

Referenced by GetClipboardData(), and SetClipboardData().

03278 { 03279 SETCLIPBDATA scd; 03280 03281 BEGINRECV(BOOL, FALSE); 03282 03283 /* 03284 * Check for jobs with JOB_OBJECT_UILIMIT_WRITECLIPBOARD 03285 */ 03286 if (IS_CURRENT_THREAD_RESTRICTED(JOB_OBJECT_UILIMIT_WRITECLIPBOARD)) { 03287 RIPMSG0(RIP_WARNING, "NtUserSetClipboardData failed for restricted thread"); 03288 MSGERROR(0); 03289 } 03290 03291 /* 03292 * Probe arguments 03293 */ 03294 try { 03295 scd = ProbeAndReadSetClipBData(pscd); 03296 } except (StubExceptionHandler(TRUE)) { 03297 MSGERROR(0); 03298 } 03299 03300 retval = _SetClipboardData( 03301 fmt, 03302 hData, 03303 scd.fGlobalHandle, 03304 scd.fIncSerialNumber); 03305 03306 TRACE("NtUserSetClipboardData"); 03307 ENDRECV(); 03308 }

W32KAPI HWND NtUserSetClipboardViewer IN HWND  hwndNewViewer  ) 
 

Definition at line 5865 of file kernel/ntstubs.c.

References BEGINRECV, ENDRECV, NULL, PtoH, ThreadLock, ThreadUnlock, TRACE, ValidateHWNDOPT, and xxxSetClipboardViewer().

05867 { 05868 PWND pwnd; 05869 TL tlpwnd; 05870 05871 BEGINRECV(HWND, NULL); 05872 05873 ValidateHWNDOPT(pwnd, hwnd); 05874 05875 ThreadLock(pwnd, &tlpwnd); 05876 05877 retval = (HWND)xxxSetClipboardViewer(pwnd); 05878 retval = PtoH((PVOID)retval); 05879 05880 ThreadUnlock(&tlpwnd); 05881 05882 TRACE("NtUserSetClipboardViewer"); 05883 ENDRECV(); 05884 }

W32KAPI BOOL NtUserSetConsoleReserveKeys IN HWND  hwnd,
IN DWORD  fsReserveKeys
 

Definition at line 7684 of file kernel/ntstubs.c.

References _SetConsoleReserveKeys(), BEGINRECV_HWND, BOOL, DWORD, ENDRECV_HWND, FALSE, and TRACE.

07687 { 07688 BOOL _SetConsoleReserveKeys(PWND, DWORD); 07689 07690 // 07691 // N.B. This function has implicit window handle translation. This 07692 // operation is performed in the User server API dispatcher. 07693 // 07694 07695 BEGINRECV_HWND(BOOL, FALSE, hwnd); 07696 07697 retval = _SetConsoleReserveKeys(pwnd, fsReserveKeys); 07698 07699 TRACE("NtUserSetConsoleReserveKeys"); 07700 ENDRECV_HWND(); 07701 }

W32KAPI HCURSOR NtUserSetCursor IN HCURSOR  hCursor  ) 
 

Definition at line 5886 of file kernel/ntstubs.c.

References BEGINRECV, ENDRECV, NULL, PtoH, TRACE, ValidateHCURSOROPT, and zzzSetCursor().

Referenced by InternalDialogBox(), MLPasteText(), ReaderSetCursor(), and SoftModalMessageBox().

05888 { 05889 PCURSOR pCursor; 05890 05891 BEGINRECV(HCURSOR, NULL); 05892 05893 ValidateHCURSOROPT(pCursor, hCursor); 05894 05895 retval = (HCURSOR)zzzSetCursor(pCursor); 05896 retval = PtoH((PVOID)retval); 05897 05898 TRACE("NtUserSetCursor"); 05899 ENDRECV(); 05900 }

W32KAPI BOOL NtUserSetCursorContents IN HCURSOR  hCursor,
IN HCURSOR  hCursorNew
 

Definition at line 7225 of file kernel/ntstubs.c.

References _SetCursorContents(), BEGINATOMICRECV, BOOL, ENDATOMICRECV, FALSE, TRACE, and ValidateHCURSOR.

07228 { 07229 PCURSOR pCursor; 07230 PCURSOR pCursorNew; 07231 07232 BEGINATOMICRECV(BOOL, FALSE); 07233 07234 ValidateHCURSOR(pCursor, hCursor); 07235 ValidateHCURSOR(pCursorNew, hCursorNew); 07236 07237 retval = _SetCursorContents(pCursor, pCursorNew); 07238 07239 TRACE("NtUserSetCursorContents"); 07240 ENDATOMICRECV(); 07241 }

W32KAPI BOOL NtUserSetCursorIconData IN HCURSOR  hCursor,
IN PUNICODE_STRING  pstrModName,
IN PUNICODE_STRING  pstrResName,
IN PCURSORDATA  pData
 

Definition at line 7305 of file kernel/ntstubs.c.

References _SetCursorIconData(), tagCURSORDATA::aicur, tagCURSORDATA::ajifRate, tagCURSORDATA::aspcur, BEGINATOMICRECV, BOOL, tagCURSORDATA::cicur, tagCURSORDATA::cpcur, CURSORDATA, CURSORF_ACON, tagCURSORDATA::CURSORF_flags, DWORD, ENDATOMICRECV, FALSE, MSGERROR, ProbeAndReadCursorData, ProbeAndReadUnicodeString, ProbeForRead, ProbeForReadUnicodeStringBuffer, ProbeForReadUnicodeStringBufferOrId, StubExceptionHandler, TRACE, and ValidateHCURSOR.

Referenced by _SetCursorIconData().

07310 { 07311 UNICODE_STRING strModName; 07312 UNICODE_STRING strResName; 07313 PCURSOR pCursor; 07314 CURSORDATA curData; 07315 DWORD cbData; 07316 07317 BEGINATOMICRECV(BOOL, FALSE); 07318 07319 ValidateHCURSOR(pCursor, hCursor); 07320 07321 /* 07322 * Probe arguments 07323 */ 07324 try { 07325 07326 strModName = ProbeAndReadUnicodeString(pstrModName); 07327 strResName = ProbeAndReadUnicodeString(pstrResName); 07328 07329 ProbeForReadUnicodeStringBuffer(strModName); 07330 ProbeForReadUnicodeStringBufferOrId(strResName); 07331 07332 curData = ProbeAndReadCursorData(pData); 07333 07334 if (curData.CURSORF_flags & CURSORF_ACON) { 07335 /* 07336 * Avoid overflow here. Or we might end up probing less 07337 * MCostea #199188 07338 */ 07339 if (HIWORD(curData.cpcur) | HIWORD(curData.cicur)) { 07340 MSGERROR(0); 07341 } 07342 /* 07343 * The code assumes that the memory was allocated in one chunk 07344 * as in CreateAniIcon(). To prevent evil apps, do this check. 07345 */ 07346 if ((INT_PTR)curData.ajifRate != curData.cpcur * (INT_PTR) sizeof(HCURSOR) || 07347 (INT_PTR)curData.aicur != (INT_PTR)curData.ajifRate + curData.cicur * (INT_PTR) sizeof(JIF)) { 07348 MSGERROR(0); 07349 } 07350 cbData = (curData.cpcur * sizeof(HCURSOR)) + 07351 (curData.cicur * sizeof(JIF)) + 07352 (curData.cicur * sizeof(DWORD)); 07353 07354 } else { 07355 cbData = 0; 07356 } 07357 ProbeForRead(curData.aspcur, cbData, sizeof(DWORD)); 07358 07359 } except (StubExceptionHandler(FALSE)) { 07360 /* 07361 * probed parameters are USER stack variables, not supplied by the 07362 * application itself, so don't bother to SetLastError. 07363 */ 07364 MSGERROR(0); 07365 } 07366 07367 /* 07368 * SetCursorIconData guards use of the buffer addresses 07369 * with try clauses. 07370 */ 07371 retval = _SetCursorIconData(pCursor, 07372 &strModName, 07373 &strResName, 07374 &curData, 07375 cbData); 07376 07377 TRACE("NtUserSetCursorIconData"); 07378 ENDATOMICRECV(); 07379 }

W32KAPI VOID NtUserSetDbgTag int  tag,
DWORD  dwBitFlags
 

Definition at line 4500 of file kernel/ntstubs.c.

References _SetDbgTag(), BEGINRECV_VOID, ENDRECV_VOID, TRACEVOID, and VOID().

Referenced by SetDbgTag().

04501 { 04502 BEGINRECV_VOID(); 04503 04504 _SetDbgTag(tag, dwBitFlags); 04505 04506 TRACEVOID("NtUserSetRipFlags"); 04507 ENDRECV_VOID(); 04508 }

VOID NtUserSetDebugErrorLevel IN DWORD  dwErrorLevel  ) 
 

W32KAPI HWND NtUserSetFocus IN HWND  hwnd  ) 
 

Definition at line 5902 of file kernel/ntstubs.c.

References BEGINRECV, ENDRECV, NULL, PtoH, ThreadLock, ThreadUnlock, TRACE, ValidateHWNDOPT, and xxxSetFocus().

Referenced by ComboBoxWndProcWorker(), DefFrameProcWorker(), DialogBox2(), DlgSetFocus(), ECMenu(), EndDialog(), MB_DlgProcWorker(), MDIClientWndProcWorker(), MLMouseMotion(), ReaderWndProc(), SLMouseMotion(), xxxBNSetCapture(), xxxInitActivateDlg(), xxxMDIActivate(), xxxRestoreDlgFocus(), and xxxTrackMouse().

05904 { 05905 PWND pwnd; 05906 TL tlpwnd; 05907 05908 BEGINRECV(HWND, NULL); 05909 05910 ValidateHWNDOPT(pwnd, hwnd); 05911 05912 ThreadLock(pwnd, &tlpwnd); 05913 05914 retval = (HWND)xxxSetFocus(pwnd); 05915 retval = PtoH((PVOID)retval); 05916 05917 ThreadUnlock(&tlpwnd); 05918 05919 TRACE("NtUserSetFocus"); 05920 ENDRECV(); 05921 }

W32KAPI NTSTATUS NtUserSetInformationProcess IN HANDLE  hProcess,
IN USERPROCESSINFOCLASS  ProcessInfoClass,
IN PVOID  ProcessInformation,
IN ULONG  ProcessInformationLength
 

Definition at line 7606 of file kernel/ntstubs.c.

References BEGINRECVCSRSS, DWORD, ENDRECVCSRSS, NTSTATUS(), ProbeForRead, SetInformationProcess(), and TRACE.

Referenced by SetProcessForegroundRights().

07611 { 07612 BEGINRECVCSRSS(NTSTATUS, STATUS_UNSUCCESSFUL); 07613 07614 /* 07615 * Probe arguments without try/except 07616 */ 07617 #if DBG 07618 ProbeForRead(ProcessInformation, ProcessInformationLength, 07619 sizeof(DWORD)); 07620 #endif 07621 07622 retval = SetInformationProcess(hProcess, 07623 ProcessInfoClass, ProcessInformation, 07624 ProcessInformationLength); 07625 07626 07627 TRACE("NtUserSetInformationProcess"); 07628 ENDRECVCSRSS(); 07629 }

W32KAPI NTSTATUS NtUserSetInformationThread IN HANDLE  hThread,
IN USERTHREADINFOCLASS  ThreadInfoClass,
IN PVOID  ThreadInformation,
IN ULONG  ThreadInformationLength
 

Definition at line 7575 of file kernel/ntstubs.c.

References BEGINRECVCSRSS, DWORD, ENDRECVCSRSS, NTSTATUS(), ProbeForRead, ProbeForWrite(), TRACE, and xxxSetInformationThread().

Referenced by _EndTask(), _ExitWindowsEx(), ConnectToEmulator(), ConsoleClientShutdown(), HandleFocusEvent(), HandleMediaChangeEvent(), HandleRemoteNetDeviceChangeEvent(), SetActivePalette(), SetActiveScreenBuffer(), SrvDeviceEvent(), SrvRegisterConsoleVDM(), SrvSetConsolePalette(), TerminalServerRequestThread(), UnregisterVDM(), UnsetActivePalette(), UserClientConnect(), and UserClientShutdown().

07580 { 07581 BEGINRECVCSRSS(NTSTATUS, STATUS_UNSUCCESSFUL); 07582 07583 /* 07584 * Probe arguments outside a try clause -- CSRSS 07585 */ 07586 #if DBG 07587 if (ThreadInfoClass == UserThreadUseDesktop) { 07588 ProbeForWrite(ThreadInformation, ThreadInformationLength, 07589 sizeof(DWORD)); 07590 } else { 07591 ProbeForRead(ThreadInformation, ThreadInformationLength, 07592 sizeof(DWORD)); 07593 } 07594 07595 #endif 07596 07597 retval = xxxSetInformationThread(hThread, 07598 ThreadInfoClass, ThreadInformation, 07599 ThreadInformationLength); 07600 07601 07602 TRACE("NtUserSetInformationThread"); 07603 ENDRECVCSRSS(); 07604 }

W32KAPI BOOL NtUserSetInternalWindowPos IN HWND  hwnd,
IN UINT  cmdShow,
IN CONST RECT *  lpRect,
IN CONST POINT *  lpPoint
 

Definition at line 3826 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, BOOL, DWORD, ENDRECV_HWNDLOCK, FALSE, MSGERROR, ProbeAndReadPoint, ProbeAndReadRect, StubExceptionHandler, TRACE, and xxxSetInternalWindowPos().

03831 { 03832 RECT rc; 03833 POINT pt; 03834 03835 // 03836 // N.B. This function has implicit window translation and thread locking 03837 // enabled. These operations are performed in the User server API 03838 // dispatcher. 03839 // 03840 03841 BEGINRECV_HWNDLOCK(DWORD, 0, hwnd); 03842 03843 /* 03844 * Probe arguments 03845 */ 03846 try { 03847 rc = ProbeAndReadRect(lpRect); 03848 pt = ProbeAndReadPoint(lpPoint); 03849 } except (StubExceptionHandler(FALSE)) { 03850 MSGERROR(0); 03851 } 03852 03853 retval = xxxSetInternalWindowPos( 03854 pwnd, 03855 cmdShow, 03856 &rc, 03857 &pt); 03858 03859 TRACE("NtUserSetInternalWindowPos"); 03860 ENDRECV_HWNDLOCK(); 03861 }

W32KAPI BOOL NtUserSetKeyboardState IN CONST BYTE lpKeyState  ) 
 

Definition at line 2160 of file kernel/ntstubs.c.

References _SetKeyboardState(), BEGINRECV, BOOL, BYTE, ENDRECV, FALSE, MSGERROR, ProbeForRead, StubExceptionHandler, TRACE, and TRUE.

02162 { 02163 BEGINRECV(BOOL, FALSE); 02164 02165 /* 02166 * Probe arguments 02167 */ 02168 try { 02169 ProbeForRead(lpKeyState, 256, sizeof(BYTE)); 02170 02171 retval = _SetKeyboardState(lpKeyState); 02172 } except (StubExceptionHandler(TRUE)) { 02173 MSGERROR(0); 02174 } 02175 02176 TRACE("NtUserSetKeyboardState"); 02177 ENDRECV(); 02178 }

W32KAPI BOOL NtUserSetLayeredWindowAttributes IN HWND  hwnd,
IN COLORREF  crKey,
IN BYTE  bAlpha,
IN DWORD  dwFlags
 

Definition at line 13435 of file kernel/ntstubs.c.

References _SetLayeredWindowAttributes(), BEGINATOMICRECV, BOOL, dwFlags, ENDATOMICRECV, FALSE, MSGERROR, TRACE, and ValidateHWND.

13440 { 13441 PWND pwnd; 13442 13443 BEGINATOMICRECV(BOOL, FALSE); 13444 13445 ValidateHWND(pwnd, hwnd); 13446 13447 if (dwFlags & ~LWA_VALID) { 13448 RIPMSG0(RIP_WARNING, "SetLayeredWindowAttributes: Invalid Parameter"); 13449 MSGERROR(ERROR_INVALID_PARAMETER); 13450 } else { 13451 retval = _SetLayeredWindowAttributes(pwnd, crKey, bAlpha, dwFlags); 13452 } 13453 13454 TRACE("NtUserSetLayeredWindowAttributes"); 13455 ENDATOMICRECV(); 13456 }

W32KAPI BOOL NtUserSetLogonNotifyWindow IN HWND  hwndNotify  ) 
 

Definition at line 7149 of file kernel/ntstubs.c.

References _SetLogonNotifyWindow(), BEGINRECV_HWND, BOOL, ENDRECV_HWND, FALSE, and TRACE.

07151 { 07152 07153 // 07154 // N.B. This function has implicit window handle translation. This 07155 // operation is performed in the User server API dispatcher. 07156 // 07157 07158 BEGINRECV_HWND(BOOL, FALSE, hwnd); 07159 07160 retval = _SetLogonNotifyWindow(pwnd); 07161 07162 TRACE("NtUserSetLogonNotifyWindow"); 07163 ENDRECV_HWND(); 07164 }

W32KAPI BOOL NtUserSetMenu IN HWND  hwnd,
IN HMENU  hmenu,
IN BOOL  fRedraw
 

Definition at line 5923 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK_ND, BOOL, DWORD, ENDRECV_HWNDLOCK_ND, ThreadLockWithPti, ThreadUnlock, TRACE, ValidateHMENUOPT, and xxxSetMenu().

Referenced by MDISetMenu(), and SetMenu().

05927 { 05928 05929 // 05930 // N.B. This function has implicit window translation and thread locking 05931 // enabled. These operations are performed in the User server API 05932 // dispatcher. 05933 // 05934 05935 PMENU pmenu; 05936 TL tlpmenu; 05937 05938 BEGINRECV_HWNDLOCK_ND(DWORD, 0, hwnd); 05939 05940 ValidateHMENUOPT(pmenu, hmenu); 05941 05942 ThreadLockWithPti(ptiCurrent, pmenu, &tlpmenu); 05943 05944 retval = xxxSetMenu( 05945 pwndND, 05946 pmenu, 05947 fRedraw); 05948 05949 ThreadUnlock(&tlpmenu); 05950 05951 TRACE("NtUserSetMenu"); 05952 ENDRECV_HWNDLOCK_ND(); 05953 }

W32KAPI BOOL NtUserSetMenuContextHelpId IN HMENU  hMenu,
IN DWORD  dwContextHelpId
 

Definition at line 4779 of file kernel/ntstubs.c.

References _SetMenuContextHelpId(), BEGINATOMICRECV, BOOL, ENDATOMICRECV, FALSE, TRACE, and ValidateHMENUMODIFY.

Referenced by MenuLoadChicagoTemplates().

04782 { 04783 PMENU pmenu; 04784 04785 BEGINATOMICRECV(BOOL, FALSE); 04786 04787 ValidateHMENUMODIFY(pmenu, hMenu); 04788 04789 retval = _SetMenuContextHelpId( 04790 pmenu, 04791 dwContextHelpId); 04792 04793 TRACE("NtUserSetMenuContextHelpId"); 04794 ENDATOMICRECV(); 04795 }

W32KAPI BOOL NtUserSetMenuDefaultItem IN HMENU  hMenu,
IN UINT  wID,
IN UINT  fByPosition
 

Definition at line 4759 of file kernel/ntstubs.c.

References _SetMenuDefaultItem(), BEGINATOMICRECV, BOOL, ENDATOMICRECV, FALSE, TRACE, and ValidateHMENUMODIFY.

04763 { 04764 PMENU pmenu; 04765 04766 BEGINATOMICRECV(BOOL, FALSE); 04767 04768 ValidateHMENUMODIFY(pmenu, hMenu); 04769 04770 retval = _SetMenuDefaultItem( 04771 pmenu, 04772 wID, 04773 fByPosition); 04774 04775 TRACE("NtUserSetMenuDefaultItem"); 04776 ENDATOMICRECV(); 04777 }

W32KAPI BOOL NtUserSetMenuFlagRtoL IN HMENU  hMenu  ) 
 

Definition at line 4797 of file kernel/ntstubs.c.

References _SetMenuFlagRtoL(), BEGINATOMICRECV, BOOL, ENDATOMICRECV, FALSE, TRACE, and ValidateHMENU.

Referenced by MenuLoadChicagoTemplates().

04799 { 04800 PMENU pmenu; 04801 04802 BEGINATOMICRECV(BOOL, FALSE); 04803 04804 ValidateHMENU(pmenu, hMenu); 04805 04806 retval = _SetMenuFlagRtoL(pmenu); 04807 04808 TRACE("NtUserSetMenuFlagRtoL"); 04809 ENDATOMICRECV(); 04810 }

W32KAPI BOOL NtUserSetObjectInformation IN HANDLE  hObject,
IN int  nIndex,
IN LPCVOID  pvInfo,
IN DWORD  nLength
 

W32KAPI HWND NtUserSetParent IN HWND  hwndChild,
IN HWND  hwndNewParent
 

Definition at line 5955 of file kernel/ntstubs.c.

References _GetDesktopWindow(), _GetMessageWindow(), BEGINRECV_HWNDLOCK_ND, ENDRECV_HWNDLOCK_ND, NULL, PtoH, ThreadLockWithPti, ThreadUnlock, TRACE, ValidateHWND, and xxxSetParent().

Referenced by xxxCBCreateHandler().

05958 { 05959 05960 PWND pwndNewParent; 05961 TL tlpwndNewParent; 05962 05963 BEGINRECV_HWNDLOCK_ND(HWND, NULL, hwndChild); 05964 05965 if (hwndNewParent == NULL) { 05966 pwndNewParent = _GetDesktopWindow(); 05967 } else if (hwndNewParent == HWND_MESSAGE) { 05968 pwndNewParent = _GetMessageWindow(); 05969 } else { 05970 ValidateHWND(pwndNewParent, hwndNewParent); 05971 } 05972 05973 ThreadLockWithPti(ptiCurrent, pwndNewParent, &tlpwndNewParent); 05974 05975 retval = (HWND)xxxSetParent( 05976 pwndND, 05977 pwndNewParent); 05978 retval = PtoH((PVOID)retval); 05979 05980 ThreadUnlock(&tlpwndNewParent); 05981 05982 TRACE("NtUserSetParent"); 05983 ENDRECV_HWNDLOCK_ND(); 05984 }

W32KAPI BOOL NtUserSetProcessWindowStation IN HWINSTA  hwinsta  ) 
 

Definition at line 1139 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, TRACE, UserMode, and xxxSetProcessWindowStation().

01141 { 01142 BEGINRECV(BOOL, FALSE); 01143 01144 retval = xxxSetProcessWindowStation(hwinsta, UserMode); 01145 01146 TRACE("NtUserSetProcessWindowStation"); 01147 ENDRECV(); 01148 }

W32KAPI BOOL NtUserSetProp IN HWND  hwnd,
IN DWORD  dwProp,
IN HANDLE  hData
 

Definition at line 9220 of file kernel/ntstubs.c.

References BEGINRECV_HWND, BOOL, DWORD, ENDRECV_HWND, InternalSetProp(), PROPF_STRING, and TRACE.

Referenced by SetProp().

09224 { 09225 09226 // 09227 // N.B. This function has implicit window handle translation. This 09228 // operation is performed in the User server API dispatcher. 09229 // 09230 09231 BEGINRECV_HWND(DWORD, 0, hwnd); 09232 09233 retval = InternalSetProp( 09234 pwnd, 09235 (LPTSTR)LOWORD(dwProp), 09236 hData, 09237 HIWORD(dwProp) ? PROPF_STRING : 0); 09238 09239 TRACE("NtUserSetProp"); 09240 ENDRECV_HWND(); 09241 }

W32KAPI VOID NtUserSetRipFlags DWORD  dwRipFlags,
DWORD  PID
 

Definition at line 4490 of file kernel/ntstubs.c.

References _SetRipFlags(), BEGINRECV_VOID, ENDRECV_VOID, TRACEVOID, and VOID().

Referenced by SetRipFlags().

04491 { 04492 BEGINRECV_VOID(); 04493 04494 _SetRipFlags(dwRipFlags, dwPID); 04495 04496 TRACEVOID("NtUserSetRipFlags"); 04497 ENDRECV_VOID(); 04498 }

W32KAPI int NtUserSetScrollInfo IN HWND  hwnd,
IN int  nBar,
IN LPCSCROLLINFO  pInfo,
IN BOOL  fRedraw
 

Definition at line 5986 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK_ND, DWORD, ENDRECV_HWNDLOCK_ND, LIMITVALUE, MSGERROR, ProbeAndReadScrollInfo, StubExceptionHandler, TRACE, TRUE, and xxxSetScrollBar().

Referenced by CalcClientScrolling(), MLScroll(), SetScrollPos(), SetScrollRange(), and xxxSetLBScrollParms().

05991 { 05992 SCROLLINFO si; 05993 05994 // 05995 // N.B. This function has implicit window translation and thread locking 05996 // enabled. These operations are performed in the User server API 05997 // dispatcher. 05998 // 05999 06000 BEGINRECV_HWNDLOCK_ND(DWORD, 0, hwnd); 06001 06002 LIMITVALUE(nBar, SB_MAX, "SetScrollInfo"); 06003 06004 /* 06005 * Probe arguments 06006 */ 06007 try { 06008 si = ProbeAndReadScrollInfo(pInfo); 06009 } except (StubExceptionHandler(TRUE)) { 06010 MSGERROR(0); 06011 } 06012 06013 retval = xxxSetScrollBar( 06014 pwndND, 06015 nBar, 06016 &si, 06017 fRedraw); 06018 06019 TRACE("NtUserSetScrollInfo"); 06020 ENDRECV_HWNDLOCK_ND(); 06021 }

W32KAPI BOOL NtUserSetShellWindowEx IN HWND  hwnd,
IN HWND  hwndBkGnd
 

Definition at line 2307 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK_ND, BOOL, ENDRECV_HWNDLOCK_ND, FALSE, ThreadLockAlwaysWithPti, ThreadUnlock, TRACE, ValidateHWNDND, and xxxSetShellWindow().

Referenced by SetShellWindow().

02310 { 02311 PWND pwndBkGnd; 02312 TL tlpwndBkGnd; 02313 02314 BEGINRECV_HWNDLOCK_ND(BOOL, FALSE, hwnd); 02315 02316 ValidateHWNDND(pwndBkGnd, hwndBkGnd); 02317 02318 ThreadLockAlwaysWithPti(ptiCurrent, pwndBkGnd, &tlpwndBkGnd); 02319 02320 retval = xxxSetShellWindow(pwndND, pwndBkGnd); 02321 02322 ThreadUnlock(&tlpwndBkGnd); 02323 02324 TRACE("NtUserSetShellWindowEx"); 02325 ENDRECV_HWNDLOCK_ND(); 02326 }

W32KAPI BOOL NtUserSetSysColors IN int  cElements,
IN CONST INT lpaElements,
IN CONST COLORREF *  lpaRgbValues,
IN UINT  uOptions
 

Definition at line 6023 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, CLEANUPRECV, CreateProfileUserName(), DATAALIGN, ENDRECV, ExRaiseStatus(), FALSE, FreeProfileUserName(), IS_THREAD_RESTRICTED, MSGERROR, MSGERRORCLEANUP, NULL, ProbeForReadBuffer, PtiCurrent, StubExceptionHandler, ThreadLockPool, ThreadUnlockPool, TRACE, TRUE, and xxxSetSysColors().

Referenced by SetSysColors(), and SetSysColorsTemp().

06028 { 06029 LPINT lpSysColors = NULL; 06030 LPDWORD lpSysColorValues = NULL; 06031 TL tlName, tlSysColors, tlSysColorValues; 06032 PUNICODE_STRING pProfileUserName = NULL; 06033 PTHREADINFO ptiCurrent; 06034 06035 BEGINRECV(BOOL, FALSE); 06036 06037 ptiCurrent = PtiCurrent(); 06038 06039 /* 06040 * Prevent restricted threads from changing global stuff 06041 */ 06042 if (IS_THREAD_RESTRICTED(ptiCurrent, JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS)) { 06043 MSGERROR(0); 06044 } 06045 06046 /* 06047 * Probe arguments 06048 */ 06049 if (nCount) { 06050 try { 06051 ProbeForReadBuffer(pSysColor, nCount, DATAALIGN); 06052 ProbeForReadBuffer(pColorValues, nCount, DATAALIGN); 06053 lpSysColors = UserAllocPoolWithQuota(nCount * sizeof(*pSysColor), TAG_COLORS); 06054 if (lpSysColors == NULL) { 06055 ExRaiseStatus(STATUS_NO_MEMORY); 06056 } 06057 RtlCopyMemory(lpSysColors, pSysColor, nCount * sizeof(*pSysColor)); 06058 lpSysColorValues = UserAllocPoolWithQuota(nCount * sizeof(*pColorValues), TAG_COLORVALUES); 06059 if (lpSysColorValues == NULL) { 06060 ExRaiseStatus(STATUS_NO_MEMORY); 06061 } 06062 RtlCopyMemory(lpSysColorValues, pColorValues, nCount * sizeof(*pColorValues)); 06063 06064 } except (StubExceptionHandler(TRUE)) { 06065 MSGERRORCLEANUP(0); 06066 } 06067 } 06068 06069 ThreadLockPool(ptiCurrent, lpSysColors, &tlSysColors); 06070 ThreadLockPool(ptiCurrent, lpSysColorValues, &tlSysColorValues); 06071 pProfileUserName = CreateProfileUserName(&tlName); 06072 retval = xxxSetSysColors(pProfileUserName, 06073 nCount, 06074 lpSysColors, 06075 lpSysColorValues, 06076 uOptions 06077 ); 06078 FreeProfileUserName(pProfileUserName, &tlName); 06079 ThreadUnlockPool(ptiCurrent, &tlSysColorValues); 06080 ThreadUnlockPool(ptiCurrent, &tlSysColors); 06081 06082 CLEANUPRECV(); 06083 if (lpSysColors) 06084 UserFreePool(lpSysColors); 06085 if (lpSysColorValues) 06086 UserFreePool(lpSysColorValues); 06087 06088 TRACE("NtUserSetSysColors"); 06089 ENDRECV(); 06090 }

W32KAPI BOOL NtUserSetSystemCursor IN HCURSOR  hcur,
IN DWORD  id
 

Definition at line 7166 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, TRACE, ValidateHCURSOR, and zzzSetSystemCursor().

Referenced by SetSystemCursor().

07169 { 07170 PCURSOR pcur; 07171 07172 BEGINRECV(BOOL, FALSE); 07173 07174 ValidateHCURSOR(pcur, hcur); 07175 07176 retval = zzzSetSystemCursor( 07177 pcur, 07178 id); 07179 07180 TRACE("NtUserSetSystemCursor"); 07181 ENDRECV(); 07182 }

W32KAPI BOOL NtUserSetSystemMenu IN HWND  hwnd,
IN HMENU  hmenu
 

Definition at line 8507 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK, BOOL, DWORD, ENDRECV_HWNDLOCK, ThreadLockAlwaysWithPti, ThreadUnlock, TRACE, ValidateHMENU, and xxxSetSystemMenu().

Referenced by MDICompleteChildCreation().

08510 { 08511 08512 // 08513 // N.B. This function has implicit window translation and thread locking 08514 // enabled. These operations are performed in the User server API 08515 // dispatcher. 08516 // 08517 08518 PMENU pmenu; 08519 TL tlpmenu; 08520 08521 BEGINRECV_HWNDLOCK(DWORD, 0, hwnd); 08522 08523 ValidateHMENU(pmenu, hmenu); 08524 08525 ThreadLockAlwaysWithPti(ptiCurrent, pmenu, &tlpmenu); 08526 08527 retval = xxxSetSystemMenu(pwnd, pmenu); 08528 08529 ThreadUnlock(&tlpmenu); 08530 08531 TRACE("NtUserSetSystemMenu"); 08532 ENDRECV_HWNDLOCK(); 08533 }

W32KAPI UINT_PTR NtUserSetSystemTimer IN HWND  hwnd,
IN UINT_PTR  nIDEvent,
IN DWORD  dwElapse,
IN WNDPROC  pTimerFunc
 

Definition at line 8554 of file kernel/ntstubs.c.

References _SetSystemTimer(), BEGINRECV_HWND, ENDRECV_HWND, NULL, and TRACE.

Referenced by MLMouseMotion().

08559 { 08560 08561 // 08562 // N.B. This function has implicit window translation and thread locking 08563 // enabled. These operations are performed in the User server API 08564 // dispatcher. 08565 // 08566 08567 BEGINRECV_HWND(UINT_PTR, 0, hwnd); 08568 08569 UNREFERENCED_PARAMETER(pTimerFunc); 08570 08571 retval = _SetSystemTimer(pwnd, 08572 nIDEvent, 08573 dwElapse, 08574 NULL); 08575 08576 TRACE("NtUserSetSystemTimer"); 08577 ENDRECV_HWND(); 08578 }

W32KAPI BOOL NtUserSetThreadDesktop IN HDESK  hdesk  ) 
 

Definition at line 1434 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, gpepCSRSS, LogDesktop, NT_SUCCESS, NTSTATUS(), NULL, ObDereferenceObject, PsGetCurrentProcess, PtiCurrent, Status, TRACE, UserMode, ValidateHdesk(), and xxxSetThreadDesktop().

01436 { 01437 PDESKTOP pdesk = NULL; 01438 NTSTATUS Status = STATUS_SUCCESS; 01439 01440 BEGINRECV(BOOL, FALSE); 01441 Status = ValidateHdesk(hdesk, UserMode, 0, &pdesk); 01442 if (NT_SUCCESS(Status)) { 01443 retval = xxxSetThreadDesktop(hdesk, pdesk); 01444 LogDesktop(pdesk, LD_DEREF_VALIDATE_HDESK1, FALSE, (ULONG_PTR)PtiCurrent()); 01445 ObDereferenceObject(pdesk); 01446 } else if (hdesk == NULL && PsGetCurrentProcess() == gpepCSRSS) { 01447 retval = xxxSetThreadDesktop(NULL, NULL); 01448 } else 01449 retval = FALSE; 01450 01451 TRACE("NtUserSetThreadDesktop"); 01452 ENDRECV(); 01453 }

W32KAPI VOID NtUserSetThreadState IN DWORD  dwFlags,
IN DWORD  dwMask
 

Definition at line 7777 of file kernel/ntstubs.c.

References BEGINRECV_VOID, dwFlags, DWORD, ENDRECV_VOID, tagTHREADINFO::pq, PtiCurrent, QF_DIALOGACTIVE, tagQ::QF_flags, TRACEVOID, and VOID().

Referenced by DefDlgProcWorker().

07780 { 07781 PTHREADINFO ptiCurrent; 07782 DWORD dwOldFlags; 07783 07784 if (dwFlags & ~(QF_DIALOGACTIVE)) { 07785 return; 07786 } 07787 07788 BEGINRECV_VOID(); 07789 07790 ptiCurrent = PtiCurrent(); 07791 dwOldFlags = ptiCurrent->pq->QF_flags; 07792 ptiCurrent->pq->QF_flags ^= ((dwOldFlags ^ dwFlags) & dwMask); 07793 07794 TRACEVOID("NtUserSetThreadState"); 07795 ENDRECV_VOID(); 07796 }

W32KAPI UINT_PTR NtUserSetTimer IN HWND  hwnd,
IN UINT_PTR  nIDEvent,
IN UINT  wElapse,
IN TIMERPROC  pTimerFunc
 

Definition at line 6092 of file kernel/ntstubs.c.

References _SetTimer(), BEGINATOMICRECV, ENDATOMICRECV, TIMERPROC_PWND, TRACE, and ValidateHWNDOPT.

Referenced by DdeClientTransaction(), ReaderWndProc(), xxxLBoxCtlCharInput(), xxxLBoxCtlKeyInput(), xxxNextAniIconStep(), xxxSetStaticImage(), and xxxTrackMouse().

06097 { 06098 PWND pwnd; 06099 06100 BEGINATOMICRECV(UINT_PTR, 0); 06101 06102 ValidateHWNDOPT(pwnd, hwnd); 06103 06104 /* 06105 * If we let apps set a timer granularity less then 10 the app 06106 * spend too long processing timer messages. Some WOW apps like 06107 * Paradox in WinStone use zero to effectively get the minimal 06108 * timer value which was ~55ms in Win 3.1. We also step this 06109 * value up for 32 bit apps because the NT timer resolution 06110 * can very depending if the multimedia timers have turned up 06111 * the resolution. If they have NT apps that specify a low value 06112 * will not work properly because they will eat the CPU processing 06113 * WM_TIMER messages 06114 */ 06115 if (wElapse < 10) { 06116 RIPMSG1(RIP_WARNING, "SetTimer: timeout value was %ld set to 10", 06117 wElapse); 06118 wElapse = 10; 06119 } 06120 06121 retval = _SetTimer( 06122 pwnd, 06123 nIDEvent, 06124 wElapse, 06125 (TIMERPROC_PWND)pTimerFunc); 06126 06127 TRACE("NtUserSetTimer"); 06128 ENDATOMICRECV(); 06129 }

W32KAPI BOOL NtUserSetWindowFNID IN HWND  hwnd,
IN WORD  fnid
 

Definition at line 7715 of file kernel/ntstubs.c.

References BEGINRECV_HWND, BOOL, ENDRECV_HWND, FALSE, FNID_CLEANEDUP_BIT, FNID_CONTROLEND, GETFNID, GETPTI, MSGERROR, PpiCurrent, TRACE, and TRUE.

Referenced by ButtonWndProcWorker(), ECNcCreate(), ECNcDestroyHandler(), ImeWndProcWorker(), MDIClientWndProcWorker(), StaticWndProcWorker(), xxxCBNcDestroyHandler(), and xxxDestroyLBox().

07718 { 07719 BEGINRECV_HWND(BOOL, FALSE, hwnd); 07720 07721 /* 07722 * Don't let apps mess with windows on other processes. 07723 */ 07724 if (GETPTI(pwnd)->ppi != PpiCurrent()) { 07725 MSGERROR(0); 07726 } 07727 07728 /* 07729 * Make sure the fnid is in the correct range. 07730 */ 07731 if (fnid != FNID_CLEANEDUP_BIT) { 07732 if ((fnid < FNID_CONTROLSTART) || (fnid > FNID_CONTROLEND) || (GETFNID(pwnd) != 0)) { 07733 MSGERROR(0); 07734 } 07735 } 07736 07737 /* 07738 * Remember what window class this window belongs to. Can't use 07739 * the real class because any app can call CallWindowProc() 07740 * directly no matter what the class is! 07741 */ 07742 pwnd->fnid |= fnid; 07743 retval = TRUE; 07744 07745 TRACE("NtUserSetWindowFNID"); 07746 ENDRECV_HWND(); 07747 }

W32KAPI LONG NtUserSetWindowLong IN HWND  hwnd,
IN int  nIndex,
IN LONG  dwNewLong,
IN BOOL  bAnsi
 

W32KAPI BOOL NtUserSetWindowPlacement IN HWND  hwnd,
IN CONST WINDOWPLACEMENT *  lpwndpl
 

Definition at line 4260 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK_ND, BOOL, ENDRECV_HWNDLOCK_ND, FALSE, Is400Compat, MSGERROR, ProbeAndReadWindowPlacement, StubExceptionHandler, TRACE, TRUE, and xxxSetWindowPlacement().

04263 { 04264 WINDOWPLACEMENT wp; 04265 04266 // 04267 // N.B. This function has implicit window translation and thread locking 04268 // enabled. These operations are performed in the User server API 04269 // dispatcher. 04270 // 04271 04272 BEGINRECV_HWNDLOCK_ND(BOOL, FALSE, hwnd); 04273 04274 /* 04275 * Probe arguments 04276 */ 04277 try { 04278 wp = ProbeAndReadWindowPlacement(pwp); 04279 } except (StubExceptionHandler(TRUE)) { 04280 MSGERROR(0); 04281 } 04282 04283 if (wp.length != sizeof(WINDOWPLACEMENT)) { 04284 if (Is400Compat(ptiCurrent->dwExpWinVer)) { 04285 RIPERR1(ERROR_INVALID_PARAMETER, RIP_WARNING, "SetWindowPlacement: invalid length %lX", pwp->length); 04286 MSGERROR(0); 04287 } else { 04288 RIPMSG1(RIP_WARNING, "SetWindowPlacement: invalid length %lX", pwp->length); 04289 } 04290 } 04291 04292 retval = xxxSetWindowPlacement(pwndND, &wp); 04293 04294 TRACE("NtUserSetWindowPlacement"); 04295 ENDRECV_HWNDLOCK_ND(); 04296 }

W32KAPI BOOL NtUserSetWindowPos IN HWND  hwnd,
IN HWND  hwndInsertAfter,
IN int  x,
IN int  y,
IN int  cx,
IN int  cy,
IN UINT  dwFlags
 

Definition at line 2180 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK_ND, BOOL, cy, dwFlags, ENDRECV_HWNDLOCK_ND, FALSE, MSGERROR, NULL, TESTFLAGS, TestWF, ThreadLockWithPti, ThreadUnlock, TRACE, ValidateHWNDIA, WFINDESTROY, and xxxSetWindowPos().

Referenced by AnimateBlend(), AnimateWindow(), BringWindowToTop(), DefDlgProcWorker(), DialogBox2(), EndDialog(), MB_DlgProcWorker(), MDIActivateDlgInit(), MDIClientWndProcWorker(), MDICompleteChildCreation(), ReaderWndProc(), ShowWindowNoRepaint(), StaticWndProcWorker(), UnmaximizeChildWindows(), xxxCBHideListBoxWindow(), xxxCBSetEditItemHeight(), xxxCBShowListBoxWindow(), xxxLBSize(), xxxMDIActivate(), and xxxSetStaticImage().

02188 { 02189 PWND pwndT; 02190 PWND pwndInsertAfter; 02191 TL tlpwndT; 02192 02193 BEGINRECV_HWNDLOCK_ND(BOOL, FALSE, hwnd); 02194 02195 TESTFLAGS(dwFlags, SWP_VALID); 02196 02197 ValidateHWNDIA(pwndInsertAfter, hwndInsertAfter); 02198 02199 /* 02200 * Let's not allow the window to be shown/hidden once we 02201 * started the destruction of the window. 02202 */ 02203 if (TestWF(pwndND, WFINDESTROY)) { 02204 RIPERR1(ERROR_INVALID_PARAMETER, 02205 RIP_WARNING, 02206 "SetWindowPos: Window is being destroyed (pwnd == %#p)", 02207 pwndND); 02208 MSGERROR(0); 02209 } 02210 02211 if (dwFlags & ~SWP_VALID) { 02212 RIPERR1(ERROR_INVALID_PARAMETER, 02213 RIP_WARNING, 02214 "SetWindowPos: Invalid flags passed in (flags == 0x%lx)", 02215 dwFlags); 02216 MSGERROR(0); 02217 } 02218 02219 /* 02220 * Make sure the window coordinates can fit in WORDs. 02221 */ 02222 if (!(dwFlags & SWP_NOMOVE)) { 02223 if (x > SHRT_MAX) { 02224 x = SHRT_MAX; 02225 } else if (x < SHRT_MIN) { 02226 x = SHRT_MIN; 02227 } 02228 if (y > SHRT_MAX) { 02229 y = SHRT_MAX; 02230 } else if (y < SHRT_MIN) { 02231 y = SHRT_MIN; 02232 } 02233 } 02234 02235 /* 02236 * Actually, if we were going to be really strict about this we'd 02237 * make sure that x + cx < SHRT_MAX, etc but since we do maintain 02238 * signed 32-bit coords internally this case doesn't cause a problem. 02239 */ 02240 if (!(dwFlags & SWP_NOSIZE)) { 02241 if (cx < 0) { 02242 cx = 0; 02243 } else if (cx > SHRT_MAX) { 02244 cx = SHRT_MAX; 02245 } 02246 if (cy < 0) { 02247 cy = 0; 02248 } else if (cy > SHRT_MAX) { 02249 cy = SHRT_MAX; 02250 } 02251 } 02252 02253 #ifdef NEVER 02254 // 02255 // do not fail these conditions because real apps use them. 02256 // 02257 if (!(dwFlags & SWP_NOMOVE) && 02258 (x > SHRT_MAX || x < SHRT_MIN || 02259 y > SHRT_MAX || y < SHRT_MIN)) { 02260 RIPERR0(ERROR_INVALID_PARAMETER, RIP_WARNING, "Invalid coordinate passed to SetWindowPos"); 02261 MSGERROR(0); 02262 } 02263 02264 /* 02265 * Actually, if we were going to be really strict about this we'd 02266 * make sure that x + cx < SHRT_MAX, etc but since we do maintain 02267 * signed 32-bit coords internally this case doesn't cause a problem. 02268 */ 02269 if (!(dwFlags & SWP_NOSIZE) && 02270 (cx < 0 || cx > SHRT_MAX || 02271 cy < 0 || cy > SHRT_MAX)) { 02272 RIPERR0(ERROR_INVALID_PARAMETER, RIP_WARNING, "Invalid width/height passed to SetWindowPos"); 02273 MSGERROR(0); 02274 } 02275 #endif 02276 02277 switch((ULONG_PTR)pwndInsertAfter) { 02278 case (ULONG_PTR)HWND_TOPMOST: 02279 case (ULONG_PTR)HWND_NOTOPMOST: 02280 case (ULONG_PTR)HWND_TOP: 02281 case (ULONG_PTR)HWND_BOTTOM: 02282 pwndT = NULL; 02283 break; 02284 02285 default: 02286 pwndT = pwndInsertAfter; 02287 break; 02288 } 02289 02290 ThreadLockWithPti(ptiCurrent, pwndT, &tlpwndT); 02291 02292 retval = xxxSetWindowPos( 02293 pwndND, 02294 pwndInsertAfter, 02295 x, 02296 y, 02297 cx, 02298 cy, 02299 dwFlags); 02300 02301 ThreadUnlock(&tlpwndT); 02302 02303 TRACE("NtUserSetWindowPos"); 02304 ENDRECV_HWNDLOCK_ND(); 02305 }

W32KAPI int NtUserSetWindowRgn IN HWND  hwnd,
IN HRGN  hRgn,
IN BOOL  bRedraw
 

Definition at line 6801 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK_ND, ENDRECV_HWNDLOCK_ND, TRACE, and xxxSetWindowRgn().

Referenced by SetWindowRgn().

06805 { 06806 06807 // 06808 // N.B. This function has implicit window translation and thread locking 06809 // enabled. These operations are performed in the User server API 06810 // dispatcher. 06811 // 06812 06813 BEGINRECV_HWNDLOCK_ND(int, 0, hwnd); 06814 06815 retval = xxxSetWindowRgn( 06816 pwndND, 06817 hrgn, 06818 bRedraw); 06819 06820 TRACE("NtUserSetWindowRgn"); 06821 ENDRECV_HWNDLOCK_ND(); 06822 }

W32KAPI HHOOK NtUserSetWindowsHookAW IN int  nFilterType,
IN HOOKPROC  pfnFilterProc,
IN DWORD  dwFlags
 

Definition at line 6203 of file kernel/ntstubs.c.

References BEGINRECV, dwFlags, ENDRECV, NULL, TRACE, and zzzSetWindowsHookAW().

Referenced by SetWindowsHookA(), and SetWindowsHookW().

06207 { 06208 BEGINRECV(HHOOK, NULL); 06209 06210 retval = (HHOOK)zzzSetWindowsHookAW( 06211 nFilterType, 06212 (PROC)pfnFilterProc, 06213 dwFlags); 06214 06215 TRACE("NtUserSetWindowsHookAW"); 06216 ENDRECV(); 06217 }

W32KAPI HHOOK NtUserSetWindowsHookEx IN HANDLE  hmod,
IN PUNICODE_STRING pstrLib  OPTIONAL,
IN DWORD  idThread,
IN int  nFilterType,
IN PROC  pfnFilterProc,
IN DWORD  dwFlags
 

Definition at line 3376 of file kernel/ntstubs.c.

References BEGINRECV, dwFlags, ENDRECV, MSGERROR, NULL, PtiFromThreadId(), PtoH, TRACE, and zzzSetWindowsHookEx().

Referenced by _SetWindowsHookEx().

03383 { 03384 PTHREADINFO ptiThread; 03385 03386 BEGINRECV(HHOOK, NULL); 03387 03388 if (idThread != 0) { 03389 ptiThread = PtiFromThreadId(idThread); 03390 if (ptiThread == NULL) { 03391 RIPERR0(ERROR_INVALID_PARAMETER, RIP_VERBOSE, ""); 03392 MSGERROR(0); 03393 } 03394 } else { 03395 ptiThread = NULL; 03396 } 03397 03398 /* 03399 * Probe pstrLib in GetHmodTableIndex(). 03400 */ 03401 retval = (HHOOK)zzzSetWindowsHookEx( 03402 hmod, 03403 pstrLib, 03404 ptiThread, 03405 nFilterType, 03406 pfnFilterProc, 03407 dwFlags); 03408 retval = PtoH((PVOID)retval); 03409 03410 TRACE("NtUserSetWindowsHookEx"); 03411 ENDRECV(); 03412 }

W32KAPI UINT NtUserSetWindowStationUser IN HWINSTA  hWindowStation,
IN PLUID  pLuidUser,
IN PSID pSidUser  OPTIONAL,
IN DWORD  cbSidUser
 

Definition at line 7110 of file kernel/ntstubs.c.

References _SetWindowStationUser(), BEGINATOMICRECV, CLEANUPRECV, DWORD, ENDATOMICRECV, FALSE, MSGERROR, MSGERRORCLEANUP, NT_SUCCESS, NTSTATUS(), ObDereferenceObject, ProbeForRead, Status, StubExceptionHandler, TRACE, UINT, UserMode, and ValidateHwinsta().

Referenced by SetWindowStationUser().

07115 { 07116 PWINDOWSTATION pwinsta; 07117 NTSTATUS Status; 07118 LUID luid; 07119 BEGINATOMICRECV(UINT, FALSE); 07120 07121 Status = ValidateHwinsta(hwinsta, UserMode, 0, &pwinsta); 07122 if (!NT_SUCCESS(Status)) 07123 MSGERROR(0); 07124 07125 try { 07126 ProbeForRead(pLuidUser, sizeof(*pLuidUser), sizeof(DWORD)); 07127 luid = *pLuidUser; 07128 if (ARGUMENT_PRESENT(pSidUser)) { 07129 ProbeForRead(pSidUser, cbSidUser, sizeof(DWORD)); 07130 } 07131 } except (StubExceptionHandler(FALSE)) { 07132 MSGERRORCLEANUP(0); // don't SetLastError for private API 07133 } 07134 07135 /* 07136 * SetWindowStationUser uses pSidUser in a try block. 07137 */ 07138 07139 retval = _SetWindowStationUser(pwinsta, &luid, pSidUser, cbSidUser); 07140 07141 CLEANUPRECV(); 07142 07143 ObDereferenceObject(pwinsta); 07144 07145 TRACE("NtUserSetWindowStationUser"); 07146 ENDATOMICRECV(); 07147 }

W32KAPI WORD NtUserSetWindowWord IN HWND  hwnd,
IN int  nIndex,
IN WORD  wNewWord
 

Definition at line 6181 of file kernel/ntstubs.c.

References _SetWindowWord(), BEGINRECV_HWND, ENDRECV_HWND, and TRACE.

06185 { 06186 06187 // 06188 // N.B. This function has implicit window handle translation. This 06189 // operation is performed in the User server API dispatcher. 06190 // 06191 06192 BEGINRECV_HWND(WORD, 0, hwnd); 06193 06194 retval = _SetWindowWord( 06195 pwnd, 06196 nIndex, 06197 wNewWord); 06198 06199 TRACE("NtUserSetWindowWord"); 06200 ENDRECV_HWND(); 06201 }

W32KAPI HWINEVENTHOOK NtUserSetWinEventHook IN DWORD  eventMin,
IN DWORD  eventMax,
IN HMODULE  hmodWinEventProc,
IN PUNICODE_STRING pstrLib  OPTIONAL,
IN WINEVENTPROC  pfnWinEventProc,
IN DWORD  idEventProcess,
IN DWORD  idEventThread,
IN DWORD  dwFlags
 

Definition at line 3414 of file kernel/ntstubs.c.

References _SetWinEventHook(), BEGINRECV, dwFlags, ENDRECV, NULL, PtoH, TESTFLAGS, and TRACE.

Referenced by SetWinEventHook().

03423 { 03424 BEGINRECV(HWINEVENTHOOK, NULL); 03425 03426 TESTFLAGS(dwFlags, WINEVENT_VALID); 03427 03428 /* 03429 * Probe pstrLib in GetHmodTableIndex(). 03430 */ 03431 retval = (HWINEVENTHOOK)_SetWinEventHook( 03432 eventMin, 03433 eventMax, 03434 hmodWinEventProc, 03435 pstrLib, 03436 pfnWinEventProc, 03437 (HANDLE)LongToHandle( idEventProcess ), 03438 idEventThread, 03439 dwFlags); 03440 retval = PtoH((PVOID)retval); 03441 03442 TRACE("NtUserSetWinEventHook"); 03443 ENDRECV(); 03444 }

W32KAPI BOOL NtUserShowCaret IN HWND  hwnd  ) 
 

Definition at line 6219 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, TRACE, ValidateHWNDOPT, and zzzShowCaret().

Referenced by ECInOutReconversionMode(), ECReleaseEditDC(), ECSetCaretHandler(), ECSetFont(), MLChangeSelection(), MLDrawText(), MLEditWndProc(), MLSetFocus(), SLChangeSelection(), SLEditWndProc(), SLPaint(), and SLSetFocus().

06221 { 06222 PWND pwnd; 06223 06224 BEGINRECV(BOOL, FALSE); 06225 06226 ValidateHWNDOPT(pwnd, hwnd); 06227 06228 retval = zzzShowCaret( 06229 pwnd); 06230 06231 TRACE("NtUserShowCaret"); 06232 ENDRECV(); 06233 }

W32KAPI BOOL NtUserShowScrollBar IN HWND  hwnd,
IN int  iBar,
IN BOOL  fShow
 

Definition at line 6235 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK_ND, BOOL, DWORD, ENDRECV_HWNDLOCK_ND, LIMITVALUE, TRACE, and xxxShowScrollBar().

Referenced by MDIClientWndProcWorker().

06239 { 06240 06241 // 06242 // N.B. This function has implicit window translation and thread locking 06243 // enabled. These operations are performed in the User server API 06244 // dispatcher. 06245 // 06246 06247 BEGINRECV_HWNDLOCK_ND(DWORD, 0, hwnd); 06248 06249 LIMITVALUE(iBar, SB_MAX, "ShowScrollBar"); 06250 06251 retval = xxxShowScrollBar( 06252 pwndND, 06253 iBar, 06254 fShow); 06255 06256 TRACE("NtUserShowScrollBar"); 06257 ENDRECV_HWNDLOCK_ND(); 06258 }

W32KAPI BOOL NtUserShowWindow IN HWND  hwnd,
IN int  nCmdShow
 

Definition at line 6274 of file kernel/ntstubs.c.

References BEGINRECV_HWNDLOCK_ND, BOOL, ENDRECV_HWNDLOCK_ND, FALSE, LIMITVALUE, MSGERROR, PUDF_ANIMATE, TEST_PUDF, TestWF, TRACE, WFINDESTROY, and xxxShowWindow().

Referenced by AnimateWindow(), CloseWindow(), DialogBox2(), InternalCreateDialog(), MDIClientWndProcWorker(), MDICompleteChildCreation(), OpenIcon(), UnmaximizeChildWindows(), xxxCBCreateHandler(), xxxCBHideListBoxWindow(), xxxCBShowListBoxWindow(), xxxMDIActivate(), xxxMDIDestroy(), and xxxMDINext().

06277 { 06278 BEGINRECV_HWNDLOCK_ND(BOOL, FALSE, hwnd); 06279 06280 LIMITVALUE(nCmdShow, SW_MAX, "ShowWindow"); 06281 06282 /* 06283 * Let's not allow the window to be shown/hidden once we 06284 * started the destruction of the window. 06285 */ 06286 if (TestWF(pwndND, WFINDESTROY)) { 06287 RIPERR1(ERROR_INVALID_PARAMETER, 06288 RIP_WARNING, 06289 "ShowWindow: Window is being destroyed (%#p)", 06290 pwndND); 06291 MSGERROR(0); 06292 } 06293 06294 retval = xxxShowWindow(pwndND, nCmdShow | TEST_PUDF(PUDF_ANIMATE)); 06295 06296 TRACE("NtUserShowWindow"); 06297 ENDRECV_HWNDLOCK_ND(); 06298 }

W32KAPI BOOL NtUserShowWindowAsync IN HWND  hwnd,
IN int  nCmdShow
 

Definition at line 6260 of file kernel/ntstubs.c.

References _ShowWindowAsync(), BEGINRECV_HWNDLOCK_ND, BOOL, ENDRECV_HWNDLOCK_ND, FALSE, LIMITVALUE, and TRACE.

Referenced by UnmaximizeChildWindows().

06263 { 06264 BEGINRECV_HWNDLOCK_ND(BOOL, FALSE, hwnd); 06265 06266 LIMITVALUE(nCmdShow, SW_MAX, "ShowWindowAsync"); 06267 06268 retval = _ShowWindowAsync(pwndND, nCmdShow, 0); 06269 06270 TRACE("NtUserShowWindowAsync"); 06271 ENDRECV_HWNDLOCK_ND(); 06272 }

W32KAPI NTSTATUS NtUserSoundSentry VOID   ) 
 

Definition at line 7651 of file kernel/ntstubs.c.

References _UserSoundSentryWorker(), BEGINRECV, ENDRECV, NTSTATUS(), and TRACE.

Referenced by _UserSoundSentry().

07652 { 07653 BEGINRECV(NTSTATUS, STATUS_UNSUCCESSFUL); 07654 07655 retval = (_UserSoundSentryWorker() ? 07656 STATUS_SUCCESS : STATUS_UNSUCCESSFUL); 07657 07658 TRACE("NtUserSoundSentry"); 07659 ENDRECV(); 07660 }

W32KAPI BOOL NtUserSwitchDesktop IN HDESK  hdesk  ) 
 

Definition at line 1467 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, tagWINDOWSTATION::dwWSF_Flags, ENDRECV, FALSE, IS_CURRENT_THREAD_RESTRICTED, LogDesktop, MSGERROR, NT_SUCCESS, NTSTATUS(), NULL, ObDereferenceObject, PtiCurrent, tagDESKTOP::rpwinstaParent, Status, ThreadLockDesktop, ThreadUnlockDesktop, TRACE, UserMode, ValidateHdesk(), WSF_NOIO, and xxxSwitchDesktop().

01469 { 01470 PDESKTOP pdesk; 01471 TL tlpdesk; 01472 PTHREADINFO ptiCurrent; 01473 NTSTATUS Status; 01474 01475 BEGINRECV(BOOL, FALSE); 01476 01477 ptiCurrent = PtiCurrent(); 01478 01479 /* 01480 * Fail this call for restricted threads 01481 */ 01482 if (IS_CURRENT_THREAD_RESTRICTED(JOB_OBJECT_UILIMIT_DESKTOP)) { 01483 RIPMSG0(RIP_WARNING, "NtUserSwitchDesktop failed for restricted thread"); 01484 MSGERROR(0); 01485 } 01486 01487 Status = ValidateHdesk(hdesk, UserMode, DESKTOP_SWITCHDESKTOP, &pdesk); 01488 if (NT_SUCCESS(Status)) { 01489 if (pdesk->rpwinstaParent->dwWSF_Flags & WSF_NOIO) { 01490 LogDesktop(pdesk, LD_DEREF_VALIDATE_HDESK2, FALSE, (ULONG_PTR)PtiCurrent()); 01491 ObDereferenceObject(pdesk); 01492 RIPERR0(ERROR_ACCESS_DENIED, RIP_VERBOSE, ""); 01493 retval = FALSE; 01494 } else { 01495 ThreadLockDesktop(ptiCurrent, pdesk, &tlpdesk, LDLT_FN_NTUSERSWITCHDESKTOP); 01496 LogDesktop(pdesk, LD_DEREF_VALIDATE_HDESK3, FALSE, (ULONG_PTR)PtiCurrent()); 01497 ObDereferenceObject(pdesk); 01498 retval = xxxSwitchDesktop(NULL, pdesk, FALSE); 01499 ThreadUnlockDesktop(ptiCurrent, &tlpdesk, LDUT_FN_NTUSERSWITCHDESKTOP); 01500 } 01501 } else 01502 retval = FALSE; 01503 01504 TRACE("NtUserSwitchDesktop"); 01505 ENDRECV(); 01506 }

W32KAPI BOOL NtUserSystemParametersInfo IN UINT  wFlag,
IN DWORD  wParam,
IN OUT LPVOID  lpData,
IN UINT  flags
 

Definition at line 2400 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, BYTE, CanForceForeground(), CHARALIGN, CLEANUPRECV, DATAALIGN, DWORD, ENDRECV, ExRaiseStatus(), FALSE, FilterKeys(), INT, INTERNALSETHIGHCONTRAST, IS_CURRENT_THREAD_RESTRICTED, IS_PTR, LPVOID, MAX_PATH, MouseKeys(), MSGERROR, MSGERRORCLEANUP, NULL, PpiCurrent, ProbeAndReadStructure, ProbeAndReadUnicodeString, ProbeForRead, ProbeForReadUnicodeStringBuffer, ProbeForWrite(), ProbeForWriteBuffer, ProbeForWriteUlong, PtiCurrent, StubExceptionHandler, ThreadLockPool, ThreadUnlockAndFreePool, ToggleKeys(), TRACE, TRUE, UPIsBOOLRange, UPIsDWORDRange, VER40, and xxxSystemParametersInfo().

Referenced by SystemParametersInfo().

02405 { 02406 UNICODE_STRING strData; 02407 ULONG ulLength, ulLength2; 02408 LPVOID lpDataSave; 02409 union { 02410 INT MouseData[3]; 02411 LOGFONTW LogFont; 02412 MOUSEKEYS MouseKeys; 02413 FILTERKEYS FilterKeys; 02414 STICKYKEYS StickyKeys; 02415 TOGGLEKEYS ToggleKeys; 02416 SOUNDSENTRY SoundSentry; 02417 ACCESSTIMEOUT AccessTimeout; 02418 RECT Rect; 02419 ANIMATIONINFO AnimationInfo; 02420 NONCLIENTMETRICS NonClientMetrics; 02421 MINIMIZEDMETRICS MinimizedMetrics; 02422 ICONMETRICS IconMetrics; 02423 HKL hkl; 02424 INTERNALSETHIGHCONTRAST ihc; 02425 HIGHCONTRAST hc; 02426 WCHAR szTemp[MAX_PATH]; 02427 } CaptureBuffer; 02428 PTHREADINFO pti; 02429 TL tlBuffer; 02430 BOOL fFreeBuffer = FALSE; 02431 BOOL fWrite = FALSE; 02432 02433 02434 02435 02436 BEGINRECV(BOOL, FALSE); 02437 02438 /* 02439 * Prevent restricted processes from setting system 02440 * parameters. 02441 * 02442 * clupu: this is ineficient and temporary. I'll change this 02443 * soon !!! 02444 */ 02445 if (IS_CURRENT_THREAD_RESTRICTED(JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS)) { 02446 02447 switch (wFlag) { 02448 case SPI_SETBEEP: 02449 case SPI_SETMOUSE: 02450 case SPI_SETBORDER: 02451 case SPI_SETKEYBOARDSPEED: 02452 case SPI_ICONHORIZONTALSPACING: 02453 case SPI_SETSCREENSAVETIMEOUT: 02454 case SPI_SETSCREENSAVEACTIVE: 02455 case SPI_SETGRIDGRANULARITY: 02456 case SPI_SETDESKWALLPAPER: 02457 case SPI_SETDESKPATTERN: 02458 case SPI_SETKEYBOARDDELAY: 02459 case SPI_ICONVERTICALSPACING: 02460 case SPI_SETICONTITLEWRAP: 02461 case SPI_SETMENUDROPALIGNMENT: 02462 case SPI_SETDOUBLECLKWIDTH: 02463 case SPI_SETDOUBLECLKHEIGHT: 02464 case SPI_SETDOUBLECLICKTIME: 02465 case SPI_SETMOUSEBUTTONSWAP: 02466 case SPI_SETICONTITLELOGFONT: 02467 case SPI_SETFASTTASKSWITCH: 02468 case SPI_SETDRAGFULLWINDOWS: 02469 case SPI_SETNONCLIENTMETRICS: 02470 case SPI_SETMINIMIZEDMETRICS: 02471 case SPI_SETICONMETRICS: 02472 case SPI_SETWORKAREA: 02473 case SPI_SETPENWINDOWS: 02474 case SPI_SETHIGHCONTRAST: 02475 case SPI_SETKEYBOARDPREF: 02476 case SPI_SETSCREENREADER: 02477 case SPI_SETANIMATION: 02478 case SPI_SETFONTSMOOTHING: 02479 case SPI_SETDRAGWIDTH: 02480 case SPI_SETDRAGHEIGHT: 02481 case SPI_SETHANDHELD: 02482 case SPI_SETLOWPOWERTIMEOUT: 02483 case SPI_SETPOWEROFFTIMEOUT: 02484 case SPI_SETLOWPOWERACTIVE: 02485 case SPI_SETPOWEROFFACTIVE: 02486 case SPI_SETCURSORS: 02487 case SPI_SETICONS: 02488 case SPI_SETDEFAULTINPUTLANG: 02489 case SPI_SETLANGTOGGLE: 02490 case SPI_SETMOUSETRAILS: 02491 case SPI_SETSCREENSAVERRUNNING: 02492 case SPI_SETFILTERKEYS: 02493 case SPI_SETTOGGLEKEYS: 02494 case SPI_SETMOUSEKEYS: 02495 case SPI_SETSHOWSOUNDS: 02496 case SPI_SETSTICKYKEYS: 02497 case SPI_SETACCESSTIMEOUT: 02498 case SPI_SETSOUNDSENTRY: 02499 case SPI_SETSNAPTODEFBUTTON: 02500 case SPI_SETMOUSEHOVERWIDTH: 02501 case SPI_SETMOUSEHOVERHEIGHT: 02502 case SPI_SETMOUSEHOVERTIME: 02503 case SPI_SETWHEELSCROLLLINES: 02504 case SPI_SETMENUSHOWDELAY: 02505 case SPI_SETSHOWIMEUI: 02506 case SPI_SETMOUSESPEED: 02507 case SPI_SETACTIVEWINDOWTRACKING: 02508 case SPI_SETMENUANIMATION: 02509 case SPI_SETCOMBOBOXANIMATION: 02510 case SPI_SETLISTBOXSMOOTHSCROLLING: 02511 case SPI_SETGRADIENTCAPTIONS: 02512 case SPI_SETKEYBOARDCUES: 02513 case SPI_SETACTIVEWNDTRKZORDER: 02514 case SPI_SETHOTTRACKING: 02515 case SPI_SETMENUFADE: 02516 case SPI_SETSELECTIONFADE: 02517 case SPI_SETTOOLTIPANIMATION: 02518 case SPI_SETTOOLTIPFADE: 02519 case SPI_SETFOREGROUNDLOCKTIMEOUT: 02520 case SPI_SETACTIVEWNDTRKTIMEOUT: 02521 case SPI_SETFOREGROUNDFLASHCOUNT: 02522 MSGERROR(0); 02523 break; 02524 } 02525 } 02526 02527 try { 02528 switch(wFlag) { 02529 02530 case SPI_SETDESKPATTERN: 02531 /* 02532 * If wParam is -1, that means read the new wallpaper from 02533 * win.ini. If wParam is not -1, lParam points to the wallpaper 02534 * string. 02535 */ 02536 if (wParam == (WPARAM)-1) 02537 break; 02538 02539 /* 02540 * SetDeskPattern may take a string in lpData; if lpData 02541 * is one of the magic values it obviously is not a string 02542 */ 02543 if (lpData == (PVOID)IntToPtr( 0xFFFFFFFF ) || lpData == (PVOID)NULL) { 02544 /* 02545 * These are not really magic values, but in order not to break apps 02546 * we have to keep them valid. wParam =-1 will make lParam be ignored 02547 * MCostea 208416 02548 */ 02549 wParam = -1; 02550 break; 02551 } 02552 goto ProbeString; 02553 02554 case SPI_SETDESKWALLPAPER: 02555 02556 /* 02557 * If the caller passed in (-1) in the wParam, then the 02558 * wallpaper-name is to be loaded later. Otherwise, 02559 * they passed in a unicode-string in the lParam. 02560 */ 02561 if (wParam == (WPARAM)-1) 02562 break; 02563 02564 if (((LPWSTR)lpData == NULL) || 02565 ((LPWSTR)lpData == SETWALLPAPER_METRICS) || 02566 ((LPWSTR)lpData == SETWALLPAPER_DEFAULT)) { 02567 break; 02568 } 02569 02570 ProbeString: 02571 02572 /* 02573 * Probe and capture the string. Capture is necessary to 02574 * the pointer to be passed directly to the registry routines 02575 * which cannot cleanly handle exceptions. 02576 */ 02577 strData = ProbeAndReadUnicodeString((PUNICODE_STRING)lpData); 02578 #if defined(_X86_) 02579 ProbeForRead(strData.Buffer, strData.Length, sizeof(BYTE)); 02580 #else 02581 ProbeForRead(strData.Buffer, strData.Length, sizeof(WCHAR)); 02582 #endif 02583 lpData = UserAllocPoolWithQuota(strData.Length + sizeof(WCHAR), TAG_TEXT2); 02584 if (lpData == NULL) { 02585 ExRaiseStatus(STATUS_NO_MEMORY); 02586 } 02587 pti = PtiCurrent(); 02588 ThreadLockPool(pti, lpData, &tlBuffer); 02589 fFreeBuffer = TRUE; 02590 RtlCopyMemory(lpData, 02591 strData.Buffer, 02592 strData.Length); 02593 ((PWSTR)lpData)[strData.Length / sizeof(WCHAR)] = 0; 02594 break; 02595 02596 case SPI_SETMOUSE: 02597 ulLength = sizeof(INT) * 3; 02598 goto ProbeRead; 02599 case SPI_SETICONTITLELOGFONT: 02600 if (!ARGUMENT_PRESENT(lpData)) 02601 break; 02602 ulLength = sizeof(LOGFONTW); 02603 goto ProbeRead; 02604 case SPI_SETMOUSEKEYS: 02605 ulLength = sizeof(MOUSEKEYS); 02606 goto ProbeRead; 02607 case SPI_SETFILTERKEYS: 02608 ulLength = sizeof(FILTERKEYS); 02609 goto ProbeRead; 02610 case SPI_SETSTICKYKEYS: 02611 ulLength = sizeof(STICKYKEYS); 02612 goto ProbeRead; 02613 case SPI_SETTOGGLEKEYS: 02614 ulLength = sizeof(TOGGLEKEYS); 02615 goto ProbeRead; 02616 case SPI_SETSOUNDSENTRY: 02617 ulLength = sizeof(SOUNDSENTRY); 02618 goto ProbeRead; 02619 case SPI_SETACCESSTIMEOUT: 02620 ulLength = sizeof(ACCESSTIMEOUT); 02621 goto ProbeRead; 02622 case SPI_SETWORKAREA: 02623 ulLength = sizeof(RECT); 02624 goto ProbeRead; 02625 case SPI_SETANIMATION: 02626 ulLength = sizeof(ANIMATIONINFO); 02627 goto ProbeRead; 02628 case SPI_SETNONCLIENTMETRICS: 02629 ulLength = sizeof(NONCLIENTMETRICS); 02630 goto ProbeRead; 02631 case SPI_SETMINIMIZEDMETRICS: 02632 ulLength = sizeof(MINIMIZEDMETRICS); 02633 goto ProbeRead; 02634 case SPI_SETICONMETRICS: 02635 ulLength = sizeof(ICONMETRICS); 02636 goto ProbeRead; 02637 case SPI_SETDEFAULTINPUTLANG: 02638 ulLength = sizeof(HKL); 02639 goto ProbeRead; 02640 case SPI_SETHIGHCONTRAST: 02641 CaptureBuffer.ihc = ProbeAndReadStructure((INTERNALSETHIGHCONTRAST *)lpData, INTERNALSETHIGHCONTRAST); 02642 lpData = &CaptureBuffer.ihc; 02643 02644 /* 02645 * Now probe High Contrast string -- note that we send a client-side buffer pointer to the routine. 02646 */ 02647 02648 ProbeForReadUnicodeStringBuffer(CaptureBuffer.ihc.usDefaultScheme); 02649 if (CaptureBuffer.ihc.usDefaultScheme.Length == 0) { 02650 CaptureBuffer.ihc.usDefaultScheme.Buffer = NULL; 02651 } 02652 break; 02653 02654 /* 02655 * Probe and capture the data. Capture is necessary to 02656 * allow the pointer to be passed to the worker routines 02657 * where exceptions cannot be cleanly handled. 02658 */ 02659 ProbeRead: 02660 #if defined(_X86_) 02661 ProbeForRead(lpData, ulLength, sizeof(BYTE)); 02662 #else 02663 ProbeForRead(lpData, ulLength, sizeof(DWORD)); 02664 #endif 02665 RtlCopyMemory(&CaptureBuffer, lpData, ulLength); 02666 lpData = &CaptureBuffer; 02667 break; 02668 02669 case SPI_ICONHORIZONTALSPACING: // returns INT 02670 case SPI_ICONVERTICALSPACING: // returns INT 02671 if (!IS_PTR(lpData)) 02672 break; 02673 02674 /* 02675 * Fall through and probe the data 02676 */ 02677 case SPI_GETBEEP: // returns BOOL 02678 case SPI_GETBORDER: // returns INT 02679 case SPI_GETKEYBOARDSPEED: // returns DWORD 02680 case SPI_GETKEYBOARDDELAY: // returns INT 02681 case SPI_GETSCREENSAVETIMEOUT: // returns INT 02682 case SPI_GETLOWPOWERTIMEOUT: // returns INT 02683 case SPI_GETPOWEROFFTIMEOUT: // returns INT 02684 case SPI_GETSCREENSAVEACTIVE: // returns BOOL 02685 case SPI_GETLOWPOWERACTIVE: // returns BOOL 02686 case SPI_GETPOWEROFFACTIVE: // returns BOOL 02687 case SPI_GETGRIDGRANULARITY: // returns INT 02688 case SPI_GETICONTITLEWRAP: // returns BOOL 02689 case SPI_GETMENUDROPALIGNMENT: // returns BOOL 02690 case SPI_GETFASTTASKSWITCH: // returns BOOL 02691 case SPI_GETDRAGFULLWINDOWS: // returns INT 02692 case SPI_GETSHOWSOUNDS: // returns BOOL 02693 case SPI_GETFONTSMOOTHING: // returns INT 02694 case SPI_GETSNAPTODEFBUTTON: // returns BOOL 02695 case SPI_GETKEYBOARDPREF: // returns BOOL 02696 case SPI_GETSCREENREADER: // returns BOOL 02697 case SPI_GETDEFAULTINPUTLANG: 02698 case SPI_GETMOUSEHOVERWIDTH: 02699 case SPI_GETMOUSEHOVERHEIGHT: 02700 case SPI_GETMOUSEHOVERTIME: 02701 case SPI_GETWHEELSCROLLLINES: 02702 case SPI_GETMENUSHOWDELAY: 02703 case SPI_GETMOUSESPEED: 02704 case SPI_GETSCREENSAVERRUNNING: 02705 case SPI_GETSHOWIMEUI: 02706 goto ProbeWriteUlong; 02707 02708 case SPI_GETICONTITLELOGFONT: // returns LOGFONT 02709 ulLength = sizeof(LOGFONT); 02710 goto ProbeWrite; 02711 case SPI_GETMOUSE: // returns 3 INTs 02712 ulLength = sizeof(INT) * 3; 02713 goto ProbeWrite; 02714 case SPI_GETFILTERKEYS: // returns FILTERKEYS 02715 ulLength = sizeof(FILTERKEYS); 02716 goto ProbeWrite; 02717 case SPI_GETSTICKYKEYS: // returns STICKYKEYS 02718 ulLength = sizeof(STICKYKEYS); 02719 goto ProbeWrite; 02720 case SPI_GETMOUSEKEYS: // returns MOUSEKEYS 02721 ulLength = sizeof(MOUSEKEYS); 02722 goto ProbeWrite; 02723 case SPI_GETTOGGLEKEYS: // returns TOGGLEKEYS 02724 ulLength = sizeof(TOGGLEKEYS); 02725 goto ProbeWrite; 02726 case SPI_GETSOUNDSENTRY: // returns SOUNDSENTRY 02727 ulLength = sizeof(SOUNDSENTRY); 02728 goto ProbeWrite; 02729 case SPI_GETACCESSTIMEOUT: // returns ACCESSTIMEOUT 02730 ulLength = sizeof(ACCESSTIMEOUT); 02731 goto ProbeWrite; 02732 case SPI_GETANIMATION: // returns ANIMATIONINFO 02733 ulLength = sizeof(ANIMATIONINFO); 02734 goto ProbeWrite; 02735 case SPI_GETNONCLIENTMETRICS: // returns NONCLIENTMETRICS 02736 ulLength = sizeof(NONCLIENTMETRICS); 02737 goto ProbeWrite; 02738 case SPI_GETMINIMIZEDMETRICS: // returns MINIMIZEDMETRICS 02739 ulLength = sizeof(MINIMIZEDMETRICS); 02740 goto ProbeWrite; 02741 case SPI_GETICONMETRICS: // returns ICONMETRICS 02742 ulLength = sizeof(ICONMETRICS); 02743 goto ProbeWrite; 02744 02745 case SPI_GETHIGHCONTRAST: // returns HIGHCONTRAST 02746 ulLength = sizeof(HIGHCONTRASTW); 02747 ProbeForWrite(lpData, ulLength, DATAALIGN); 02748 lpDataSave = lpData; 02749 CaptureBuffer.hc = *((LPHIGHCONTRAST)lpData); 02750 lpData = &CaptureBuffer.hc; 02751 02752 /* 02753 * now probe string address 02754 */ 02755 02756 ulLength2 = MAX_SCHEME_NAME_SIZE * sizeof(WCHAR); 02757 02758 ProbeForWrite(((LPHIGHCONTRAST)lpData)->lpszDefaultScheme, ulLength2, CHARALIGN); 02759 fWrite = TRUE; 02760 break; 02761 case SPI_GETWORKAREA: // returns RECT 02762 ulLength = sizeof(RECT); 02763 goto ProbeWrite; 02764 02765 02766 /* 02767 * Bug 257718 - joejo 02768 * Add SPI_GETDESKWALLPAPER to SystemParametersInfo 02769 */ 02770 case SPI_GETDESKWALLPAPER: 02771 lpDataSave = lpData; 02772 lpData = CaptureBuffer.szTemp; 02773 ProbeForWriteBuffer((PWSTR)lpDataSave, wParam, CHARALIGN); 02774 wParam = (wParam < MAX_PATH) ? wParam : MAX_PATH; 02775 ulLength = wParam * sizeof(WCHAR); 02776 fWrite = TRUE; 02777 break; 02778 02779 default: 02780 if (wFlag < SPI_MAX) { 02781 break; 02782 } else if (!UPIsBOOLRange(wFlag) 02783 && !UPIsDWORDRange(wFlag)) { 02784 02785 RIPERR1(ERROR_INVALID_PARAMETER, RIP_WARNING, "NtUserSystemParametersInfo: Invalid SPI_:%#lx", wFlag); 02786 retval = FALSE; 02787 MSGERRORCLEANUP(0); 02788 } 02789 02790 /* 02791 * Let's enforce this or this parameter is gone for good. 02792 */ 02793 if (wParam != 0) { 02794 /* 02795 * Too late, Winstone98 is alreay using it (incorrectly). 02796 * Bummer, this has never been shipped and it's hacked already 02797 * Allow a special case to go through 02798 */ 02799 if ((PtiCurrent()->dwExpWinVer > VER40) 02800 || (wFlag != SPI_SETUIEFFECTS) 02801 || (wParam != 1)) { 02802 RIPERR1(ERROR_INVALID_PARAMETER, RIP_WARNING, "NtUserSystemParametersInfo: uiParam must be zero for SPI %#lx", wFlag); 02803 retval = FALSE; 02804 MSGERRORCLEANUP(0); 02805 } 02806 } 02807 02808 UserAssert(wFlag & SPIF_RANGETYPEMASK); 02809 02810 if (wFlag & SPIF_SET) { 02811 /* 02812 * If your dword data needs to be validated (i.e, range, value), 02813 * switch here on wFlag and do it here 02814 */ 02815 switch (wFlag) { 02816 case SPI_SETFOREGROUNDLOCKTIMEOUT: 02817 if (!CanForceForeground(PpiCurrent())) { 02818 RIPERR0(ERROR_ACCESS_DENIED, RIP_VERBOSE, ""); 02819 retval = FALSE; 02820 MSGERRORCLEANUP(0); 02821 } 02822 break; 02823 } 02824 02825 } else { /* if (wFlag & SPIF_SET) */ 02826 ProbeWriteUlong: 02827 ulLength = sizeof(ULONG); 02828 lpDataSave = lpData; 02829 lpData = &CaptureBuffer; 02830 ProbeForWriteUlong((PULONG)lpDataSave); 02831 fWrite = TRUE; 02832 } 02833 break; 02834 02835 /* 02836 * Probe the data. wParam contains the length 02837 */ 02838 ProbeWrite: 02839 lpDataSave = lpData; 02840 lpData = &CaptureBuffer; 02841 ProbeForWrite(lpDataSave, ulLength, DATAALIGN); 02842 fWrite = TRUE; 02843 /* 02844 * Copy the first DWORD of the buffer. This will make sure that 02845 * the cbSize parameter of some structures gets copied. 02846 */ 02847 02848 UserAssert(ulLength >= sizeof(DWORD)); 02849 *(LPDWORD)lpData=*(LPDWORD)lpDataSave; 02850 } 02851 } except (StubExceptionHandler(TRUE)) { 02852 MSGERRORCLEANUP(0); 02853 } 02854 02855 retval = xxxSystemParametersInfo(wFlag, wParam, lpData, flags); 02856 02857 /* 02858 * Copy out any data we need to. 02859 */ 02860 if (fWrite) { 02861 try { 02862 RtlCopyMemory(lpDataSave, lpData, ulLength); 02863 } except (StubExceptionHandler(TRUE)) { 02864 MSGERRORCLEANUP(0); 02865 } 02866 } 02867 02868 CLEANUPRECV(); 02869 if (fFreeBuffer) 02870 ThreadUnlockAndFreePool(pti, &tlBuffer); 02871 02872 TRACE("NtUserSystemParametersInfo"); 02873 ENDRECV(); 02874 }

W32KAPI NTSTATUS NtUserTestForInteractiveUser IN PLUID  pluidCaller  ) 
 

Definition at line 7662 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, ENDRECV_SHARED, FALSE, MSGERROR, NTSTATUS(), ProbeAndReadStructure, StubExceptionHandler, TestForInteractiveUser(), and TRACE.

Referenced by _UserTestTokenForInteractive().

07664 { 07665 LUID luidCaller; 07666 07667 BEGINRECV_SHARED(NTSTATUS, STATUS_UNSUCCESSFUL); 07668 07669 /* 07670 * Probe arguments 07671 */ 07672 try { 07673 luidCaller = ProbeAndReadStructure(pluidCaller, LUID); 07674 } except (StubExceptionHandler(FALSE)) { 07675 MSGERROR(0); 07676 } 07677 07678 retval = TestForInteractiveUser(&luidCaller); 07679 07680 TRACE("NtUserTestForInteractiveUser"); 07681 ENDRECV_SHARED(); 07682 }

W32KAPI BOOL NtUserThunkedMenuInfo IN HMENU  hMenu,
IN LPCMENUINFO  lpmi
 

Definition at line 4730 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, MSGERROR, ProbeAndReadMenuInfo, StubExceptionHandler, ThreadLock, ThreadUnlock, TRACE, TRUE, ValidateHMENUMODIFY, and xxxSetMenuInfo().

Referenced by SetMenuInfo().

04733 { 04734 PMENU pmenu; 04735 MENUINFO mi; 04736 TL tlpmenu; 04737 04738 BEGINRECV(BOOL, FALSE); 04739 04740 /* 04741 * Probe arguments 04742 */ 04743 try { 04744 mi = ProbeAndReadMenuInfo(lpmi); 04745 } except (StubExceptionHandler(TRUE)) { 04746 MSGERROR(0); 04747 } 04748 04749 ValidateHMENUMODIFY(pmenu, hMenu); 04750 04751 ThreadLock(pmenu, &tlpmenu); 04752 retval = xxxSetMenuInfo(pmenu, &mi); 04753 ThreadUnlock(&tlpmenu); 04754 04755 TRACE("NtUserThunkedMenuInfo"); 04756 ENDRECV(); 04757 }

W32KAPI BOOL NtUserThunkedMenuItemInfo IN HMENU  hMenu,
IN UINT  nPosition,
IN BOOL  fByPosition,
IN BOOL  fInsert,
IN LPMENUITEMINFOW  lpmii,
IN PUNICODE_STRING pstrItem  OPTIONAL
 

Definition at line 4663 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, MSGERROR, NULL, ProbeAndReadMenuItem, ProbeAndReadUnicodeString, ProbeForReadUnicodeStringBuffer, RtlInitUnicodeString(), StubExceptionHandler, ThreadLock, ThreadUnlock, TRACE, ValidateHMENUMODIFY, xxxInsertMenuItem(), and xxxSetMenuItemInfo().

Referenced by CheckMenuRadioItem(), MenuLoadChicagoTemplates(), MenuLoadWinTemplates(), and ThunkedMenuItemInfo().

04670 { 04671 PMENU pmenu; 04672 MENUITEMINFO mii; 04673 UNICODE_STRING strItem; 04674 TL tlpmenu; 04675 04676 BEGINRECV(BOOL, FALSE); 04677 04678 /* 04679 * Probe arguments 04680 * No need to SetLastError because lpmii always the address of 04681 * local stack structure in USER code, not an application address. 04682 */ 04683 try { 04684 mii = ProbeAndReadMenuItem(lpmii); 04685 04686 if (ARGUMENT_PRESENT(pstrItem)) { 04687 strItem = ProbeAndReadUnicodeString(pstrItem); 04688 ProbeForReadUnicodeStringBuffer(strItem); 04689 } else { 04690 RtlInitUnicodeString(&strItem, NULL); 04691 } 04692 } except (StubExceptionHandler(FALSE)) { 04693 MSGERROR(0); 04694 } 04695 04696 ValidateHMENUMODIFY(pmenu, hMenu); 04697 04698 ThreadLock(pmenu, &tlpmenu); 04699 /* 04700 * These routines only use the buffer in a try/except (actually in 04701 * xxxSetLPITEMInfo). 04702 */ 04703 if (fInsert) { 04704 retval = xxxInsertMenuItem( 04705 pmenu, 04706 nPosition, 04707 fByPosition, 04708 &mii, 04709 &strItem); 04710 } else { 04711 retval = xxxSetMenuItemInfo( 04712 pmenu, 04713 nPosition, 04714 fByPosition, 04715 &mii, 04716 &strItem); 04717 } 04718 ThreadUnlock(&tlpmenu); 04719 04720 TRACE("NtUserThunkedMenuItemInfo"); 04721 ENDRECV(); 04722 }

W32KAPI int NtUserToUnicodeEx IN UINT  wVirtKey,
IN UINT  wScanCode,
IN CONST BYTE lpKeyState,
OUT LPWSTR  lpszBuff,
IN int  cchBuff,
IN UINT  wFlags,
IN HKL  hKeyboardLayout
 

Definition at line 6953 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, BYTE, CHARALIGN, CLEANUPRECV, ENDRECV, ExRaiseStatus(), FALSE, MSGERROR, MSGERRORCLEANUP, NULL, ProbeForRead, ProbeForWriteBuffer, PtiCurrent, StubExceptionHandler, ThreadLockPool, ThreadUnlockAndFreePool, TRACE, TRUE, and xxxToUnicodeEx().

Referenced by ToUnicode(), and ToUnicodeEx().

06961 { 06962 BYTE KeyState[256]; 06963 WCHAR wcBuff[4]; 06964 LPWSTR pwszBuffK; 06965 BOOL bAlloc = FALSE; 06966 PTHREADINFO ptiCurrent; 06967 TL tlInput; 06968 06969 BEGINRECV(int, 0); 06970 06971 if (cchBuff <= 0) { 06972 MSGERROR(ERROR_INVALID_PARAMETER); 06973 } 06974 06975 /* 06976 * Probe arguments 06977 */ 06978 try { 06979 ProbeForRead(lpKeyState, 256, sizeof(BYTE)); 06980 RtlCopyMemory(&KeyState, lpKeyState, 256); 06981 ProbeForWriteBuffer(pwszBuff, cchBuff, CHARALIGN); 06982 if (cchBuff < 4) { 06983 pwszBuffK = wcBuff; 06984 }else { 06985 pwszBuffK = UserAllocPoolWithQuota(cchBuff * sizeof(WCHAR), TAG_UNICODEBUFFER); 06986 if (pwszBuffK == NULL) { 06987 ExRaiseStatus(STATUS_NO_MEMORY); 06988 } 06989 bAlloc = TRUE; 06990 ptiCurrent = PtiCurrent(); 06991 ThreadLockPool(ptiCurrent, pwszBuffK, &tlInput); 06992 } 06993 } except (StubExceptionHandler(TRUE)) { 06994 MSGERROR(0); 06995 } 06996 06997 retval = xxxToUnicodeEx( 06998 wVirtKey, 06999 wScanCode, 07000 KeyState, 07001 pwszBuffK, 07002 cchBuff, 07003 wFlags, 07004 hKeyboardLayout); 07005 07006 try { 07007 RtlCopyMemory(pwszBuff, pwszBuffK, cchBuff*sizeof(WCHAR)); 07008 } except (StubExceptionHandler(TRUE)) { 07009 MSGERRORCLEANUP(0); 07010 } 07011 07012 CLEANUPRECV(); 07013 07014 if (bAlloc) { 07015 ThreadUnlockAndFreePool(ptiCurrent, &tlInput); 07016 } 07017 07018 TRACE("NtUserToUnicodeEx"); 07019 ENDRECV(); 07020 }

W32KAPI BOOL NtUserTrackMouseEvent IN OUT LPTRACKMOUSEEVENT  lpTME  ) 
 

Definition at line 6300 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, MSGERROR, ProbeAndReadTrackMouseEvent, QueryTrackMouseEvent(), StubExceptionHandler, TESTFLAGS, TRACE, TrackMouseEvent(), and TRUE.

06302 { 06303 TRACKMOUSEEVENT tme; 06304 06305 BEGINRECV(BOOL, FALSE); 06306 06307 /* 06308 * Probe arguments 06309 */ 06310 try { 06311 tme = ProbeAndReadTrackMouseEvent(lpTME); 06312 06313 if (tme.cbSize != sizeof(tme)) { 06314 RIPERR1(ERROR_INVALID_PARAMETER, RIP_WARNING, "TrackMouseEvent: invalid size %lX", tme.cbSize); 06315 MSGERROR(0); 06316 } 06317 06318 TESTFLAGS(tme.dwFlags, TME_VALID); 06319 06320 } except (StubExceptionHandler(TRUE)) { 06321 MSGERROR(0); 06322 } 06323 06324 if (tme.dwFlags & TME_QUERY) { 06325 retval = QueryTrackMouseEvent(&tme); 06326 try { 06327 RtlCopyMemory(lpTME, &tme, sizeof(tme)); 06328 } except (StubExceptionHandler(TRUE)) { 06329 MSGERROR(0); 06330 } 06331 } else { 06332 retval = TrackMouseEvent(&tme); 06333 } 06334 06335 TRACE("NtUserTrackMouseEvent"); 06336 ENDRECV(); 06337 }

W32KAPI BOOL NtUserTrackPopupMenuEx IN HMENU  hMenu,
IN UINT  uFlags,
IN int  x,
IN int  y,
IN HWND  hwnd,
IN CONST TPMPARAMS *pparamst  OPTIONAL
 

Definition at line 6339 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, CLEANUPRECV, ENDRECV, FALSE, MSGERRORCLEANUP, ProbeAndReadPopupParams, PtiCurrent, StubExceptionHandler, TESTFLAGS, ThreadLockAlwaysWithPti, ThreadUnlock, TRACE, TRUE, ValidateHMENU, ValidateHWND, and xxxTrackPopupMenuEx().

Referenced by ECMenu(), and TrackPopupMenu().

06346 { 06347 PWND pwnd; 06348 PMENU pmenu; 06349 TL tlpwnd; 06350 TL tlpmenu; 06351 PTHREADINFO ptiCurrent; 06352 TPMPARAMS paramst; 06353 06354 BEGINRECV(BOOL, FALSE); 06355 06356 TESTFLAGS(uFlags, TPM_VALID); 06357 06358 ValidateHMENU(pmenu, hMenu); 06359 ValidateHWND(pwnd, hwnd); 06360 06361 ptiCurrent = PtiCurrent(); 06362 ThreadLockAlwaysWithPti(ptiCurrent, pwnd, &tlpwnd); 06363 ThreadLockAlwaysWithPti(ptiCurrent, pmenu, &tlpmenu); 06364 06365 /* 06366 * Probe arguments 06367 */ 06368 try { 06369 if (ARGUMENT_PRESENT(pparamst)) { 06370 paramst = ProbeAndReadPopupParams(pparamst); 06371 pparamst = &paramst; 06372 } 06373 06374 } except (StubExceptionHandler(TRUE)) { 06375 MSGERRORCLEANUP(0); 06376 } 06377 retval = xxxTrackPopupMenuEx( 06378 pmenu, 06379 uFlags, 06380 x, 06381 y, 06382 pwnd, 06383 pparamst); 06384 06385 CLEANUPRECV(); 06386 06387 ThreadUnlock(&tlpmenu); 06388 ThreadUnlock(&tlpwnd); 06389 06390 TRACE("NtUserTrackPopupMenuEx"); 06391 ENDRECV(); 06392 }

W32KAPI int NtUserTranslateAccelerator IN HWND  hwnd,
IN HACCEL  hAccTable,
IN LPMSG  lpMsg
 

Definition at line 1991 of file kernel/ntstubs.c.

References BEGINRECV, ENDRECV, FALSE, msg, MSGERROR, ProbeAndReadMessage, PtiCurrent, StubExceptionHandler, ThreadLockAlwaysWithPti, ThreadUnlock, TRACE, ValidateHACCEL, ValidateHWNDNoRIP, and xxxTranslateAccelerator().

Referenced by TranslateAcceleratorA(), and TranslateAcceleratorW().

01995 { 01996 PWND pwnd; 01997 LPACCELTABLE pat; 01998 TL tlpwnd; 01999 TL tlpat; 02000 PTHREADINFO ptiCurrent; 02001 MSG msg; 02002 02003 BEGINRECV(int, 0); 02004 02005 /* 02006 * Probe arguments 02007 */ 02008 try { 02009 msg = ProbeAndReadMessage(lpmsg); 02010 } except (StubExceptionHandler(FALSE)) { 02011 MSGERROR(0); 02012 } 02013 02014 /* 02015 * This is called within a message loop. If the window gets destroyed, 02016 * there still may be other messages in the queue that get returned 02017 * after the window is destroyed. The app will call TranslateAccelerator() 02018 * on every one of these, causing RIPs.... Make it nice so it just 02019 * returns FALSE. 02020 */ 02021 ValidateHWNDNoRIP(pwnd, hwnd); 02022 ValidateHACCEL(pat, haccel); 02023 02024 ptiCurrent = PtiCurrent(); 02025 ThreadLockAlwaysWithPti(ptiCurrent, pwnd, &tlpwnd); 02026 ThreadLockAlwaysWithPti(ptiCurrent, pat, &tlpat); 02027 02028 retval = xxxTranslateAccelerator( 02029 pwnd, 02030 pat, 02031 &msg); 02032 02033 ThreadUnlock(&tlpat); 02034 ThreadUnlock(&tlpwnd); 02035 02036 TRACE("NtUserTranslateAccelerator"); 02037 ENDRECV(); 02038 }

W32KAPI BOOL NtUserTranslateMessage IN CONST MSG *  lpMsg,
IN UINT  flags
 

Definition at line 6394 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, msg, MSGERROR, NULL, ProbeAndReadMessage, StubExceptionHandler, TRACE, TRUE, ValidateHwnd, and xxxTranslateMessage().

Referenced by TranslateMessageEx().

06397 { 06398 MSG msg; 06399 06400 BEGINRECV(BOOL, FALSE); 06401 06402 /* 06403 * Probe arguments 06404 */ 06405 try { 06406 msg = ProbeAndReadMessage(lpMsg); 06407 } except (StubExceptionHandler(TRUE)) { 06408 MSGERROR(0); 06409 } 06410 06411 if (ValidateHwnd(msg.hwnd) == NULL) { 06412 MSGERROR(0); 06413 } 06414 06415 retval = xxxTranslateMessage( 06416 &msg, 06417 flags); 06418 06419 TRACE("NtUserTranslateMessage"); 06420 ENDRECV(); 06421 }

W32KAPI BOOL NtUserUnhookWindowsHookEx IN HHOOK  hhk  ) 
 

Definition at line 6423 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, TRACE, ValidateHHOOK, and zzzUnhookWindowsHookEx().

06425 { 06426 PHOOK phk; 06427 06428 BEGINRECV(BOOL, FALSE); 06429 06430 ValidateHHOOK(phk, hhk); 06431 06432 retval = zzzUnhookWindowsHookEx( 06433 phk); 06434 06435 TRACE("NtUserUnhookWindowsHookEx"); 06436 ENDRECV(); 06437 }

W32KAPI BOOL NtUserUnhookWinEvent IN HWINEVENTHOOK  hWinEventHook  ) 
 

Definition at line 3446 of file kernel/ntstubs.c.

References _UnhookWinEvent(), BEGINATOMICRECV, BOOL, ENDATOMICRECV, FALSE, TRACE, and ValidateHWINEVENTHOOK.

03448 { 03449 PEVENTHOOK peh; 03450 03451 BEGINATOMICRECV(BOOL, FALSE); 03452 03453 ValidateHWINEVENTHOOK(peh, hWinEventUnhook); 03454 03455 retval = _UnhookWinEvent(peh); 03456 03457 TRACE("NtUserUnhookWinEvent"); 03458 ENDATOMICRECV(); 03459 }

W32KAPI BOOL NtUserUnloadKeyboardLayout IN HKL  hkl  ) 
 

Definition at line 8494 of file kernel/ntstubs.c.

References _GetProcessWindowStation(), BEGINRECV, BOOL, ENDRECV, FALSE, NULL, TRACE, and xxxUnloadKeyboardLayout().

Referenced by UnloadKeyboardLayout().

08496 { 08497 BEGINRECV(BOOL, FALSE); 08498 08499 retval = xxxUnloadKeyboardLayout( 08500 _GetProcessWindowStation(NULL), 08501 hkl); 08502 08503 TRACE("NtUserUnloadKeyboardLayout"); 08504 ENDRECV(); 08505 }

W32KAPI BOOL NtUserUnlockWindowStation IN HWINSTA  hWindowStation  ) 
 

Definition at line 7090 of file kernel/ntstubs.c.

References _UnlockWindowStation(), BEGINRECV, BOOL, ENDRECV, FALSE, MSGERROR, NT_SUCCESS, NTSTATUS(), ObDereferenceObject, Status, TRACE, UserMode, and ValidateHwinsta().

07092 { 07093 PWINDOWSTATION pwinsta; 07094 NTSTATUS Status; 07095 07096 BEGINRECV(BOOL, FALSE); 07097 07098 Status = ValidateHwinsta(hwinsta, UserMode, 0, &pwinsta); 07099 if (!NT_SUCCESS(Status)) 07100 MSGERROR(0); 07101 07102 retval = _UnlockWindowStation(pwinsta); 07103 07104 ObDereferenceObject(pwinsta); 07105 07106 TRACE("NtUserUnlockWindowStation"); 07107 ENDRECV(); 07108 }

W32KAPI BOOL NtUserUnregisterClass IN PUNICODE_STRING  pstrClassName,
IN HINSTANCE  hInstance,
OUT PCLSMENUNAME  pcmn
 

Definition at line 9243 of file kernel/ntstubs.c.

References _UnregisterClass(), BEGINRECV, BOOL, ENDRECV, FALSE, MSGERROR, ProbeAndReadUnicodeString, ProbeAndWriteStructure, ProbeForReadUnicodeStringBufferOrId, StubExceptionHandler, TRACE, and TRUE.

Referenced by UnregisterClass().

09247 { 09248 UNICODE_STRING strClassName; 09249 CLSMENUNAME cmn; 09250 09251 BEGINRECV(BOOL, FALSE); 09252 09253 /* 09254 * Probe arguments 09255 */ 09256 try { 09257 strClassName = ProbeAndReadUnicodeString(pstrClassName); 09258 ProbeForReadUnicodeStringBufferOrId(strClassName); 09259 } except (StubExceptionHandler(TRUE)) { 09260 MSGERROR(0); 09261 } 09262 09263 /* 09264 * The buffer is in client-side memory. 09265 */ 09266 09267 retval = _UnregisterClass( 09268 strClassName.Buffer, 09269 hInstance, 09270 &cmn); 09271 09272 try { 09273 ProbeAndWriteStructure(pcmn, cmn, CLSMENUNAME); 09274 } except (StubExceptionHandler(FALSE)) { 09275 // no SetLastError, since pcmn is a USER address, not the application's 09276 } 09277 09278 TRACE("NtUserUnregisterClass"); 09279 ENDRECV(); 09280 }

W32KAPI BOOL NtUserUnregisterHotKey IN HWND  hwnd,
IN int  id
 

Definition at line 6439 of file kernel/ntstubs.c.

References _UnregisterHotKey(), BEGINATOMICRECV, BOOL, ENDATOMICRECV, FALSE, TRACE, and ValidateHWNDOPT.

06442 { 06443 PWND pwnd; 06444 06445 BEGINATOMICRECV(BOOL, FALSE); 06446 06447 ValidateHWNDOPT(pwnd, hwnd); 06448 06449 retval = _UnregisterHotKey( 06450 pwnd, 06451 id); 06452 06453 TRACE("NtUserUnregisterHotKey"); 06454 ENDATOMICRECV(); 06455 }

W32KAPI DWORD NtUserUpdateInstance IN HANDLE  hInst,
OUT LPDWORD  pMonFlags,
IN DWORD  afCmd
 

Definition at line 2929 of file kernel/ntstubs.c.

References _CsUpdateInstance(), BEGINRECV, DWORD, ENDRECV, FALSE, hInst, MSGERROR, ProbeForWriteUlong, StubExceptionHandler, TRACE, and TRUE.

Referenced by DdeNameService(), and InternalDdeInitialize().

02933 { 02934 DWORD MonFlags; 02935 BEGINRECV(DWORD, DMLERR_INVALIDPARAMETER); 02936 02937 /* 02938 * Probe arguments 02939 */ 02940 try { 02941 ProbeForWriteUlong(pMonFlags); 02942 } except (StubExceptionHandler(FALSE)) { 02943 MSGERROR(0); 02944 } 02945 retval = _CsUpdateInstance(hInst, &MonFlags, afCmd); 02946 try { 02947 *pMonFlags = MonFlags; 02948 } except (StubExceptionHandler(TRUE)) { 02949 MSGERROR(0); 02950 } 02951 02952 TRACE("NtUserUpdateInstance"); 02953 ENDRECV(); 02954 }

W32KAPI BOOL NtUserUpdateLayeredWindow IN HWND  hwnd,
IN HDC  hdcDst,
IN POINT *  pptDst,
IN SIZE *  psize,
IN HDC  hdcSrc,
IN POINT *  pptSrc,
IN COLORREF  crKey,
IN BLENDFUNCTION *  pblend,
IN DWORD  dwFlags
 

Definition at line 13366 of file kernel/ntstubs.c.

References _UpdateLayeredWindow(), BEGINATOMICRECV, BOOL, dwFlags, ENDATOMICRECV, FALSE, MSGERROR, ProbeAndReadBlendfunction, ProbeAndReadPoint, ProbeAndReadSize, StubExceptionHandler, TRACE, TRUE, and ValidateHWND.

Referenced by AnimateBlend().

13376 { 13377 PWND pwnd; 13378 POINT ptSrc; 13379 SIZE size; 13380 POINT ptDst; 13381 BLENDFUNCTION blend; 13382 13383 BEGINATOMICRECV(BOOL, FALSE); 13384 13385 ValidateHWND(pwnd, hwnd); 13386 13387 /* 13388 * Probe and validate arguments. 13389 */ 13390 try { 13391 if (ARGUMENT_PRESENT(pptSrc)) { 13392 ptSrc = ProbeAndReadPoint(pptSrc); 13393 pptSrc = &ptSrc; 13394 } 13395 if (ARGUMENT_PRESENT(psize)) { 13396 size = ProbeAndReadSize(psize); 13397 psize = &size; 13398 if (psize->cx < 0 || psize->cy < 0) { 13399 MSGERROR(ERROR_INVALID_PARAMETER); // this is a jump out of try! 13400 } 13401 } 13402 if (ARGUMENT_PRESENT(pptDst)) { 13403 ptDst = ProbeAndReadPoint(pptDst); 13404 pptDst = &ptDst; 13405 } 13406 13407 if (ARGUMENT_PRESENT(pblend)) { 13408 blend = ProbeAndReadBlendfunction(pblend); 13409 pblend = &blend; 13410 } 13411 } except (StubExceptionHandler(TRUE)) { 13412 MSGERROR(0); 13413 } 13414 13415 if (dwFlags & ~ULW_VALID) { 13416 RIPMSG0(RIP_WARNING, "UpdateLayeredWindow: Invalid Parameter"); 13417 MSGERROR(ERROR_INVALID_PARAMETER); 13418 } else { 13419 retval = _UpdateLayeredWindow( 13420 pwnd, 13421 hdcDst, 13422 pptDst, 13423 psize, 13424 hdcSrc, 13425 pptSrc, 13426 crKey, 13427 pblend, 13428 dwFlags); 13429 } 13430 13431 TRACE("NtUserUpdateLayeredWindow"); 13432 ENDATOMICRECV(); 13433 }

W32KAPI BOOL NtUserUpdatePerUserSystemParameters IN HANDLE  hToken,
IN BOOL  bUserLoggedOn
 

Definition at line 2876 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, TRACE, and xxxUpdatePerUserSystemParameters().

Referenced by UpdatePerUserSystemParameters().

02879 { 02880 BEGINRECV(BOOL, FALSE); 02881 02882 retval = xxxUpdatePerUserSystemParameters(hToken, bUserLoggedOn); 02883 02884 TRACE("NtUserUpdatePerUserSystemParameters"); 02885 ENDRECV(); 02886 }

W32KAPI BOOL NtUserUserHandleGrantAccess IN HANDLE  hUserHandle,
IN HANDLE  hJob,
IN BOOL  bGrant
 

Definition at line 7905 of file kernel/ntstubs.c.

References tagSHAREDINFO::aheList, _HANDLEENTRY::bFlags, BOOL, CLEANUPRECV, DWORD, EnterCrit, ExAcquireResourceExclusive, ExReleaseResource, FALSE, GH_SIZE, gpJobsList, gSharedInfo, HANDLEF_GRANTED, HMIndexFromHandle, HMValidateHandle(), tagW32JOB::Job, KeEnterCriticalRegion, KeLeaveCriticalRegion, LeaveCrit, MSGERRORCLEANUP, NT_SUCCESS, NTSTATUS(), NULL, ObDereferenceObject, ObReferenceObjectByHandle(), tagW32JOB::pgh, tagW32JOB::pNext, PsJobType, Status, StubExceptionHandler, TRACE, TRUE, TYPE_GENERIC, tagW32JOB::ughCrt, tagW32JOB::ughMax, and UserMode.

07909 { 07910 NTSTATUS Status; 07911 PEJOB Job; 07912 PW32JOB pW32Job; 07913 DWORD dw; 07914 PHE phe; 07915 PULONG_PTR pgh; 07916 BOOL retval; 07917 BOOL errret = FALSE; 07918 07919 Status = ObReferenceObjectByHandle( 07920 hJob, 07921 JOB_OBJECT_SET_ATTRIBUTES, 07922 *PsJobType, 07923 UserMode, 07924 (PVOID*)&Job, 07925 NULL); 07926 07927 if (!NT_SUCCESS(Status)) { 07928 RIPERR1(ERROR_INVALID_PARAMETER, 07929 RIP_WARNING, 07930 "UserHandleGrantAccess: invalid job handle %#p\n", 07931 hJob); 07932 return FALSE; 07933 } 07934 07935 /* 07936 * aquire the job's lock and after that enter the user 07937 * critical section. 07938 */ 07939 KeEnterCriticalRegion(); 07940 ExAcquireResourceExclusive(&Job->JobLock, TRUE); 07941 07942 EnterCrit(); 07943 07944 /* 07945 * bail out if it doesn't have UI restrictions 07946 */ 07947 if (Job->UIRestrictionsClass == 0) { 07948 RIPERR1(ERROR_INVALID_PARAMETER, 07949 RIP_WARNING, 07950 "UserHandleGrantAccess: job %#p doesn't have UI restrictions\n", 07951 hJob); 07952 MSGERRORCLEANUP(0); 07953 } 07954 07955 /* 07956 * see if we have a W32JOB structure created for this job 07957 */ 07958 pW32Job = gpJobsList; 07959 07960 while (pW32Job) { 07961 if (pW32Job->Job == Job) { 07962 break; 07963 } 07964 pW32Job = pW32Job->pNext; 07965 } 07966 07967 UserAssert(pW32Job != NULL); 07968 07969 try { 07970 /* 07971 * Now, validate the 'unsecure' handle 07972 */ 07973 if (HMValidateHandle(hUserHandle, TYPE_GENERIC) == NULL) { 07974 RIPERR1(ERROR_INVALID_PARAMETER, 07975 RIP_WARNING, 07976 "UserHandleGrantAccess: invalid handle %#p\n", 07977 hUserHandle); 07978 07979 MSGERRORCLEANUP(0); 07980 } 07981 07982 dw = HMIndexFromHandle(hUserHandle); 07983 07984 phe = &gSharedInfo.aheList[dw]; 07985 07986 phe->bFlags |= HANDLEF_GRANTED; 07987 07988 pgh = pW32Job->pgh; 07989 07990 if (bGrant) { 07991 /* 07992 * Add the handle to the process' list 07993 */ 07994 if (pW32Job->ughCrt == pW32Job->ughMax) { 07995 07996 if (pW32Job->ughCrt == 0) { 07997 pgh = UserAllocPool(GH_SIZE * sizeof(*pgh), TAG_GRANTEDHANDLES); 07998 } else { 07999 /* 08000 * we need to grow the array 08001 */ 08002 DWORD uBytes = (pW32Job->ughMax) * sizeof(*pgh); 08003 08004 pgh = UserReAllocPool(pgh, 08005 uBytes, 08006 uBytes + GH_SIZE * sizeof(*pgh), 08007 TAG_GRANTEDHANDLES); 08008 } 08009 08010 if (pgh == NULL) { 08011 RIPMSG0(RIP_WARNING, "UserHandleGrantAccess: out of memory\n"); 08012 MSGERRORCLEANUP(ERROR_NOT_ENOUGH_MEMORY); 08013 } 08014 08015 pW32Job->pgh = pgh; 08016 pW32Job->ughMax += GH_SIZE; 08017 } 08018 08019 UserAssert(pW32Job->ughCrt < pW32Job->ughMax); 08020 08021 /* 08022 * see if the handle is not already granted to this process 08023 */ 08024 for (dw = 0; dw < pW32Job->ughCrt; dw++) { 08025 if (*(pgh + dw) == (ULONG_PTR)hUserHandle) { 08026 break; 08027 } 08028 } 08029 08030 if (dw >= pW32Job->ughCrt) { 08031 08032 /* 08033 * add the handle to the granted handles table 08034 */ 08035 *(pgh + pW32Job->ughCrt) = (ULONG_PTR)hUserHandle; 08036 08037 (pW32Job->ughCrt)++; 08038 } 08039 } else { 08040 /* 08041 * Remove the handle from the granted list 08042 */ 08043 /* 08044 * search for the handle in the array. 08045 */ 08046 for (dw = 0; dw < pW32Job->ughCrt; dw++) { 08047 if (*(pgh + dw) == (ULONG_PTR)hUserHandle) { 08048 08049 /* 08050 * found the handle granted to this process 08051 */ 08052 RtlMoveMemory(pgh + dw, 08053 pgh + dw + 1, 08054 (pW32Job->ughCrt - dw - 1) * sizeof(*pgh)); 08055 08056 (pW32Job->ughCrt)--; 08057 break; 08058 } 08059 } 08060 #if DBG 08061 if (dw >= pW32Job->ughCrt) { 08062 RIPERR1(ERROR_INVALID_HANDLE, RIP_WARNING, 08063 "UserHandleGrantAccess(FALSE): handle not found %#p", 08064 hUserHandle); 08065 } 08066 #endif // DBG 08067 } 08068 08069 retval = TRUE; 08070 08071 } except (StubExceptionHandler(TRUE)) { 08072 MSGERRORCLEANUP(0); 08073 } 08074 08075 CLEANUPRECV(); 08076 08077 LeaveCrit(); 08078 ExReleaseResource(&Job->JobLock); 08079 KeLeaveCriticalRegion(); 08080 ObDereferenceObject(Job); 08081 08082 TRACE("NtUserUserHandleGrantAccess"); 08083 08084 return retval; 08085 }

W32KAPI BOOL NtUserValidateHandleSecure IN HANDLE  h  ) 
 

Definition at line 7894 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, TRACE, and ValidateHandleSecure().

07896 { 07897 BEGINRECV(BOOL, FALSE); 07898 07899 retval = ValidateHandleSecure(h); 07900 07901 TRACE("NtUserValidateHandleSecure"); 07902 ENDRECV(); 07903 }

W32KAPI BOOL NtUserValidateRect IN HWND  hwnd,
IN CONST RECT *lpRect  OPTIONAL
 

Definition at line 6457 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, MSGERROR, ProbeAndReadRect, StubExceptionHandler, ThreadLock, ThreadUnlock, TRACE, TRUE, ValidateHWNDOPT, and xxxValidateRect().

06460 { 06461 PWND pwnd; 06462 TL tlpwnd; 06463 RECT rc; 06464 06465 BEGINRECV(BOOL, FALSE); 06466 06467 /* 06468 * Probe arguments 06469 */ 06470 if (ARGUMENT_PRESENT(lpRect)) { 06471 try { 06472 rc = ProbeAndReadRect(lpRect); 06473 lpRect = &rc; 06474 } except (StubExceptionHandler(TRUE)) { 06475 MSGERROR(0); 06476 } 06477 } 06478 06479 ValidateHWNDOPT(pwnd, hwnd); 06480 06481 ThreadLock(pwnd, &tlpwnd); 06482 06483 retval = xxxValidateRect(pwnd, (PRECT)lpRect); 06484 06485 ThreadUnlock(&tlpwnd); 06486 06487 TRACE("NtUserValidateRect"); 06488 ENDRECV(); 06489 }

W32KAPI SHORT NtUserVkKeyScanEx IN WCHAR  ch,
IN ULONG_PTR  dwHKLorPKL,
IN BOOL  bHKL
 

Definition at line 9282 of file kernel/ntstubs.c.

References BEGINRECV_SHARED, ENDRECV_SHARED, HKLtoPKL(), InternalVkKeyScanEx(), NULL, tagKBDFILE::pKbdTbl, PtiCurrentShared, SHORT, tagKL::spkf, and TRACE.

Referenced by VkKeyScan(), and VkKeyScanEx().

09286 { 09287 PKL pkl; 09288 09289 BEGINRECV_SHARED(SHORT, -1); 09290 09291 /* 09292 * See if we need to convert an HKL to a PKL. VkKeyScan passes a PKL and 09293 * VkKeyScanEx passes an HKL. The conversion must be done on the server side. 09294 */ 09295 if (bHKL) { 09296 pkl = HKLtoPKL(PtiCurrentShared(), (HKL)dwHKLorPKL); 09297 } else { 09298 pkl = PtiCurrentShared()->spklActive; 09299 } 09300 09301 if (pkl == NULL) { 09302 retval = (SHORT)-1; 09303 } else { 09304 retval = InternalVkKeyScanEx(cChar, pkl->spkf->pKbdTbl); 09305 } 09306 09307 TRACE("NtUserVkKeyScanEx"); 09308 ENDRECV_SHARED(); 09309 }

W32KAPI DWORD NtUserWaitForInputIdle IN ULONG_PTR  idProcess,
IN DWORD  dwMilliseconds,
IN BOOL  fSharedWow
 

Definition at line 6491 of file kernel/ntstubs.c.

References BEGINRECV, DWORD, ENDRECV, TRACE, and xxxWaitForInputIdle().

Referenced by WaitForInputIdle().

06495 { 06496 BEGINRECV(DWORD, (DWORD)-1); 06497 06498 retval = xxxWaitForInputIdle( 06499 idProcess, 06500 dwMilliseconds, 06501 fSharedWow); 06502 06503 TRACE("NtUserWaitForInputIdle"); 06504 ENDRECV(); 06505 }

W32KAPI BOOL NtUserWaitForMsgAndEvent IN HANDLE  hevent  ) 
 

Definition at line 1541 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, TRACE, and xxxSleepTask().

Referenced by MsgWaitForMultipleObjectsEx(), and UserRegisterWowHandlers().

01543 { 01544 BEGINRECV(BOOL, FALSE); 01545 01546 retval = xxxSleepTask(FALSE, hevent); 01547 01548 TRACE("NtUserWaitForMsgAndEvent"); 01549 ENDRECV(); 01550 }

W32KAPI BOOL NtUserWaitMessage VOID   ) 
 

Definition at line 7059 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, ENDRECV, FALSE, TRACE, and xxxWaitMessage().

Referenced by CtxUserWaitMessage(), and DialogBox2().

07061 { 07062 BEGINRECV(BOOL, FALSE); 07063 07064 retval = xxxWaitMessage(); 07065 07066 TRACE("NtUserWaitMessage"); 07067 ENDRECV(); 07068 }

W32KAPI BOOL NtUserWin32PoolAllocationStats IN LPDWORD  parrTags,
IN SIZE_T  tagsCount,
OUT SIZE_T *  lpdwMaxMem,
OUT SIZE_T *  lpdwCrtMem,
OUT LPDWORD  lpdwMaxAlloc,
OUT LPDWORD  lpdwCrtAlloc
 

Definition at line 724 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, DWORD, ENDRECV, FALSE, MSGERROR, NULL, ProbeForWrite(), StubExceptionHandler, and TRACE.

00731 { 00732 #ifdef POOL_INSTR_API 00733 SIZE_T dwMaxMem, dwCrtMem; 00734 DWORD dwMaxAlloc, dwCrtAlloc; 00735 00736 BEGINRECV(BOOL, FALSE); 00737 00738 retval = _Win32PoolAllocationStats(parrTags, 00739 tagsCount, 00740 &dwMaxMem, 00741 &dwCrtMem, 00742 &dwMaxAlloc, 00743 &dwCrtAlloc); 00744 /* 00745 * Probe and copy 00746 */ 00747 try { 00748 if (lpdwMaxMem != NULL) { 00749 ProbeForWrite(lpdwMaxMem, sizeof(SIZE_T), sizeof(DWORD)); 00750 *lpdwMaxMem = dwMaxMem; 00751 } 00752 if (lpdwCrtMem != NULL) { 00753 ProbeForWrite(lpdwCrtMem, sizeof(SIZE_T), sizeof(DWORD)); 00754 *lpdwCrtMem = dwCrtMem; 00755 } 00756 if (lpdwMaxAlloc != NULL) { 00757 ProbeForWrite(lpdwMaxAlloc, sizeof(DWORD), sizeof(DWORD)); 00758 *lpdwMaxAlloc = dwMaxAlloc; 00759 } 00760 if (lpdwCrtAlloc != NULL) { 00761 ProbeForWrite(lpdwCrtAlloc, sizeof(DWORD), sizeof(DWORD)); 00762 *lpdwCrtAlloc = dwCrtAlloc; 00763 } 00764 00765 } except (StubExceptionHandler(FALSE)) { 00766 MSGERROR(0); 00767 } 00768 00769 TRACE("NtUserWin32PoolAllocationStats"); 00770 ENDRECV(); 00771 #else 00772 UNREFERENCED_PARAMETER(parrTags); 00773 UNREFERENCED_PARAMETER(tagsCount); 00774 UNREFERENCED_PARAMETER(lpdwMaxMem); 00775 UNREFERENCED_PARAMETER(lpdwCrtMem); 00776 UNREFERENCED_PARAMETER(lpdwMaxAlloc); 00777 UNREFERENCED_PARAMETER(lpdwCrtAlloc); 00778 return FALSE; 00779 #endif // POOL_INSTR_API 00780 }

W32KAPI HWND NtUserWindowFromPoint IN POINT  Point  ) 
 

Definition at line 6507 of file kernel/ntstubs.c.

References BEGINRECV, ENDRECV, NULL, Point, PtoH, TRACE, and xxxWindowFromPoint().

06509 { 06510 BEGINRECV(HWND, NULL); 06511 06512 retval = (HWND)xxxWindowFromPoint( 06513 Point); 06514 retval = PtoH((PVOID)retval); 06515 06516 TRACE("NtUserWindowFromPoint"); 06517 ENDRECV(); 06518 }

BOOL NtUserWOWCleanup IN HANDLE  hInstance,
IN DWORD  hTaskWow
 

BOOL NtUserWOWModuleUnload IN HANDLE  hModule  ) 
 

W32KAPI BOOL NtUserYieldTask VOID   ) 
 

Definition at line 7022 of file kernel/ntstubs.c.

References BEGINRECV, BOOL, CSPINBACKGROUND, _CLIENTINFO::cSpins, _CLIENTINFO::dwTIFlags, ENDRECV, FALSE, gppiWantForegroundPriority, tagTHREADINFO::pClientInfo, tagTHREADINFO::ppi, PtiCurrent, SetForegroundPriority(), tagTHREADINFO::TIF_flags, TIF_SPINNING, TRACE, and xxxUserYield().

Referenced by CtxUserYieldTask(), and UserRegisterWowHandlers().

07024 { 07025 PTHREADINFO ptiCurrent; 07026 07027 BEGINRECV(BOOL, FALSE); 07028 07029 /* 07030 * Make sure this process is running in the background if it is just 07031 * spinning. 07032 */ 07033 ptiCurrent = PtiCurrent(); 07034 07035 ptiCurrent->pClientInfo->cSpins++; 07036 07037 /* 07038 * CheckProcessBackground see input.c for comments 07039 */ 07040 if (ptiCurrent->pClientInfo->cSpins >= CSPINBACKGROUND) { 07041 ptiCurrent->pClientInfo->cSpins = 0; 07042 ptiCurrent->TIF_flags |= TIF_SPINNING; 07043 ptiCurrent->pClientInfo->dwTIFlags |= TIF_SPINNING; 07044 07045 if (!(ptiCurrent->ppi->W32PF_Flags & W32PF_FORCEBACKGROUNDPRIORITY)) { 07046 ptiCurrent->ppi->W32PF_Flags |= W32PF_FORCEBACKGROUNDPRIORITY; 07047 if (ptiCurrent->ppi == gppiWantForegroundPriority) { 07048 SetForegroundPriority(ptiCurrent, FALSE); 07049 } 07050 } 07051 } 07052 07053 retval = xxxUserYield(ptiCurrent); 07054 07055 TRACE("NtUserYieldTask"); 07056 ENDRECV(); 07057 }


Generated on Sat May 15 19:44:57 2004 for test by doxygen 1.3.7