ReactOS 0.4.17-dev-37-g0bfb40d
ntuser.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _USER_HANDLE_ENTRY
 
struct  _USER_HANDLE_TABLE
 
struct  _LARGE_UNICODE_STRING
 
struct  _LARGE_STRING
 
struct  _LARGE_ANSI_STRING
 
struct  _DESKTOPINFO
 
struct  _CLIENTTHREADINFO
 
struct  _HEAD
 
struct  _THROBJHEAD
 
struct  _THRDESKHEAD
 
struct  tagIMC
 
struct  _PROCDESKHEAD
 
struct  _PROCMARKHEAD
 
struct  tagHOOK
 
struct  tagCLIPBOARDDATA
 
struct  _CALLBACKWND
 
struct  _CLIENTINFO
 
struct  tagDDEPACK
 
struct  tagITEM
 
struct  tagMENULIST
 
struct  tagMENU
 
struct  tagPOPUPMENU
 
struct  _REGISTER_SYSCLASS
 
struct  _CLSMENUNAME
 
struct  tagSBDATA
 
struct  tagSBINFO
 
struct  tagSBCALC
 
struct  _CALLPROCDATA
 
struct  _CLS
 
struct  _SBINFOEX
 
struct  _WND
 
struct  _SBWND
 
struct  _MDIWND
 
struct  _MENUWND
 
struct  _PFNCLIENT
 
struct  _PFNCLIENTWORKER
 
struct  tagOEMBITMAPINFO
 
struct  tagMBSTRING
 
struct  tagDPISERVERINFO
 
struct  _PERUSERSERVERINFO
 
struct  tagSERVERINFO
 
struct  _PROPLISTITEM
 
struct  _PROPERTY
 
struct  _BROADCASTPARM
 
struct  _WNDMSG
 
struct  _SHAREDINFO
 
struct  _USERCONNECT
 
struct  tagGETCLIPBDATA
 
struct  tagSETCLIPBDATA
 
struct  tagCURSORDATA
 
struct  tagIMEUI
 
struct  tagIMEWND
 
struct  _DESKTOP_CONSOLE_THREAD
 
struct  _DRAWICONEXDATA
 
struct  tagDOSENDMESSAGE
 
struct  _tagFINDEXISTINGCURICONPARAM
 
struct  _SETSCROLLBARINFO
 

Macros

#define FIRST_USER_HANDLE   0x0020 /* first possible value for low word of user handle */
 
#define LAST_USER_HANDLE   0xffef /* last possible value for low word of user handle */
 
#define HANDLEENTRY_DESTROY   1
 
#define HANDLEENTRY_INDESTROY   2
 
#define NB_HOOKS   (WH_MAXHOOK - WH_MINHOOK + 1)
 
#define CTI_THREADSYSLOCK   0x0001
 
#define CTI_INSENDMESSAGE   0x0002
 
#define UserHMGetHandle(obj)   ((obj)->head.h)
 
#define UserHMSetHandle(obj, handle)   ((obj)->head.h = (handle))
 
#define WEF_SETBYWNDPTI   0x0001
 
#define TIF_INCLEANUP   0x00000001
 
#define TIF_16BIT   0x00000002
 
#define TIF_SYSTEMTHREAD   0x00000004
 
#define TIF_CSRSSTHREAD   0x00000008
 
#define TIF_TRACKRECTVISIBLE   0x00000010
 
#define TIF_ALLOWFOREGROUNDACTIVATE   0x00000020
 
#define TIF_DONTATTACHQUEUE   0x00000040
 
#define TIF_DONTJOURNALATTACH   0x00000080
 
#define TIF_WOW64   0x00000100
 
#define TIF_INACTIVATEAPPMSG   0x00000200
 
#define TIF_SPINNING   0x00000400
 
#define TIF_PALETTEAWARE   0x00000800
 
#define TIF_SHAREDWOW   0x00001000
 
#define TIF_FIRSTIDLE   0x00002000
 
#define TIF_WAITFORINPUTIDLE   0x00004000
 
#define TIF_MOVESIZETRACKING   0x00008000
 
#define TIF_VDMAPP   0x00010000
 
#define TIF_DOSEMULATOR   0x00020000
 
#define TIF_GLOBALHOOKER   0x00040000
 
#define TIF_DELAYEDEVENT   0x00080000
 
#define TIF_MSGPOSCHANGED   0x00100000
 
#define TIF_SHUTDOWNCOMPLETE   0x00200000
 
#define TIF_IGNOREPLAYBACKDELAY   0x00400000
 
#define TIF_ALLOWOTHERACCOUNTHOOK   0x00800000
 
#define TIF_GUITHREADINITIALIZED   0x02000000
 
#define TIF_DISABLEIME   0x04000000
 
#define TIF_INGETTEXTLENGTH   0x08000000
 
#define TIF_ANSILENGTH   0x10000000
 
#define TIF_DISABLEHOOKS   0x20000000
 
#define CI_TRANSACTION   0x00000001
 
#define CI_QUEUEMSG   0x00000002
 
#define CI_WOW   0x00000004
 
#define CI_INITTHREAD   0x00000008
 
#define CI_CURTHPRHOOK   0x00000010
 
#define CI_CLASSESREGISTERED   0x00000020
 
#define CI_IMMACTIVATE   0x00000040 /* IMM/IME (Asian input) */
 
#define CI_CTFCOINIT   0x00000080 /* Did CTF CoInitialize? */
 
#define CI_CTFTIM   0x00000100 /* CTF Thread Input Manager (TIM) */
 
#define CI_CICERO_STARTED   0x00000200 /* Is Cicero started in the thread? */
 
#define CI_TSFDISABLED   0x00000400 /* TSF (Text Services Framework a.k.a. Cicero) */
 
#define CI_AIMMACTIVATED   0x00000800 /* Active IMM (AIMM) */
 
#define GetWin32ClientInfo()   ((PCLIENTINFO)(NtCurrentTeb()->Win32ClientInfo))
 
#define HRGN_NULL   ((HRGN)0) /* NULL empty region */
 
#define HRGN_WINDOW   ((HRGN)1) /* region from window rcWindow */
 
#define HRGN_MONITOR   ((HRGN)2) /* region from monitor region. */
 
#define MFT_RTOL   0x6000
 
#define MFS_HBMMENUBMP   0x20000000
 
#define MNF_POPUP   0x0001
 
#define MNF_UNDERLINE   0x0004
 
#define MNF_INACTIVE   0x0010
 
#define MNF_RTOL   0x0020
 
#define MNF_DESKTOPMN   0x0040
 
#define MNF_SYSDESKMN   0x0080
 
#define MNF_SYSSUBMENU   0x0100
 
#define MNF_SYSMENU   0x0200
 
#define NO_SELECTED_ITEM   0xffff
 
#define CSF_SERVERSIDEPROC   0x0001
 
#define CSF_ANSIPROC   0x0002
 
#define CSF_WOWDEFERDESTROY   0x0004
 
#define CSF_SYSTEMCLASS   0x0008
 
#define CSF_WOWCLASS   0x0010
 
#define CSF_WOWEXTRA   0x0020
 
#define CSF_CACHEDSMICON   0x0040
 
#define CSF_WIN40COMPAT   0x0080
 
#define WNDS_HASMENU   0X00000001
 
#define WNDS_HASVERTICALSCROOLLBAR   0X00000002
 
#define WNDS_HASHORIZONTALSCROLLBAR   0X00000004
 
#define WNDS_HASCAPTION   0X00000008
 
#define WNDS_SENDSIZEMOVEMSGS   0X00000010
 
#define WNDS_MSGBOX   0X00000020
 
#define WNDS_ACTIVEFRAME   0X00000040
 
#define WNDS_HASSPB   0X00000080
 
#define WNDS_NONCPAINT   0X00000100
 
#define WNDS_SENDERASEBACKGROUND   0X00000200
 
#define WNDS_ERASEBACKGROUND   0X00000400
 
#define WNDS_SENDNCPAINT   0X00000800
 
#define WNDS_INTERNALPAINT   0X00001000
 
#define WNDS_UPDATEDIRTY   0X00002000
 
#define WNDS_HIDDENPOPUP   0X00004000
 
#define WNDS_FORCEMENUDRAW   0X00008000
 
#define WNDS_DIALOGWINDOW   0X00010000
 
#define WNDS_HASCREATESTRUCTNAME   0X00020000
 
#define WNDS_SERVERSIDEWINDOWPROC   0x00040000 /* Call proc inside win32k. */
 
#define WNDS_ANSIWINDOWPROC   0x00080000
 
#define WNDS_BEINGACTIVATED   0x00100000
 
#define WNDS_HASPALETTE   0x00200000
 
#define WNDS_PAINTNOTPROCESSED   0x00400000
 
#define WNDS_SYNCPAINTPENDING   0x00800000
 
#define WNDS_RECEIVEDQUERYSUSPENDMSG   0x01000000
 
#define WNDS_RECEIVEDSUSPENDMSG   0x02000000
 
#define WNDS_TOGGLETOPMOST   0x04000000
 
#define WNDS_REDRAWIFHUNG   0x08000000
 
#define WNDS_REDRAWFRAMEIFHUNG   0x10000000
 
#define WNDS_ANSICREATOR   0x20000000
 
#define WNDS_MAXIMIZESTOMONITOR   0x40000000
 
#define WNDS_DESTROYED   0x80000000
 
#define WNDSACTIVEFRAME   0x00000006
 
#define WNDS2_WMPAINTSENT   0X00000001
 
#define WNDS2_ENDPAINTINVALIDATE   0X00000002
 
#define WNDS2_STARTPAINT   0X00000004
 
#define WNDS2_OLDUI   0X00000008
 
#define WNDS2_HASCLIENTEDGE   0X00000010
 
#define WNDS2_BOTTOMMOST   0X00000020
 
#define WNDS2_FULLSCREEN   0X00000040
 
#define WNDS2_INDESTROY   0X00000080
 
#define WNDS2_WIN31COMPAT   0X00000100
 
#define WNDS2_WIN40COMPAT   0X00000200
 
#define WNDS2_WIN50COMPAT   0X00000400
 
#define WNDS2_MAXIMIZEDMONITORREGION   0X00000800
 
#define WNDS2_CLOSEBUTTONDOWN   0X00001000
 
#define WNDS2_MAXIMIZEBUTTONDOWN   0X00002000
 
#define WNDS2_MINIMIZEBUTTONDOWN   0X00004000
 
#define WNDS2_HELPBUTTONDOWN   0X00008000
 
#define WNDS2_SCROLLBARLINEUPBTNDOWN   0X00010000
 
#define WNDS2_SCROLLBARPAGEUPBTNDOWN   0X00020000
 
#define WNDS2_SCROLLBARPAGEDOWNBTNDOWN   0X00040000
 
#define WNDS2_SCROLLBARLINEDOWNBTNDOWN   0X00080000
 
#define WNDS2_ANYSCROLLBUTTONDOWN   0X00100000
 
#define WNDS2_SCROLLBARVERTICALTRACKING   0X00200000
 
#define WNDS2_FORCENCPAINT   0X00400000
 
#define WNDS2_FORCEFULLNCPAINTCLIPRGN   0X00800000
 
#define WNDS2_FULLSCREENMODE   0X01000000
 
#define WNDS2_CAPTIONTEXTTRUNCATED   0X08000000
 
#define WNDS2_NOMINMAXANIMATERECTS   0X10000000
 
#define WNDS2_SMALLICONFROMWMQUERYDRAG   0X20000000
 
#define WNDS2_SHELLHOOKREGISTERED   0X40000000
 
#define WNDS2_WMCREATEMSGPROCESSED   0X80000000
 
#define WS_EX2_CLIPBOARDLISTENER   0X00000001
 
#define WS_EX2_LAYEREDINVALIDATE   0X00000002
 
#define WS_EX2_REDIRECTEDFORPRINT   0X00000004
 
#define WS_EX2_LINKED   0X00000008
 
#define WS_EX2_LAYEREDFORDWM   0X00000010
 
#define WS_EX2_LAYEREDLIMBO   0X00000020
 
#define WS_EX2_HIGHTDPI_UNAWAR   0X00000040
 
#define WS_EX2_VERTICALLYMAXIMIZEDLEFT   0X00000080
 
#define WS_EX2_VERTICALLYMAXIMIZEDRIGHT   0X00000100
 
#define WS_EX2_HASOVERLAY   0X00000200
 
#define WS_EX2_CONSOLEWINDOW   0X00000400
 
#define WS_EX2_CHILDNOACTIVATE   0X00000800
 
#define WPF_MININIT   0x0008
 
#define WPF_MAXINIT   0x0010
 
#define PWND_BOTTOM   ((PWND)1)
 
#define GWLP_MDIWND   4
 
#define FNID_FIRST   0x029A
 
#define FNID_SCROLLBAR   0x029A
 
#define FNID_ICONTITLE   0x029B
 
#define FNID_MENU   0x029C
 
#define FNID_DESKTOP   0x029D
 
#define FNID_DEFWINDOWPROC   0x029E
 
#define FNID_MESSAGEWND   0x029F
 
#define FNID_SWITCH   0x02A0
 
#define FNID_BUTTON   0x02A1
 
#define FNID_COMBOBOX   0x02A2
 
#define FNID_COMBOLBOX   0x02A3
 
#define FNID_DIALOG   0x02A4
 
#define FNID_EDIT   0x02A5
 
#define FNID_LISTBOX   0x02A6
 
#define FNID_MDICLIENT   0x02A7
 
#define FNID_STATIC   0x02A8
 
#define FNID_IME   0x02A9
 
#define FNID_GHOST   0x02AA
 
#define FNID_CALLWNDPROC   0x02AB
 
#define FNID_CALLWNDPROCRET   0x02AC
 
#define FNID_HKINLPCWPEXSTRUCT   0x02AD
 
#define FNID_HKINLPCWPRETEXSTRUCT   0x02AE
 
#define FNID_MB_DLGPROC   0x02AF
 
#define FNID_MDIACTIVATEDLGPROC   0x02B0
 
#define FNID_SENDMESSAGE   0x02B1
 
#define FNID_SENDMESSAGEFF   0x02B2
 
#define FNID_SENDMESSAGEWTOOPTION   0x02B3
 
#define FNID_SENDMESSAGECALLPROC   0x02B4
 
#define FNID_BROADCASTSYSTEMMESSAGE   0x02B5
 
#define FNID_TOOLTIPS   0x02B6
 
#define FNID_SENDNOTIFYMESSAGE   0x02B7
 
#define FNID_SENDMESSAGECALLBACK   0x02B8
 
#define FNID_LAST   FNID_SENDMESSAGECALLBACK
 
#define FNID_NUM   (FNID_LAST - FNID_FIRST + 1)
 
#define FNID_NUMSERVERPROC   (FNID_SWITCH - FNID_FIRST + 1)
 
#define FNID_DDEML   0x2000 /* Registers DDEML */
 
#define FNID_DESTROY   0x4000 /* This is sent when WM_NCDESTROY or in the support routine. */
 
#define FNID_FREED   0x8000 /* Window being Freed... */
 
#define ICLASS_TO_MASK(iCls)   (1 << ((iCls)))
 
#define GETPFNCLIENTA(fnid)    (WNDPROC)(*(((ULONG_PTR *)&gpsi->apfnClientA) + (fnid - FNID_FIRST)))
 
#define GETPFNCLIENTW(fnid)    (WNDPROC)(*(((ULONG_PTR *)&gpsi->apfnClientW) + (fnid - FNID_FIRST)))
 
#define GETPFNSERVER(fnid)   gpsi->aStoCidPfn[fnid - FNID_FIRST]
 
#define ICLS_BUTTON   0
 
#define ICLS_EDIT   1
 
#define ICLS_STATIC   2
 
#define ICLS_LISTBOX   3
 
#define ICLS_SCROLLBAR   4
 
#define ICLS_COMBOBOX   5
 
#define ICLS_MDICLIENT   6
 
#define ICLS_COMBOLBOX   7
 
#define ICLS_DDEMLEVENT   8
 
#define ICLS_DDEMLMOTHER   9
 
#define ICLS_DDEML16BIT   10
 
#define ICLS_DDEMLCLIENTA   11
 
#define ICLS_DDEMLCLIENTW   12
 
#define ICLS_DDEMLSERVERA   13
 
#define ICLS_DDEMLSERVERW   14
 
#define ICLS_IME   15
 
#define ICLS_GHOST   16
 
#define ICLS_DESKTOP   17
 
#define ICLS_DIALOG   18
 
#define ICLS_MENU   19
 
#define ICLS_SWITCH   20
 
#define ICLS_ICONTITLE   21
 
#define ICLS_TOOLTIPS   22
 
#define ICLS_UNKNOWN   22
 
#define ICLS_NOTUSED   23
 
#define ICLS_END   31
 
#define COLOR_LAST   COLOR_MENUBAR
 
#define MAX_MB_STRINGS   11
 
#define SRVINFO_DBCSENABLED   0x0002
 
#define SRVINFO_IMM32   0x0004
 
#define SRVINFO_APIHOOK   0x0010
 
#define SRVINFO_CTFIME_ENABLED   0x0020
 
#define SRVINFO_KBDPREF   0x0080
 
#define NUM_SYSCOLORS   31
 
#define PUSIF_PALETTEDISPLAY   0x01
 
#define PUSIF_SNAPTO   0x02
 
#define PUSIF_COMBOBOXANIMATION   0x04
 
#define PUSIF_LISTBOXSMOOTHSCROLLING   0x08
 
#define PUSIF_KEYBOARDCUES   0x20
 
#define SRV_EVENT_MENU   0x0001
 
#define SRV_EVENT_END_APPLICATION   0x0002
 
#define SRV_EVENT_RUNNING   0x0004
 
#define SRV_EVENT_NAMECHANGE   0x0008
 
#define SRV_EVENT_VALUECHANGE   0x0010
 
#define SRV_EVENT_STATECHANGE   0x0020
 
#define SRV_EVENT_LOCATIONCHANGE   0x0040
 
#define SRV_EVENT_CREATE   0x8000
 
#define PROPERTY_FLAG_SYSTEM   1
 
#define USER_VERSION   MAKELONG(0x0000, 0x0005)
 
#define CURSORF_FROMRESOURCE   0x0001
 
#define CURSORF_GLOBAL   0x0002
 
#define CURSORF_LRSHARED   0x0004
 
#define CURSORF_ACON   0x0008
 
#define CURSORF_WOWCLEANUP   0x0010
 
#define CURSORF_ACONFRAME   0x0040
 
#define CURSORF_SECRET   0x0080
 
#define CURSORF_LINKED   0x0100
 
#define CURSORF_CURRENT   0x0200
 
#define COMPAT_FLAG_2_CICERO_DISABLED   2
 
#define IS_IMM_MODE()   (gpsi && (gpsi->dwSRVIFlags & SRVINFO_IMM32))
 
#define IS_CICERO_MODE()   (gpsi && (gpsi->dwSRVIFlags & SRVINFO_CTFIME_ENABLED))
 
#define IS_16BIT_MODE()   (GetWin32ClientInfo()->dwTIFlags & TIF_16BIT)
 
#define IS_CICERO_COMPAT_DISABLED()    (GetWin32ClientInfo()->dwCompatFlags2 & COMPAT_FLAG_2_CICERO_DISABLED)
 
#define GWLP_IMEWND_PIMEUI   0
 
#define WIN32K_VERSION   NTDDI_WINXPSP2 /* FIXME: this should go somewhere else */
 
#define QUERY_WINDOW_UNIQUE_PROCESS_ID   0x00
 
#define QUERY_WINDOW_UNIQUE_THREAD_ID   0x01
 
#define QUERY_WINDOW_ACTIVE   0x02
 
#define QUERY_WINDOW_FOCUS   0x03
 
#define QUERY_WINDOW_ISHUNG   0x04
 
#define QUERY_WINDOW_REAL_ID   0x05
 
#define QUERY_WINDOW_FOREGROUND   0x06
 
#define QUERY_WINDOW_DEFAULT_IME   0x07
 
#define QUERY_WINDOW_DEFAULT_ICONTEXT   0x08
 
#define QUERY_WINDOW_ACTIVE_IME   0x09
 
#define NtUserSetWindowLongPtr   NtUserSetWindowLong
 
#define NOPARAM_ROUTINE_ISCONSOLEMODE   0xffff0001
 
#define ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING   0xfffe000d
 
#define ONEPARAM_ROUTINE_GETDESKTOPMAPPING   0xfffe000e
 
#define TWOPARAM_ROUTINE_SETMENUBARHEIGHT   0xfffd0050
 
#define TWOPARAM_ROUTINE_SETGUITHRDHANDLE   0xfffd0051
 
#define HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOWMOUSE   0xfffd0052
 
#define MSQ_STATE_CAPTURE   0x1
 
#define MSQ_STATE_ACTIVE   0x2
 
#define MSQ_STATE_FOCUS   0x3
 
#define MSQ_STATE_MENUOWNER   0x4
 
#define MSQ_STATE_MOVESIZE   0x5
 
#define MSQ_STATE_CARET   0x6
 
#define TWOPARAM_ROUTINE_ROS_UPDATEUISTATE   0x1004
 
#define HWNDPARAM_ROUTINE_ROS_NOTIFYWINEVENT   0x1005
 

Typedefs

typedef struct _USER_HANDLE_ENTRY USER_HANDLE_ENTRY
 
typedef struct _USER_HANDLE_ENTRYPUSER_HANDLE_ENTRY
 
typedef struct _USER_HANDLE_TABLE USER_HANDLE_TABLE
 
typedef struct _USER_HANDLE_TABLEPUSER_HANDLE_TABLE
 
typedef enum _HANDLE_TYPE HANDLE_TYPE
 
typedef enum _HANDLE_TYPEPHANDLE_TYPE
 
typedef enum _USERTHREADINFOCLASS USERTHREADINFOCLASS
 
typedef struct _LARGE_UNICODE_STRING LARGE_UNICODE_STRING
 
typedef struct _LARGE_UNICODE_STRINGPLARGE_UNICODE_STRING
 
typedef struct _LARGE_STRING LARGE_STRING
 
typedef struct _LARGE_STRINGPLARGE_STRING
 
typedef struct _LARGE_ANSI_STRING LARGE_ANSI_STRING
 
typedef struct _LARGE_ANSI_STRINGPLARGE_ANSI_STRING
 
typedef struct _DESKTOPINFO DESKTOPINFO
 
typedef struct _DESKTOPINFOPDESKTOPINFO
 
typedef struct _CLIENTTHREADINFO CLIENTTHREADINFO
 
typedef struct _CLIENTTHREADINFOPCLIENTTHREADINFO
 
typedef struct _HEAD HEAD
 
typedef struct _HEADPHEAD
 
typedef struct _THROBJHEAD THROBJHEAD
 
typedef struct _THROBJHEADPTHROBJHEAD
 
typedef struct _THRDESKHEAD THRDESKHEAD
 
typedef struct _THRDESKHEADPTHRDESKHEAD
 
typedef struct tagIMC IMC
 
typedef struct tagIMCPIMC
 
typedef struct _PROCDESKHEAD PROCDESKHEAD
 
typedef struct _PROCDESKHEADPPROCDESKHEAD
 
typedef struct _PROCMARKHEAD PROCMARKHEAD
 
typedef struct _PROCMARKHEADPPROCMARKHEAD
 
typedef struct tagHOOK HOOK
 
typedef struct tagHOOKPHOOK
 
typedef struct tagCLIPBOARDDATA CLIPBOARDDATA
 
typedef struct tagCLIPBOARDDATAPCLIPBOARDDATA
 
typedef struct _CALLBACKWND CALLBACKWND
 
typedef struct _CALLBACKWNDPCALLBACKWND
 
typedef struct _CLIENTINFO CLIENTINFO
 
typedef struct _CLIENTINFOPCLIENTINFO
 
typedef struct tagDDEPACK DDEPACK
 
typedef struct tagDDEPACKPDDEPACK
 
typedef struct tagITEM ITEM
 
typedef struct tagITEMPITEM
 
typedef struct tagMENULIST MENULIST
 
typedef struct tagMENULISTPMENULIST
 
typedef struct tagMENU MENU
 
typedef struct tagMENUPMENU
 
typedef struct tagPOPUPMENU POPUPMENU
 
typedef struct tagPOPUPMENUPPOPUPMENU
 
typedef struct _REGISTER_SYSCLASS REGISTER_SYSCLASS
 
typedef struct _REGISTER_SYSCLASSPREGISTER_SYSCLASS
 
typedef struct _CLSMENUNAME CLSMENUNAME
 
typedef struct _CLSMENUNAMEPCLSMENUNAME
 
typedef struct tagSBDATA SBDATA
 
typedef struct tagSBDATAPSBDATA
 
typedef struct tagSBINFO SBINFO
 
typedef struct tagSBINFOPSBINFO
 
typedef struct tagSBCALC SBCALC
 
typedef struct tagSBCALCPSBCALC
 
typedef enum _GETCPD GETCPD
 
typedef enum _GETCPDPGETCPD
 
typedef struct _CALLPROCDATA CALLPROCDATA
 
typedef struct _CALLPROCDATAPCALLPROCDATA
 
typedef struct _CLS CLS
 
typedef struct _CLSPCLS
 
typedef struct _SBINFOEX SBINFOEX
 
typedef struct _SBINFOEXPSBINFOEX
 
typedef struct _WND WND
 
typedef struct _WNDPWND
 
typedef struct _SBWND SBWND
 
typedef struct _SBWNDPSBWND
 
typedef struct _MDIWND MDIWND
 
typedef struct _MDIWNDPMDIWND
 
typedef struct _MENUWND MENUWND
 
typedef struct _MENUWNDPMENUWND
 
typedef struct _PFNCLIENT PFNCLIENT
 
typedef struct _PFNCLIENTPPFNCLIENT
 
typedef LRESULT(CALLBACKWNDPROC_EX) (HWND, UINT, WPARAM, LPARAM, BOOL)
 
typedef struct _PFNCLIENTWORKER PFNCLIENTWORKER
 
typedef struct _PFNCLIENTWORKERPPFNCLIENTWORKER
 
typedef LONG_PTR(NTAPIPFN_FNID) (PWND, UINT, WPARAM, LPARAM, ULONG_PTR)
 
typedef struct tagOEMBITMAPINFO OEMBITMAPINFO
 
typedef struct tagOEMBITMAPINFOPOEMBITMAPINFO
 
typedef enum _OBI_TYPES OBI_TYPES
 
typedef struct tagMBSTRING MBSTRING
 
typedef struct tagMBSTRINGPMBSTRING
 
typedef struct tagDPISERVERINFO DPISERVERINFO
 
typedef struct tagDPISERVERINFOPDPISERVERINFO
 
typedef struct _PERUSERSERVERINFO PERUSERSERVERINFO
 
typedef struct _PERUSERSERVERINFOPPERUSERSERVERINFO
 
typedef struct tagSERVERINFO SERVERINFO
 
typedef struct tagSERVERINFOPSERVERINFO
 
typedef struct _PROPLISTITEM PROPLISTITEM
 
typedef struct _PROPLISTITEMPPROPLISTITEM
 
typedef struct _PROPERTY PROPERTY
 
typedef struct _PROPERTYPPROPERTY
 
typedef struct _BROADCASTPARM BROADCASTPARM
 
typedef struct _BROADCASTPARMPBROADCASTPARM
 
typedef struct _WNDMSG WNDMSG
 
typedef struct _WNDMSGPWNDMSG
 
typedef struct _SHAREDINFO SHAREDINFO
 
typedef struct _SHAREDINFOPSHAREDINFO
 
typedef struct _USERCONNECT USERCONNECT
 
typedef struct _USERCONNECTPUSERCONNECT
 
typedef struct tagGETCLIPBDATA GETCLIPBDATA
 
typedef struct tagGETCLIPBDATAPGETCLIPBDATA
 
typedef struct tagSETCLIPBDATA SETCLIPBDATA
 
typedef struct tagSETCLIPBDATAPSETCLIPBDATA
 
typedef struct tagCURSORDATA CURSORDATA
 
typedef struct tagCURSORDATAPCURSORDATA
 
typedef struct tagIMEUI IMEUI
 
typedef struct tagIMEUIPIMEUI
 
typedef struct tagIMEWND IMEWND
 
typedef struct tagIMEWNDPIMEWND
 
typedef enum _CONSOLECONTROL CONSOLECONTROL
 
typedef enum _CONSOLECONTROLPCONSOLECONTROL
 
typedef struct _DESKTOP_CONSOLE_THREAD DESKTOP_CONSOLE_THREAD
 
typedef struct _DESKTOP_CONSOLE_THREADPDESKTOP_CONSOLE_THREAD
 
typedef struct _DRAWICONEXDATA DRAWICONEXDATA
 
typedef struct _DRAWICONEXDATAPDRAWICONEXDATA
 
typedef struct tagDOSENDMESSAGE DOSENDMESSAGE
 
typedef struct tagDOSENDMESSAGEPDOSENDMESSAGE
 
typedef struct _tagFINDEXISTINGCURICONPARAM FINDEXISTINGCURICONPARAM
 
typedef struct _SETSCROLLBARINFO SETSCROLLBARINFO
 
typedef struct _SETSCROLLBARINFOPSETSCROLLBARINFO
 

Enumerations

enum  _HANDLE_TYPE {
  TYPE_FREE = 0 , TYPE_WINDOW = 1 , TYPE_MENU = 2 , TYPE_CURSOR = 3 ,
  TYPE_SETWINDOWPOS = 4 , TYPE_HOOK = 5 , TYPE_CLIPDATA = 6 , TYPE_CALLPROC = 7 ,
  TYPE_ACCELTABLE = 8 , TYPE_DDEACCESS = 9 , TYPE_DDECONV = 10 , TYPE_DDEXACT = 11 ,
  TYPE_MONITOR = 12 , TYPE_KBDLAYOUT = 13 , TYPE_KBDFILE = 14 , TYPE_WINEVENTHOOK = 15 ,
  TYPE_TIMER = 16 , TYPE_INPUTCONTEXT = 17 , TYPE_HIDDATA = 18 , TYPE_DEVICEINFO = 19 ,
  TYPE_TOUCHINPUTINFO = 20 , TYPE_GESTUREINFOOBJ = 21 , TYPE_CTYPES , TYPE_GENERIC = 255
}
 
enum  _USERTHREADINFOCLASS {
  UserThreadShutdownInformation , UserThreadFlags , UserThreadTaskName , UserThreadWOWInformation ,
  UserThreadHungStatus , UserThreadInitiateShutdown , UserThreadEndShutdown , UserThreadUseActiveDesktop ,
  UserThreadUseDesktop , UserThreadRestoreDesktop , UserThreadCsrApiPort
}
 
enum  _GETCPD {
  UserGetCPDA2U = 0x01 , UserGetCPDU2A = 0X02 , UserGetCPDClass = 0X10 , UserGetCPDWindow = 0X20 ,
  UserGetCPDDialog = 0X40 , UserGetCPDWndtoCls = 0X80
}
 
enum  _OBI_TYPES {
  OBI_CLOSE = 0 , OBI_UPARROW = 46 , OBI_UPARROWI = 49 , OBI_DNARROW = 50 ,
  OBI_DNARROWI = 53 , OBI_MNARROW = 62 , OBI_CTYPES = 93
}
 
enum  SimpleCallRoutines {
  NOPARAM_ROUTINE_CREATEMENU , NOPARAM_ROUTINE_CREATEMENUPOPUP , NOPARAM_ROUTINE_ALLOWFOREGNDACTIVATION , NOPARAM_ROUTINE_MSQCLEARWAKEMASK ,
  NOPARAM_ROUTINE_CREATESYSTEMTHREADS , NOPARAM_ROUTINE_DESTROY_CARET , NOPARAM_ROUTINE_ENABLEPROCWNDGHSTING , NOPARAM_ROUTINE_GETDEVICECHANGEINFO ,
  NOPARAM_ROUTINE_GETIMESHOWSTATUS , NOPARAM_ROUTINE_GETINPUTDESKTOP , NOPARAM_ROUTINE_GETMSESSAGEPOS , NOPARAM_ROUTINE_HANDLESYSTHRDCREATFAIL ,
  NOPARAM_ROUTINE_HIDECURSORNOCAPTURE , NOPARAM_ROUTINE_LOADCURSANDICOS , NOPARAM_ROUTINE_LOADUSERAPIHOOK , NOPARAM_ROUTINE_PREPAREFORLOGOFF ,
  NOPARAM_ROUTINE_RELEASECAPTURE , NOPARAM_ROUTINE_RESETDBLCLICK , NOPARAM_ROUTINE_ZAPACTIVEANDFOUS , NOPARAM_ROUTINE_REMOTECONSHDWSTOP ,
  NOPARAM_ROUTINE_REMOTEDISCONNECT , NOPARAM_ROUTINE_REMOTELOGOFF , NOPARAM_ROUTINE_REMOTENTSECURITY , NOPARAM_ROUTINE_REMOTESHDWSETUP ,
  NOPARAM_ROUTINE_REMOTESHDWSTOP , NOPARAM_ROUTINE_REMOTEPASSTHRUENABLE , NOPARAM_ROUTINE_REMOTEPASSTHRUDISABLE , NOPARAM_ROUTINE_REMOTECONNECTSTATE ,
  NOPARAM_ROUTINE_UPDATEPERUSERIMMENABLING , NOPARAM_ROUTINE_USERPWRCALLOUTWORKER , NOPARAM_ROUTINE_WAKERITFORSHTDWN , NOPARAM_ROUTINE_INIT_MESSAGE_PUMP ,
  NOPARAM_ROUTINE_UNINIT_MESSAGE_PUMP , ONEPARAM_ROUTINE_BEGINDEFERWNDPOS , ONEPARAM_ROUTINE_GETSENDMSGRECVR , ONEPARAM_ROUTINE_WINDOWFROMDC ,
  ONEPARAM_ROUTINE_ALLOWSETFOREGND , ONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT , ONEPARAM_ROUTINE_CSDDEUNINITIALIZE , ONEPARAM_ROUTINE_DIRECTEDYIELD ,
  ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMATS , ONEPARAM_ROUTINE_GETINPUTEVENT , ONEPARAM_ROUTINE_GETKEYBOARDLAYOUT , ONEPARAM_ROUTINE_GETKEYBOARDTYPE ,
  ONEPARAM_ROUTINE_GETPROCDEFLAYOUT , ONEPARAM_ROUTINE_GETQUEUESTATUS , ONEPARAM_ROUTINE_GETWINSTAINFO , ONEPARAM_ROUTINE_LOCKFOREGNDWINDOW ,
  ONEPARAM_ROUTINE_LOADFONTS , ONEPARAM_ROUTINE_MAPDEKTOPOBJECT , ONEPARAM_ROUTINE_MESSAGEBEEP , ONEPARAM_ROUTINE_PLAYEVENTSOUND ,
  ONEPARAM_ROUTINE_POSTQUITMESSAGE , ONEPARAM_ROUTINE_REALIZEPALETTE , ONEPARAM_ROUTINE_REGISTERLPK , ONEPARAM_ROUTINE_REGISTERSYSTEMTHREAD ,
  ONEPARAM_ROUTINE_REMOTERECONNECT , ONEPARAM_ROUTINE_REMOTETHINWIRESTATUS , ONEPARAM_ROUTINE_RELEASEDC , ONEPARAM_ROUTINE_REMOTENOTIFY ,
  ONEPARAM_ROUTINE_REPLYMESSAGE , ONEPARAM_ROUTINE_SETCARETBLINKTIME , ONEPARAM_ROUTINE_SETDBLCLICKTIME , ONEPARAM_ROUTINE_SETMESSAGEEXTRAINFO ,
  ONEPARAM_ROUTINE_SETPROCDEFLAYOUT , ONEPARAM_ROUTINE_SETWATERMARKSTRINGS , ONEPARAM_ROUTINE_SHOWCURSOR , ONEPARAM_ROUTINE_SHOWSTARTGLASS ,
  ONEPARAM_ROUTINE_SWAPMOUSEBUTTON , X_ROUTINE_WOWMODULEUNLOAD , HWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW , HWND_ROUTINE_DWP_GETENABLEDPOPUP ,
  HWND_ROUTINE_GETWNDCONTEXTHLPID , HWND_ROUTINE_REGISTERSHELLHOOKWINDOW , HWND_ROUTINE_SETMSGBOX , HWNDOPT_ROUTINE_SETPROGMANWINDOW ,
  HWNDOPT_ROUTINE_SETTASKMANWINDOW , HWNDPARAM_ROUTINE_GETCLASSICOCUR , HWNDPARAM_ROUTINE_CLEARWINDOWSTATE , HWNDPARAM_ROUTINE_KILLSYSTEMTIMER ,
  HWNDPARAM_ROUTINE_SETDIALOGPOINTER , HWNDPARAM_ROUTINE_SETVISIBLE , HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID , HWNDPARAM_ROUTINE_SETWINDOWSTATE ,
  HWNDLOCK_ROUTINE_WINDOWHASSHADOW , HWNDLOCK_ROUTINE_ARRANGEICONICWINDOWS , HWNDLOCK_ROUTINE_DRAWMENUBAR , HWNDLOCK_ROUTINE_CHECKIMESHOWSTATUSINTHRD ,
  HWNDLOCK_ROUTINE_GETSYSMENUHANDLE , HWNDLOCK_ROUTINE_REDRAWFRAME , HWNDLOCK_ROUTINE_REDRAWFRAMEANDHOOK , HWNDLOCK_ROUTINE_SETDLGSYSMENU ,
  HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOW , HWNDLOCK_ROUTINE_SETSYSMENU , HWNDLOCK_ROUTINE_UPDATECKIENTRECT , HWNDLOCK_ROUTINE_UPDATEWINDOW ,
  TWOPARAM_ROUTINE_IMESHOWSTATUSCHANGE , TWOPARAM_ROUTINE_ENABLEWINDOW , TWOPARAM_ROUTINE_REDRAWTITLE , TWOPARAM_ROUTINE_SHOWOWNEDPOPUPS ,
  TWOPARAM_ROUTINE_SWITCHTOTHISWINDOW , TWOPARAM_ROUTINE_UPDATEWINDOWS , TWOPARAM_ROUTINE_VALIDATERGN , TWOPARAM_ROUTINE_CHANGEWNDMSGFILTER ,
  TWOPARAM_ROUTINE_GETCURSORPOS , TWOPARAM_ROUTINE_GETHDEVNAME , TWOPARAM_ROUTINE_INITANSIOEM , TWOPARAM_ROUTINE_NLSSENDIMENOTIFY ,
  TWOPARAM_ROUTINE_REGISTERGHSTWND , TWOPARAM_ROUTINE_REGISTERLOGONPROCESS , TWOPARAM_ROUTINE_REGISTERSBLFROSTWND , TWOPARAM_ROUTINE_REGISTERUSERHUNGAPPHANDLERS ,
  TWOPARAM_ROUTINE_SHADOWCLEANUP , TWOPARAM_ROUTINE_REMOTESHADOWSTART , TWOPARAM_ROUTINE_SETCARETPOS , TWOPARAM_ROUTINE_SETCURSORPOS ,
  TWOPARAM_ROUTINE_SETPHYSCURSORPOS , TWOPARAM_ROUTINE_UNHOOKWINDOWSHOOK , TWOPARAM_ROUTINE_WOWCLEANUP
}
 
enum  _CONSOLECONTROL { ConsoleCtrlDesktopConsoleThread = 0 , GuiConsoleWndClassAtom = 1 , ConsoleMakePalettePublic = 5 , ConsoleAcquireDisplayOwnership }
 
enum  ThreadStateRoutines {
  THREADSTATE_FOCUSWINDOW = 0 , THREADSTATE_ACTIVEWINDOW , THREADSTATE_CAPTUREWINDOW , THREADSTATE_DEFAULTIMEWINDOW ,
  THREADSTATE_DEFAULTINPUTCONTEXT , THREADSTATE_GETINPUTSTATE , THREADSTATE_GETCURSOR , THREADSTATE_CHANGEBITS ,
  THREADSTATE_UPTIMELASTREAD , THREADSTATE_GETMESSAGEEXTRAINFO , THREADSTATE_INSENDMESSAGE , THREADSTATE_GETMESSAGETIME ,
  THREADSTATE_FOREGROUNDTHREAD , THREADSTATE_IMECOMPATFLAGS , THREADSTATE_OLDKEYBOARDLAYOUT , THREADSTATE_ISWINLOGON ,
  THREADSTATE_UNKNOWN_0x10 , THREADSTATE_CHECKCONIME , THREADSTATE_GETTHREADINFO , THREADSTATE_PROGMANWINDOW ,
  THREADSTATE_TASKMANWINDOW
}
 

Functions

VOID NTAPI RtlInitLargeAnsiString (IN OUT PLARGE_ANSI_STRING, IN PCSZ, IN INT)
 
VOID NTAPI RtlInitLargeUnicodeString (IN OUT PLARGE_UNICODE_STRING, IN PCWSTR, IN INT)
 
BOOL NTAPI RtlLargeStringToUnicodeString (PUNICODE_STRING, PLARGE_STRING)
 
 C_ASSERT (offsetof(IMC, head.h)==0x0)
 
 C_ASSERT (offsetof(IMC, head.cLockObj)==0x4)
 
 C_ASSERT (offsetof(IMC, head.pti)==0x8)
 
 C_ASSERT (offsetof(IMC, pImcNext)==0x14)
 
 C_ASSERT (offsetof(IMC, dwClientImcData)==0x18)
 
 C_ASSERT (offsetof(IMC, hImeWnd)==0x1c)
 
 C_ASSERT (sizeof(CLIENTINFO)<=sizeof(((PTEB) 0) ->Win32ClientInfo))
 
struct _THREADINFOGetW32ThreadInfo (VOID)
 
struct _PROCESSINFOGetW32ProcessInfo (VOID)
 
 C_ASSERT (sizeof(WND) % sizeof(PVOID)==0)
 
DWORD NTAPI NtUserAssociateInputContext (_In_ HWND hWnd, _In_opt_ HIMC hIMC, _In_ DWORD dwFlags)
 
NTSTATUS NTAPI NtUserBuildHimcList (_In_ DWORD dwThreadId, _In_ DWORD dwCount, _Out_ HIMC *phList, _Out_ PDWORD pdwCount)
 
DWORD NTAPI NtUserCalcMenuBar (HWND hwnd, DWORD x, DWORD width, DWORD y, LPRECT prc)
 
DWORD NTAPI NtUserCheckMenuItem (HMENU hmenu, UINT uIDCheckItem, UINT uCheck)
 
DWORD NTAPI NtUserCtxDisplayIOCtl (DWORD dwUnknown1, DWORD dwUnknown2, DWORD dwUnknown3)
 
DWORD APIENTRY NtUserDbgWin32HeapFail (DWORD Unknown0, DWORD Unknown1)
 
DWORD APIENTRY NtUserDbgWin32HeapStat (DWORD Unknown0, DWORD Unknown1)
 
BOOL NTAPI NtUserDeleteMenu (HMENU hMenu, UINT uPosition, UINT uFlags)
 
BOOL NTAPI NtUserDestroyMenu (HMENU hMenu)
 
DWORD NTAPI NtUserDrawMenuBarTemp (HWND hWnd, HDC hDC, PRECT hRect, HMENU hMenu, HFONT hFont)
 
UINT NTAPI NtUserEnableMenuItem (HMENU hMenu, UINT uIDEnableItem, UINT uEnable)
 
BOOL NTAPI NtUserEndMenu (VOID)
 
BOOL NTAPI NtUserGetMenuBarInfo (HWND hwnd, LONG idObject, LONG idItem, PMENUBARINFO pmbi)
 
UINT NTAPI NtUserGetMenuIndex (HMENU hMenu, HMENU hSubMenu)
 
BOOL NTAPI NtUserGetMenuItemRect (HWND hWnd, HMENU hMenu, UINT uItem, LPRECT lprcItem)
 
HMENU NTAPI NtUserGetSystemMenu (HWND hWnd, BOOL bRevert)
 
BOOL NTAPI NtUserHiliteMenuItem (HWND hWnd, HMENU hMenu, UINT uItemHilite, UINT uHilite)
 
int NTAPI NtUserMenuItemFromPoint (HWND hWnd, HMENU hMenu, DWORD X, DWORD Y)
 
BOOL NTAPI NtUserRemoveMenu (HMENU hMenu, UINT uPosition, UINT uFlags)
 
BOOL NTAPI NtUserSetMenu (HWND hWnd, HMENU hMenu, BOOL bRepaint)
 
BOOL NTAPI NtUserSetMenuContextHelpId (HMENU hmenu, DWORD dwContextHelpId)
 
BOOL NTAPI NtUserSetMenuDefaultItem (HMENU hMenu, UINT uItem, UINT fByPos)
 
BOOL NTAPI NtUserSetMenuFlagRtoL (HMENU hMenu)
 
BOOL NTAPI NtUserSetSystemMenu (HWND hWnd, HMENU hMenu)
 
BOOL NTAPI NtUserThunkedMenuInfo (HMENU hMenu, LPCMENUINFO lpcmi)
 
BOOL NTAPI NtUserThunkedMenuItemInfo (HMENU hMenu, UINT uItem, BOOL fByPosition, BOOL bInsert, LPMENUITEMINFOW lpmii, PUNICODE_STRING lpszCaption)
 
BOOL NTAPI NtUserTrackPopupMenuEx (_In_ HMENU hMenu, _In_ UINT fuFlags, _In_ INT x, _In_ INT y, _In_ HWND hwnd, _In_opt_ LPTPMPARAMS lptpm)
 
HKL NTAPI NtUserActivateKeyboardLayout (HKL hKL, ULONG Flags)
 
DWORD NTAPI NtUserAlterWindowStyle (HWND hWnd, DWORD Index, LONG NewValue)
 
BOOL NTAPI NtUserAttachThreadInput (IN DWORD idAttach, IN DWORD idAttachTo, IN BOOL fAttach)
 
HDC NTAPI NtUserBeginPaint (HWND hWnd, PAINTSTRUCT *lPs)
 
BOOL NTAPI NtUserBitBltSysBmp (HDC hdc, INT nXDest, INT nYDest, INT nWidth, INT nHeight, INT nXSrc, INT nYSrc, DWORD dwRop)
 
BOOL NTAPI NtUserBlockInput (BOOL BlockIt)
 
NTSTATUS NTAPI NtUserBuildHwndList (HDESK hDesktop, HWND hwndParent, BOOLEAN bChildren, ULONG dwThreadId, ULONG cHwnd, HWND *phwndList, ULONG *pcHwndNeeded)
 
NTSTATUS NTAPI NtUserBuildNameList (HWINSTA hWinSta, ULONG dwSize, PVOID lpBuffer, PULONG pRequiredSize)
 
NTSTATUS NTAPI NtUserBuildPropList (HWND hWnd, LPVOID Buffer, DWORD BufferSize, DWORD *Count)
 
DWORD_PTR NTAPI NtUserCallHwnd (HWND hWnd, DWORD Routine)
 
BOOL NTAPI NtUserCallHwndLock (HWND hWnd, DWORD Routine)
 
HWND NTAPI NtUserCallHwndOpt (HWND hWnd, DWORD Routine)
 
DWORD NTAPI NtUserCallHwndParam (HWND hWnd, DWORD_PTR Param, DWORD Routine)
 
DWORD NTAPI NtUserCallHwndParamLock (HWND hWnd, DWORD_PTR Param, DWORD Routine)
 
BOOL NTAPI NtUserCallMsgFilter (LPMSG msg, INT code)
 
LRESULT NTAPI NtUserCallNextHookEx (int Code, WPARAM wParam, LPARAM lParam, BOOL Ansi)
 
DWORD_PTR NTAPI NtUserCallNoParam (DWORD Routine)
 
DWORD_PTR NTAPI NtUserCallOneParam (DWORD_PTR Param, DWORD Routine)
 
DWORD_PTR NTAPI NtUserCallTwoParam (DWORD_PTR Param1, DWORD_PTR Param2, DWORD Routine)
 
BOOL NTAPI NtUserChangeClipboardChain (HWND hWndRemove, HWND hWndNewNext)
 
LONG NTAPI NtUserChangeDisplaySettings (PUNICODE_STRING lpszDeviceName, LPDEVMODEW lpDevMode, DWORD dwflags, LPVOID lParam)
 
BOOL NTAPI NtUserCheckDesktopByThreadId (DWORD dwThreadId)
 
BOOL NTAPI NtUserCheckWindowThreadDesktop (HWND hwnd, DWORD dwThreadId, ULONG ReturnValue)
 
DWORD NTAPI NtUserCheckImeHotKey (_In_ UINT uVirtualKey, _In_ LPARAM lParam)
 
HWND NTAPI NtUserChildWindowFromPointEx (HWND Parent, LONG x, LONG y, UINT Flags)
 
BOOL NTAPI NtUserClipCursor (RECT *lpRect)
 
BOOL NTAPI NtUserCloseClipboard (VOID)
 
BOOL NTAPI NtUserCloseDesktop (HDESK hDesktop)
 
BOOL NTAPI NtUserCloseWindowStation (HWINSTA hWinSta)
 
NTSTATUS APIENTRY NtUserConsoleControl (IN CONSOLECONTROL ConsoleCtrl, IN PVOID ConsoleCtrlInfo, IN ULONG ConsoleCtrlInfoLength)
 
HANDLE NTAPI NtUserConvertMemHandle (PVOID pData, DWORD cbData)
 
ULONG NTAPI NtUserCopyAcceleratorTable (HACCEL Table, LPACCEL Entries, ULONG EntriesCount)
 
DWORD NTAPI NtUserCountClipboardFormats (VOID)
 
HACCEL NTAPI NtUserCreateAcceleratorTable (LPACCEL Entries, ULONG EntriesCount)
 
BOOL NTAPI NtUserCreateCaret (HWND hWnd, HBITMAP hBitmap, int nWidth, int nHeight)
 
HDESK NTAPI NtUserCreateDesktop (POBJECT_ATTRIBUTES poa, PUNICODE_STRING lpszDesktopDevice, LPDEVMODEW lpdmw, DWORD dwFlags, ACCESS_MASK dwDesiredAccess)
 
HIMC NTAPI NtUserCreateInputContext (_In_ ULONG_PTR dwClientImcData)
 
NTSTATUS NTAPI NtUserCreateLocalMemHandle (HANDLE hMem, PVOID pData, DWORD cbData, DWORD *pcbData)
 
HWND NTAPI NtUserCreateWindowEx (DWORD dwExStyle, PLARGE_STRING plstrClassName, PLARGE_STRING plstrClsVersion, PLARGE_STRING plstrWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam, DWORD dwFlags, PVOID acbiBuffer)
 
HWINSTA NTAPI NtUserCreateWindowStation (POBJECT_ATTRIBUTES ObjectAttributes, ACCESS_MASK dwDesiredAccess, DWORD Unknown2, DWORD Unknown3, DWORD Unknown4, DWORD Unknown5, DWORD Unknown6)
 
BOOL NTAPI NtUserDdeGetQualityOfService (IN HWND hwndClient, IN HWND hWndServer, OUT PSECURITY_QUALITY_OF_SERVICE pqosPrev)
 
DWORD NTAPI NtUserDdeInitialize (DWORD Unknown0, DWORD Unknown1, DWORD Unknown2, DWORD Unknown3, DWORD Unknown4)
 
BOOL NTAPI NtUserDdeSetQualityOfService (IN HWND hwndClient, IN PSECURITY_QUALITY_OF_SERVICE pqosNew, OUT PSECURITY_QUALITY_OF_SERVICE pqosPrev)
 
HDWP NTAPI NtUserDeferWindowPos (HDWP WinPosInfo, HWND Wnd, HWND WndInsertAfter, int x, int y, int cx, int cy, UINT Flags)
 
BOOL NTAPI NtUserDefSetText (HWND WindowHandle, PLARGE_STRING WindowText)
 
BOOLEAN NTAPI NtUserDestroyAcceleratorTable (HACCEL Table)
 
BOOL NTAPI NtUserDestroyCursor (_In_ HANDLE Handle, _In_ BOOL bForce)
 
BOOL NTAPI NtUserDestroyInputContext (_In_ HIMC hIMC)
 
BOOLEAN NTAPI NtUserDestroyWindow (HWND Wnd)
 
BOOL NTAPI NtUserDisableThreadIme (_In_ DWORD dwThreadID)
 
LRESULT NTAPI NtUserDispatchMessage (PMSG pMsg)
 
BOOL NTAPI NtUserDragDetect (HWND hWnd, POINT pt)
 
DWORD NTAPI NtUserDragObject (HWND hwnd1, HWND hwnd2, UINT u1, DWORD dw1, HCURSOR hc1)
 
BOOL NTAPI NtUserDrawAnimatedRects (HWND hwnd, INT idAni, RECT *lprcFrom, RECT *lprcTo)
 
BOOL NTAPI NtUserDrawCaption (HWND hWnd, HDC hDc, LPCRECT lpRc, UINT uFlags)
 
BOOL NTAPI NtUserDrawCaptionTemp (HWND hWnd, HDC hDC, LPCRECT lpRc, HFONT hFont, HICON hIcon, const PUNICODE_STRING str, UINT uFlags)
 
BOOL NTAPI NtUserDrawIconEx (HDC hdc, int xLeft, int yTop, HICON hIcon, int cxWidth, int cyWidth, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags, BOOL bMetaHDC, PVOID pDIXData)
 
BOOL NTAPI NtUserEmptyClipboard (VOID)
 
BOOL NTAPI NtUserEnableScrollBar (HWND hWnd, UINT wSBflags, UINT wArrows)
 
BOOL NTAPI NtUserEndDeferWindowPosEx (HDWP WinPosInfo, BOOL bAsync)
 
BOOL NTAPI NtUserEndPaint (HWND hWnd, CONST PAINTSTRUCT *lPs)
 
BOOL NTAPI NtUserEnumDisplayDevices (PUNICODE_STRING lpDevice, DWORD iDevNum, PDISPLAY_DEVICEW lpDisplayDevice, DWORD dwFlags)
 
INT NTAPI NtUserEnumDisplayMonitors (OPTIONAL IN HDC hDC, OPTIONAL IN LPCRECT pRect, OPTIONAL OUT HMONITOR *hMonitorList, OPTIONAL OUT LPRECT monitorRectList, OPTIONAL IN DWORD listSize)
 
NTSTATUS NTAPI NtUserEnumDisplaySettings (PUNICODE_STRING lpszDeviceName, DWORD iModeNum, LPDEVMODEW lpDevMode, DWORD dwFlags)
 
DWORD NTAPI NtUserEvent (DWORD Unknown0)
 
INT NTAPI NtUserExcludeUpdateRgn (HDC hDC, HWND hWnd)
 
BOOL NTAPI NtUserFillWindow (HWND hWndPaint, HWND hWndPaint1, HDC hDC, HBRUSH hBrush)
 
HWND NTAPI NtUserFindWindowEx (HWND hwndParent, HWND hwndChildAfter, PUNICODE_STRING ucClassName, PUNICODE_STRING ucWindowName, DWORD dwUnknown)
 
BOOL NTAPI NtUserFlashWindowEx (IN PFLASHWINFO pfwi)
 
BOOL NTAPI NtUserGetAltTabInfo (HWND hwnd, INT iItem, PALTTABINFO pati, LPWSTR pszItemText, UINT cchItemText, BOOL Ansi)
 
HWND NTAPI NtUserGetAncestor (_In_ HWND hWnd, _In_ UINT uType)
 
DWORD NTAPI NtUserGetAppImeLevel (_In_ HWND hWnd)
 
SHORT NTAPI NtUserGetAsyncKeyState (INT Key)
 
 _Success_ (return !=0) _At_(pustrName -> Buffer, _Out_z_bytecap_post_bytecount_(pustrName->MaximumLength, return *2+2)) ULONG APIENTRY NtUserGetAtomName(_In_ ATOM atom, _Inout_ PUNICODE_STRING pustrName)
 
UINT NTAPI NtUserGetCaretBlinkTime (VOID)
 
BOOL NTAPI NtUserGetCaretPos (LPPOINT lpPoint)
 
BOOL NTAPI NtUserGetClassInfo (HINSTANCE hInstance, PUNICODE_STRING ClassName, LPWNDCLASSEXW wcex, LPWSTR *ppszMenuName, BOOL Ansi)
 
INT NTAPI NtUserGetClassName (HWND hWnd, BOOL Real, PUNICODE_STRING ClassName)
 
HANDLE NTAPI NtUserGetClipboardData (UINT fmt, PGETCLIPBDATA pgcd)
 
INT NTAPI NtUserGetClipboardFormatName (UINT uFormat, LPWSTR lpszFormatName, INT cchMaxCount)
 
HWND NTAPI NtUserGetClipboardOwner (VOID)
 
DWORD NTAPI NtUserGetClipboardSequenceNumber (VOID)
 
HWND NTAPI NtUserGetClipboardViewer (VOID)
 
BOOL NTAPI NtUserGetClipCursor (RECT *lpRect)
 
BOOL NTAPI NtUserGetComboBoxInfo (HWND hWnd, PCOMBOBOXINFO pcbi)
 
HBRUSH NTAPI NtUserGetControlBrush (HWND hwnd, HDC hdc, UINT ctlType)
 
HBRUSH NTAPI NtUserGetControlColor (HWND hwndParent, HWND hwnd, HDC hdc, UINT CtlMsg)
 
ULONG_PTR NTAPI NtUserGetCPD (HWND hWnd, GETCPD Flags, ULONG_PTR Proc)
 
HCURSOR NTAPI NtUserGetCursorFrameInfo (HCURSOR hCursor, DWORD istep, INT *rate_jiffies, DWORD *num_steps)
 
BOOL NTAPI NtUserGetCursorInfo (PCURSORINFO pci)
 
HDC NTAPI NtUserGetDC (HWND hWnd)
 
HDC NTAPI NtUserGetDCEx (HWND hWnd, HANDLE hRegion, ULONG Flags)
 
UINT NTAPI NtUserGetDoubleClickTime (VOID)
 
HWND NTAPI NtUserGetForegroundWindow (VOID)
 
DWORD NTAPI NtUserGetGuiResources (HANDLE hProcess, DWORD uiFlags)
 
BOOL NTAPI NtUserGetGUIThreadInfo (DWORD idThread, LPGUITHREADINFO lpgui)
 
BOOL NTAPI NtUserGetIconSize (HANDLE Handle, UINT istepIfAniCur, LONG *plcx, LONG *plcy)
 
BOOL NTAPI NtUserGetImeHotKey (_In_ DWORD dwHotKeyId, _Out_ PUINT lpuModifiers, _Out_ PUINT lpuVirtualKey, _Out_opt_ LPHKL lphKL)
 
BOOL NTAPI NtUserGetImeInfoEx (_Inout_ PIMEINFOEX pImeInfoEx, _In_ IMEINFOEXCLASS SearchType)
 
DWORD NTAPI NtUserGetInternalWindowPos (HWND hwnd, LPRECT rectWnd, LPPOINT ptIcon)
 
HKL NTAPI NtUserGetKeyboardLayout (DWORD dwThreadid)
 
UINT NTAPI NtUserGetKeyboardLayoutList (ULONG nItems, HKL *pHklBuff)
 
BOOL NTAPI NtUserGetKeyboardLayoutName (_Inout_ PUNICODE_STRING pustrName)
 
DWORD NTAPI NtUserGetKeyboardState (LPBYTE Unknown0)
 
DWORD NTAPI NtUserGetKeyboardType (DWORD TypeFlag)
 
DWORD NTAPI NtUserGetKeyNameText (LONG lParam, LPWSTR lpString, int nSize)
 
SHORT NTAPI NtUserGetKeyState (INT VirtKey)
 
BOOL NTAPI NtUserGetLayeredWindowAttributes (HWND hwnd, COLORREF *pcrKey, BYTE *pbAlpha, DWORD *pdwFlags)
 
DWORD NTAPI NtUserGetListBoxInfo (HWND hWnd)
 
BOOL APIENTRY NtUserGetMessage (PMSG pMsg, HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax)
 
DWORD NTAPI NtUserGetMouseMovePointsEx (UINT cbSize, LPMOUSEMOVEPOINT lppt, LPMOUSEMOVEPOINT lpptBuf, int nBufPoints, DWORD resolution)
 
BOOL NTAPI NtUserGetObjectInformation (HANDLE hObject, DWORD nIndex, PVOID pvInformation, DWORD nLength, PDWORD nLengthNeeded)
 
HWND NTAPI NtUserGetOpenClipboardWindow (VOID)
 
INT NTAPI NtUserGetPriorityClipboardFormat (UINT *paFormatPriorityList, INT cFormats)
 
HWINSTA NTAPI NtUserGetProcessWindowStation (VOID)
 
DWORD NTAPI NtUserGetRawInputBuffer (PRAWINPUT pData, PUINT pcbSize, UINT cbSizeHeader)
 
DWORD NTAPI NtUserGetRawInputData (HRAWINPUT hRawInput, UINT uiCommand, LPVOID pData, PUINT pcbSize, UINT cbSizeHeader)
 
DWORD NTAPI NtUserGetRawInputDeviceInfo (HANDLE hDevice, UINT uiCommand, LPVOID pData, PUINT pcbSize)
 
DWORD NTAPI NtUserGetRawInputDeviceList (PRAWINPUTDEVICELIST pRawInputDeviceList, PUINT puiNumDevices, UINT cbSize)
 
DWORD NTAPI NtUserGetRegisteredRawInputDevices (PRAWINPUTDEVICE pRawInputDevices, PUINT puiNumDevices, UINT cbSize)
 
BOOL NTAPI NtUserGetScrollBarInfo (HWND hWnd, LONG idObject, PSCROLLBARINFO psbi)
 
HDESK NTAPI NtUserGetThreadDesktop (DWORD dwThreadId, HDESK hConsoleDesktop)
 
DWORD_PTR NTAPI NtUserGetThreadState (DWORD Routine)
 
BOOLEAN NTAPI NtUserGetTitleBarInfo (HWND hwnd, PTITLEBARINFO pti)
 
BOOL NTAPI NtUserGetUpdateRect (HWND hWnd, LPRECT lpRect, BOOL fErase)
 
INT NTAPI NtUserGetUpdateRgn (HWND hWnd, HRGN hRgn, BOOL bErase)
 
HDC NTAPI NtUserGetWindowDC (HWND hWnd)
 
BOOL NTAPI NtUserGetWindowPlacement (HWND hWnd, WINDOWPLACEMENT *lpwndpl)
 
PCLS NTAPI NtUserGetWOWClass (HINSTANCE hInstance, PUNICODE_STRING ClassName)
 
DWORD NTAPI NtUserHardErrorControl (DWORD dwUnknown1, DWORD dwUnknown2, DWORD dwUnknown3)
 
BOOL NTAPI NtUserImpersonateDdeClientWindow (HWND hWndClient, HWND hWndServer)
 
NTSTATUS NTAPI NtUserInitialize (DWORD dwWinVersion, HANDLE hPowerRequestEvent, HANDLE hMediaRequestEvent)
 
NTSTATUS NTAPI NtUserInitializeClientPfnArrays (PPFNCLIENT pfnClientA, PPFNCLIENT pfnClientW, PPFNCLIENTWORKER pfnClientWorker, HINSTANCE hmodUser)
 
DWORD NTAPI NtUserInitTask (DWORD Unknown0, DWORD Unknown1, DWORD Unknown2, DWORD Unknown3, DWORD Unknown4, DWORD Unknown5, DWORD Unknown6, DWORD Unknown7, DWORD Unknown8, DWORD Unknown9, DWORD Unknown10, DWORD Unknown11)
 
INT NTAPI NtUserInternalGetWindowText (HWND hWnd, LPWSTR lpString, INT nMaxCount)
 
BOOL NTAPI NtUserInvalidateRect (HWND hWnd, CONST RECT *lpRect, BOOL bErase)
 
BOOL NTAPI NtUserInvalidateRgn (HWND hWnd, HRGN hRgn, BOOL bErase)
 
BOOL NTAPI NtUserIsClipboardFormatAvailable (UINT format)
 
BOOL NTAPI NtUserKillTimer (HWND hWnd, UINT_PTR uIDEvent)
 
HKL NTAPI NtUserLoadKeyboardLayoutEx (IN HANDLE hFile, IN DWORD offTable, IN PVOID pTables, IN HKL hOldKL, IN PUNICODE_STRING puszKLID, IN DWORD dwNewKL, IN UINT Flags)
 
BOOL NTAPI NtUserLockWindowStation (HWINSTA hWindowStation)
 
BOOL NTAPI NtUserLockWindowUpdate (HWND hWnd)
 
BOOL NTAPI NtUserLockWorkStation (VOID)
 
UINT NTAPI NtUserMapVirtualKeyEx (UINT keyCode, UINT transType, DWORD keyboardId, HKL dwhkl)
 
BOOL NTAPI NtUserMessageCall (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ResultInfo, DWORD dwType, BOOL Ansi)
 
DWORD NTAPI NtUserMinMaximize (HWND hWnd, UINT cmd, BOOL Hide)
 
DWORD NTAPI NtUserMNDragLeave (VOID)
 
DWORD NTAPI NtUserMNDragOver (DWORD Unknown0, DWORD Unknown1)
 
DWORD NTAPI NtUserModifyUserStartupInfoFlags (DWORD Unknown0, DWORD Unknown1)
 
BOOL NTAPI NtUserMoveWindow (HWND hWnd, int X, int Y, int nWidth, int nHeight, BOOL bRepaint)
 
DWORD NTAPI NtUserNotifyIMEStatus (_In_ HWND hwnd, _In_ BOOL fOpen, _In_ DWORD dwConversion)
 
BOOL NTAPI NtUserNotifyProcessCreate (HANDLE NewProcessId, HANDLE ParentThreadId, ULONG dwUnknown, ULONG CreateFlags)
 
VOID NTAPI NtUserNotifyWinEvent (DWORD Event, HWND hWnd, LONG idObject, LONG idChild)
 
BOOL NTAPI NtUserOpenClipboard (HWND hWnd, DWORD Unknown1)
 
HDESK NTAPI NtUserOpenDesktop (POBJECT_ATTRIBUTES ObjectAttributes, DWORD dwFlags, ACCESS_MASK dwDesiredAccess)
 
HDESK NTAPI NtUserOpenInputDesktop (DWORD dwFlags, BOOL fInherit, ACCESS_MASK dwDesiredAccess)
 
HWINSTA NTAPI NtUserOpenWindowStation (POBJECT_ATTRIBUTES ObjectAttributes, ACCESS_MASK dwDesiredAccess)
 
BOOL NTAPI NtUserPaintDesktop (HDC hDC)
 
DWORD NTAPI NtUserPaintMenuBar (HWND hWnd, HDC hDC, ULONG left, ULONG right, ULONG top, BOOL bActive)
 
BOOL APIENTRY NtUserPeekMessage (PMSG pMsg, HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax, UINT RemoveMsg)
 
BOOL NTAPI NtUserPostMessage (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 
BOOL NTAPI NtUserPostThreadMessage (DWORD idThread, UINT Msg, WPARAM wParam, LPARAM lParam)
 
BOOL NTAPI NtUserPrintWindow (HWND hwnd, HDC hdcBlt, UINT nFlags)
 
NTSTATUS NTAPI NtUserProcessConnect (IN HANDLE ProcessHandle, OUT PUSERCONNECT pUserConnect, IN ULONG Size)
 
NTSTATUS NTAPI NtUserQueryInformationThread (IN HANDLE ThreadHandle, IN USERTHREADINFOCLASS ThreadInformationClass, OUT PVOID ThreadInformation, IN ULONG ThreadInformationLength)
 
DWORD_PTR NTAPI NtUserQueryInputContext (HIMC hIMC, DWORD dwType)
 
DWORD NTAPI NtUserQuerySendMessage (DWORD Unknown0)
 
DWORD NTAPI NtUserQueryUserCounters (DWORD Unknown0, DWORD Unknown1, DWORD Unknown2, DWORD Unknown3, DWORD Unknown4)
 
DWORD_PTR NTAPI NtUserQueryWindow (HWND hWnd, DWORD Index)
 
BOOL NTAPI NtUserRealInternalGetMessage (LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg, BOOL bGMSG)
 
HWND NTAPI NtUserRealChildWindowFromPoint (HWND Parent, LONG x, LONG y)
 
BOOL NTAPI NtUserRealWaitMessageEx (DWORD dwWakeMask, UINT uTimeout)
 
BOOL NTAPI NtUserRedrawWindow (HWND hWnd, CONST RECT *lprcUpdate, HRGN hrgnUpdate, UINT flags)
 
RTL_ATOM NTAPI NtUserRegisterClassExWOW (WNDCLASSEXW *lpwcx, PUNICODE_STRING pustrClassName, PUNICODE_STRING pustrCVersion, PCLSMENUNAME pClassMenuName, DWORD fnID, DWORD Flags, LPDWORD pWow)
 
BOOL NTAPI NtUserRegisterRawInputDevices (IN PCRAWINPUTDEVICE pRawInputDevices, IN UINT uiNumDevices, IN UINT cbSize)
 
BOOL NTAPI NtUserRegisterUserApiHook (PUNICODE_STRING m_dllname1, PUNICODE_STRING m_funname1, DWORD dwUnknown3, DWORD dwUnknown4)
 
BOOL NTAPI NtUserRegisterHotKey (HWND hWnd, int id, UINT fsModifiers, UINT vk)
 
DWORD NTAPI NtUserRegisterTasklist (DWORD Unknown0)
 
UINT NTAPI NtUserRegisterWindowMessage (PUNICODE_STRING MessageName)
 
DWORD NTAPI NtUserRemoteConnect (DWORD dwUnknown1, DWORD dwUnknown2, DWORD dwUnknown3)
 
DWORD NTAPI NtUserRemoteRedrawRectangle (DWORD dwUnknown1, DWORD dwUnknown2, DWORD dwUnknown3, DWORD dwUnknown4)
 
DWORD NTAPI NtUserRemoteRedrawScreen (VOID)
 
DWORD NTAPI NtUserRemoteStopScreenUpdates (VOID)
 
HANDLE NTAPI NtUserRemoveProp (HWND hWnd, ATOM Atom)
 
HDESK NTAPI NtUserResolveDesktop (IN HANDLE ProcessHandle, IN PUNICODE_STRING DesktopPath, IN BOOL bInherit, OUT HWINSTA *phWinSta)
 
DWORD NTAPI NtUserResolveDesktopForWOW (DWORD Unknown0)
 
BOOL NTAPI NtUserSBGetParms (HWND hwnd, int fnBar, PSBDATA pSBData, LPSCROLLINFO lpsi)
 
BOOL NTAPI NtUserScrollDC (HDC hDC, int dx, int dy, CONST RECT *lprcScroll, CONST RECT *lprcClip, HRGN hrgnUpdate, LPRECT lprcUpdate)
 
DWORD NTAPI NtUserScrollWindowEx (HWND hWnd, INT dx, INT dy, const RECT *rect, const RECT *clipRect, HRGN hrgnUpdate, LPRECT rcUpdate, UINT flags)
 
UINT NTAPI NtUserSendInput (UINT nInputs, LPINPUT pInput, INT cbSize)
 
HWND NTAPI NtUserSetActiveWindow (HWND Wnd)
 
BOOL NTAPI NtUserSetAppImeLevel (HWND hWnd, DWORD dwLevel)
 
HWND NTAPI NtUserSetCapture (HWND Wnd)
 
ULONG_PTR NTAPI NtUserSetClassLong (_In_ HWND hWnd, _In_ INT Offset, _In_ ULONG dwNewLong, _In_ BOOL Ansi)
 
WORD NTAPI NtUserSetClassWord (HWND hWnd, INT nIndex, WORD wNewWord)
 
HANDLE NTAPI NtUserSetClipboardData (UINT fmt, HANDLE hMem, PSETCLIPBDATA scd)
 
HWND NTAPI NtUserSetClipboardViewer (HWND hWndNewViewer)
 
HPALETTE NTAPI NtUserSelectPalette (HDC hDC, HPALETTE hpal, BOOL ForceBackground)
 
DWORD NTAPI NtUserSetConsoleReserveKeys (DWORD Unknown0, DWORD Unknown1)
 
HCURSOR NTAPI NtUserSetCursor (HCURSOR hCursor)
 
BOOL NTAPI NtUserSetCursorContents (HANDLE Handle, PICONINFO IconInfo)
 
BOOL NTAPI NtUserSetCursorIconData (_In_ HCURSOR hCursor, _In_opt_ PUNICODE_STRING pustrModule, _In_opt_ PUNICODE_STRING puSrcName, _In_ const CURSORDATA *pCursorData)
 
HICON NTAPI NtUserFindExistingCursorIcon (_In_ PUNICODE_STRING pustrModule, _In_ PUNICODE_STRING pustrRsrc, _In_ FINDEXISTINGCURICONPARAM *param)
 
DWORD NTAPI NtUserSetDbgTag (DWORD Unknown0, DWORD Unknown1)
 
DWORD APIENTRY NtUserSetDbgTagCount (DWORD Unknown0)
 
HWND NTAPI NtUserSetFocus (HWND hWnd)
 
BOOL NTAPI NtUserSetImeHotKey (_In_ DWORD dwHotKeyId, _In_ UINT uModifiers, _In_ UINT uVirtualKey, _In_opt_ HKL hKL, _In_ DWORD dwAction)
 
BOOL NTAPI NtUserSetImeInfoEx (_In_ const IMEINFOEX *pImeInfoEx)
 
BOOL NTAPI NtUserSetImeOwnerWindow (_In_ HWND hImeWnd, _In_opt_ HWND hwndFocus)
 
DWORD NTAPI NtUserSetInformationProcess (DWORD dwUnknown1, DWORD dwUnknown2, DWORD dwUnknown3, DWORD dwUnknown4)
 
NTSTATUS NTAPI NtUserSetInformationThread (IN HANDLE ThreadHandle, IN USERTHREADINFOCLASS ThreadInformationClass, IN PVOID ThreadInformation, IN ULONG ThreadInformationLength)
 
DWORD NTAPI NtUserSetInternalWindowPos (HWND hwnd, UINT showCmd, LPRECT rect, LPPOINT pt)
 
BOOL NTAPI NtUserSetKeyboardState (LPBYTE lpKeyState)
 
BOOL NTAPI NtUserSetLayeredWindowAttributes (HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags)
 
BOOL NTAPI NtUserSetLogonNotifyWindow (HWND hWnd)
 
BOOL NTAPI NtUserSetObjectInformation (HANDLE hObject, DWORD nIndex, PVOID pvInformation, DWORD nLength)
 
HWND NTAPI NtUserSetParent (HWND hWndChild, HWND hWndNewParent)
 
BOOL NTAPI NtUserSetProcessWindowStation (HWINSTA hWindowStation)
 
BOOL NTAPI NtUserSetProp (HWND hWnd, ATOM Atom, HANDLE Data)
 
DWORD NTAPI NtUserSetRipFlags (DWORD Unknown0)
 
DWORD NTAPI NtUserSetScrollInfo (HWND hwnd, int fnBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
 
BOOL NTAPI NtUserSetShellWindowEx (HWND hwndShell, HWND hwndShellListView)
 
BOOL NTAPI NtUserSetSysColors (int cElements, IN CONST INT *lpaElements, IN CONST COLORREF *lpaRgbValues, FLONG Flags)
 
BOOL NTAPI NtUserSetSystemCursor (HCURSOR hcur, DWORD id)
 
BOOL NTAPI NtUserSetThreadDesktop (HDESK hDesktop)
 
DWORD NTAPI NtUserSetThreadState (DWORD Unknown0, DWORD Unknown1)
 
UINT_PTR NTAPI NtUserSetSystemTimer (HWND hWnd, UINT_PTR nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc)
 
DWORD NTAPI NtUserSetThreadLayoutHandles (_In_ HKL hNewKL, _In_ HKL hOldKL)
 
UINT_PTR NTAPI NtUserSetTimer (HWND hWnd, UINT_PTR nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc)
 
BOOL NTAPI NtUserSetWindowFNID (HWND hWnd, WORD fnID)
 
LONG NTAPI NtUserSetWindowLong (HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
 
BOOL NTAPI NtUserSetWindowPlacement (HWND hWnd, WINDOWPLACEMENT *lpwndpl)
 
BOOL NTAPI NtUserSetWindowPos (HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags)
 
INT NTAPI NtUserSetWindowRgn (HWND hWnd, HRGN hRgn, BOOL bRedraw)
 
HHOOK NTAPI NtUserSetWindowsHookAW (int idHook, HOOKPROC lpfn, BOOL Ansi)
 
HHOOK NTAPI NtUserSetWindowsHookEx (HINSTANCE Mod, PUNICODE_STRING ModuleName, DWORD ThreadId, int HookId, HOOKPROC HookProc, BOOL Ansi)
 
BOOL NTAPI NtUserSetWindowStationUser (IN HWINSTA hWindowStation, IN PLUID pluid, IN PSID psid OPTIONAL, IN DWORD size)
 
WORD NTAPI NtUserSetWindowWord (HWND hWnd, INT Index, WORD NewVal)
 
HWINEVENTHOOK NTAPI NtUserSetWinEventHook (UINT eventMin, UINT eventMax, HMODULE hmodWinEventProc, PUNICODE_STRING puString, WINEVENTPROC lpfnWinEventProc, DWORD idProcess, DWORD idThread, UINT dwflags)
 
BOOL NTAPI NtUserShowCaret (HWND hWnd)
 
BOOL NTAPI NtUserHideCaret (HWND hWnd)
 
DWORD NTAPI NtUserShowScrollBar (HWND hWnd, int wBar, DWORD bShow)
 
BOOL NTAPI NtUserShowWindow (HWND hWnd, LONG nCmdShow)
 
BOOL NTAPI NtUserShowWindowAsync (HWND hWnd, LONG nCmdShow)
 
BOOL NTAPI NtUserSoundSentry (VOID)
 
BOOL NTAPI NtUserSwitchDesktop (HDESK hDesktop)
 
BOOL NTAPI NtUserSystemParametersInfo (UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
 
DWORD NTAPI NtUserTestForInteractiveUser (DWORD dwUnknown1)
 
INT NTAPI NtUserToUnicodeEx (UINT wVirtKey, UINT wScanCode, PBYTE lpKeyState, LPWSTR pwszBuff, int cchBuff, UINT wFlags, HKL dwhkl)
 
BOOL NTAPI NtUserTrackMouseEvent (LPTRACKMOUSEEVENT lpEventTrack)
 
int NTAPI NtUserTranslateAccelerator (HWND Window, HACCEL Table, LPMSG Message)
 
BOOL NTAPI NtUserTranslateMessage (LPMSG lpMsg, UINT flags)
 
BOOL NTAPI NtUserUnhookWindowsHookEx (HHOOK Hook)
 
BOOL NTAPI NtUserUnhookWinEvent (HWINEVENTHOOK hWinEventHook)
 
BOOL NTAPI NtUserUnloadKeyboardLayout (HKL hKl)
 
BOOL NTAPI NtUserUnlockWindowStation (HWINSTA hWindowStation)
 
BOOL NTAPI NtUserUnregisterClass (PUNICODE_STRING ClassNameOrAtom, HINSTANCE hInstance, PCLSMENUNAME pClassMenuName)
 
BOOL NTAPI NtUserUnregisterHotKey (HWND hWnd, int id)
 
BOOL NTAPI NtUserUnregisterUserApiHook (VOID)
 
BOOL NTAPI NtUserUpdateInputContext (HIMC hIMC, DWORD dwType, DWORD_PTR dwValue)
 
DWORD NTAPI NtUserUpdateInstance (DWORD Unknown0, DWORD Unknown1, DWORD Unknown2)
 
BOOL NTAPI NtUserUpdateLayeredWindow (HWND hwnd, HDC hdcDst, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc, COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags, RECT *prcDirty)
 
BOOL NTAPI NtUserUpdatePerUserSystemParameters (DWORD dwReserved, BOOL bEnable)
 
BOOL NTAPI NtUserUserHandleGrantAccess (IN HANDLE hUserHandle, IN HANDLE hJob, IN BOOL bGrant)
 
BOOL NTAPI NtUserValidateHandleSecure (HANDLE hHdl)
 
BOOL NTAPI NtUserValidateRect (HWND hWnd, CONST RECT *lpRect)
 
BOOL APIENTRY NtUserValidateTimerCallback (LPARAM lParam)
 
DWORD NTAPI NtUserVkKeyScanEx (WCHAR wChar, HKL KeyboardLayout, BOOL bUsehHK)
 
DWORD NTAPI NtUserWaitForInputIdle (IN HANDLE hProcess, IN DWORD dwMilliseconds, IN BOOL bSharedWow)
 
DWORD NTAPI NtUserWaitForMsgAndEvent (DWORD Unknown0)
 
BOOL NTAPI NtUserWaitMessage (VOID)
 
DWORD NTAPI NtUserWin32PoolAllocationStats (DWORD Unknown0, DWORD Unknown1, DWORD Unknown2, DWORD Unknown3, DWORD Unknown4, DWORD Unknown5)
 
HWND NTAPI NtUserWindowFromPoint (LONG X, LONG Y)
 
DWORD NTAPI NtUserYieldTask (VOID)
 
BOOL NTAPI NtUserGetMonitorInfo (IN HMONITOR hMonitor, OUT LPMONITORINFO pMonitorInfo)
 
HMONITOR NTAPI NtUserMonitorFromPoint (_In_ POINT point, _In_ DWORD dwFlags)
 
HMONITOR NTAPI NtUserMonitorFromRect (_In_ LPCRECT pRect, _In_ DWORD dwFlags)
 
HMONITOR NTAPI NtUserMonitorFromWindow (_In_ HWND hWnd, _In_ DWORD dwFlags)
 
BOOL NTAPI NtUserSetScrollBarInfo (HWND hwnd, LONG idObject, SETSCROLLBARINFO *info)
 
ULONG RtlGetExpWinVer (_In_ PVOID BaseAddress)
 

Variables

_Out_opt_ PICONINFO IconInfo
 
_Out_opt_ PICONINFO _Inout_opt_ PUNICODE_STRING lpInstName
 
_Out_opt_ PICONINFO _Inout_opt_ PUNICODE_STRING _Inout_opt_ PUNICODE_STRING lpResName
 
_Out_opt_ PICONINFO _Inout_opt_ PUNICODE_STRING _Inout_opt_ PUNICODE_STRING _Out_opt_ LPDWORD pbpp
 
_Out_opt_ PICONINFO _Inout_opt_ PUNICODE_STRING _Inout_opt_ PUNICODE_STRING _Out_opt_ LPDWORD _In_ BOOL bInternal
 

Macro Definition Documentation

◆ CI_AIMMACTIVATED

#define CI_AIMMACTIVATED   0x00000800 /* Active IMM (AIMM) */

Definition at line 311 of file ntuser.h.

◆ CI_CICERO_STARTED

#define CI_CICERO_STARTED   0x00000200 /* Is Cicero started in the thread? */

Definition at line 309 of file ntuser.h.

◆ CI_CLASSESREGISTERED

#define CI_CLASSESREGISTERED   0x00000020

Definition at line 305 of file ntuser.h.

◆ CI_CTFCOINIT

#define CI_CTFCOINIT   0x00000080 /* Did CTF CoInitialize? */

Definition at line 307 of file ntuser.h.

◆ CI_CTFTIM

#define CI_CTFTIM   0x00000100 /* CTF Thread Input Manager (TIM) */

Definition at line 308 of file ntuser.h.

◆ CI_CURTHPRHOOK

#define CI_CURTHPRHOOK   0x00000010

Definition at line 304 of file ntuser.h.

◆ CI_IMMACTIVATE

#define CI_IMMACTIVATE   0x00000040 /* IMM/IME (Asian input) */

Definition at line 306 of file ntuser.h.

◆ CI_INITTHREAD

#define CI_INITTHREAD   0x00000008

Definition at line 303 of file ntuser.h.

◆ CI_QUEUEMSG

#define CI_QUEUEMSG   0x00000002

Definition at line 301 of file ntuser.h.

◆ CI_TRANSACTION

#define CI_TRANSACTION   0x00000001

Definition at line 300 of file ntuser.h.

◆ CI_TSFDISABLED

#define CI_TSFDISABLED   0x00000400 /* TSF (Text Services Framework a.k.a. Cicero) */

Definition at line 310 of file ntuser.h.

◆ CI_WOW

#define CI_WOW   0x00000004

Definition at line 302 of file ntuser.h.

◆ COLOR_LAST

#define COLOR_LAST   COLOR_MENUBAR

Definition at line 945 of file ntuser.h.

◆ COMPAT_FLAG_2_CICERO_DISABLED

#define COMPAT_FLAG_2_CICERO_DISABLED   2

Definition at line 1210 of file ntuser.h.

◆ CSF_ANSIPROC

#define CSF_ANSIPROC   0x0002

Definition at line 557 of file ntuser.h.

◆ CSF_CACHEDSMICON

#define CSF_CACHEDSMICON   0x0040

Definition at line 562 of file ntuser.h.

◆ CSF_SERVERSIDEPROC

#define CSF_SERVERSIDEPROC   0x0001

Definition at line 556 of file ntuser.h.

◆ CSF_SYSTEMCLASS

#define CSF_SYSTEMCLASS   0x0008

Definition at line 559 of file ntuser.h.

◆ CSF_WIN40COMPAT

#define CSF_WIN40COMPAT   0x0080

Definition at line 563 of file ntuser.h.

◆ CSF_WOWCLASS

#define CSF_WOWCLASS   0x0010

Definition at line 560 of file ntuser.h.

◆ CSF_WOWDEFERDESTROY

#define CSF_WOWDEFERDESTROY   0x0004

Definition at line 558 of file ntuser.h.

◆ CSF_WOWEXTRA

#define CSF_WOWEXTRA   0x0020

Definition at line 561 of file ntuser.h.

◆ CTI_INSENDMESSAGE

#define CTI_INSENDMESSAGE   0x0002

Definition at line 162 of file ntuser.h.

◆ CTI_THREADSYSLOCK

#define CTI_THREADSYSLOCK   0x0001

Definition at line 161 of file ntuser.h.

◆ CURSORF_ACON

#define CURSORF_ACON   0x0008

Definition at line 1202 of file ntuser.h.

◆ CURSORF_ACONFRAME

#define CURSORF_ACONFRAME   0x0040

Definition at line 1204 of file ntuser.h.

◆ CURSORF_CURRENT

#define CURSORF_CURRENT   0x0200

Definition at line 1207 of file ntuser.h.

◆ CURSORF_FROMRESOURCE

#define CURSORF_FROMRESOURCE   0x0001

Definition at line 1199 of file ntuser.h.

◆ CURSORF_GLOBAL

#define CURSORF_GLOBAL   0x0002

Definition at line 1200 of file ntuser.h.

◆ CURSORF_LINKED

#define CURSORF_LINKED   0x0100

Definition at line 1206 of file ntuser.h.

◆ CURSORF_LRSHARED

#define CURSORF_LRSHARED   0x0004

Definition at line 1201 of file ntuser.h.

◆ CURSORF_SECRET

#define CURSORF_SECRET   0x0080

Definition at line 1205 of file ntuser.h.

◆ CURSORF_WOWCLEANUP

#define CURSORF_WOWCLEANUP   0x0010

Definition at line 1203 of file ntuser.h.

◆ FIRST_USER_HANDLE

#define FIRST_USER_HANDLE   0x0020 /* first possible value for low word of user handle */

Definition at line 10 of file ntuser.h.

◆ FNID_BROADCASTSYSTEMMESSAGE

#define FNID_BROADCASTSYSTEMMESSAGE   0x02B5

Definition at line 887 of file ntuser.h.

◆ FNID_BUTTON

#define FNID_BUTTON   0x02A1

Definition at line 866 of file ntuser.h.

◆ FNID_CALLWNDPROC

#define FNID_CALLWNDPROC   0x02AB

Definition at line 876 of file ntuser.h.

◆ FNID_CALLWNDPROCRET

#define FNID_CALLWNDPROCRET   0x02AC

Definition at line 877 of file ntuser.h.

◆ FNID_COMBOBOX

#define FNID_COMBOBOX   0x02A2

Definition at line 867 of file ntuser.h.

◆ FNID_COMBOLBOX

#define FNID_COMBOLBOX   0x02A3

Definition at line 868 of file ntuser.h.

◆ FNID_DDEML

#define FNID_DDEML   0x2000 /* Registers DDEML */

Definition at line 897 of file ntuser.h.

◆ FNID_DEFWINDOWPROC

#define FNID_DEFWINDOWPROC   0x029E

Definition at line 863 of file ntuser.h.

◆ FNID_DESKTOP

#define FNID_DESKTOP   0x029D

Definition at line 862 of file ntuser.h.

◆ FNID_DESTROY

#define FNID_DESTROY   0x4000 /* This is sent when WM_NCDESTROY or in the support routine. */

Definition at line 898 of file ntuser.h.

◆ FNID_DIALOG

#define FNID_DIALOG   0x02A4

Definition at line 869 of file ntuser.h.

◆ FNID_EDIT

#define FNID_EDIT   0x02A5

Definition at line 870 of file ntuser.h.

◆ FNID_FIRST

#define FNID_FIRST   0x029A

Definition at line 858 of file ntuser.h.

◆ FNID_FREED

#define FNID_FREED   0x8000 /* Window being Freed... */

Definition at line 900 of file ntuser.h.

◆ FNID_GHOST

#define FNID_GHOST   0x02AA

Definition at line 875 of file ntuser.h.

◆ FNID_HKINLPCWPEXSTRUCT

#define FNID_HKINLPCWPEXSTRUCT   0x02AD

Definition at line 878 of file ntuser.h.

◆ FNID_HKINLPCWPRETEXSTRUCT

#define FNID_HKINLPCWPRETEXSTRUCT   0x02AE

Definition at line 879 of file ntuser.h.

◆ FNID_ICONTITLE

#define FNID_ICONTITLE   0x029B

Definition at line 860 of file ntuser.h.

◆ FNID_IME

#define FNID_IME   0x02A9

Definition at line 874 of file ntuser.h.

◆ FNID_LAST

Definition at line 892 of file ntuser.h.

◆ FNID_LISTBOX

#define FNID_LISTBOX   0x02A6

Definition at line 871 of file ntuser.h.

◆ FNID_MB_DLGPROC

#define FNID_MB_DLGPROC   0x02AF

Definition at line 880 of file ntuser.h.

◆ FNID_MDIACTIVATEDLGPROC

#define FNID_MDIACTIVATEDLGPROC   0x02B0

Definition at line 881 of file ntuser.h.

◆ FNID_MDICLIENT

#define FNID_MDICLIENT   0x02A7

Definition at line 872 of file ntuser.h.

◆ FNID_MENU

#define FNID_MENU   0x029C

Definition at line 861 of file ntuser.h.

◆ FNID_MESSAGEWND

#define FNID_MESSAGEWND   0x029F

Definition at line 864 of file ntuser.h.

◆ FNID_NUM

#define FNID_NUM   (FNID_LAST - FNID_FIRST + 1)

Definition at line 894 of file ntuser.h.

◆ FNID_NUMSERVERPROC

#define FNID_NUMSERVERPROC   (FNID_SWITCH - FNID_FIRST + 1)

Definition at line 895 of file ntuser.h.

◆ FNID_SCROLLBAR

#define FNID_SCROLLBAR   0x029A

Definition at line 859 of file ntuser.h.

◆ FNID_SENDMESSAGE

#define FNID_SENDMESSAGE   0x02B1

Definition at line 882 of file ntuser.h.

◆ FNID_SENDMESSAGECALLBACK

#define FNID_SENDMESSAGECALLBACK   0x02B8

Definition at line 890 of file ntuser.h.

◆ FNID_SENDMESSAGECALLPROC

#define FNID_SENDMESSAGECALLPROC   0x02B4

Definition at line 886 of file ntuser.h.

◆ FNID_SENDMESSAGEFF

#define FNID_SENDMESSAGEFF   0x02B2

Definition at line 883 of file ntuser.h.

◆ FNID_SENDMESSAGEWTOOPTION

#define FNID_SENDMESSAGEWTOOPTION   0x02B3

Definition at line 885 of file ntuser.h.

◆ FNID_SENDNOTIFYMESSAGE

#define FNID_SENDNOTIFYMESSAGE   0x02B7

Definition at line 889 of file ntuser.h.

◆ FNID_STATIC

#define FNID_STATIC   0x02A8

Definition at line 873 of file ntuser.h.

◆ FNID_SWITCH

#define FNID_SWITCH   0x02A0

Definition at line 865 of file ntuser.h.

◆ FNID_TOOLTIPS

#define FNID_TOOLTIPS   0x02B6

Definition at line 888 of file ntuser.h.

◆ GETPFNCLIENTA

#define GETPFNCLIENTA (   fnid)     (WNDPROC)(*(((ULONG_PTR *)&gpsi->apfnClientA) + (fnid - FNID_FIRST)))

Definition at line 904 of file ntuser.h.

◆ GETPFNCLIENTW

#define GETPFNCLIENTW (   fnid)     (WNDPROC)(*(((ULONG_PTR *)&gpsi->apfnClientW) + (fnid - FNID_FIRST)))

Definition at line 906 of file ntuser.h.

◆ GETPFNSERVER

#define GETPFNSERVER (   fnid)    gpsi->aStoCidPfn[fnid - FNID_FIRST]

Definition at line 909 of file ntuser.h.

◆ GetWin32ClientInfo

#define GetWin32ClientInfo ( )    ((PCLIENTINFO)(NtCurrentTeb()->Win32ClientInfo))

Definition at line 352 of file ntuser.h.

◆ GWLP_IMEWND_PIMEUI

#define GWLP_IMEWND_PIMEUI   0

Definition at line 1244 of file ntuser.h.

◆ GWLP_MDIWND

#define GWLP_MDIWND   4

Definition at line 786 of file ntuser.h.

◆ HANDLEENTRY_DESTROY

#define HANDLEENTRY_DESTROY   1

Definition at line 13 of file ntuser.h.

◆ HANDLEENTRY_INDESTROY

#define HANDLEENTRY_INDESTROY   2

Definition at line 14 of file ntuser.h.

◆ HRGN_MONITOR

#define HRGN_MONITOR   ((HRGN)2) /* region from monitor region. */

Definition at line 362 of file ntuser.h.

◆ HRGN_NULL

#define HRGN_NULL   ((HRGN)0) /* NULL empty region */

Definition at line 360 of file ntuser.h.

◆ HRGN_WINDOW

#define HRGN_WINDOW   ((HRGN)1) /* region from window rcWindow */

Definition at line 361 of file ntuser.h.

◆ HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOWMOUSE

#define HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOWMOUSE   0xfffd0052

Definition at line 3607 of file ntuser.h.

◆ HWNDPARAM_ROUTINE_ROS_NOTIFYWINEVENT

#define HWNDPARAM_ROUTINE_ROS_NOTIFYWINEVENT   0x1005

Definition at line 3617 of file ntuser.h.

◆ ICLASS_TO_MASK

#define ICLASS_TO_MASK (   iCls)    (1 << ((iCls)))

Definition at line 902 of file ntuser.h.

◆ ICLS_BUTTON

#define ICLS_BUTTON   0

Definition at line 912 of file ntuser.h.

◆ ICLS_COMBOBOX

#define ICLS_COMBOBOX   5

Definition at line 917 of file ntuser.h.

◆ ICLS_COMBOLBOX

#define ICLS_COMBOLBOX   7

Definition at line 919 of file ntuser.h.

◆ ICLS_DDEML16BIT

#define ICLS_DDEML16BIT   10

Definition at line 922 of file ntuser.h.

◆ ICLS_DDEMLCLIENTA

#define ICLS_DDEMLCLIENTA   11

Definition at line 923 of file ntuser.h.

◆ ICLS_DDEMLCLIENTW

#define ICLS_DDEMLCLIENTW   12

Definition at line 924 of file ntuser.h.

◆ ICLS_DDEMLEVENT

#define ICLS_DDEMLEVENT   8

Definition at line 920 of file ntuser.h.

◆ ICLS_DDEMLMOTHER

#define ICLS_DDEMLMOTHER   9

Definition at line 921 of file ntuser.h.

◆ ICLS_DDEMLSERVERA

#define ICLS_DDEMLSERVERA   13

Definition at line 925 of file ntuser.h.

◆ ICLS_DDEMLSERVERW

#define ICLS_DDEMLSERVERW   14

Definition at line 926 of file ntuser.h.

◆ ICLS_DESKTOP

#define ICLS_DESKTOP   17

Definition at line 929 of file ntuser.h.

◆ ICLS_DIALOG

#define ICLS_DIALOG   18

Definition at line 930 of file ntuser.h.

◆ ICLS_EDIT

#define ICLS_EDIT   1

Definition at line 913 of file ntuser.h.

◆ ICLS_END

#define ICLS_END   31

Definition at line 943 of file ntuser.h.

◆ ICLS_GHOST

#define ICLS_GHOST   16

Definition at line 928 of file ntuser.h.

◆ ICLS_ICONTITLE

#define ICLS_ICONTITLE   21

Definition at line 933 of file ntuser.h.

◆ ICLS_IME

#define ICLS_IME   15

Definition at line 927 of file ntuser.h.

◆ ICLS_LISTBOX

#define ICLS_LISTBOX   3

Definition at line 915 of file ntuser.h.

◆ ICLS_MDICLIENT

#define ICLS_MDICLIENT   6

Definition at line 918 of file ntuser.h.

◆ ICLS_MENU

#define ICLS_MENU   19

Definition at line 931 of file ntuser.h.

◆ ICLS_NOTUSED

#define ICLS_NOTUSED   23

Definition at line 937 of file ntuser.h.

◆ ICLS_SCROLLBAR

#define ICLS_SCROLLBAR   4

Definition at line 916 of file ntuser.h.

◆ ICLS_STATIC

#define ICLS_STATIC   2

Definition at line 914 of file ntuser.h.

◆ ICLS_SWITCH

#define ICLS_SWITCH   20

Definition at line 932 of file ntuser.h.

◆ ICLS_TOOLTIPS

#define ICLS_TOOLTIPS   22

Definition at line 934 of file ntuser.h.

◆ ICLS_UNKNOWN

#define ICLS_UNKNOWN   22

Definition at line 936 of file ntuser.h.

◆ IS_16BIT_MODE

#define IS_16BIT_MODE ( )    (GetWin32ClientInfo()->dwTIFlags & TIF_16BIT)

Definition at line 1214 of file ntuser.h.

◆ IS_CICERO_COMPAT_DISABLED

#define IS_CICERO_COMPAT_DISABLED ( )     (GetWin32ClientInfo()->dwCompatFlags2 & COMPAT_FLAG_2_CICERO_DISABLED)

Definition at line 1215 of file ntuser.h.

◆ IS_CICERO_MODE

#define IS_CICERO_MODE ( )    (gpsi && (gpsi->dwSRVIFlags & SRVINFO_CTFIME_ENABLED))

Definition at line 1213 of file ntuser.h.

◆ IS_IMM_MODE

#define IS_IMM_MODE ( )    (gpsi && (gpsi->dwSRVIFlags & SRVINFO_IMM32))

Definition at line 1212 of file ntuser.h.

◆ LAST_USER_HANDLE

#define LAST_USER_HANDLE   0xffef /* last possible value for low word of user handle */

Definition at line 11 of file ntuser.h.

◆ MAX_MB_STRINGS

#define MAX_MB_STRINGS   11

Definition at line 946 of file ntuser.h.

◆ MFS_HBMMENUBMP

#define MFS_HBMMENUBMP   0x20000000

Definition at line 368 of file ntuser.h.

◆ MFT_RTOL

#define MFT_RTOL   0x6000

Definition at line 365 of file ntuser.h.

◆ MNF_DESKTOPMN

#define MNF_DESKTOPMN   0x0040

Definition at line 406 of file ntuser.h.

◆ MNF_INACTIVE

#define MNF_INACTIVE   0x0010

Definition at line 404 of file ntuser.h.

◆ MNF_POPUP

#define MNF_POPUP   0x0001

Definition at line 402 of file ntuser.h.

◆ MNF_RTOL

#define MNF_RTOL   0x0020

Definition at line 405 of file ntuser.h.

◆ MNF_SYSDESKMN

#define MNF_SYSDESKMN   0x0080

Definition at line 407 of file ntuser.h.

◆ MNF_SYSMENU

#define MNF_SYSMENU   0x0200

Definition at line 410 of file ntuser.h.

◆ MNF_SYSSUBMENU

#define MNF_SYSSUBMENU   0x0100

Definition at line 408 of file ntuser.h.

◆ MNF_UNDERLINE

#define MNF_UNDERLINE   0x0004

Definition at line 403 of file ntuser.h.

◆ MSQ_STATE_ACTIVE

#define MSQ_STATE_ACTIVE   0x2

Definition at line 3610 of file ntuser.h.

◆ MSQ_STATE_CAPTURE

#define MSQ_STATE_CAPTURE   0x1

Definition at line 3609 of file ntuser.h.

◆ MSQ_STATE_CARET

#define MSQ_STATE_CARET   0x6

Definition at line 3614 of file ntuser.h.

◆ MSQ_STATE_FOCUS

#define MSQ_STATE_FOCUS   0x3

Definition at line 3611 of file ntuser.h.

◆ MSQ_STATE_MENUOWNER

#define MSQ_STATE_MENUOWNER   0x4

Definition at line 3612 of file ntuser.h.

◆ MSQ_STATE_MOVESIZE

#define MSQ_STATE_MOVESIZE   0x5

Definition at line 3613 of file ntuser.h.

◆ NB_HOOKS

#define NB_HOOKS   (WH_MAXHOOK - WH_MINHOOK + 1)

Definition at line 127 of file ntuser.h.

◆ NO_SELECTED_ITEM

#define NO_SELECTED_ITEM   0xffff

Definition at line 413 of file ntuser.h.

◆ NOPARAM_ROUTINE_ISCONSOLEMODE

#define NOPARAM_ROUTINE_ISCONSOLEMODE   0xffff0001

Definition at line 3602 of file ntuser.h.

◆ NtUserSetWindowLongPtr

#define NtUserSetWindowLongPtr   NtUserSetWindowLong

Definition at line 3310 of file ntuser.h.

◆ NUM_SYSCOLORS

#define NUM_SYSCOLORS   31

Definition at line 954 of file ntuser.h.

◆ ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING

#define ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING   0xfffe000d

Definition at line 3603 of file ntuser.h.

◆ ONEPARAM_ROUTINE_GETDESKTOPMAPPING

#define ONEPARAM_ROUTINE_GETDESKTOPMAPPING   0xfffe000e

Definition at line 3604 of file ntuser.h.

◆ PROPERTY_FLAG_SYSTEM

#define PROPERTY_FLAG_SYSTEM   1

Definition at line 1096 of file ntuser.h.

◆ PUSIF_COMBOBOXANIMATION

#define PUSIF_COMBOBOXANIMATION   0x04

Definition at line 995 of file ntuser.h.

◆ PUSIF_KEYBOARDCUES

#define PUSIF_KEYBOARDCUES   0x20

Definition at line 997 of file ntuser.h.

◆ PUSIF_LISTBOXSMOOTHSCROLLING

#define PUSIF_LISTBOXSMOOTHSCROLLING   0x08

Definition at line 996 of file ntuser.h.

◆ PUSIF_PALETTEDISPLAY

#define PUSIF_PALETTEDISPLAY   0x01

Definition at line 993 of file ntuser.h.

◆ PUSIF_SNAPTO

#define PUSIF_SNAPTO   0x02

Definition at line 994 of file ntuser.h.

◆ PWND_BOTTOM

#define PWND_BOTTOM   ((PWND)1)

Definition at line 769 of file ntuser.h.

◆ QUERY_WINDOW_ACTIVE

#define QUERY_WINDOW_ACTIVE   0x02

Definition at line 2849 of file ntuser.h.

◆ QUERY_WINDOW_ACTIVE_IME

#define QUERY_WINDOW_ACTIVE_IME   0x09

Definition at line 2856 of file ntuser.h.

◆ QUERY_WINDOW_DEFAULT_ICONTEXT

#define QUERY_WINDOW_DEFAULT_ICONTEXT   0x08

Definition at line 2855 of file ntuser.h.

◆ QUERY_WINDOW_DEFAULT_IME

#define QUERY_WINDOW_DEFAULT_IME   0x07

Definition at line 2854 of file ntuser.h.

◆ QUERY_WINDOW_FOCUS

#define QUERY_WINDOW_FOCUS   0x03

Definition at line 2850 of file ntuser.h.

◆ QUERY_WINDOW_FOREGROUND

#define QUERY_WINDOW_FOREGROUND   0x06

Definition at line 2853 of file ntuser.h.

◆ QUERY_WINDOW_ISHUNG

#define QUERY_WINDOW_ISHUNG   0x04

Definition at line 2851 of file ntuser.h.

◆ QUERY_WINDOW_REAL_ID

#define QUERY_WINDOW_REAL_ID   0x05

Definition at line 2852 of file ntuser.h.

◆ QUERY_WINDOW_UNIQUE_PROCESS_ID

#define QUERY_WINDOW_UNIQUE_PROCESS_ID   0x00

Definition at line 2847 of file ntuser.h.

◆ QUERY_WINDOW_UNIQUE_THREAD_ID

#define QUERY_WINDOW_UNIQUE_THREAD_ID   0x01

Definition at line 2848 of file ntuser.h.

◆ SRV_EVENT_CREATE

#define SRV_EVENT_CREATE   0x8000

Definition at line 1088 of file ntuser.h.

◆ SRV_EVENT_END_APPLICATION

#define SRV_EVENT_END_APPLICATION   0x0002

Definition at line 1082 of file ntuser.h.

◆ SRV_EVENT_LOCATIONCHANGE

#define SRV_EVENT_LOCATIONCHANGE   0x0040

Definition at line 1087 of file ntuser.h.

◆ SRV_EVENT_MENU

#define SRV_EVENT_MENU   0x0001

Definition at line 1081 of file ntuser.h.

◆ SRV_EVENT_NAMECHANGE

#define SRV_EVENT_NAMECHANGE   0x0008

Definition at line 1084 of file ntuser.h.

◆ SRV_EVENT_RUNNING

#define SRV_EVENT_RUNNING   0x0004

Definition at line 1083 of file ntuser.h.

◆ SRV_EVENT_STATECHANGE

#define SRV_EVENT_STATECHANGE   0x0020

Definition at line 1086 of file ntuser.h.

◆ SRV_EVENT_VALUECHANGE

#define SRV_EVENT_VALUECHANGE   0x0010

Definition at line 1085 of file ntuser.h.

◆ SRVINFO_APIHOOK

#define SRVINFO_APIHOOK   0x0010

Definition at line 950 of file ntuser.h.

◆ SRVINFO_CTFIME_ENABLED

#define SRVINFO_CTFIME_ENABLED   0x0020

Definition at line 951 of file ntuser.h.

◆ SRVINFO_DBCSENABLED

#define SRVINFO_DBCSENABLED   0x0002

Definition at line 948 of file ntuser.h.

◆ SRVINFO_IMM32

#define SRVINFO_IMM32   0x0004

Definition at line 949 of file ntuser.h.

◆ SRVINFO_KBDPREF

#define SRVINFO_KBDPREF   0x0080

Definition at line 952 of file ntuser.h.

◆ TIF_16BIT

#define TIF_16BIT   0x00000002

Definition at line 264 of file ntuser.h.

◆ TIF_ALLOWFOREGROUNDACTIVATE

#define TIF_ALLOWFOREGROUNDACTIVATE   0x00000020

Definition at line 268 of file ntuser.h.

◆ TIF_ALLOWOTHERACCOUNTHOOK

#define TIF_ALLOWOTHERACCOUNTHOOK   0x00800000

Definition at line 286 of file ntuser.h.

◆ TIF_ANSILENGTH

#define TIF_ANSILENGTH   0x10000000

Definition at line 290 of file ntuser.h.

◆ TIF_CSRSSTHREAD

#define TIF_CSRSSTHREAD   0x00000008

Definition at line 266 of file ntuser.h.

◆ TIF_DELAYEDEVENT

#define TIF_DELAYEDEVENT   0x00080000

Definition at line 282 of file ntuser.h.

◆ TIF_DISABLEHOOKS

#define TIF_DISABLEHOOKS   0x20000000

Definition at line 291 of file ntuser.h.

◆ TIF_DISABLEIME

#define TIF_DISABLEIME   0x04000000

Definition at line 288 of file ntuser.h.

◆ TIF_DONTATTACHQUEUE

#define TIF_DONTATTACHQUEUE   0x00000040

Definition at line 269 of file ntuser.h.

◆ TIF_DONTJOURNALATTACH

#define TIF_DONTJOURNALATTACH   0x00000080

Definition at line 270 of file ntuser.h.

◆ TIF_DOSEMULATOR

#define TIF_DOSEMULATOR   0x00020000

Definition at line 280 of file ntuser.h.

◆ TIF_FIRSTIDLE

#define TIF_FIRSTIDLE   0x00002000

Definition at line 276 of file ntuser.h.

◆ TIF_GLOBALHOOKER

#define TIF_GLOBALHOOKER   0x00040000

Definition at line 281 of file ntuser.h.

◆ TIF_GUITHREADINITIALIZED

#define TIF_GUITHREADINITIALIZED   0x02000000

Definition at line 287 of file ntuser.h.

◆ TIF_IGNOREPLAYBACKDELAY

#define TIF_IGNOREPLAYBACKDELAY   0x00400000

Definition at line 285 of file ntuser.h.

◆ TIF_INACTIVATEAPPMSG

#define TIF_INACTIVATEAPPMSG   0x00000200

Definition at line 272 of file ntuser.h.

◆ TIF_INCLEANUP

#define TIF_INCLEANUP   0x00000001

Definition at line 263 of file ntuser.h.

◆ TIF_INGETTEXTLENGTH

#define TIF_INGETTEXTLENGTH   0x08000000

Definition at line 289 of file ntuser.h.

◆ TIF_MOVESIZETRACKING

#define TIF_MOVESIZETRACKING   0x00008000

Definition at line 278 of file ntuser.h.

◆ TIF_MSGPOSCHANGED

#define TIF_MSGPOSCHANGED   0x00100000

Definition at line 283 of file ntuser.h.

◆ TIF_PALETTEAWARE

#define TIF_PALETTEAWARE   0x00000800

Definition at line 274 of file ntuser.h.

◆ TIF_SHAREDWOW

#define TIF_SHAREDWOW   0x00001000

Definition at line 275 of file ntuser.h.

◆ TIF_SHUTDOWNCOMPLETE

#define TIF_SHUTDOWNCOMPLETE   0x00200000

Definition at line 284 of file ntuser.h.

◆ TIF_SPINNING

#define TIF_SPINNING   0x00000400

Definition at line 273 of file ntuser.h.

◆ TIF_SYSTEMTHREAD

#define TIF_SYSTEMTHREAD   0x00000004

Definition at line 265 of file ntuser.h.

◆ TIF_TRACKRECTVISIBLE

#define TIF_TRACKRECTVISIBLE   0x00000010

Definition at line 267 of file ntuser.h.

◆ TIF_VDMAPP

#define TIF_VDMAPP   0x00010000

Definition at line 279 of file ntuser.h.

◆ TIF_WAITFORINPUTIDLE

#define TIF_WAITFORINPUTIDLE   0x00004000

Definition at line 277 of file ntuser.h.

◆ TIF_WOW64

#define TIF_WOW64   0x00000100

Definition at line 271 of file ntuser.h.

◆ TWOPARAM_ROUTINE_ROS_UPDATEUISTATE

#define TWOPARAM_ROUTINE_ROS_UPDATEUISTATE   0x1004

Definition at line 3616 of file ntuser.h.

◆ TWOPARAM_ROUTINE_SETGUITHRDHANDLE

#define TWOPARAM_ROUTINE_SETGUITHRDHANDLE   0xfffd0051

Definition at line 3606 of file ntuser.h.

◆ TWOPARAM_ROUTINE_SETMENUBARHEIGHT

#define TWOPARAM_ROUTINE_SETMENUBARHEIGHT   0xfffd0050

Definition at line 3605 of file ntuser.h.

◆ USER_VERSION

#define USER_VERSION   MAKELONG(0x0000, 0x0005)

Definition at line 1149 of file ntuser.h.

◆ UserHMGetHandle

#define UserHMGetHandle (   obj)    ((obj)->head.h)

Definition at line 230 of file ntuser.h.

◆ UserHMSetHandle

#define UserHMSetHandle (   obj,
  handle 
)    ((obj)->head.h = (handle))

Definition at line 231 of file ntuser.h.

◆ WEF_SETBYWNDPTI

#define WEF_SETBYWNDPTI   0x0001

Definition at line 236 of file ntuser.h.

◆ WIN32K_VERSION

#define WIN32K_VERSION   NTDDI_WINXPSP2 /* FIXME: this should go somewhere else */

Definition at line 1510 of file ntuser.h.

◆ WNDS2_ANYSCROLLBUTTONDOWN

#define WNDS2_ANYSCROLLBUTTONDOWN   0X00100000

Definition at line 661 of file ntuser.h.

◆ WNDS2_BOTTOMMOST

#define WNDS2_BOTTOMMOST   0X00000020

Definition at line 646 of file ntuser.h.

◆ WNDS2_CAPTIONTEXTTRUNCATED

#define WNDS2_CAPTIONTEXTTRUNCATED   0X08000000

Definition at line 666 of file ntuser.h.

◆ WNDS2_CLOSEBUTTONDOWN

#define WNDS2_CLOSEBUTTONDOWN   0X00001000

Definition at line 653 of file ntuser.h.

◆ WNDS2_ENDPAINTINVALIDATE

#define WNDS2_ENDPAINTINVALIDATE   0X00000002

Definition at line 642 of file ntuser.h.

◆ WNDS2_FORCEFULLNCPAINTCLIPRGN

#define WNDS2_FORCEFULLNCPAINTCLIPRGN   0X00800000

Definition at line 664 of file ntuser.h.

◆ WNDS2_FORCENCPAINT

#define WNDS2_FORCENCPAINT   0X00400000

Definition at line 663 of file ntuser.h.

◆ WNDS2_FULLSCREEN

#define WNDS2_FULLSCREEN   0X00000040

Definition at line 647 of file ntuser.h.

◆ WNDS2_FULLSCREENMODE

#define WNDS2_FULLSCREENMODE   0X01000000

Definition at line 665 of file ntuser.h.

◆ WNDS2_HASCLIENTEDGE

#define WNDS2_HASCLIENTEDGE   0X00000010

Definition at line 645 of file ntuser.h.

◆ WNDS2_HELPBUTTONDOWN

#define WNDS2_HELPBUTTONDOWN   0X00008000

Definition at line 656 of file ntuser.h.

◆ WNDS2_INDESTROY

#define WNDS2_INDESTROY   0X00000080

Definition at line 648 of file ntuser.h.

◆ WNDS2_MAXIMIZEBUTTONDOWN

#define WNDS2_MAXIMIZEBUTTONDOWN   0X00002000

Definition at line 654 of file ntuser.h.

◆ WNDS2_MAXIMIZEDMONITORREGION

#define WNDS2_MAXIMIZEDMONITORREGION   0X00000800

Definition at line 652 of file ntuser.h.

◆ WNDS2_MINIMIZEBUTTONDOWN

#define WNDS2_MINIMIZEBUTTONDOWN   0X00004000

Definition at line 655 of file ntuser.h.

◆ WNDS2_NOMINMAXANIMATERECTS

#define WNDS2_NOMINMAXANIMATERECTS   0X10000000

Definition at line 667 of file ntuser.h.

◆ WNDS2_OLDUI

#define WNDS2_OLDUI   0X00000008

Definition at line 644 of file ntuser.h.

◆ WNDS2_SCROLLBARLINEDOWNBTNDOWN

#define WNDS2_SCROLLBARLINEDOWNBTNDOWN   0X00080000

Definition at line 660 of file ntuser.h.

◆ WNDS2_SCROLLBARLINEUPBTNDOWN

#define WNDS2_SCROLLBARLINEUPBTNDOWN   0X00010000

Definition at line 657 of file ntuser.h.

◆ WNDS2_SCROLLBARPAGEDOWNBTNDOWN

#define WNDS2_SCROLLBARPAGEDOWNBTNDOWN   0X00040000

Definition at line 659 of file ntuser.h.

◆ WNDS2_SCROLLBARPAGEUPBTNDOWN

#define WNDS2_SCROLLBARPAGEUPBTNDOWN   0X00020000

Definition at line 658 of file ntuser.h.

◆ WNDS2_SCROLLBARVERTICALTRACKING

#define WNDS2_SCROLLBARVERTICALTRACKING   0X00200000

Definition at line 662 of file ntuser.h.

◆ WNDS2_SHELLHOOKREGISTERED

#define WNDS2_SHELLHOOKREGISTERED   0X40000000

Definition at line 669 of file ntuser.h.

◆ WNDS2_SMALLICONFROMWMQUERYDRAG

#define WNDS2_SMALLICONFROMWMQUERYDRAG   0X20000000

Definition at line 668 of file ntuser.h.

◆ WNDS2_STARTPAINT

#define WNDS2_STARTPAINT   0X00000004

Definition at line 643 of file ntuser.h.

◆ WNDS2_WIN31COMPAT

#define WNDS2_WIN31COMPAT   0X00000100

Definition at line 649 of file ntuser.h.

◆ WNDS2_WIN40COMPAT

#define WNDS2_WIN40COMPAT   0X00000200

Definition at line 650 of file ntuser.h.

◆ WNDS2_WIN50COMPAT

#define WNDS2_WIN50COMPAT   0X00000400

Definition at line 651 of file ntuser.h.

◆ WNDS2_WMCREATEMSGPROCESSED

#define WNDS2_WMCREATEMSGPROCESSED   0X80000000

Definition at line 670 of file ntuser.h.

◆ WNDS2_WMPAINTSENT

#define WNDS2_WMPAINTSENT   0X00000001

Definition at line 641 of file ntuser.h.

◆ WNDS_ACTIVEFRAME

#define WNDS_ACTIVEFRAME   0X00000040

Definition at line 611 of file ntuser.h.

◆ WNDS_ANSICREATOR

#define WNDS_ANSICREATOR   0x20000000

Definition at line 634 of file ntuser.h.

◆ WNDS_ANSIWINDOWPROC

#define WNDS_ANSIWINDOWPROC   0x00080000

Definition at line 624 of file ntuser.h.

◆ WNDS_BEINGACTIVATED

#define WNDS_BEINGACTIVATED   0x00100000

Definition at line 625 of file ntuser.h.

◆ WNDS_DESTROYED

#define WNDS_DESTROYED   0x80000000

Definition at line 636 of file ntuser.h.

◆ WNDS_DIALOGWINDOW

#define WNDS_DIALOGWINDOW   0X00010000

Definition at line 621 of file ntuser.h.

◆ WNDS_ERASEBACKGROUND

#define WNDS_ERASEBACKGROUND   0X00000400

Definition at line 615 of file ntuser.h.

◆ WNDS_FORCEMENUDRAW

#define WNDS_FORCEMENUDRAW   0X00008000

Definition at line 620 of file ntuser.h.

◆ WNDS_HASCAPTION

#define WNDS_HASCAPTION   0X00000008

Definition at line 608 of file ntuser.h.

◆ WNDS_HASCREATESTRUCTNAME

#define WNDS_HASCREATESTRUCTNAME   0X00020000

Definition at line 622 of file ntuser.h.

◆ WNDS_HASHORIZONTALSCROLLBAR

#define WNDS_HASHORIZONTALSCROLLBAR   0X00000004

Definition at line 607 of file ntuser.h.

◆ WNDS_HASMENU

#define WNDS_HASMENU   0X00000001

Definition at line 605 of file ntuser.h.

◆ WNDS_HASPALETTE

#define WNDS_HASPALETTE   0x00200000

Definition at line 626 of file ntuser.h.

◆ WNDS_HASSPB

#define WNDS_HASSPB   0X00000080

Definition at line 612 of file ntuser.h.

◆ WNDS_HASVERTICALSCROOLLBAR

#define WNDS_HASVERTICALSCROOLLBAR   0X00000002

Definition at line 606 of file ntuser.h.

◆ WNDS_HIDDENPOPUP

#define WNDS_HIDDENPOPUP   0X00004000

Definition at line 619 of file ntuser.h.

◆ WNDS_INTERNALPAINT

#define WNDS_INTERNALPAINT   0X00001000

Definition at line 617 of file ntuser.h.

◆ WNDS_MAXIMIZESTOMONITOR

#define WNDS_MAXIMIZESTOMONITOR   0x40000000

Definition at line 635 of file ntuser.h.

◆ WNDS_MSGBOX

#define WNDS_MSGBOX   0X00000020

Definition at line 610 of file ntuser.h.

◆ WNDS_NONCPAINT

#define WNDS_NONCPAINT   0X00000100

Definition at line 613 of file ntuser.h.

◆ WNDS_PAINTNOTPROCESSED

#define WNDS_PAINTNOTPROCESSED   0x00400000

Definition at line 627 of file ntuser.h.

◆ WNDS_RECEIVEDQUERYSUSPENDMSG

#define WNDS_RECEIVEDQUERYSUSPENDMSG   0x01000000

Definition at line 629 of file ntuser.h.

◆ WNDS_RECEIVEDSUSPENDMSG

#define WNDS_RECEIVEDSUSPENDMSG   0x02000000

Definition at line 630 of file ntuser.h.

◆ WNDS_REDRAWFRAMEIFHUNG

#define WNDS_REDRAWFRAMEIFHUNG   0x10000000

Definition at line 633 of file ntuser.h.

◆ WNDS_REDRAWIFHUNG

#define WNDS_REDRAWIFHUNG   0x08000000

Definition at line 632 of file ntuser.h.

◆ WNDS_SENDERASEBACKGROUND

#define WNDS_SENDERASEBACKGROUND   0X00000200

Definition at line 614 of file ntuser.h.

◆ WNDS_SENDNCPAINT

#define WNDS_SENDNCPAINT   0X00000800

Definition at line 616 of file ntuser.h.

◆ WNDS_SENDSIZEMOVEMSGS

#define WNDS_SENDSIZEMOVEMSGS   0X00000010

Definition at line 609 of file ntuser.h.

◆ WNDS_SERVERSIDEWINDOWPROC

#define WNDS_SERVERSIDEWINDOWPROC   0x00040000 /* Call proc inside win32k. */

Definition at line 623 of file ntuser.h.

◆ WNDS_SYNCPAINTPENDING

#define WNDS_SYNCPAINTPENDING   0x00800000

Definition at line 628 of file ntuser.h.

◆ WNDS_TOGGLETOPMOST

#define WNDS_TOGGLETOPMOST   0x04000000

Definition at line 631 of file ntuser.h.

◆ WNDS_UPDATEDIRTY

#define WNDS_UPDATEDIRTY   0X00002000

Definition at line 618 of file ntuser.h.

◆ WNDSACTIVEFRAME

#define WNDSACTIVEFRAME   0x00000006

Definition at line 638 of file ntuser.h.

◆ WPF_MAXINIT

#define WPF_MAXINIT   0x0010

Definition at line 687 of file ntuser.h.

◆ WPF_MININIT

#define WPF_MININIT   0x0008

Definition at line 686 of file ntuser.h.

◆ WS_EX2_CHILDNOACTIVATE

#define WS_EX2_CHILDNOACTIVATE   0X00000800

Definition at line 684 of file ntuser.h.

◆ WS_EX2_CLIPBOARDLISTENER

#define WS_EX2_CLIPBOARDLISTENER   0X00000001

Definition at line 673 of file ntuser.h.

◆ WS_EX2_CONSOLEWINDOW

#define WS_EX2_CONSOLEWINDOW   0X00000400

Definition at line 683 of file ntuser.h.

◆ WS_EX2_HASOVERLAY

#define WS_EX2_HASOVERLAY   0X00000200

Definition at line 682 of file ntuser.h.

◆ WS_EX2_HIGHTDPI_UNAWAR

#define WS_EX2_HIGHTDPI_UNAWAR   0X00000040

Definition at line 679 of file ntuser.h.

◆ WS_EX2_LAYEREDFORDWM

#define WS_EX2_LAYEREDFORDWM   0X00000010

Definition at line 677 of file ntuser.h.

◆ WS_EX2_LAYEREDINVALIDATE

#define WS_EX2_LAYEREDINVALIDATE   0X00000002

Definition at line 674 of file ntuser.h.

◆ WS_EX2_LAYEREDLIMBO

#define WS_EX2_LAYEREDLIMBO   0X00000020

Definition at line 678 of file ntuser.h.

◆ WS_EX2_LINKED

#define WS_EX2_LINKED   0X00000008

Definition at line 676 of file ntuser.h.

◆ WS_EX2_REDIRECTEDFORPRINT

#define WS_EX2_REDIRECTEDFORPRINT   0X00000004

Definition at line 675 of file ntuser.h.

◆ WS_EX2_VERTICALLYMAXIMIZEDLEFT

#define WS_EX2_VERTICALLYMAXIMIZEDLEFT   0X00000080

Definition at line 680 of file ntuser.h.

◆ WS_EX2_VERTICALLYMAXIMIZEDRIGHT

#define WS_EX2_VERTICALLYMAXIMIZEDRIGHT   0X00000100

Definition at line 681 of file ntuser.h.

Typedef Documentation

◆ BROADCASTPARM

◆ CALLBACKWND

◆ CALLPROCDATA

◆ CLIENTINFO

◆ CLIENTTHREADINFO

◆ CLIPBOARDDATA

◆ CLS

typedef struct _CLS CLS

◆ CLSMENUNAME

◆ CONSOLECONTROL

◆ CURSORDATA

◆ DDEPACK

◆ DESKTOP_CONSOLE_THREAD

◆ DESKTOPINFO

◆ DOSENDMESSAGE

◆ DPISERVERINFO

◆ DRAWICONEXDATA

◆ FINDEXISTINGCURICONPARAM

◆ GETCLIPBDATA

◆ GETCPD

typedef enum _GETCPD GETCPD

◆ HANDLE_TYPE

◆ HEAD

typedef struct _HEAD HEAD

◆ HOOK

typedef struct tagHOOK HOOK

◆ IMC

typedef struct tagIMC IMC

◆ IMEUI

◆ IMEWND

◆ ITEM

typedef struct tagITEM ITEM

◆ LARGE_ANSI_STRING

◆ LARGE_STRING

◆ LARGE_UNICODE_STRING

◆ MBSTRING

◆ MDIWND

◆ MENU

typedef struct tagMENU MENU

◆ MENULIST

◆ MENUWND

◆ OBI_TYPES

◆ OEMBITMAPINFO

◆ PBROADCASTPARM

◆ PCALLBACKWND

◆ PCALLPROCDATA

◆ PCLIENTINFO

◆ PCLIENTTHREADINFO

◆ PCLIPBOARDDATA

◆ PCLS

typedef struct _CLS * PCLS

◆ PCLSMENUNAME

◆ PCONSOLECONTROL

◆ PCURSORDATA

◆ PDDEPACK

◆ PDESKTOP_CONSOLE_THREAD

◆ PDESKTOPINFO

◆ PDOSENDMESSAGE

◆ PDPISERVERINFO

◆ PDRAWICONEXDATA

◆ PERUSERSERVERINFO

◆ PFN_FNID

typedef LONG_PTR(NTAPI * PFN_FNID) (PWND, UINT, WPARAM, LPARAM, ULONG_PTR)

Definition at line 849 of file ntuser.h.

◆ PFNCLIENT

◆ PFNCLIENTWORKER

◆ PGETCLIPBDATA

◆ PGETCPD

typedef enum _GETCPD * PGETCPD

◆ PHANDLE_TYPE

◆ PHEAD

typedef struct _HEAD * PHEAD

◆ PHOOK

typedef struct tagHOOK * PHOOK

◆ PIMC

typedef struct tagIMC * PIMC

◆ PIMEUI

typedef struct tagIMEUI * PIMEUI

◆ PIMEWND

◆ PITEM

typedef struct tagITEM * PITEM

◆ PLARGE_ANSI_STRING

◆ PLARGE_STRING

◆ PLARGE_UNICODE_STRING

◆ PMBSTRING

◆ PMDIWND

typedef struct _MDIWND * PMDIWND

◆ PMENU

typedef struct tagMENU * PMENU

◆ PMENULIST

◆ PMENUWND

◆ POEMBITMAPINFO

◆ POPUPMENU

◆ PPERUSERSERVERINFO

◆ PPFNCLIENT

◆ PPFNCLIENTWORKER

◆ PPOPUPMENU

◆ PPROCDESKHEAD

◆ PPROCMARKHEAD

◆ PPROPERTY

◆ PPROPLISTITEM

◆ PREGISTER_SYSCLASS

◆ PROCDESKHEAD

◆ PROCMARKHEAD

◆ PROPERTY

◆ PROPLISTITEM

◆ PSBCALC

◆ PSBDATA

◆ PSBINFO

◆ PSBINFOEX

◆ PSBWND

typedef struct _SBWND * PSBWND

◆ PSERVERINFO

◆ PSETCLIPBDATA

◆ PSETSCROLLBARINFO

◆ PSHAREDINFO

◆ PTHRDESKHEAD

◆ PTHROBJHEAD

◆ PUSER_HANDLE_ENTRY

◆ PUSER_HANDLE_TABLE

◆ PUSERCONNECT

◆ PWND

typedef struct _WND * PWND

◆ PWNDMSG

typedef struct _WNDMSG * PWNDMSG

◆ REGISTER_SYSCLASS

◆ SBCALC

◆ SBDATA

◆ SBINFO

◆ SBINFOEX

◆ SBWND

typedef struct _SBWND SBWND

◆ SERVERINFO

◆ SETCLIPBDATA

◆ SETSCROLLBARINFO

◆ SHAREDINFO

◆ THRDESKHEAD

◆ THROBJHEAD

◆ USER_HANDLE_ENTRY

◆ USER_HANDLE_TABLE

◆ USERCONNECT

◆ USERTHREADINFOCLASS

◆ WND

typedef struct _WND WND

◆ WNDMSG

◆ WNDPROC_EX

typedef LRESULT(CALLBACK * WNDPROC_EX) (HWND, UINT, WPARAM, LPARAM, BOOL)

Definition at line 826 of file ntuser.h.

Enumeration Type Documentation

◆ _CONSOLECONTROL

Enumerator
ConsoleCtrlDesktopConsoleThread 
GuiConsoleWndClassAtom 
ConsoleMakePalettePublic 
ConsoleAcquireDisplayOwnership 

Definition at line 1812 of file ntuser.h.

1813{
enum _CONSOLECONTROL * PCONSOLECONTROL
@ ConsoleCtrlDesktopConsoleThread
Definition: ntuser.h:1814
@ ConsoleMakePalettePublic
Definition: ntuser.h:1816
@ GuiConsoleWndClassAtom
Definition: ntuser.h:1815
@ ConsoleAcquireDisplayOwnership
Definition: ntuser.h:1817
enum _CONSOLECONTROL CONSOLECONTROL

◆ _GETCPD

Enumerator
UserGetCPDA2U 
UserGetCPDU2A 
UserGetCPDClass 
UserGetCPDWindow 
UserGetCPDDialog 
UserGetCPDWndtoCls 

Definition at line 538 of file ntuser.h.

539{
540 UserGetCPDA2U = 0x01, /* " Unicode " */
541 UserGetCPDU2A = 0X02, /* " Ansi " */
542 UserGetCPDClass = 0X10,
543 UserGetCPDWindow = 0X20,
544 UserGetCPDDialog = 0X40,
545 UserGetCPDWndtoCls = 0X80
546} GETCPD, *PGETCPD;
@ UserGetCPDWndtoCls
Definition: ntuser.h:545
@ UserGetCPDClass
Definition: ntuser.h:542
@ UserGetCPDU2A
Definition: ntuser.h:541
@ UserGetCPDDialog
Definition: ntuser.h:544
@ UserGetCPDWindow
Definition: ntuser.h:543
@ UserGetCPDA2U
Definition: ntuser.h:540
enum _GETCPD * PGETCPD
enum _GETCPD GETCPD

◆ _HANDLE_TYPE

Enumerator
TYPE_FREE 
TYPE_WINDOW 
TYPE_MENU 
TYPE_CURSOR 
TYPE_SETWINDOWPOS 
TYPE_HOOK 
TYPE_CLIPDATA 
TYPE_CALLPROC 
TYPE_ACCELTABLE 
TYPE_DDEACCESS 
TYPE_DDECONV 
TYPE_DDEXACT 
TYPE_MONITOR 
TYPE_KBDLAYOUT 
TYPE_KBDFILE 
TYPE_WINEVENTHOOK 
TYPE_TIMER 
TYPE_INPUTCONTEXT 
TYPE_HIDDATA 
TYPE_DEVICEINFO 
TYPE_TOUCHINPUTINFO 
TYPE_GESTUREINFOOBJ 
TYPE_CTYPES 
TYPE_GENERIC 

Definition at line 38 of file ntuser.h.

39{
40 TYPE_FREE = 0,
41 TYPE_WINDOW = 1,
42 TYPE_MENU = 2,
43 TYPE_CURSOR = 3,
45 TYPE_HOOK = 5,
46 TYPE_CLIPDATA = 6,
47 TYPE_CALLPROC = 7,
50 TYPE_DDECONV = 10,
51 TYPE_DDEXACT = 11,
52 TYPE_MONITOR = 12,
53 TYPE_KBDLAYOUT = 13,
54 TYPE_KBDFILE = 14,
56 TYPE_TIMER = 16,
58 TYPE_HIDDATA = 18,
59 TYPE_DEVICEINFO = 19,
63 TYPE_GENERIC = 255
enum _HANDLE_TYPE HANDLE_TYPE
@ TYPE_CLIPDATA
Definition: ntuser.h:46
@ TYPE_TIMER
Definition: ntuser.h:56
@ TYPE_KBDFILE
Definition: ntuser.h:54
@ TYPE_HOOK
Definition: ntuser.h:45
@ TYPE_GESTUREINFOOBJ
Definition: ntuser.h:61
@ TYPE_CTYPES
Definition: ntuser.h:62
@ TYPE_DDEACCESS
Definition: ntuser.h:49
@ TYPE_GENERIC
Definition: ntuser.h:63
@ TYPE_DDECONV
Definition: ntuser.h:50
@ TYPE_DEVICEINFO
Definition: ntuser.h:59
@ TYPE_CALLPROC
Definition: ntuser.h:47
@ TYPE_HIDDATA
Definition: ntuser.h:58
@ TYPE_FREE
Definition: ntuser.h:40
@ TYPE_WINEVENTHOOK
Definition: ntuser.h:55
@ TYPE_CURSOR
Definition: ntuser.h:43
@ TYPE_WINDOW
Definition: ntuser.h:41
@ TYPE_DDEXACT
Definition: ntuser.h:51
@ TYPE_TOUCHINPUTINFO
Definition: ntuser.h:60
@ TYPE_ACCELTABLE
Definition: ntuser.h:48
@ TYPE_KBDLAYOUT
Definition: ntuser.h:53
@ TYPE_MONITOR
Definition: ntuser.h:52
@ TYPE_MENU
Definition: ntuser.h:42
@ TYPE_SETWINDOWPOS
Definition: ntuser.h:44
@ TYPE_INPUTCONTEXT
Definition: ntuser.h:57
enum _HANDLE_TYPE * PHANDLE_TYPE

◆ _OBI_TYPES

Enumerator
OBI_CLOSE 
OBI_UPARROW 
OBI_UPARROWI 
OBI_DNARROW 
OBI_DNARROWI 
OBI_MNARROW 
OBI_CTYPES 

Definition at line 964 of file ntuser.h.

965{
966 OBI_CLOSE = 0,
967 OBI_UPARROW = 46,
968 OBI_UPARROWI = 49,
969 OBI_DNARROW = 50,
970 OBI_DNARROWI = 53,
971 OBI_MNARROW = 62,
972 OBI_CTYPES = 93
973} OBI_TYPES;
enum _OBI_TYPES OBI_TYPES
@ OBI_UPARROWI
Definition: ntuser.h:968
@ OBI_UPARROW
Definition: ntuser.h:967
@ OBI_DNARROW
Definition: ntuser.h:969
@ OBI_CTYPES
Definition: ntuser.h:972
@ OBI_CLOSE
Definition: ntuser.h:966
@ OBI_DNARROWI
Definition: ntuser.h:970
@ OBI_MNARROW
Definition: ntuser.h:971

◆ _USERTHREADINFOCLASS

Enumerator
UserThreadShutdownInformation 
UserThreadFlags 
UserThreadTaskName 
UserThreadWOWInformation 
UserThreadHungStatus 
UserThreadInitiateShutdown 
UserThreadEndShutdown 
UserThreadUseActiveDesktop 
UserThreadUseDesktop 
UserThreadRestoreDesktop 
UserThreadCsrApiPort 

Definition at line 66 of file ntuser.h.

67{
enum _USERTHREADINFOCLASS USERTHREADINFOCLASS
@ UserThreadEndShutdown
Definition: ntuser.h:74
@ UserThreadWOWInformation
Definition: ntuser.h:71
@ UserThreadUseDesktop
Definition: ntuser.h:76
@ UserThreadTaskName
Definition: ntuser.h:70
@ UserThreadFlags
Definition: ntuser.h:69
@ UserThreadRestoreDesktop
Definition: ntuser.h:77
@ UserThreadShutdownInformation
Definition: ntuser.h:68
@ UserThreadInitiateShutdown
Definition: ntuser.h:73
@ UserThreadCsrApiPort
Definition: ntuser.h:78
@ UserThreadUseActiveDesktop
Definition: ntuser.h:75
@ UserThreadHungStatus
Definition: ntuser.h:72

◆ SimpleCallRoutines

Enumerator
NOPARAM_ROUTINE_CREATEMENU 
NOPARAM_ROUTINE_CREATEMENUPOPUP 
NOPARAM_ROUTINE_ALLOWFOREGNDACTIVATION 
NOPARAM_ROUTINE_MSQCLEARWAKEMASK 
NOPARAM_ROUTINE_CREATESYSTEMTHREADS 
NOPARAM_ROUTINE_DESTROY_CARET 
NOPARAM_ROUTINE_ENABLEPROCWNDGHSTING 
NOPARAM_ROUTINE_GETDEVICECHANGEINFO 
NOPARAM_ROUTINE_GETIMESHOWSTATUS 
NOPARAM_ROUTINE_GETINPUTDESKTOP 
NOPARAM_ROUTINE_GETMSESSAGEPOS 
NOPARAM_ROUTINE_HANDLESYSTHRDCREATFAIL 
NOPARAM_ROUTINE_HIDECURSORNOCAPTURE 
NOPARAM_ROUTINE_LOADCURSANDICOS 
NOPARAM_ROUTINE_LOADUSERAPIHOOK 
NOPARAM_ROUTINE_PREPAREFORLOGOFF 
NOPARAM_ROUTINE_RELEASECAPTURE 
NOPARAM_ROUTINE_RESETDBLCLICK 
NOPARAM_ROUTINE_ZAPACTIVEANDFOUS 
NOPARAM_ROUTINE_REMOTECONSHDWSTOP 
NOPARAM_ROUTINE_REMOTEDISCONNECT 
NOPARAM_ROUTINE_REMOTELOGOFF 
NOPARAM_ROUTINE_REMOTENTSECURITY 
NOPARAM_ROUTINE_REMOTESHDWSETUP 
NOPARAM_ROUTINE_REMOTESHDWSTOP 
NOPARAM_ROUTINE_REMOTEPASSTHRUENABLE 
NOPARAM_ROUTINE_REMOTEPASSTHRUDISABLE 
NOPARAM_ROUTINE_REMOTECONNECTSTATE 
NOPARAM_ROUTINE_UPDATEPERUSERIMMENABLING 
NOPARAM_ROUTINE_USERPWRCALLOUTWORKER 
NOPARAM_ROUTINE_WAKERITFORSHTDWN 
NOPARAM_ROUTINE_INIT_MESSAGE_PUMP 
NOPARAM_ROUTINE_UNINIT_MESSAGE_PUMP 
ONEPARAM_ROUTINE_BEGINDEFERWNDPOS 
ONEPARAM_ROUTINE_GETSENDMSGRECVR 
ONEPARAM_ROUTINE_WINDOWFROMDC 
ONEPARAM_ROUTINE_ALLOWSETFOREGND 
ONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT 
ONEPARAM_ROUTINE_CSDDEUNINITIALIZE 
ONEPARAM_ROUTINE_DIRECTEDYIELD 
ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMATS 
ONEPARAM_ROUTINE_GETINPUTEVENT 
ONEPARAM_ROUTINE_GETKEYBOARDLAYOUT 
ONEPARAM_ROUTINE_GETKEYBOARDTYPE 
ONEPARAM_ROUTINE_GETPROCDEFLAYOUT 
ONEPARAM_ROUTINE_GETQUEUESTATUS 
ONEPARAM_ROUTINE_GETWINSTAINFO 
ONEPARAM_ROUTINE_LOCKFOREGNDWINDOW 
ONEPARAM_ROUTINE_LOADFONTS 
ONEPARAM_ROUTINE_MAPDEKTOPOBJECT 
ONEPARAM_ROUTINE_MESSAGEBEEP 
ONEPARAM_ROUTINE_PLAYEVENTSOUND 
ONEPARAM_ROUTINE_POSTQUITMESSAGE 
ONEPARAM_ROUTINE_REALIZEPALETTE 
ONEPARAM_ROUTINE_REGISTERLPK 
ONEPARAM_ROUTINE_REGISTERSYSTEMTHREAD 
ONEPARAM_ROUTINE_REMOTERECONNECT 
ONEPARAM_ROUTINE_REMOTETHINWIRESTATUS 
ONEPARAM_ROUTINE_RELEASEDC 
ONEPARAM_ROUTINE_REMOTENOTIFY 
ONEPARAM_ROUTINE_REPLYMESSAGE 
ONEPARAM_ROUTINE_SETCARETBLINKTIME 
ONEPARAM_ROUTINE_SETDBLCLICKTIME 
ONEPARAM_ROUTINE_SETMESSAGEEXTRAINFO 
ONEPARAM_ROUTINE_SETPROCDEFLAYOUT 
ONEPARAM_ROUTINE_SETWATERMARKSTRINGS 
ONEPARAM_ROUTINE_SHOWCURSOR 
ONEPARAM_ROUTINE_SHOWSTARTGLASS 
ONEPARAM_ROUTINE_SWAPMOUSEBUTTON 
X_ROUTINE_WOWMODULEUNLOAD 
HWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW 
HWND_ROUTINE_DWP_GETENABLEDPOPUP 
HWND_ROUTINE_GETWNDCONTEXTHLPID 
HWND_ROUTINE_REGISTERSHELLHOOKWINDOW 
HWND_ROUTINE_SETMSGBOX 
HWNDOPT_ROUTINE_SETPROGMANWINDOW 
HWNDOPT_ROUTINE_SETTASKMANWINDOW 
HWNDPARAM_ROUTINE_GETCLASSICOCUR 
HWNDPARAM_ROUTINE_CLEARWINDOWSTATE 
HWNDPARAM_ROUTINE_KILLSYSTEMTIMER 
HWNDPARAM_ROUTINE_SETDIALOGPOINTER 
HWNDPARAM_ROUTINE_SETVISIBLE 
HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID 
HWNDPARAM_ROUTINE_SETWINDOWSTATE 
HWNDLOCK_ROUTINE_WINDOWHASSHADOW 
HWNDLOCK_ROUTINE_ARRANGEICONICWINDOWS 
HWNDLOCK_ROUTINE_DRAWMENUBAR 
HWNDLOCK_ROUTINE_CHECKIMESHOWSTATUSINTHRD 
HWNDLOCK_ROUTINE_GETSYSMENUHANDLE 
HWNDLOCK_ROUTINE_REDRAWFRAME 
HWNDLOCK_ROUTINE_REDRAWFRAMEANDHOOK 
HWNDLOCK_ROUTINE_SETDLGSYSMENU 
HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOW 
HWNDLOCK_ROUTINE_SETSYSMENU 
HWNDLOCK_ROUTINE_UPDATECKIENTRECT 
HWNDLOCK_ROUTINE_UPDATEWINDOW 
TWOPARAM_ROUTINE_IMESHOWSTATUSCHANGE 
TWOPARAM_ROUTINE_ENABLEWINDOW 
TWOPARAM_ROUTINE_REDRAWTITLE 
TWOPARAM_ROUTINE_SHOWOWNEDPOPUPS 
TWOPARAM_ROUTINE_SWITCHTOTHISWINDOW 
TWOPARAM_ROUTINE_UPDATEWINDOWS 
TWOPARAM_ROUTINE_VALIDATERGN 
TWOPARAM_ROUTINE_CHANGEWNDMSGFILTER 
TWOPARAM_ROUTINE_GETCURSORPOS 
TWOPARAM_ROUTINE_GETHDEVNAME 
TWOPARAM_ROUTINE_INITANSIOEM 
TWOPARAM_ROUTINE_NLSSENDIMENOTIFY 
TWOPARAM_ROUTINE_REGISTERGHSTWND 
TWOPARAM_ROUTINE_REGISTERLOGONPROCESS 
TWOPARAM_ROUTINE_REGISTERSBLFROSTWND 
TWOPARAM_ROUTINE_REGISTERUSERHUNGAPPHANDLERS 
TWOPARAM_ROUTINE_SHADOWCLEANUP 
TWOPARAM_ROUTINE_REMOTESHADOWSTART 
TWOPARAM_ROUTINE_SETCARETPOS 
TWOPARAM_ROUTINE_SETCURSORPOS 
TWOPARAM_ROUTINE_SETPHYSCURSORPOS 
TWOPARAM_ROUTINE_UNHOOKWINDOWSHOOK 
TWOPARAM_ROUTINE_WOWCLEANUP 

Definition at line 1512 of file ntuser.h.

1513{
1516#if (WIN32K_VERSION >= NTDDI_VISTA)
1521#endif
1523#if (WIN32K_VERSION < NTDDI_VISTA)
1527#endif
1532#if (WIN32K_VERSION >= NTDDI_VISTA)
1534#else
1535 NOPARAM_ROUTINE_GETREMOTEPROCESSID,
1536#endif
1539#if (WIN32K_VERSION >= NTDDI_VISTA)
1542#endif
1557#if (WIN32K_VERSION >= NTDDI_VISTA)
1559#endif
1562#if (WIN32K_VERSION < NTDDI_VISTA)
1564#endif
1566#if (WIN32K_VERSION >= NTDDI_VISTA)
1568#endif
1572#if (WIN32K_VERSION < NTDDI_VISTA)
1573 ONEPARAM_ROUTINE_CREATESYSTEMTHREADS,
1574#endif
1578#if (WIN32K_VERSION < NTDDI_VISTA)
1579 ONEPARAM_ROUTINE_GETCURSORPOS,
1580#endif
1587#if (WIN32K_VERSION < NTDDI_VISTA)
1588 ONEPARAM_ROUTINE_HANDLESYSTHRDCREATFAIL,
1589#endif
1596#if (WIN32K_VERSION < NTDDI_VISTA)
1597 ONEPARAM_ROUTINE_PREPAREFORLOGOFF,
1598#endif
1601#if (WIN32K_VERSION >= NTDDI_VISTA)
1603#endif
1607#if (WIN32K_VERSION >= NTDDI_VISTA)
1609#endif
1613#if (WIN32K_VERSION < NTDDI_VISTA)
1614 ONEPARAM_ROUTINE_SETIMESHOWSTATUS,
1615#endif
1618#if (WIN32K_VERSION >= NTDDI_VISTA)
1620#endif
1625#if (WIN32K_VERSION < NTDDI_VISTA)
1626 X_ROUTINE_REMOTENOTIFY,
1627#endif
1642 HWNDLOCK_ROUTINE_WINDOWHASSHADOW, /* correct prefix ? */
1661#if (WIN32K_VERSION >= NTDDI_VISTA)
1664#endif
1668#if (WIN32K_VERSION >= NTDDI_VISTA)
1670#endif
1672#if (WIN32K_VERSION >= NTDDI_VISTA)
1674#else
1675 TWOPARAM_ROUTINE_REGISTERSYSTEMTHREAD,
1676#endif
1682#if (WIN32K_VERSION >= NTDDI_VISTA)
1684#endif
1687};
@ TWOPARAM_ROUTINE_REGISTERLOGONPROCESS
Definition: ntuser.h:1671
@ ONEPARAM_ROUTINE_DIRECTEDYIELD
Definition: ntuser.h:1576
@ TWOPARAM_ROUTINE_SHOWOWNEDPOPUPS
Definition: ntuser.h:1657
@ HWNDLOCK_ROUTINE_UPDATEWINDOW
Definition: ntuser.h:1653
@ TWOPARAM_ROUTINE_UNHOOKWINDOWSHOOK
Definition: ntuser.h:1685
@ NOPARAM_ROUTINE_INIT_MESSAGE_PUMP
Definition: ntuser.h:1560
@ NOPARAM_ROUTINE_REMOTEDISCONNECT
Definition: ntuser.h:1547
@ NOPARAM_ROUTINE_RESETDBLCLICK
Definition: ntuser.h:1544
@ NOPARAM_ROUTINE_PREPAREFORLOGOFF
Definition: ntuser.h:1541
@ NOPARAM_ROUTINE_ZAPACTIVEANDFOUS
Definition: ntuser.h:1545
@ TWOPARAM_ROUTINE_REDRAWTITLE
Definition: ntuser.h:1656
@ HWNDLOCK_ROUTINE_WINDOWHASSHADOW
Definition: ntuser.h:1642
@ ONEPARAM_ROUTINE_GETKEYBOARDTYPE
Definition: ntuser.h:1583
@ NOPARAM_ROUTINE_HIDECURSORNOCAPTURE
Definition: ntuser.h:1537
@ TWOPARAM_ROUTINE_SWITCHTOTHISWINDOW
Definition: ntuser.h:1658
@ NOPARAM_ROUTINE_CREATEMENUPOPUP
Definition: ntuser.h:1515
@ X_ROUTINE_WOWMODULEUNLOAD
Definition: ntuser.h:1624
@ TWOPARAM_ROUTINE_GETCURSORPOS
Definition: ntuser.h:1663
@ NOPARAM_ROUTINE_HANDLESYSTHRDCREATFAIL
Definition: ntuser.h:1533
@ HWNDPARAM_ROUTINE_SETDIALOGPOINTER
Definition: ntuser.h:1638
@ ONEPARAM_ROUTINE_WINDOWFROMDC
Definition: ntuser.h:1569
@ HWNDPARAM_ROUTINE_KILLSYSTEMTIMER
Definition: ntuser.h:1637
@ HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID
Definition: ntuser.h:1640
@ NOPARAM_ROUTINE_LOADUSERAPIHOOK
Definition: ntuser.h:1540
@ TWOPARAM_ROUTINE_INITANSIOEM
Definition: ntuser.h:1666
@ NOPARAM_ROUTINE_GETINPUTDESKTOP
Definition: ntuser.h:1530
@ TWOPARAM_ROUTINE_ENABLEWINDOW
Definition: ntuser.h:1655
@ ONEPARAM_ROUTINE_MESSAGEBEEP
Definition: ntuser.h:1593
@ HWNDLOCK_ROUTINE_DRAWMENUBAR
Definition: ntuser.h:1644
@ ONEPARAM_ROUTINE_SETPROCDEFLAYOUT
Definition: ntuser.h:1617
@ TWOPARAM_ROUTINE_REMOTESHADOWSTART
Definition: ntuser.h:1679
@ ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMATS
Definition: ntuser.h:1577
@ ONEPARAM_ROUTINE_SETDBLCLICKTIME
Definition: ntuser.h:1612
@ ONEPARAM_ROUTINE_BEGINDEFERWNDPOS
Definition: ntuser.h:1565
@ ONEPARAM_ROUTINE_LOADFONTS
Definition: ntuser.h:1591
@ HWND_ROUTINE_REGISTERSHELLHOOKWINDOW
Definition: ntuser.h:1631
@ NOPARAM_ROUTINE_GETMSESSAGEPOS
Definition: ntuser.h:1531
@ NOPARAM_ROUTINE_USERPWRCALLOUTWORKER
Definition: ntuser.h:1556
@ ONEPARAM_ROUTINE_REGISTERLPK
Definition: ntuser.h:1600
@ ONEPARAM_ROUTINE_GETKEYBOARDLAYOUT
Definition: ntuser.h:1582
@ HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOW
Definition: ntuser.h:1650
@ TWOPARAM_ROUTINE_CHANGEWNDMSGFILTER
Definition: ntuser.h:1662
@ TWOPARAM_ROUTINE_NLSSENDIMENOTIFY
Definition: ntuser.h:1667
@ ONEPARAM_ROUTINE_REMOTERECONNECT
Definition: ntuser.h:1604
@ TWOPARAM_ROUTINE_SHADOWCLEANUP
Definition: ntuser.h:1678
@ HWNDPARAM_ROUTINE_GETCLASSICOCUR
Definition: ntuser.h:1635
@ NOPARAM_ROUTINE_MSQCLEARWAKEMASK
Definition: ntuser.h:1518
@ ONEPARAM_ROUTINE_CSDDEUNINITIALIZE
Definition: ntuser.h:1575
@ NOPARAM_ROUTINE_GETDEVICECHANGEINFO
Definition: ntuser.h:1528
@ ONEPARAM_ROUTINE_POSTQUITMESSAGE
Definition: ntuser.h:1595
@ ONEPARAM_ROUTINE_GETSENDMSGRECVR
Definition: ntuser.h:1567
@ NOPARAM_ROUTINE_REMOTESHDWSTOP
Definition: ntuser.h:1551
@ HWNDLOCK_ROUTINE_SETDLGSYSMENU
Definition: ntuser.h:1649
@ HWND_ROUTINE_SETMSGBOX
Definition: ntuser.h:1632
@ HWNDPARAM_ROUTINE_CLEARWINDOWSTATE
Definition: ntuser.h:1636
@ NOPARAM_ROUTINE_CREATEMENU
Definition: ntuser.h:1514
@ HWNDPARAM_ROUTINE_SETVISIBLE
Definition: ntuser.h:1639
@ ONEPARAM_ROUTINE_REMOTENOTIFY
Definition: ntuser.h:1608
@ TWOPARAM_ROUTINE_UPDATEWINDOWS
Definition: ntuser.h:1659
@ ONEPARAM_ROUTINE_LOCKFOREGNDWINDOW
Definition: ntuser.h:1590
@ HWND_ROUTINE_GETWNDCONTEXTHLPID
Definition: ntuser.h:1630
@ NOPARAM_ROUTINE_REMOTESHDWSETUP
Definition: ntuser.h:1550
@ ONEPARAM_ROUTINE_RELEASEDC
Definition: ntuser.h:1606
@ NOPARAM_ROUTINE_REMOTECONNECTSTATE
Definition: ntuser.h:1554
@ TWOPARAM_ROUTINE_REGISTERUSERHUNGAPPHANDLERS
Definition: ntuser.h:1677
@ ONEPARAM_ROUTINE_SWAPMOUSEBUTTON
Definition: ntuser.h:1623
@ HWNDLOCK_ROUTINE_SETSYSMENU
Definition: ntuser.h:1651
@ NOPARAM_ROUTINE_GETIMESHOWSTATUS
Definition: ntuser.h:1529
@ ONEPARAM_ROUTINE_SETWATERMARKSTRINGS
Definition: ntuser.h:1619
@ HWNDLOCK_ROUTINE_GETSYSMENUHANDLE
Definition: ntuser.h:1646
@ HWNDLOCK_ROUTINE_ARRANGEICONICWINDOWS
Definition: ntuser.h:1643
@ ONEPARAM_ROUTINE_SHOWCURSOR
Definition: ntuser.h:1621
@ ONEPARAM_ROUTINE_SETMESSAGEEXTRAINFO
Definition: ntuser.h:1616
@ NOPARAM_ROUTINE_CREATESYSTEMTHREADS
Definition: ntuser.h:1519
@ NOPARAM_ROUTINE_ENABLEPROCWNDGHSTING
Definition: ntuser.h:1522
@ NOPARAM_ROUTINE_REMOTECONSHDWSTOP
Definition: ntuser.h:1546
@ NOPARAM_ROUTINE_ALLOWFOREGNDACTIVATION
Definition: ntuser.h:1517
@ TWOPARAM_ROUTINE_SETPHYSCURSORPOS
Definition: ntuser.h:1683
@ ONEPARAM_ROUTINE_REALIZEPALETTE
Definition: ntuser.h:1599
@ HWNDLOCK_ROUTINE_REDRAWFRAMEANDHOOK
Definition: ntuser.h:1648
@ NOPARAM_ROUTINE_DESTROY_CARET
Definition: ntuser.h:1520
@ NOPARAM_ROUTINE_REMOTELOGOFF
Definition: ntuser.h:1548
@ ONEPARAM_ROUTINE_PLAYEVENTSOUND
Definition: ntuser.h:1594
@ HWNDLOCK_ROUTINE_CHECKIMESHOWSTATUSINTHRD
Definition: ntuser.h:1645
@ ONEPARAM_ROUTINE_SHOWSTARTGLASS
Definition: ntuser.h:1622
@ HWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW
Definition: ntuser.h:1628
@ ONEPARAM_ROUTINE_REMOTETHINWIRESTATUS
Definition: ntuser.h:1605
@ ONEPARAM_ROUTINE_REPLYMESSAGE
Definition: ntuser.h:1610
@ HWNDLOCK_ROUTINE_REDRAWFRAME
Definition: ntuser.h:1647
@ ONEPARAM_ROUTINE_GETQUEUESTATUS
Definition: ntuser.h:1585
@ HWNDOPT_ROUTINE_SETTASKMANWINDOW
Definition: ntuser.h:1634
@ ONEPARAM_ROUTINE_MAPDEKTOPOBJECT
Definition: ntuser.h:1592
@ NOPARAM_ROUTINE_WAKERITFORSHTDWN
Definition: ntuser.h:1558
@ NOPARAM_ROUTINE_RELEASECAPTURE
Definition: ntuser.h:1543
@ TWOPARAM_ROUTINE_REGISTERSBLFROSTWND
Definition: ntuser.h:1673
@ HWNDLOCK_ROUTINE_UPDATECKIENTRECT
Definition: ntuser.h:1652
@ ONEPARAM_ROUTINE_CREATEEMPTYCUROBJECT
Definition: ntuser.h:1571
@ HWND_ROUTINE_DWP_GETENABLEDPOPUP
Definition: ntuser.h:1629
@ NOPARAM_ROUTINE_UNINIT_MESSAGE_PUMP
Definition: ntuser.h:1561
@ NOPARAM_ROUTINE_UPDATEPERUSERIMMENABLING
Definition: ntuser.h:1555
@ NOPARAM_ROUTINE_LOADCURSANDICOS
Definition: ntuser.h:1538
@ ONEPARAM_ROUTINE_SETCARETBLINKTIME
Definition: ntuser.h:1611
@ TWOPARAM_ROUTINE_VALIDATERGN
Definition: ntuser.h:1660
@ ONEPARAM_ROUTINE_REGISTERSYSTEMTHREAD
Definition: ntuser.h:1602
@ TWOPARAM_ROUTINE_SETCARETPOS
Definition: ntuser.h:1680
@ NOPARAM_ROUTINE_REMOTEPASSTHRUENABLE
Definition: ntuser.h:1552
@ TWOPARAM_ROUTINE_REGISTERGHSTWND
Definition: ntuser.h:1669
@ TWOPARAM_ROUTINE_IMESHOWSTATUSCHANGE
Definition: ntuser.h:1654
@ ONEPARAM_ROUTINE_GETPROCDEFLAYOUT
Definition: ntuser.h:1584
@ TWOPARAM_ROUTINE_WOWCLEANUP
Definition: ntuser.h:1686
@ NOPARAM_ROUTINE_REMOTEPASSTHRUDISABLE
Definition: ntuser.h:1553
@ HWNDOPT_ROUTINE_SETPROGMANWINDOW
Definition: ntuser.h:1633
@ ONEPARAM_ROUTINE_GETINPUTEVENT
Definition: ntuser.h:1581
@ ONEPARAM_ROUTINE_GETWINSTAINFO
Definition: ntuser.h:1586
@ ONEPARAM_ROUTINE_ALLOWSETFOREGND
Definition: ntuser.h:1570
@ NOPARAM_ROUTINE_REMOTENTSECURITY
Definition: ntuser.h:1549
@ HWNDPARAM_ROUTINE_SETWINDOWSTATE
Definition: ntuser.h:1641
@ TWOPARAM_ROUTINE_SETCURSORPOS
Definition: ntuser.h:1681
@ TWOPARAM_ROUTINE_GETHDEVNAME
Definition: ntuser.h:1665

◆ ThreadStateRoutines

Enumerator
THREADSTATE_FOCUSWINDOW 
THREADSTATE_ACTIVEWINDOW 
THREADSTATE_CAPTUREWINDOW 
THREADSTATE_DEFAULTIMEWINDOW 
THREADSTATE_DEFAULTINPUTCONTEXT 
THREADSTATE_GETINPUTSTATE 
THREADSTATE_GETCURSOR 
THREADSTATE_CHANGEBITS 
THREADSTATE_UPTIMELASTREAD 
THREADSTATE_GETMESSAGEEXTRAINFO 
THREADSTATE_INSENDMESSAGE 
THREADSTATE_GETMESSAGETIME 
THREADSTATE_FOREGROUNDTHREAD 
THREADSTATE_IMECOMPATFLAGS 
THREADSTATE_OLDKEYBOARDLAYOUT 
THREADSTATE_ISWINLOGON 
THREADSTATE_UNKNOWN_0x10 
THREADSTATE_CHECKCONIME 
THREADSTATE_GETTHREADINFO 
THREADSTATE_PROGMANWINDOW 
THREADSTATE_TASKMANWINDOW 

Definition at line 2487 of file ntuser.h.

2488{
2508 THREADSTATE_PROGMANWINDOW, /* FIXME: Delete this HACK */
2509 THREADSTATE_TASKMANWINDOW, /* FIXME: Delete this HACK */
2510};
@ THREADSTATE_GETCURSOR
Definition: ntuser.h:2495
@ THREADSTATE_DEFAULTIMEWINDOW
Definition: ntuser.h:2492
@ THREADSTATE_DEFAULTINPUTCONTEXT
Definition: ntuser.h:2493
@ THREADSTATE_CHECKCONIME
Definition: ntuser.h:2506
@ THREADSTATE_INSENDMESSAGE
Definition: ntuser.h:2499
@ THREADSTATE_GETTHREADINFO
Definition: ntuser.h:2507
@ THREADSTATE_CAPTUREWINDOW
Definition: ntuser.h:2491
@ THREADSTATE_TASKMANWINDOW
Definition: ntuser.h:2509
@ THREADSTATE_UNKNOWN_0x10
Definition: ntuser.h:2505
@ THREADSTATE_FOREGROUNDTHREAD
Definition: ntuser.h:2501
@ THREADSTATE_OLDKEYBOARDLAYOUT
Definition: ntuser.h:2503
@ THREADSTATE_GETINPUTSTATE
Definition: ntuser.h:2494
@ THREADSTATE_PROGMANWINDOW
Definition: ntuser.h:2508
@ THREADSTATE_ACTIVEWINDOW
Definition: ntuser.h:2490
@ THREADSTATE_GETMESSAGETIME
Definition: ntuser.h:2500
@ THREADSTATE_FOCUSWINDOW
Definition: ntuser.h:2489
@ THREADSTATE_GETMESSAGEEXTRAINFO
Definition: ntuser.h:2498
@ THREADSTATE_ISWINLOGON
Definition: ntuser.h:2504
@ THREADSTATE_UPTIMELASTREAD
Definition: ntuser.h:2497
@ THREADSTATE_CHANGEBITS
Definition: ntuser.h:2496
@ THREADSTATE_IMECOMPATFLAGS
Definition: ntuser.h:2502

Function Documentation

◆ _Success_()

_Success_ ( return = 0) -> Buffer, _Out_z_bytecap_post_bytecount_(pustrName->MaximumLength, return * 2 + 2)) ULONG APIENTRY NtUserGetAtomName( _In_ ATOM atom, _Inout_ PUNICODE_STRING pustrName)

Definition at line 1028 of file fsctrl.c.

3189{
3191
3192 PVPB Vpb = Vcb->Vpb;
3193 PVPB OldVpb;
3194
3195 BOOLEAN Remount = FALSE;
3196
3197 PAGED_CODE();
3198
3199 UNREFERENCED_PARAMETER( IrpContext );
3200
3201 //
3202 // Check whether we are looking for a device only Mvcb.
3203 //
3204
3205 for (Link = CdData.VcbQueue.Flink;
3206 Link != &CdData.VcbQueue;
3207 Link = Link->Flink) {
3208
3209 *OldVcb = CONTAINING_RECORD( Link, VCB, VcbLinks );
3210
3211 //
3212 // Skip ourselves.
3213 //
3214
3215 if (Vcb == *OldVcb) { continue; }
3216
3217 //
3218 // Look at the Vpb and state of the previous Vcb.
3219 //
3220
3221 OldVpb = (*OldVcb)->Vpb;
3222
3223 if ((OldVpb != Vpb) &&
3224 (OldVpb->RealDevice == Vpb->RealDevice) &&
3225 ((*OldVcb)->VcbCondition == VcbNotMounted)) {
3226
3227 //
3228 // If the current disk is a raw disk then it can match a previous music or
3229 // raw disk.
3230 //
3231
3232 if (FlagOn( Vcb->VcbState, VCB_STATE_AUDIO_DISK)) {
3233
3234 if (FlagOn( (*OldVcb)->VcbState, VCB_STATE_AUDIO_DISK )) {
3235
3236 //
3237 // If we have both TOC then fail the remount if the lengths
3238 // are different or they don't match.
3239 //
3240
3241 if ((Vcb->TocLength != (*OldVcb)->TocLength) ||
3242 ((Vcb->TocLength != 0) &&
3243 !RtlEqualMemory( Vcb->CdromToc,
3244 (*OldVcb)->CdromToc,
3245 Vcb->TocLength ))) {
3246
3247 continue;
3248 }
3249
3250 Remount = TRUE;
3251 break;
3252 }
3253
3254 //
3255 // The current disk is not a raw disk. Go ahead and compare
3256 // serial numbers, volume label and TOC.
3257 //
3258
3259 }
3260 else if ((OldVpb->SerialNumber == Vpb->SerialNumber) &&
3261 (Vcb->TocLength == (*OldVcb)->TocLength) &&
3262 ((Vcb->TocLength == 0) || RtlEqualMemory( Vcb->CdromToc,
3263 (*OldVcb)->CdromToc,
3264 Vcb->TocLength )) &&
3265 (Vpb->VolumeLabelLength == OldVpb->VolumeLabelLength) &&
3266 (RtlEqualMemory( OldVpb->VolumeLabel,
3267 Vpb->VolumeLabel,
3268 Vpb->VolumeLabelLength ))) {
3269 //
3270 // Remember the old Vcb. Then set the return value to
3271 // TRUE and break.
3272 //
3273
3274 Remount = TRUE;
3275 break;
3276 }
3277 }
3278 }
3279
3280 return Remount;
3281}
#define PAGED_CODE()
unsigned char BOOLEAN
Definition: actypes.h:127
CD_DATA CdData
Definition: cddata.c:42
#define VCB_STATE_AUDIO_DISK
Definition: cdstruc.h:712
@ VcbNotMounted
Definition: cdstruc.h:490
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
IN OUT PVCB IN PDEVICE_OBJECT IN PVPB Vpb
Definition: fatprocs.h:1676
#define RtlEqualMemory(dst, src, len)
Definition: kdvm.h:18
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
#define Vcb
Definition: cdprocs.h:1415
LIST_ENTRY VcbQueue
Definition: cdstruc.h:334
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
Definition: cdstruc.h:498
Definition: iotypes.h:189
WCHAR VolumeLabel[MAXIMUM_VOLUME_LABEL_LENGTH/sizeof(WCHAR)]
Definition: iotypes.h:198
USHORT VolumeLabelLength
Definition: iotypes.h:193
ULONG SerialNumber
Definition: iotypes.h:196
struct _DEVICE_OBJECT * RealDevice
Definition: iotypes.h:195
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
static int Link(const char **args)
Definition: vfdcmd.c:2414

◆ C_ASSERT() [1/8]

C_ASSERT ( offsetof(IMC, dwClientImcData)  = =0x18)

◆ C_ASSERT() [2/8]

C_ASSERT ( offsetof(IMC, head.cLockObj)  = =0x4)

◆ C_ASSERT() [3/8]

C_ASSERT ( offsetof(IMC, head.h = =0x0)

◆ C_ASSERT() [4/8]

C_ASSERT ( offsetof(IMC, head.pti)  = =0x8)

◆ C_ASSERT() [5/8]

C_ASSERT ( offsetof(IMC, hImeWnd)  = =0x1c)

◆ C_ASSERT() [6/8]

C_ASSERT ( offsetof(IMC, pImcNext)  = =0x14)

◆ C_ASSERT() [7/8]

C_ASSERT ( sizeof(CLIENTINFO)<=sizeof(((PTEB) 0) ->Win32ClientInfo)  )

◆ C_ASSERT() [8/8]

C_ASSERT ( sizeof(WND) % sizeof(PVOID = =0)

◆ GetW32ProcessInfo()

◆ GetW32ThreadInfo()

◆ NtUserActivateKeyboardLayout()

HKL NTAPI NtUserActivateKeyboardLayout ( HKL  hKL,
ULONG  Flags 
)

Definition at line 1226 of file kbdlayout.c.

1229{
1230 PWINSTATION_OBJECT pWinSta;
1231 HKL hOldKL;
1232
1234
1235 /* FIXME */
1236
1238 hOldKL = co_IntActivateKeyboardLayout(pWinSta, hKL, Flags, NULL);
1239 UserLeave();
1240
1241 return hOldKL;
1242}
#define NULL
Definition: types.h:112
UINT_PTR HKL
Definition: msctf.idl:125
PWINSTATION_OBJECT FASTCALL IntGetProcessWindowStation(HWINSTA *phWinSta OPTIONAL)
Definition: winsta.c:410
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:255
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:247
HKL APIENTRY co_IntActivateKeyboardLayout(_Inout_ PWINSTATION_OBJECT pWinSta, _In_ HKL hKL, _In_ ULONG uFlags, _In_opt_ PWND pWnd)
Definition: kbdlayout.c:782
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by LoadKeyboardLayoutW(), and User32DefWindowProc().

◆ NtUserAlterWindowStyle()

DWORD NTAPI NtUserAlterWindowStyle ( HWND  hWnd,
DWORD  Index,
LONG  NewValue 
)

Definition at line 4100 of file window.c.

4101{
4102 LONG ret;
4103
4105
4106 if (hWnd == IntGetDesktopWindow())
4107 {
4109 UserLeave();
4110 return 0;
4111 }
4112
4113 ret = co_IntSetWindowLongPtr(hWnd, Index, NewValue, FALSE, sizeof(LONG), TRUE);
4114
4115 UserLeave();
4116
4117 return ret;
4118}
HWND hWnd
Definition: settings.c:17
return ret
Definition: mutex.c:146
long LONG
Definition: pedump.c:60
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
_In_ WDFCOLLECTION _In_ ULONG Index
HWND FASTCALL IntGetDesktopWindow(VOID)
Definition: desktop.c:1391
static LONG_PTR co_IntSetWindowLongPtr(HWND hWnd, DWORD Index, LONG_PTR NewValue, BOOL Ansi, ULONG Size, BOOL bAlter)
Definition: window.c:3836
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:21

Referenced by ButtonWndProc_common().

◆ NtUserAssociateInputContext()

DWORD NTAPI NtUserAssociateInputContext ( _In_ HWND  hWnd,
_In_opt_ HIMC  hIMC,
_In_ DWORD  dwFlags 
)

Definition at line 1795 of file ime.c.

1799{
1800 DWORD ret = 2;
1801 PWND pWnd;
1802 PIMC pIMC;
1803
1805
1806 if (!IS_IMM_MODE())
1807 {
1808 ERR("!IS_IMM_MODE()\n");
1809 goto Quit;
1810 }
1811
1812 pWnd = ValidateHwndNoErr(hWnd);
1813 if (!pWnd)
1814 {
1815 ERR("Invalid HWND: %p\n", hWnd);
1816 goto Quit;
1817 }
1818
1819 pIMC = (hIMC ? UserGetObjectNoErr(gHandleTable, hIMC, TYPE_INPUTCONTEXT) : NULL);
1820 ret = IntAssociateInputContextEx(pWnd, pIMC, dwFlags);
1821
1822Quit:
1823 UserLeave();
1824 return ret;
1825}
#define ERR(fmt,...)
Definition: precomp.h:57
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IS_IMM_MODE()
Definition: ntuser.h:1212
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
Definition: netsh.h:141
static DWORD FASTCALL IntAssociateInputContextEx(_In_ PWND pWnd, _In_ PIMC pIMC, _In_ DWORD dwFlags)
Definition: ime.c:1729
Definition: ntuser.h:694
Definition: ntuser.h:199
#define ValidateHwndNoErr(hwnd)
Definition: precomp.h:97
PUSER_HANDLE_TABLE gHandleTable
Definition: object.c:13
PVOID UserGetObjectNoErr(PUSER_HANDLE_TABLE ht, HANDLE handle, HANDLE_TYPE type)
Definition: object.c:481

Referenced by ImmAssociateContext(), and ImmAssociateContextEx().

◆ NtUserAttachThreadInput()

BOOL NTAPI NtUserAttachThreadInput ( IN DWORD  idAttach,
IN DWORD  idAttachTo,
IN BOOL  fAttach 
)

Definition at line 680 of file input.c.

684{
686 PTHREADINFO pti, ptiTo;
687 BOOL Ret = FALSE;
688
690 TRACE("Enter NtUserAttachThreadInput %s\n",(fAttach ? "TRUE" : "FALSE" ));
691
692 pti = IntTID2PTI(UlongToHandle(idAttach));
693 ptiTo = IntTID2PTI(UlongToHandle(idAttachTo));
694
695 if ( !pti || !ptiTo )
696 {
697 TRACE("AttachThreadInput pti or ptiTo NULL.\n");
699 goto Exit;
700 }
701
702 Status = UserAttachThreadInput( pti, ptiTo, fAttach);
703 if (!NT_SUCCESS(Status))
704 {
705 TRACE("AttachThreadInput Error Status 0x%x. \n",Status);
707 }
708 else Ret = TRUE;
709
710Exit:
711 TRACE("Leave NtUserAttachThreadInput, ret=%d\n",Ret);
712 UserLeave();
713 return Ret;
714}
LONG NTSTATUS
Definition: precomp.h:26
#define UlongToHandle(ul)
Definition: basetsd.h:91
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
unsigned int BOOL
Definition: ntddk_ex.h:94
Status
Definition: gdiplustypes.h:25
static void Exit(void)
Definition: sock.c:1330
#define TRACE(s)
Definition: solgame.cpp:4
NTSTATUS FASTCALL UserAttachThreadInput(PTHREADINFO ptiFrom, PTHREADINFO ptiTo, BOOL fAttach)
Definition: input.c:495
PTHREADINFO FASTCALL IntTID2PTI(HANDLE id)
Definition: misc.c:41
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)

◆ NtUserBeginPaint()

HDC NTAPI NtUserBeginPaint ( HWND  hWnd,
PAINTSTRUCT lPs 
)

Definition at line 1612 of file painting.c.

1613{
1614 PWND Window;
1615 PAINTSTRUCT Ps;
1617 HDC hDC;
1619 HDC Ret = NULL;
1620
1621 TRACE("Enter NtUserBeginPaint\n");
1623
1625 {
1626 goto Cleanup; // Return NULL
1627 }
1628
1629 UserRefObjectCo(Window, &Ref);
1630
1631 hDC = IntBeginPaint(Window, &Ps);
1632
1633 Status = MmCopyToCaller(UnsafePs, &Ps, sizeof(PAINTSTRUCT));
1634 if (! NT_SUCCESS(Status))
1635 {
1637 goto Cleanup; // Return NULL
1638 }
1639
1640 Ret = hDC;
1641
1642Cleanup:
1644
1645 TRACE("Leave NtUserBeginPaint, ret=%p\n", Ret);
1646 UserLeave();
1647 return Ret;
1648}
static HDC hDC
Definition: 3dtext.c:33
static const WCHAR Cleanup[]
Definition: register.c:80
#define MmCopyToCaller(x, y, z)
Definition: mmcopy.h:19
static HDC
Definition: imagelist.c:88
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:43
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:27
Definition: window.c:28
Definition: object.h:4
HDC FASTCALL IntBeginPaint(PWND Window, PPAINTSTRUCT Ps)
Definition: painting.c:1441
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:123
VOID FASTCALL SetLastNtError(_In_ NTSTATUS Status)
Definition: error.c:30

Referenced by BeginPaint().

◆ NtUserBitBltSysBmp()

BOOL NTAPI NtUserBitBltSysBmp ( HDC  hdc,
INT  nXDest,
INT  nYDest,
INT  nWidth,
INT  nHeight,
INT  nXSrc,
INT  nYSrc,
DWORD  dwRop 
)

Definition at line 17 of file ntstubs.c.

26{
27 BOOL Ret = FALSE;
29
30 Ret = NtGdiBitBlt( hdc,
31 nXDest,
32 nYDest,
33 nWidth,
34 nHeight,
36 nXSrc,
37 nYSrc,
38 dwRop,
40 0);
41
42 UserLeave();
43 return Ret;
44}
HDC hSystemBM
Definition: stockobj.c:52
HDC hdc
Definition: main.c:9
__kernel_entry W32KAPI BOOL APIENTRY NtGdiBitBlt(_In_ HDC hdcDst, _In_ INT x, _In_ INT y, _In_ INT cx, _In_ INT cy, _In_opt_ HDC hdcSrc, _In_ INT xSrc, _In_ INT ySrc, _In_ DWORD rop4, _In_ DWORD crBackColor, _In_ FLONG fl)
#define CLR_INVALID
Definition: wingdi.h:883

◆ NtUserBlockInput()

BOOL NTAPI NtUserBlockInput ( BOOL  BlockIt)

Definition at line 435 of file input.c.

437{
438 BOOL ret;
439
440 TRACE("Enter NtUserBlockInput\n");
442
444
445 UserLeave();
446 TRACE("Leave NtUserBlockInput, ret=%i\n", ret);
447
448 return ret;
449}
BOOL FASTCALL IntBlockInput(PTHREADINFO pti, BOOL BlockIt)
Definition: input.c:391

Referenced by BlockInput().

◆ NtUserBuildHimcList()

NTSTATUS NTAPI NtUserBuildHimcList ( _In_ DWORD  dwThreadId,
_In_ DWORD  dwCount,
_Out_ HIMC phList,
_Out_ PDWORD  pdwCount 
)

Definition at line 733 of file ime.c.

738{
740 DWORD dwRealCount;
741 PTHREADINFO pti;
742
744
745 if (!IS_IMM_MODE())
746 {
747 ERR("!IS_IMM_MODE()\n");
749 goto Quit;
750 }
751
752 if (dwThreadId == 0)
753 {
754 pti = gptiCurrent;
755 }
756 else if (dwThreadId == INVALID_THREAD_ID)
757 {
758 pti = NULL;
759 }
760 else
761 {
763 if (!pti || !pti->rpdesk)
764 goto Quit;
765 }
766
768 {
769 ProbeForWrite(phList, dwCount * sizeof(HIMC), 1);
770 ProbeForWrite(pdwCount, sizeof(DWORD), 1);
771 *pdwCount = dwRealCount = UserBuildHimcList(pti, dwCount, phList);
772 }
774 {
775 ERR("Exception in NtUserBuildHimcList: %p, %p\n", phList, pdwCount);
776 _SEH2_YIELD(goto Quit);
777 }
778 _SEH2_END;
779
780 if (dwCount < dwRealCount)
782 else
784
785Quit:
786 UserLeave();
787 return ret;
788}
DWORD HIMC
Definition: dimm.idl:75
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
DWORD dwThreadId
Definition: fdebug.c:31
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define INVALID_THREAD_ID
Definition: ime.c:16
DWORD FASTCALL UserBuildHimcList(_Inout_ PTHREADINFO pti, _In_ DWORD dwCount, _Inout_ HIMC *phList)
Definition: ime.c:567
PTHREADINFO gptiCurrent
Definition: ntuser.c:15
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:104
#define _SEH2_END
Definition: pseh2_64.h:194
#define _SEH2_TRY
Definition: pseh2_64.h:93
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:207
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
struct _DESKTOP * rpdesk
Definition: win32.h:92
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132

Referenced by Imm32BuildHimcList().

◆ NtUserBuildHwndList()

NTSTATUS NTAPI NtUserBuildHwndList ( HDESK  hDesktop,
HWND  hwndParent,
BOOLEAN  bChildren,
ULONG  dwThreadId,
ULONG  cHwnd,
HWND phwndList,
ULONG pcHwndNeeded 
)

Definition at line 1515 of file window.c.

1523{
1525 ULONG dwCount = 0;
1526
1527 if (pcHwndNeeded == NULL)
1529
1531
1532 if (hwndParent || !dwThreadId)
1533 {
1536
1537 if(!hwndParent)
1538 {
1539 if(hDesktop == NULL && !(Desktop = IntGetActiveDesktop()))
1540 {
1542 goto Quit;
1543 }
1544
1545 if(hDesktop)
1546 {
1548 UserMode,
1549 0,
1550 &Desktop);
1551 if(!NT_SUCCESS(Status))
1552 {
1554 goto Quit;
1555 }
1556 }
1557 hwndParent = Desktop->DesktopWindow;
1558 }
1559 else
1560 {
1561 hDesktop = 0;
1562 }
1563
1565 (Window = Parent->spwndChild))
1566 {
1567 BOOL bGoDown = TRUE;
1568
1570 while(TRUE)
1571 {
1572 if (bGoDown)
1573 {
1574 if (dwCount++ < cHwnd && phwndList)
1575 {
1576 _SEH2_TRY
1577 {
1578 ProbeForWrite(phwndList, sizeof(HWND), 1);
1579 *phwndList = UserHMGetHandle(Window);
1580 phwndList++;
1581 }
1583 {
1585 }
1586 _SEH2_END
1587 if(!NT_SUCCESS(Status))
1588 {
1589 break;
1590 }
1591 }
1592 if (Window->spwndChild && bChildren)
1593 {
1594 Window = Window->spwndChild;
1595 continue;
1596 }
1597 bGoDown = FALSE;
1598 }
1599 if (Window->spwndNext)
1600 {
1601 Window = Window->spwndNext;
1602 bGoDown = TRUE;
1603 continue;
1604 }
1605 Window = Window->spwndParent;
1606 if (Window == Parent)
1607 {
1608 break;
1609 }
1610 }
1611 }
1612
1613 if(hDesktop)
1614 {
1616 }
1617 }
1618 else // Build EnumThreadWindows list!
1619 {
1621 PTHREADINFO W32Thread;
1622 PWND Window;
1623 HWND *List = NULL;
1624
1626 if (!NT_SUCCESS(Status))
1627 {
1628 ERR("Thread Id is not valid!\n");
1630 goto Quit;
1631 }
1632 if (!(W32Thread = (PTHREADINFO)Thread->Tcb.Win32Thread))
1633 {
1635 TRACE("Tried to enumerate windows of a non gui thread\n");
1637 goto Quit;
1638 }
1639
1640 // Do not use Thread link list due to co_UserFreeWindow!!!
1641 // Current = W32Thread->WindowListHead.Flink;
1642 // Fixes Api:CreateWindowEx tests!!!
1644 if (List)
1645 {
1646 int i;
1647 for (i = 0; List[i]; i++)
1648 {
1650 if (Window && Window->head.pti == W32Thread)
1651 {
1652 if (dwCount < cHwnd && phwndList)
1653 {
1654 _SEH2_TRY
1655 {
1656 ProbeForWrite(phwndList, sizeof(HWND), 1);
1657 *phwndList = UserHMGetHandle(Window);
1658 phwndList++;
1659 }
1661 {
1663 }
1664 _SEH2_END
1665 if (!NT_SUCCESS(Status))
1666 {
1667 ERR("Failure to build window list!\n");
1668 break;
1669 }
1670 }
1671 dwCount++;
1672 }
1673 }
1675 }
1676
1678 }
1679
1680 *pcHwndNeeded = dwCount;
1682
1683Quit:
1685 UserLeave();
1686 return Status;
1687}
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:732
static HWND hwndParent
Definition: cryptui.c:300
#define STATUS_INVALID_HANDLE
Definition: d3dkmdt.h:40
static CHAR Desktop[MAX_PATH]
Definition: dem.c:256
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define UserHMGetHandle(obj)
Definition: ntuser.h:230
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
#define UserMode
Definition: asm.h:39
NTSTATUS NTAPI PsLookupThreadByThreadId(IN HANDLE ThreadId, OUT PETHREAD *Thread)
Definition: thread.c:643
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:204
KTHREAD Tcb
Definition: pstypes.h:1187
PVOID Win32Thread
Definition: ketypes.h:1994
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
PDESKTOP FASTCALL IntGetActiveDesktop(VOID)
Definition: desktop.c:1279
PWND FASTCALL UserGetDesktopWindow(VOID)
Definition: desktop.c:1402
NTSTATUS FASTCALL IntValidateDesktopHandle(HDESK Desktop, KPROCESSOR_MODE AccessMode, ACCESS_MASK DesiredAccess, PDESKTOP *Object)
Definition: desktop.c:1254
#define USERTAG_WINDOWLIST
Definition: tags.h:298
HWND *FASTCALL IntWinListChildren(PWND Window)
Definition: window.c:275
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:123
#define ObDereferenceObject
Definition: obfuncs.h:203

Referenced by enum_windows(), User32EnumWindows(), and WIN_ListChildren().

◆ NtUserBuildNameList()

NTSTATUS NTAPI NtUserBuildNameList ( HWINSTA  hWinSta,
ULONG  dwSize,
PVOID  lpBuffer,
PULONG  pRequiredSize 
)

Definition at line 1947 of file winsta.c.

1952{
1953 /* The WindowStation name list and desktop name list are build in completely
1954 different ways. Call the appropriate function */
1955 return NULL == hWindowStation ? BuildWindowStationNameList(dwSize, lpBuffer, pRequiredSize) :
1956 BuildDesktopNameList(hWindowStation, dwSize, lpBuffer, pRequiredSize);
1957}
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
_Out_ LPWSTR lpBuffer
Definition: netsh.h:68
static NTSTATUS FASTCALL BuildWindowStationNameList(ULONG dwSize, PVOID lpBuffer, PULONG pRequiredSize)
Definition: winsta.c:1632
static NTSTATUS FASTCALL BuildDesktopNameList(HWINSTA hWindowStation, ULONG dwSize, PVOID lpBuffer, PULONG pRequiredSize)
Definition: winsta.c:1820

Referenced by EnumNamesW().

◆ NtUserBuildPropList()

NTSTATUS NTAPI NtUserBuildPropList ( HWND  hWnd,
LPVOID  Buffer,
DWORD  BufferSize,
DWORD Count 
)

◆ NtUserCalcMenuBar()

DWORD NTAPI NtUserCalcMenuBar ( HWND  hwnd,
DWORD  x,
DWORD  width,
DWORD  y,
LPRECT  prc 
)

Definition at line 5564 of file menu.c.

5570{
5571 HDC hdc;
5572 PWND Window;
5573 RECT Rect;
5574 DWORD ret;
5575
5577
5579 {
5580 UserLeave();
5582 return 0;
5583 }
5584
5586 if (!hdc)
5587 {
5588 UserLeave();
5589 return 0;
5590 }
5591
5592 Rect.left = leftBorder;
5593 Rect.right = Window->rcWindow.right - Window->rcWindow.left - rightBorder;
5594 Rect.top = top;
5595 Rect.bottom = 0;
5596
5598
5599 UserReleaseDC( 0, hdc, FALSE );
5600
5601 UserLeave();
5602 return ret;
5603}
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
INT FASTCALL UserReleaseDC(PWND Window, HDC hDc, BOOL EndPaint)
Definition: windc.c:918
HDC FASTCALL UserGetDCEx(PWND Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
UINT MENU_DrawMenuBar(HDC hDC, LPRECT lprect, PWND pWnd, BOOL suppress_draw)
Definition: menu.c:2742
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define ERROR_INVALID_WINDOW_HANDLE
Definition: winerror.h:1226
#define DCX_CACHE
Definition: winuser.h:2150

◆ NtUserCallHwnd()

DWORD_PTR NTAPI NtUserCallHwnd ( HWND  hWnd,
DWORD  Routine 
)

Definition at line 711 of file simplecall.c.

714{
715 switch (Routine)
716 {
718 {
719 PWND Window;
720 DWORD HelpId;
721
723
725 {
726 UserLeave();
727 return 0;
728 }
729
731
732 UserLeave();
733 return HelpId;
734 }
735
737 if (IntIsWindow(hWnd))
739 return FALSE;
740 break;
741
743 if (IntIsWindow(hWnd))
745 return FALSE;
746
748 {
749 PWND Window;
752 {
753 Window->state |= WNDS_MSGBOX;
754 }
755 UserLeave();
756 return FALSE;
757 }
758
760 {
761 PWND pWnd;
764 if (pWnd)
765 pWnd = DWP_GetEnabledPopup(pWnd);
766 UserLeave();
767 return (DWORD_PTR)pWnd;
768 }
769 }
770
771 STUB;
772
773 return 0;
774}
#define HandleToUlong(h)
Definition: basetsd.h:73
PSERVERINFO gpsi
Definition: imm.c:18
#define WNDS_MSGBOX
Definition: ntuser.h:610
#define STUB
Definition: kernel32.h:27
PWND FASTCALL DWP_GetEnabledPopup(PWND pWnd)
Definition: defwnd.c:494
VOID FASTCALL UserEnterShared(VOID)
Definition: ntuser.c:241
ATOM atomContextHelpIdProp
Definition: ntuser.h:1067
uint32_t DWORD_PTR
Definition: typedefs.h:65
BOOL IntDeRegisterShellHookWindow(HWND hWnd)
Definition: desktop.c:1798
BOOL IntRegisterShellHookWindow(HWND hWnd)
Definition: desktop.c:1766
HANDLE FASTCALL UserGetProp(_In_ PWND Window, _In_ ATOM Atom, _In_ BOOLEAN SystemProp)
Definition: prop.c:46
BOOL FASTCALL IntIsWindow(HWND hWnd)
Definition: window.c:177

Referenced by GetWindow(), NtUserxDeregisterShellHookWindow(), NtUserxGetWindowContextHelpId(), NtUserxRegisterShellHookWindow(), NtUserxSetMessageBox(), START_TEST(), Test_HwndParamRoutine_SetWindowContextHelpId(), Test_HwndRoutine_DeregisterShellHookWindow(), Test_HwndRoutine_GetWindowContextHelpId(), Test_HwndRoutine_SetMsgBox(), WIN_GetFullHandle(), WIN_IsCurrentProcess(), and WIN_IsCurrentThread().

◆ NtUserCallHwndLock()

BOOL NTAPI NtUserCallHwndLock ( HWND  hWnd,
DWORD  Routine 
)

Definition at line 585 of file simplecall.c.

588{
589 BOOL Ret = FALSE;
590 PWND Window;
592
593 TRACE("Enter NtUserCallHwndLock\n");
595
597 {
598 Ret = FALSE;
599 goto Exit;
600 }
601
602 UserRefObjectCo(Window, &Ref);
603
604 /* FIXME: Routine can be 0x53 - 0x5E */
605 switch (Routine)
606 {
609 break;
610
612 {
613 TRACE("HWNDLOCK_ROUTINE_DRAWMENUBAR\n");
614 Ret = TRUE;
615 if ((Window->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
618 0, 0, 0, 0,
619 SWP_NOSIZE |
620 SWP_NOMOVE |
624 break;
625 }
626
630 0, 0, 0, 0,
631 SWP_NOSIZE |
632 SWP_NOMOVE |
636 Ret = TRUE;
637 break;
638
642 0, 0, 0, 0,
643 SWP_NOSIZE |
644 SWP_NOMOVE |
648 if (!Window->spwndOwner && !IntGetParent(Window))
649 {
650 co_IntShellHookNotify(HSHELL_REDRAW, (WPARAM)hWnd, FALSE); // FIXME Flashing?
651 }
652 Ret = TRUE;
653 break;
654
656 TRACE("co_IntSetForegroundWindow 1 0x%p\n", hWnd);
658 TRACE("co_IntSetForegroundWindow 2 0x%p\n", hWnd);
659 break;
660
662 TRACE("co_IntSetForegroundWindow M 1 0x%p\n", hWnd);
664 TRACE("co_IntSetForegroundWindow M 2 0x%p\n", hWnd);
665 break;
666
669 Ret = TRUE;
670 break;
671
674 break;
675 }
676
678
679Exit:
680 TRACE("Leave NtUserCallHwndLock, ret=%u\n", Ret);
681 UserLeave();
682
683 return Ret;
684}
BOOL FASTCALL co_IntSetForegroundWindow(PWND Window)
Definition: focus.c:1545
BOOL FASTCALL co_IntSetForegroundWindowMouse(PWND Window)
Definition: focus.c:1556
#define HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOWMOUSE
Definition: ntuser.h:3607
UINT_PTR WPARAM
Definition: minwindef.h:174
VOID FASTCALL IntCheckImeShowStatusInThread(_In_ PWND pImeWnd)
Definition: ime.c:2527
UINT FASTCALL co_WinPosArrangeIconicWindows(PWND parent)
Definition: winpos.c:737
BOOLEAN FASTCALL co_WinPosSetWindowPos(PWND Window, HWND WndInsertAfter, INT x, INT y, INT cx, INT cy, UINT flags)
Definition: winpos.c:1792
#define WS_CHILD
Definition: pedump.c:617
#define WS_POPUP
Definition: pedump.c:616
VOID FASTCALL co_IntUpdateWindows(PWND Wnd, ULONG Flags, BOOL Recurse)
Definition: painting.c:519
VOID co_IntShellHookNotify(WPARAM Message, WPARAM wParam, LPARAM lParam)
Definition: desktop.c:1704
PWND FASTCALL IntGetParent(PWND Wnd)
Definition: window.c:205
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define SWP_FRAMECHANGED
Definition: winuser.h:1251
#define SWP_NOMOVE
Definition: winuser.h:1255
#define SWP_NOSIZE
Definition: winuser.h:1256
#define HWND_DESKTOP
Definition: winuser.h:1220
#define RDW_ALLCHILDREN
Definition: winuser.h:1232
#define SWP_NOZORDER
Definition: winuser.h:1258

Referenced by ImeWnd_OnImeSetContext(), NtUserxArrangeIconicWindows(), NtUserxDrawMenuBar(), NtUserxMDIRedrawFrame(), NtUserxSetForegroundWindow(), NtUserxUpdateWindow(), START_TEST(), Test_HwndLockRoutine_CheckImeShowStatusInThread(), Test_HwndLockRoutine_DrawMenuBar(), Test_HwndLockRoutine_GetSysMenuHandle(), and Test_HwndLockRoutine_UpdateWindow().

◆ NtUserCallHwndOpt()

HWND NTAPI NtUserCallHwndOpt ( HWND  hWnd,
DWORD  Routine 
)

Definition at line 691 of file simplecall.c.

694{
695 switch (Routine)
696 {
698 GetW32ThreadInfo()->pDeskInfo->hProgmanWindow = hWnd;
699 break;
700
702 GetW32ThreadInfo()->pDeskInfo->hTaskManWindow = hWnd;
703 break;
704 }
705
706 return hWnd;
707}
struct _THREADINFO * GetW32ThreadInfo(VOID)
Definition: misc.c:806

Referenced by NtUserxSetProgmanWindow(), and NtUserxSetTaskmanWindow().

◆ NtUserCallHwndParam()

DWORD NTAPI NtUserCallHwndParam ( HWND  hWnd,
DWORD_PTR  Param,
DWORD  Routine 
)

Definition at line 778 of file simplecall.c.

782{
783
784 switch (Routine)
785 {
787 {
788 DWORD ret;
789
792 UserLeave();
793 return ret;
794 }
795
797 {
798 PWND Window;
799
802 {
803 UserLeave();
804 return FALSE;
805 }
806
807 if (Param)
808 UserSetProp(Window, gpsi->atomContextHelpIdProp, (HANDLE)Param, TRUE);
809 else
811
812 UserLeave();
813 return TRUE;
814 }
815
817 {
818 PWND pWnd;
820
822
823 if (!(pWnd = UserGetWindowObject(hWnd)))
824 {
825 UserLeave();
826 return 0;
827 }
828 UserRefObjectCo(pWnd, &Ref);
829
830 if (pWnd->head.pti->ppi == PsGetCurrentProcessWin32Process() &&
831 pWnd->cbwndExtra >= DLGWINDOWEXTRA &&
833 {
834 pWnd->DialogPointer = (PVOID)Param;
835 if (Param)
836 {
837 if (!pWnd->fnid) pWnd->fnid = FNID_DIALOG;
838 pWnd->state |= WNDS_DIALOGWINDOW;
839 }
840 else
841 {
842 pWnd->fnid |= FNID_DESTROY;
843 pWnd->state &= ~WNDS_DIALOGWINDOW;
844 }
845 }
846
847 UserDerefObjectCo(pWnd);
848 UserLeave();
849 return 0;
850 }
851
853 {
854 PWND pWnd;
855 PNOTIFYEVENT pne;
857 pne = (PNOTIFYEVENT)Param;
858 if (hWnd)
860 else
861 pWnd = NULL;
862 IntNotifyWinEvent(pne->event, pWnd, pne->idObject, pne->idChild, pne->flags);
863 UserLeave();
864 return 0;
865 }
866
868 {
869 PWND pWnd;
872 if (pWnd) IntClearWindowState(pWnd, (UINT)Param);
873 UserLeave();
874 return 0;
875 }
876
878 {
879 PWND pWnd;
882 if (pWnd) IntSetWindowState(pWnd, (UINT)Param);
883 UserLeave();
884 return 0;
885 }
886 }
887
888 STUB;
889
890 return 0;
891}
struct _NOTIFYEVENT * PNOTIFYEVENT
#define FNID_DESTROY
Definition: ntuser.h:898
#define WNDS_SERVERSIDEWINDOWPROC
Definition: ntuser.h:623
#define FNID_DIALOG
Definition: ntuser.h:869
#define HWNDPARAM_ROUTINE_ROS_NOTIFYWINEVENT
Definition: ntuser.h:3617
#define WNDS_DIALOGWINDOW
Definition: ntuser.h:621
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
HANDLE FASTCALL UserRemoveProp(_In_ PWND Window, _In_ ATOM Atom, _In_ BOOLEAN SystemProp)
LONG idChild
Definition: hook.h:39
DWORD flags
Definition: hook.h:40
LONG idObject
Definition: hook.h:38
DWORD event
Definition: hook.h:37
THRDESKHEAD head
Definition: ntuser.h:695
DWORD fnid
Definition: ntuser.h:709
DWORD state
Definition: ntuser.h:701
PVOID DialogPointer
Definition: ntuser.h:766
ULONG cbwndExtra
Definition: ntuser.h:738
void * PVOID
Definition: typedefs.h:50
VOID FASTCALL IntNotifyWinEvent(DWORD Event, PWND pWnd, LONG idObject, LONG idChild, DWORD flags)
Definition: event.c:178
VOID FASTCALL IntClearWindowState(PWND pWnd, UINT Flag)
Definition: misc.c:617
VOID FASTCALL IntSetWindowState(PWND pWnd, UINT Flag)
Definition: misc.c:596
BOOL FASTCALL IntKillTimer(PWND Window, UINT_PTR IDEvent, BOOL SystemTimer)
Definition: timer.c:579
#define DLGWINDOWEXTRA
Definition: winuser.h:2601

Referenced by NtUserxClearWindowState(), NtUserxKillSystemTimer(), NtUserxNotifyWinEvent(), NtUserxSetDialogPointer(), NtUserxSetWindowContextHelpId(), NtUserxSetWindowState(), Test_HwndParamRoutine_SetWindowContextHelpId(), Test_HwndRoutine_GetWindowContextHelpId(), and WIN_SetStyle().

◆ NtUserCallHwndParamLock()

DWORD NTAPI NtUserCallHwndParamLock ( HWND  hWnd,
DWORD_PTR  Param,
DWORD  Routine 
)

Definition at line 895 of file simplecall.c.

899{
900 DWORD Ret = FALSE;
901 PWND Window;
903
904 TRACE("Enter NtUserCallHwndParamLock\n");
906
908 {
909 Ret = FALSE;
910 goto Exit;
911 }
912
913 UserRefObjectCo(Window, &Ref);
914
915 switch (Routine)
916 {
919 break;
920
922 {
923 PREGION Rgn = REGION_LockRgn((HRGN)Param);
925 if (Rgn) REGION_UnlockRgn(Rgn);
926 break;
927 }
928 }
929
931
932Exit:
933
934 TRACE("Leave NtUserCallHwndParamLock, ret=%lu\n", Ret);
935 UserLeave();
936
937 return Ret;
938}
#define DWORD
Definition: nt_native.h:44
BOOL FASTCALL IntBroadcastImeShowStatusChange(_In_ PWND pImeWnd, _In_ BOOL bShow)
Definition: ime.c:2514
Definition: region.h:8
BOOL FASTCALL co_UserRedrawWindow(PWND Window, const RECTL *UpdateRect, PREGION UpdateRgn, ULONG Flags)
Definition: painting.c:895
PREGION FASTCALL REGION_LockRgn(_In_ HRGN hrgn)
Definition: region.c:2358
VOID FASTCALL REGION_UnlockRgn(_In_ PREGION prgn)
Definition: region.c:2373
#define RDW_VALIDATE
Definition: winuser.h:1229

Referenced by ImeWnd_OnImeSystem(), and NtUserxValidateRgn().

◆ NtUserCallMsgFilter()

BOOL NTAPI NtUserCallMsgFilter ( LPMSG  msg,
INT  code 
)

Definition at line 2429 of file message.c.

2430{
2431 BOOL Ret = FALSE;
2432 MSG Msg;
2433
2434 _SEH2_TRY
2435 {
2436 ProbeForRead(lpmsg, sizeof(MSG), 1);
2437 RtlCopyMemory( &Msg, lpmsg, sizeof(MSG));
2438 }
2440 {
2441 _SEH2_YIELD(return FALSE);
2442 }
2443 _SEH2_END;
2444
2446 Ret = IntCallMsgFilter(&Msg, code);
2447 UserLeave();
2448
2449 _SEH2_TRY
2450 {
2451 ProbeForWrite(lpmsg, sizeof(MSG), 1);
2452 RtlCopyMemory(lpmsg, &Msg, sizeof(MSG));
2453 }
2455 {
2456 Ret = FALSE;
2457 }
2458 _SEH2_END;
2459
2460 return Ret;
2461}
struct @1767 Msg[]
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
Definition: inflate.c:139
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
BOOL FASTCALL IntCallMsgFilter(LPMSG lpmsg, INT code)
Definition: message.c:2190

Referenced by CallMsgFilterA(), and CallMsgFilterW().

◆ NtUserCallNextHookEx()

LRESULT NTAPI NtUserCallNextHookEx ( int  Code,
WPARAM  wParam,
LPARAM  lParam,
BOOL  Ansi 
)

Definition at line 1370 of file hook.c.

1374{
1375 PTHREADINFO pti;
1376 PHOOK HookObj, NextObj;
1378 LRESULT lResult = 0;
1379
1380 TRACE("Enter NtUserCallNextHookEx\n");
1382
1383 pti = GetW32ThreadInfo();
1384
1385 HookObj = pti->sphkCurrent;
1386
1387 if (!HookObj)
1388 goto Exit; // Return 0
1389
1390 NextObj = HookObj->phkNext;
1391
1392 pti->sphkCurrent = NextObj;
1393 ClientInfo = pti->pClientInfo;
1394 _SEH2_TRY
1395 {
1396 ClientInfo->phkCurrent = NextObj;
1397 }
1399 {
1400 ClientInfo = NULL;
1401 }
1402 _SEH2_END;
1403
1404 /* Now in List run down. */
1405 if (ClientInfo && NextObj)
1406 {
1407 NextObj->phkNext = IntGetNextHook(NextObj);
1408 lResult = co_UserCallNextHookEx( NextObj, Code, wParam, lParam, NextObj->Ansi);
1409 }
1410
1411Exit:
1412 TRACE("Leave NtUserCallNextHookEx, ret=%i\n", lResult);
1413 UserLeave();
1414 return lResult;
1415}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
CLIENT_DATA ClientInfo
LONG_PTR LRESULT
Definition: minwindef.h:176
PHOOK FASTCALL IntGetNextHook(PHOOK Hook)
Definition: hook.c:995
static LRESULT APIENTRY co_UserCallNextHookEx(PHOOK Hook, int Code, WPARAM wParam, LPARAM lParam, BOOL Ansi)
Definition: hook.c:521
struct tagHOOK * sphkCurrent
Definition: win32.h:118
struct _CLIENTINFO * pClientInfo
Definition: win32.h:94
struct tagHOOK * phkNext
Definition: ntuser.h:241
BOOLEAN Ansi
Definition: ntuser.h:251
_In_ UCHAR _In_ UCHAR _In_ ULONG Code
Definition: wdfdevice.h:1707

Referenced by CallNextHookEx().

◆ NtUserCallNoParam()

DWORD_PTR NTAPI NtUserCallNoParam ( DWORD  Routine)

Definition at line 59 of file simplecall.c.

60{
61 DWORD_PTR Result = 0;
62
63 TRACE("Enter NtUserCallNoParam\n");
65
66 switch (Routine)
67 {
70 break;
71
74 break;
75
78 break;
79
82 break;
83
86 break;
87
90 break;
91
93 {
95 Result = (DWORD_PTR)MAKELONG(pti->ptLast.x, pti->ptLast.y);
96 break;
97 }
98
101 break;
102
105 break;
106
108 {
110 TRACE("Zapping the Active and Focus window out of the Queue!\n");
111 pti->MessageQueue->spwndFocus = NULL;
112 pti->MessageQueue->spwndActive = NULL;
113 Result = 0;
114 break;
115 }
116
119 break;
120
121 /* this is a ReactOS only case and is needed for gui-on-demand */
124 break;
125
127 if (UserIsIMMEnabled())
129 else
131
132 Result = TRUE; // Always return TRUE.
133 break;
134
135 default:
136 ERR("Calling invalid routine number 0x%x in NtUserCallNoParam\n", Routine);
138 break;
139 }
140
141 TRACE("Leave NtUserCallNoParam, ret=%p\n",(PVOID)Result);
142 UserLeave();
143
144 return Result;
145}
#define PsGetCurrentThread()
Definition: env_spec_w32.h:81
BOOL FASTCALL IntReleaseCapture(VOID)
Definition: focus.c:1525
#define NOPARAM_ROUTINE_ISCONSOLEMODE
Definition: ntuser.h:3602
#define SRVINFO_IMM32
Definition: ntuser.h:949
BOOL FASTCALL IntMsqClearWakeMask(VOID)
Definition: msgqueue.c:392
BOOL FASTCALL UserLoadApiHook(VOID)
Definition: hook.c:131
BOOL gfIMEShowStatus
Definition: ime.c:24
POINT ptLast
Definition: win32.h:129
struct _USER_MESSAGE_QUEUE * MessageQueue
Definition: win32.h:89
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
DWORD dwSRVIFlags
Definition: ntuser.h:1051
#define DWORD_PTR
Definition: treelist.c:76
#define MAKELONG(a, b)
Definition: typedefs.h:249
BOOL FASTCALL co_IntDestroyCaret(PTHREADINFO Win32Thread)
Definition: caret.c:159
HDC ScreenDeviceContext
Definition: desktop.c:53
HMENU FASTCALL UserCreateMenu(PDESKTOP Desktop, BOOL PopupMenu)
Definition: menu.c:5058
BOOL APIENTRY IntInitMessagePumpHook(VOID)
Definition: message.c:2160
BOOL APIENTRY IntUninitMessagePumpHook(VOID)
Definition: message.c:2173
BOOL FASTCALL UserIsIMMEnabled(VOID)
Definition: metric.c:22
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

Referenced by EndDialog(), IsConsoleMode(), LoadUserApiHook(), NtUserxCreateMenu(), NtUserxCreatePopupMenu(), NtUserxDestroyCaret(), NtUserxGetMessagePos(), NtUserxInitMessagePump(), NtUserxMsqClearWakeMask(), NtUserxReleaseCapture(), NtUserxUnInitMessagePump(), Test_NoParamRoutine_CreateMenu(), Test_NoParamRoutine_CreatePopupMenu(), Test_NoParamRoutine_LoadUserApiHook(), UpdatePerUserImmEnabling(), and User32GetImeShowStatus().

◆ NtUserCallOneParam()

DWORD_PTR NTAPI NtUserCallOneParam ( DWORD_PTR  Param,
DWORD  Routine 
)

Definition at line 153 of file simplecall.c.

156{
158
159 TRACE("Enter NtUserCallOneParam\n");
160
162
163 switch (Routine)
164 {
166 {
167 PTHREADINFO pti;
169 MsqPostQuitMessage(pti, Param);
170 Result = TRUE;
171 break;
172 }
173
175 {
176 PSMWP psmwp;
177 HDWP hDwp = NULL;
178 INT count = (INT)Param;
179
180 if (count < 0)
181 {
183 Result = 0;
184 break;
185 }
186
187 /* Windows allows zero count, in which case it allocates context for 8 moves */
188 if (count == 0) count = 8;
189
191 NULL,
192 NULL,
193 (PHANDLE)&hDwp,
195 sizeof(SMWP));
196 if (!psmwp)
197 {
198 Result = 0;
199 break;
200 }
201
203 if (!psmwp->acvr)
204 {
206 Result = 0;
207 break;
208 }
209
210 RtlZeroMemory(psmwp->acvr, count * sizeof(CVR));
211 psmwp->bHandle = TRUE;
212 psmwp->ccvr = 0; // actualCount
213 psmwp->ccvrAlloc = count; // suggestedCount
214 Result = (DWORD_PTR)hDwp;
215 break;
216 }
217
220 break;
221
223 {
224 PTHREADINFO ti;
225 ti = GetW32ThreadInfo();
226 if (ti != NULL)
227 {
228 /* Try convert the pointer to a user mode pointer if the desktop is
229 mapped into the process */
231 }
232 else
233 {
234 Result = 0;
235 }
236 break;
237 }
238
241 break;
242
244 {
246 gspv.bMouseBtnSwap = Param ? TRUE : FALSE;
248 break;
249 }
250
253 break;
254
257 break;
258
260 {
262 {
264 Result = 0;
265 }
266 break;
267 }
268
270 {
271 BOOL Enable;
273
274 if (Process != NULL)
275 {
276 Enable = (BOOL)(Param != 0);
277
278 if (Enable)
279 {
280 Process->W32PF_flags &= ~W32PF_NOWINDOWGHOSTING;
281 }
282 else
283 {
284 Process->W32PF_flags |= W32PF_NOWINDOWGHOSTING;
285 }
286
287 Result = TRUE;
288 break;
289 }
290
291 Result = FALSE;
292 break;
293 }
294
297 break;
298
301 break;
302
305 break;
306
308 Result = UserReleaseDC(NULL, (HDC) Param, FALSE);
309 break;
310
312 Result = UserRealizePalette((HDC) Param);
313 break;
314
316 {
318 break;
319 }
320
322 /* FIXME: Should use UserEnterShared */
324 break;
325
326 case ONEPARAM_ROUTINE_GETCURSORPOS:
327 {
330 Result = TRUE;
331 if (pti->rpdesk != IntGetActiveDesktop())
332 {
333 Result = FALSE;
334 break;
335 }
337 {
338 ProbeForWrite((POINT*)Param,sizeof(POINT),1);
339 pptl = (PPOINTL)Param;
340 *pptl = gpsi->ptCursor;
341 }
343 {
344 Result = FALSE;
345 }
346 _SEH2_END;
347 break;
348 }
349
351 {
352 PPROCESSINFO ppi;
353 if (Param & LAYOUT_ORIENTATIONMASK || Param == LAYOUT_LTR)
354 {
356 ppi->dwLayout = Param;
357 Result = TRUE;
358 break;
359 }
361 Result = FALSE;
362 break;
363 }
364
366 {
367 PPROCESSINFO ppi;
368 PDWORD pdwLayout;
369 Result = TRUE;
370
372 {
374 Result = FALSE;
375 break;
376 }
377
380 {
381 pdwLayout = (PDWORD)Param;
382 *pdwLayout = ppi->dwLayout;
383 }
385 {
387 Result = FALSE;
388 }
389 _SEH2_END;
390 break;
391 }
392
395 break;
396
398 /* TODO: Implement sound sentry */
400 break;
401
402 case ONEPARAM_ROUTINE_CREATESYSTEMTHREADS:
404 break;
405
408 break;
409
412 break;
413
414 default:
415 ERR("Calling invalid routine number 0x%x in NtUserCallOneParam(), Param=0x%x\n",
416 Routine, Param);
418 Result = 0;
419 break;
420 }
421
422 TRACE("Leave NtUserCallOneParam, ret=%p\n", (PVOID)Result);
423 UserLeave();
424
425 return Result;
426}
PEPROCESS gpepCSRSS
Definition: csr.c:15
DWORD UserSystemThreadProc(BOOL bRemoteProcess)
Definition: csr.c:207
HWND FASTCALL IntWindowFromDC(HDC hDc)
Definition: windc.c:894
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
static __inline PVOID DesktopHeapAddressToUser(PVOID lpMem)
Definition: desktop.h:308
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
BOOL FASTCALL IntLockSetForegroundWindow(UINT uLockCode)
Definition: focus.c:1567
BOOL FASTCALL IntAllowSetForegroundWindow(DWORD dwProcessId)
Definition: focus.c:1598
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:223
UINT WINAPI UserRealizePalette(HDC hDC)
Definition: painting.c:2343
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING
Definition: ntuser.h:3603
#define ONEPARAM_ROUTINE_GETDESKTOPMAPPING
Definition: ntuser.h:3604
LONG_PTR LPARAM
Definition: minwindef.h:175
#define LAYOUT_LTR
Definition: dc.c:36
VOID FASTCALL MsqPostQuitMessage(PTHREADINFO pti, ULONG ExitCode)
Definition: msgqueue.c:1381
int UserShowCursor(BOOL bShow)
Definition: msgqueue.c:168
LPARAM FASTCALL MsqSetMessageExtraInfo(LPARAM lParam)
Definition: msgqueue.c:2447
BOOL FASTCALL co_MsqReplyMessage(LRESULT lResult)
Definition: msgqueue.c:2484
HANDLE FASTCALL IntMsqSetWakeMask(DWORD WakeMask)
Definition: msgqueue.c:362
#define BOOL
Definition: nt_native.h:43
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
HWND hwndSAS
Definition: winsta.c:24
DWORD * PDWORD
Definition: pedump.c:68
#define INT
Definition: polytest.cpp:20
Definition: winpos.h:4
DWORD dwLayout
Definition: win32.h:280
Definition: winpos.h:21
PCVR acvr
Definition: winpos.h:27
INT ccvr
Definition: winpos.h:25
UINT bHandle
Definition: winpos.h:24
INT ccvrAlloc
Definition: winpos.h:26
BOOL bMouseBtnSwap
Definition: sysparams.h:82
int32_t INT
Definition: typedefs.h:58
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define WM_LOGONNOTIFY
Definition: undocuser.h:39
#define LN_MESSAGE_BEEP
Definition: undocuser.h:121
#define W32PF_NOWINDOWGHOSTING
Definition: win32.h:32
BOOL FASTCALL IntSetCaretBlinkTime(UINT uMSeconds)
Definition: caret.c:183
UINT APIENTRY UserEnumClipboardFormats(UINT fmt)
Definition: clipboard.c:443
HANDLE IntCreateCurIconHandle(BOOLEAN Animated)
Definition: cursoricon.c:285
HKL FASTCALL UserGetKeyboardLayout(DWORD dwThreadId)
Definition: kbdlayout.c:995
DWORD FASTCALL UserGetKeyboardType(DWORD dwTypeFlag)
Definition: keyboard.c:1907
DWORD APIENTRY IntGetQueueStatus(DWORD Changes)
Definition: message.c:2139
BOOL FASTCALL UserPostMessage(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1395
BOOL FASTCALL UserDeleteObject(HANDLE h, HANDLE_TYPE type)
Definition: object.c:716
PVOID FASTCALL UserCreateObject(PUSER_HANDLE_TABLE ht, PDESKTOP pDesktop, PTHREADINFO pti, HANDLE *h, HANDLE_TYPE type, ULONG size)
Definition: object.c:568
SPIVALUES gspv
Definition: sysparams.c:17
#define USERTAG_SWP
Definition: tags.h:281
_In_ POINTL * pptl
Definition: winddi.h:3741
struct _POINTL * PPOINTL
#define ERROR_INVALID_ACCESS
Definition: winerror.h:237
#define LAYOUT_ORIENTATIONMASK
Definition: wingdi.h:1374
struct _SMWP SMWP
struct _SMWP * PSMWP
#define SM_SWAPBUTTON
Definition: winuser.h:995
#define PsGetCurrentProcess
Definition: psfuncs.h:17

Referenced by CreateSystemThreads(), DesktopPtrToUser(), GetProcessDefaultLayout(), GetWinStationInfo(), NtUserxAllowSetForegroundWindow(), NtUserxBeginDeferWindowPos(), NtUserxCreateEmptyCurObject(), NtUserxCreateSystemThreads(), NtUserxEnableProcessWindowGhosting(), NtUserxEnumClipboardFormats(), NtUserxGetCursorPos(), NtUserxGetDesktopMapping(), NtUserxGetKeyboardLayout(), NtUserxGetKeyboardType(), NtUserxGetQueueStatus(), NtUserxLockSetForegroundWindow(), NtUserxMessageBeep(), NtUserxMsqSetWakeMask(), NtUserxPostQuitMessage(), NtUserxRealizePalette(), NtUserxReleaseDC(), NtUserxReplyMessage(), NtUserxSetCaretBlinkTime(), NtUserxSetMessageExtraInfo(), NtUserxShowCursor(), NtUserxSwapMouseButton(), NtUserxWindowFromDC(), SetProcessDefaultLayout(), START_TEST(), Test_OneParamRoutine_BeginDeferWindowPos(), Test_OneParamRoutine_CreateEmptyCurObject(), Test_OneParamRoutine_MapDesktopObject(), Test_OneParamRoutine_SwapMouseButtons(), and Test_OneParamRoutine_WindowFromDC().

◆ NtUserCallTwoParam()

DWORD_PTR NTAPI NtUserCallTwoParam ( DWORD_PTR  Param1,
DWORD_PTR  Param2,
DWORD  Routine 
)

Definition at line 434 of file simplecall.c.

438{
439 PWND Window;
440 DWORD_PTR Ret;
441 TRACE("Enter NtUserCallTwoParam\n");
443
444 switch (Routine)
445 {
447 {
449 Ret = (DWORD_PTR)UserPaintCaption(Window, (INT)Param2);
450 break;
451 }
452
454 {
455 PMENU MenuObject = IntGetMenuObject((HMENU)Param1);
456 if (!MenuObject)
457 {
458 Ret = 0;
459 break;
460 }
461
462 if (Param2 > 0)
463 {
464 Ret = (MenuObject->cyMenu == (int)Param2);
465 MenuObject->cyMenu = (int)Param2;
466 }
467 else
468 Ret = (DWORD_PTR)MenuObject->cyMenu;
469 IntReleaseMenuObject(MenuObject);
470 break;
471 }
472
474 {
476 ASSERT(pti->MessageQueue);
477 Ret = (DWORD_PTR)MsqSetStateWindow(pti, (ULONG)Param1, (HWND)Param2);
478 break;
479 }
480
482 Ret = IntEnableWindow((HWND)Param1, (BOOL)Param2);
483 break;
484
486 {
488 if (!Window)
489 {
490 Ret = 0;
491 break;
492 }
493
494 Ret = (DWORD_PTR)IntShowOwnedPopups(Window, (BOOL)Param2);
495 break;
496 }
497
499 {
502 if (!Window)
503 {
504 Ret = 0;
505 break;
506 }
507
508 /* Unpack wParam */
509 wParam = MAKEWPARAM((Param2 >> 3) & 0x3,
510 Param2 & (UISF_HIDEFOCUS | UISF_HIDEACCEL | UISF_ACTIVE));
511
513 break;
514 }
515
517 {
518 HWND hwnd = (HWND)Param1;
519 BOOL fAltTab = (BOOL)Param2;
520 Ret = 0;
522 if (!Window)
523 break;
524
525 if (gpqForeground && !fAltTab)
526 {
527 PWND pwndActive = gpqForeground->spwndActive;
528 if (pwndActive && !(pwndActive->ExStyle & WS_EX_TOPMOST))
529 {
530 co_WinPosSetWindowPos(pwndActive, HWND_BOTTOM, 0, 0, 0, 0,
533 }
534
536 break;
537 }
538
540
541 if (fAltTab && (Window->style & WS_MINIMIZE))
542 {
544 MsqPostMessage(Window->head.pti, &msg, FALSE, QS_POSTMESSAGE, 0, 0);
545 }
546 break;
547 }
548
550 Ret = (DWORD_PTR)co_IntSetCaretPos((int)Param1, (int)Param2);
551 break;
552
554 Ret = (DWORD_PTR)co_IntRegisterLogonProcess((HANDLE)Param1, (BOOL)Param2);
555 break;
556
558 Ret = (DWORD_PTR)UserSetCursorPos((int)Param1, (int)Param2, 0, 0, FALSE);
559 break;
560
562 Ret = IntUnhookWindowsHook((int)Param1, (HOOKPROC)Param2);
563 break;
564
565 default:
566 ERR("Calling invalid routine number 0x%x in NtUserCallTwoParam(), Param1=0x%x Parm2=0x%x\n",
567 Routine, Param1, Param2);
569 Ret = 0;
570 }
571
572
573 TRACE("Leave NtUserCallTwoParam, ret=%p\n", (PVOID)Ret);
574 UserLeave();
575
576 return Ret;
577}
#define msg(x)
Definition: auth_time.c:54
HANDLE HWND
Definition: compat.h:19
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
BOOL FASTCALL UserSetActiveWindow(_In_opt_ PWND Wnd)
Definition: focus.c:1258
PUSER_MESSAGE_QUEUE gpqForeground
Definition: focus.c:13
#define TWOPARAM_ROUTINE_SETGUITHRDHANDLE
Definition: ntuser.h:3606
#define TWOPARAM_ROUTINE_ROS_UPDATEUISTATE
Definition: ntuser.h:3616
#define TWOPARAM_ROUTINE_SETMENUBARHEIGHT
Definition: ntuser.h:3605
#define IntReleaseMenuObject(MenuObj)
Definition: menu.h:130
#define ASSERT(a)
Definition: mode.c:44
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
HWND FASTCALL MsqSetStateWindow(PTHREADINFO pti, ULONG Type, HWND hWnd)
Definition: msgqueue.c:2507
VOID FASTCALL MsqPostMessage(PTHREADINFO pti, MSG *Msg, BOOLEAN HardwareMessage, DWORD MessageBits, DWORD dwQEvent, LONG_PTR ExtraInfo)
Definition: msgqueue.c:1337
BOOL UserPaintCaption(PWND pWnd, INT Flags)
Definition: defwnd.c:395
BOOL FASTCALL IntUnhookWindowsHook(int HookId, HOOKPROC pfnFilterProc)
Definition: hook.c:1319
struct _THREADINFO * PTHREADINFO
Definition: ntwin32.h:6
#define WS_MINIMIZE
Definition: pedump.c:622
#define WS_EX_TOPMOST
Definition: pedump.c:647
BOOL FASTCALL co_IntRegisterLogonProcess(HANDLE ProcessId, BOOL Register)
Definition: simplecall.c:18
DWORD ExStyle
Definition: ntuser.h:704
ULONG cyMenu
Definition: ntuser.h:423
BOOL FASTCALL co_IntSetCaretPos(int X, int Y)
Definition: caret.c:192
BOOL UserSetCursorPos(INT x, INT y, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook)
Definition: cursoricon.c:238
PMENU FASTCALL IntGetMenuObject(HMENU hMenu)
Definition: menu.c:192
BOOL FASTCALL IntEnableWindow(HWND hWnd, BOOL bEnable)
Definition: window.c:221
BOOL FASTCALL IntShowOwnedPopups(PWND OwnerWnd, BOOL fShow)
Definition: window.c:4662
BOOL FASTCALL UserUpdateUiState(PWND Wnd, WPARAM wParam)
Definition: window.c:40
#define MAKEWPARAM(l, h)
Definition: winuser.h:4117
LRESULT(CALLBACK * HOOKPROC)(int, WPARAM, LPARAM)
Definition: winuser.h:3007
#define WM_SYSCOMMAND
Definition: winuser.h:1769
#define SWP_ASYNCWINDOWPOS
Definition: winuser.h:1264
#define QS_POSTMESSAGE
Definition: winuser.h:888
#define SC_RESTORE
Definition: winuser.h:2634
#define HWND_BOTTOM
Definition: winuser.h:1216

Referenced by MDI_UpdateFrameText(), NtUserxEnableWindow(), NtUserxRegisterLogonProcess(), NtUserxSetCaretPos(), NtUserxSetCursorPos(), NtUserxSetGUIThreadHandle(), NtUserxSetMenuBarHeight(), NtUserxShowOwnedPopups(), NtUserxSwitchToThisWindow(), NtUserxUnhookWindowsHook(), NtUserxUpdateUiState(), and set_dialog_proc().

◆ NtUserChangeClipboardChain()

BOOL NTAPI NtUserChangeClipboardChain ( HWND  hWndRemove,
HWND  hWndNewNext 
)

Definition at line 624 of file clipboard.c.

625{
626 BOOL bRet = FALSE;
627 PWND pWindowRemove;
628 PWINSTATION_OBJECT pWinStaObj;
629
630 TRACE("NtUserChangeClipboardChain(%p, %p)\n", hWndRemove, hWndNewNext);
631
633
634 pWinStaObj = IntGetWinStaForCbAccess();
635 if (!pWinStaObj)
636 goto cleanup;
637
638 pWindowRemove = UserGetWindowObject(hWndRemove);
639
640 if (pWindowRemove && pWinStaObj->spwndClipViewer)
641 {
642 if (pWindowRemove == pWinStaObj->spwndClipViewer)
643 pWinStaObj->spwndClipViewer = UserGetWindowObject(hWndNewNext);
644
645 if (pWinStaObj->spwndClipViewer)
646 bRet = (BOOL)co_IntSendMessage(UserHMGetHandle(pWinStaObj->spwndClipViewer), WM_CHANGECBCHAIN, (WPARAM)hWndRemove, (LPARAM)hWndNewNext);
647 }
648
649 ObDereferenceObject(pWinStaObj);
650
651cleanup:
652 UserLeave();
653
654 return bRet;
655}
static void cleanup(void)
Definition: main.c:1335
PWND spwndClipViewer
Definition: winsta.h:27
static PWINSTATION_OBJECT FASTCALL IntGetWinStaForCbAccess(VOID)
Definition: clipboard.c:21
LRESULT FASTCALL co_IntSendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1495
#define WM_CHANGECBCHAIN
Definition: winuser.h:1902

Referenced by ChangeClipboardChain().

◆ NtUserChangeDisplaySettings()

LONG NTAPI NtUserChangeDisplaySettings ( PUNICODE_STRING  lpszDeviceName,
LPDEVMODEW  lpDevMode,
DWORD  dwflags,
LPVOID  lParam 
)

Definition at line 953 of file display.c.

958{
959 WCHAR awcDevice[CCHDEVICENAME];
960 UNICODE_STRING ustrDevice;
961 DEVMODEW dmLocal;
962 LONG lRet;
963
964 /* Check arguments */
965 if ((dwflags != CDS_VIDEOPARAMETERS) && (lParam != NULL))
966 {
969 }
970
971 /* Check flags */
973 {
975 }
976
977 if ((dwflags & CDS_RESET) && (dwflags & CDS_NORESET))
978 {
980 }
981
982 /* Copy the device name */
983 if (pustrDevice)
984 {
985 /* Initialize destination string */
986 RtlInitEmptyUnicodeString(&ustrDevice, awcDevice, sizeof(awcDevice));
987
989 {
990 /* Probe the UNICODE_STRING and the buffer */
991 ProbeForRead(pustrDevice, sizeof(UNICODE_STRING), 1);
992 ProbeForRead(pustrDevice->Buffer, pustrDevice->Length, 1);
993
994 /* Copy the string */
995 RtlCopyUnicodeString(&ustrDevice, pustrDevice);
996 }
998 {
999 /* Set and return error */
1002 }
1003 _SEH2_END
1004
1005 pustrDevice = &ustrDevice;
1006 }
1007
1008 /* Copy devmode */
1009 if (lpDevMode)
1010 {
1011 _SEH2_TRY
1012 {
1013 /* Probe the size field of the structure */
1014 ProbeForRead(lpDevMode, sizeof(dmLocal.dmSize), 1);
1015
1016 /* Calculate usable size */
1017 dmLocal.dmSize = min(sizeof(dmLocal), lpDevMode->dmSize);
1018
1019 /* Probe and copy the full DEVMODE */
1020 ProbeForRead(lpDevMode, dmLocal.dmSize, 1);
1021 RtlCopyMemory(&dmLocal, lpDevMode, dmLocal.dmSize);
1022 }
1024 {
1025 /* Set and return error */
1028 }
1029 _SEH2_END
1030
1031 /* Check for extra parameters */
1032 if (dmLocal.dmDriverExtra > 0)
1033 {
1034 /* FIXME: TODO */
1035 ERR("lpDevMode->dmDriverExtra is IGNORED!\n");
1036 dmLocal.dmDriverExtra = 0;
1037 }
1038
1039 /* Use the local structure */
1040 lpDevMode = &dmLocal;
1041 }
1042
1043 // FIXME: Copy videoparameters
1044
1045 /* Acquire global USER lock */
1047
1048 /* Call internal function */
1049 lRet = UserChangeDisplaySettings(pustrDevice, lpDevMode, dwflags, NULL);
1050
1051 /* Release lock */
1052 UserLeave();
1053
1054 return lRet;
1055}
#define CCHDEVICENAME
Definition: ddrawi.h:63
static _In_ DWORD dwflags
Definition: dispmode.c:64
static _In_ DWORD _Inout_ PDEVMODEA lpDevMode
Definition: dispmode.c:77
#define min(a, b)
Definition: monoChain.cc:55
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
short WCHAR
Definition: pedump.c:58
WORD dmSize
Definition: wingdi.h:2014
WORD dmDriverExtra
Definition: wingdi.h:2067
WORD dmSize
Definition: wingdi.h:2066
LONG APIENTRY UserChangeDisplaySettings(PUNICODE_STRING pustrDevice, LPDEVMODEW pdm, DWORD flags, LPVOID lParam)
Definition: display.c:723
#define CDS_VIDEOPARAMETERS
Definition: winuser.h:186
#define DISP_CHANGE_BADPARAM
Definition: winuser.h:193
#define CDS_UPDATEREGISTRY
Definition: winuser.h:181
#define DISP_CHANGE_BADFLAGS
Definition: winuser.h:192
#define CDS_NORESET
Definition: winuser.h:189
#define CDS_RESET
Definition: winuser.h:187
#define CDS_GLOBAL
Definition: winuser.h:184

Referenced by ChangeDisplaySettingsExA(), and ChangeDisplaySettingsExW().

◆ NtUserCheckDesktopByThreadId()

BOOL NTAPI NtUserCheckDesktopByThreadId ( DWORD  dwThreadId)

◆ NtUserCheckImeHotKey()

DWORD NTAPI NtUserCheckImeHotKey ( _In_ UINT  uVirtualKey,
_In_ LPARAM  lParam 
)

Definition at line 494 of file ime.c.

497{
498 PIMEHOTKEY pNode;
500
502
503 if (!gpqForeground || !IS_IMM_MODE())
504 goto Quit;
505
506 pNode = IntCheckImeHotKey(gpqForeground, uVirtualKey, lParam);
507 if (pNode)
508 ret = pNode->dwHotKeyId;
509
510Quit:
511 UserLeave();
512 return ret;
513}
#define INVALID_HOTKEY
Definition: ime.c:17
static PIMEHOTKEY IntCheckImeHotKey(_In_ const USER_MESSAGE_QUEUE *MessageQueue, _In_ UINT uVirtualKey, _In_ LPARAM lParam)
Definition: ime.c:291
DWORD dwHotKeyId
Definition: ime.c:29

◆ NtUserCheckMenuItem()

DWORD NTAPI NtUserCheckMenuItem ( HMENU  hmenu,
UINT  uIDCheckItem,
UINT  uCheck 
)

Definition at line 5609 of file menu.c.

5613{
5614 PMENU Menu;
5615 DWORD Ret = (DWORD)-1;
5616
5617 TRACE("Enter NtUserCheckMenuItem\n");
5619
5620 Menu = UserGetMenuObject(hMenu);
5621 if (Menu)
5622 {
5623 Ret = IntCheckMenuItem(Menu, uIDCheckItem, uCheck);
5624 }
5625
5626 UserLeave();
5627 TRACE("Leave NtUserCheckMenuItem, ret=%lu\n", Ret);
5628 return Ret;
5629}
FORCEINLINE PMENU UserGetMenuObject(HMENU hMenu)
Definition: userfuncs.h:3
DWORD FASTCALL IntCheckMenuItem(PMENU MenuObject, UINT uIDCheckItem, UINT uCheck)
Definition: menu.c:1259

Referenced by CheckMenuItem().

◆ NtUserCheckWindowThreadDesktop()

BOOL NTAPI NtUserCheckWindowThreadDesktop ( HWND  hwnd,
DWORD  dwThreadId,
ULONG  ReturnValue 
)

◆ NtUserChildWindowFromPointEx()

HWND NTAPI NtUserChildWindowFromPointEx ( HWND  Parent,
LONG  x,
LONG  y,
UINT  Flags 
)

Definition at line 3279 of file winpos.c.

3283{
3284 PWND pwndParent;
3285 TRACE("Enter NtUserChildWindowFromPointEx\n");
3287 if ((pwndParent = UserGetWindowObject(hwndParent)))
3288 {
3289 pwndParent = IntChildWindowFromPointEx(pwndParent, x, y, uiFlags);
3290 }
3291 UserLeave();
3292 TRACE("Leave NtUserChildWindowFromPointEx\n");
3293 return pwndParent ? UserHMGetHandle(pwndParent) : NULL;
3294}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
PWND APIENTRY IntChildWindowFromPointEx(PWND Parent, LONG x, LONG y, UINT uiFlags)
Definition: winpos.c:3067

Referenced by ChildWindowFromPoint(), and ChildWindowFromPointEx().

◆ NtUserClipCursor()

BOOL NTAPI NtUserClipCursor ( RECT lpRect)

Referenced by ClipCursor().

◆ NtUserCloseClipboard()

BOOL NTAPI NtUserCloseClipboard ( VOID  )

Definition at line 589 of file clipboard.c.

590{
591 BOOL bRet;
592
594 bRet = UserCloseClipboard();
595 UserLeave();
596
597 return bRet;
598}
BOOL NTAPI UserCloseClipboard(VOID)
Definition: clipboard.c:545

Referenced by CloseClipboard().

◆ NtUserCloseDesktop()

BOOL NTAPI NtUserCloseDesktop ( HDESK  hDesktop)

Definition at line 2755 of file desktop.c.

2756{
2757 PDESKTOP pdesk;
2759 BOOL Ret = FALSE;
2760
2761 TRACE("NtUserCloseDesktop(0x%p) called\n", hDesktop);
2763
2764 if (hDesktop == gptiCurrent->hdesk || hDesktop == gptiCurrent->ppi->hdeskStartup)
2765 {
2766 ERR("Attempted to close thread desktop\n");
2768 goto Exit; // Return FALSE
2769 }
2770
2771 Status = IntValidateDesktopHandle(hDesktop, UserMode, 0, &pdesk);
2772 if (!NT_SUCCESS(Status))
2773 {
2774 ERR("Validation of desktop handle 0x%p failed\n", hDesktop);
2775 goto Exit; // Return FALSE
2776 }
2777
2778 ObDereferenceObject(pdesk);
2779
2780 Status = ObCloseHandle(hDesktop, UserMode);
2781 if (!NT_SUCCESS(Status))
2782 {
2783 ERR("Failed to close desktop handle 0x%p\n", hDesktop);
2785 goto Exit; // Return FALSE
2786 }
2787
2788 Ret = TRUE;
2789
2790Exit:
2791 TRACE("Leave NtUserCloseDesktop, ret=%i\n", Ret);
2792 UserLeave();
2793 return Ret;
2794}
#define ERROR_BUSY
Definition: dderror.h:12
NTSTATUS NTAPI ObCloseHandle(IN HANDLE Handle, IN KPROCESSOR_MODE AccessMode)
Definition: obhandle.c:3379
HDESK hdeskStartup
Definition: win32.h:264
PPROCESSINFO ppi
Definition: win32.h:88
HDESK hdesk
Definition: win32.h:108

Referenced by CloseDesktop().

◆ NtUserCloseWindowStation()

BOOL NTAPI NtUserCloseWindowStation ( HWINSTA  hWinSta)

Definition at line 1029 of file winsta.c.

1031{
1034
1035 TRACE("NtUserCloseWindowStation called (%p)\n", hWinSta);
1036
1037 if (hWinSta == UserGetProcessWindowStation())
1038 {
1039 ERR("Attempted to close process window station\n");
1040 return FALSE;
1041 }
1042
1044 UserMode,
1045 0,
1046 &Object,
1047 NULL);
1048 if (!NT_SUCCESS(Status))
1049 {
1050 ERR("Validation of window station handle (%p) failed\n", hWinSta);
1051 return FALSE;
1052 }
1053
1055
1056 TRACE("Closing window station handle (%p)\n", hWinSta);
1057
1058 Status = ObCloseHandle(hWinSta, UserMode);
1059 if (!NT_SUCCESS(Status))
1060 {
1062 return FALSE;
1063 }
1064
1065 return TRUE;
1066}
HWINSTA FASTCALL UserGetProcessWindowStation(VOID)
Definition: winsta.c:1363
NTSTATUS FASTCALL IntValidateWindowStationHandle(HWINSTA WindowStation, KPROCESSOR_MODE AccessMode, ACCESS_MASK DesiredAccess, PWINSTATION_OBJECT *Object, POBJECT_HANDLE_INFORMATION pObjectHandleInfo)
Definition: winsta.c:232
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object

Referenced by CloseWindowStation().

◆ NtUserConsoleControl()

NTSTATUS APIENTRY NtUserConsoleControl ( IN CONSOLECONTROL  ConsoleCtrl,
IN PVOID  ConsoleCtrlInfo,
IN ULONG  ConsoleCtrlInfoLength 
)

Definition at line 14 of file console.c.

18{
20
21 /* Allow only the Console Server to perform this operation (via CSRSS) */
24
26
27 switch (ConsoleCtrl)
28 {
30 {
31 DESKTOP_CONSOLE_THREAD DesktopConsoleThreadInfo;
33 ULONG_PTR OldThreadId;
34
35 if (ConsoleCtrlInfoLength != sizeof(DesktopConsoleThreadInfo))
36 {
38 break;
39 }
40
42 {
43 ProbeForWrite(ConsoleCtrlInfo, ConsoleCtrlInfoLength, sizeof(USHORT));
44 DesktopConsoleThreadInfo = *(PDESKTOP_CONSOLE_THREAD)ConsoleCtrlInfo;
45 }
47 {
49 _SEH2_YIELD(break);
50 }
52
53 /* Reference the desktop */
54 Status = ObReferenceObjectByHandle(DesktopConsoleThreadInfo.DesktopHandle,
55 0,
58 (PVOID*)&Desktop,
59 NULL);
60 if (!NT_SUCCESS(Status)) break;
61
62 /* Save the old thread ID, it is always returned to the caller */
63 OldThreadId = Desktop->dwConsoleThreadId;
64
65 /* Set the new console input thread ID for this desktop if required */
66 if (DesktopConsoleThreadInfo.ThreadId != (ULONG_PTR)INVALID_HANDLE_VALUE)
67 {
68 Desktop->dwConsoleThreadId = DesktopConsoleThreadInfo.ThreadId;
69 }
70
71 /* Always return the old thread ID */
72 DesktopConsoleThreadInfo.ThreadId = OldThreadId;
73
74 /* Dereference the desktop */
76
77 /* Return the information back to the caller */
79 {
80 *(PDESKTOP_CONSOLE_THREAD)ConsoleCtrlInfo = DesktopConsoleThreadInfo;
81 }
83 {
85 }
87
88 break;
89 }
90
92 {
93 if (ConsoleCtrlInfoLength != sizeof(ATOM))
94 {
96 break;
97 }
98
100 {
101 ProbeForRead(ConsoleCtrlInfo, ConsoleCtrlInfoLength, sizeof(USHORT));
102 gaGuiConsoleWndClass = *(ATOM*)ConsoleCtrlInfo;
103 }
105 {
107 }
108 _SEH2_END;
109
110 break;
111 }
112
114 {
115 HPALETTE hPalette;
116
117 if (ConsoleCtrlInfoLength != sizeof(hPalette))
118 {
120 break;
121 }
122
124 {
125 ProbeForRead(ConsoleCtrlInfo, ConsoleCtrlInfoLength, sizeof(USHORT));
126 hPalette = *(HPALETTE*)ConsoleCtrlInfo;
127 }
129 {
131 _SEH2_YIELD(break);
132 }
133 _SEH2_END;
134
135 /* Make the palette handle public */
136 GreSetObjectOwnerEx(hPalette,
139 break;
140 }
141
143 {
144 ERR("NtUserConsoleControl - ConsoleAcquireDisplayOwnership is UNIMPLEMENTED\n");
146 break;
147 }
148
149 default:
150 ERR("Calling invalid control %d in NtUserConsoleControl\n", ConsoleCtrl);
152 break;
153 }
154
155 UserLeave();
156
157 return Status;
158}
#define STATUS_NOT_IMPLEMENTED
Definition: d3dkmdt.h:42
WORD ATOM
Definition: dimm.idl:113
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
@ GDIOBJFLAG_IGNOREPID
Definition: gdiobj.h:72
struct _DESKTOP_CONSOLE_THREAD * PDESKTOP_CONSOLE_THREAD
#define GDI_OBJ_HMGR_PUBLIC
Definition: ntgdihdl.h:116
#define STATUS_INVALID_INFO_CLASS
Definition: ntstatus.h:333
ATOM gaGuiConsoleWndClass
Definition: ntuser.c:27
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
Definition: obref.c:494
unsigned short USHORT
Definition: pedump.c:61
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
POBJECT_TYPE ExDesktopObjectType
Definition: win32k.c:22
BOOL NTAPI GreSetObjectOwnerEx(HGDIOBJ hobj, ULONG ulOwner, ULONG Flags)
Definition: gdiobj.c:1235

Referenced by CON_API(), GuiConsoleInputThread(), GuiInit(), and RegisterConWndClass().

◆ NtUserConvertMemHandle()

HANDLE NTAPI NtUserConvertMemHandle ( PVOID  pData,
DWORD  cbData 
)

Definition at line 1187 of file clipboard.c.

1190{
1191 HANDLE hMem = NULL;
1192 PCLIPBOARDDATA pMemObj;
1194
1196
1197 /* Create Clipboard data object */
1199 if (!pMemObj)
1200 goto cleanup;
1201
1202 pMemObj->cbData = cbData;
1203
1204 /* Copy data */
1205 _SEH2_TRY
1206 {
1208 memcpy(pMemObj->Data, pData, cbData);
1209 }
1211 {
1213 }
1214 _SEH2_END;
1215
1216 /* Release the extra reference (UserCreateObject added 2 references) */
1217 UserDereferenceObject(pMemObj);
1218
1219 /* If we failed to copy data, remove handle */
1220 if (!NT_SUCCESS(Status))
1221 {
1223 hMem = NULL;
1224 }
1225
1226cleanup:
1227 UserLeave();
1228
1229 return hMem;
1230}
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
_In_opt_ _In_opt_ _In_ _In_ DWORD cbData
Definition: shlwapi.h:761
BYTE Data[0]
Definition: ntuser.h:259
DWORD cbData
Definition: ntuser.h:258
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
BOOL FASTCALL UserDereferenceObject(PVOID Object)
Definition: object.c:643

Referenced by GetClipboardData(), setClipboardData(), SetClipboardData(), and START_TEST().

◆ NtUserCopyAcceleratorTable()

ULONG NTAPI NtUserCopyAcceleratorTable ( HACCEL  Table,
LPACCEL  Entries,
ULONG  EntriesCount 
)

Definition at line 171 of file accelerator.c.

175{
176 PACCELERATOR_TABLE Accel;
177 ULONG Ret = 0;
178
179 TRACE("Enter NtUserCopyAcceleratorTable\n");
181
182 Accel = UserGetAccelObject(hAccel);
183 if (!Accel)
184 {
185 goto Exit; // Return 0
186 }
187
188 /* If Entries is NULL return table size */
189 if (!Entries)
190 {
191 Ret = Accel->Count;
192 goto Exit;
193 }
194
195 /* Don't overrun */
196 if (Accel->Count < EntriesCount)
197 EntriesCount = Accel->Count;
198
200 {
201 ProbeForWrite(Entries, EntriesCount*sizeof(Entries[0]), 4);
202
203 for (Ret = 0; Ret < EntriesCount; Ret++)
204 {
205 Entries[Ret].fVirt = Accel->Table[Ret].fVirt;
206 Entries[Ret].key = Accel->Table[Ret].key;
207 Entries[Ret].cmd = Accel->Table[Ret].cmd;
208 }
209 }
211 {
213 Ret = 0;
214 }
215 _SEH2_END;
216
217Exit:
218 TRACE("Leave NtUserCopyAcceleratorTable, ret=%lu\n", Ret);
219 UserLeave();
220 return Ret;
221}
HACCEL hAccel
Definition: main.c:47
static const ENTRY Entries[]
WORD cmd
Definition: winuser.h:3033
BYTE fVirt
Definition: winuser.h:3031
WORD key
Definition: winuser.h:3032
PACCELERATOR_TABLE FASTCALL UserGetAccelObject(HACCEL hAccel)
Definition: accelerator.c:21

Referenced by CopyAcceleratorTableW().

◆ NtUserCountClipboardFormats()

DWORD NTAPI NtUserCountClipboardFormats ( VOID  )

Definition at line 658 of file clipboard.c.

659{
660 DWORD cFormats = 0;
661 PWINSTATION_OBJECT pWinStaObj;
662
664
665 pWinStaObj = IntGetWinStaForCbAccess();
666 if (!pWinStaObj)
667 goto cleanup;
668
669 cFormats = pWinStaObj->cNumClipFormats;
670
671 ObDereferenceObject(pWinStaObj);
672
673cleanup:
674 UserLeave();
675
676 return cFormats;
677}
DWORD cNumClipFormats
Definition: winsta.h:30

Referenced by CountClipboardFormats(), and START_TEST().

◆ NtUserCreateAcceleratorTable()

HACCEL NTAPI NtUserCreateAcceleratorTable ( LPACCEL  Entries,
ULONG  EntriesCount 
)

Definition at line 225 of file accelerator.c.

228{
229 PACCELERATOR_TABLE Accel;
230 HACCEL hAccel;
231 ULONG Index;
233 HACCEL Ret = NULL;
234 PTHREADINFO pti;
235
236 TRACE("Enter NtUserCreateAcceleratorTable(Entries %p, EntriesCount %u)\n",
237 Entries, EntriesCount);
239
240 if (Entries == NULL || EntriesCount == 0 ||
241 EntriesCount > MAXULONG_PTR / sizeof(*Entries))
242 {
243 goto Exit; // Return NULL
244 }
245
247
249 pti->rpdesk,
250 pti,
251 (PHANDLE)&hAccel,
253 sizeof(ACCELERATOR_TABLE));
254
255 if (Accel == NULL)
256 {
258 goto Exit; // Return NULL
259 }
260
261 Accel->Count = EntriesCount;
262 Accel->Table = ExAllocatePoolWithTag(PagedPool, EntriesCount * sizeof(ACCEL), USERTAG_ACCEL);
263 if (Accel->Table == NULL)
264 {
268 goto Exit; // Return NULL
269 }
270
272 {
273 ProbeForRead(Entries, EntriesCount * sizeof(ACCEL), 4);
274
275 for (Index = 0; Index < EntriesCount; Index++)
276 {
277 Accel->Table[Index].fVirt = Entries[Index].fVirt & FVIRT_MASK;
278 if(Accel->Table[Index].fVirt & FVIRTKEY)
279 {
280 Accel->Table[Index].key = Entries[Index].key;
281 }
282 else
283 {
285 sizeof(WCHAR),
286 NULL,
287 (PCSTR)&Entries[Index].key,
288 sizeof(CHAR));
289 }
290
291 Accel->Table[Index].cmd = Entries[Index].cmd;
292 }
293 }
295 {
297 }
298 _SEH2_END;
299
300 if (!NT_SUCCESS(Status))
301 {
306 goto Exit; // Return NULL
307 }
308
309 /* FIXME: Save HandleTable in a list somewhere so we can clean it up again */
310
311 /* Release the extra reference (UserCreateObject added 2 references) */
313
314 Ret = hAccel;
315
316Exit:
317 UserLeave();
318 TRACE("Leave NtUserCreateAcceleratorTable(Entries %p, EntriesCount %u) = %p\n",
319 Entries, EntriesCount, Ret);
320 return Ret;
321}
#define MAXULONG_PTR
Definition: basetsd.h:97
#define STATUS_NO_MEMORY
Definition: d3dkmdt.h:51
_Use_decl_annotations_ NTSTATUS NTAPI RtlMultiByteToUnicodeN(_Out_ PWCH UnicodeString, _In_ ULONG UnicodeSize, _Out_opt_ PULONG ResultSize, _In_ PCCH MbString, _In_ ULONG MbSize)
Definition: nlsboot.c:63
char CHAR
Definition: pedump.c:57
const char * PCSTR
Definition: typedefs.h:52
#define FVIRT_MASK
Definition: accelerator.c:17
#define USERTAG_ACCEL
Definition: tags.h:196
#define FVIRTKEY
Definition: winuser.h:24

Referenced by CreateAcceleratorTableW(), START_TEST(), and U32LoadAccelerators().

◆ NtUserCreateCaret()

BOOL NTAPI NtUserCreateCaret ( HWND  hWnd,
HBITMAP  hBitmap,
int  nWidth,
int  nHeight 
)

Definition at line 307 of file caret.c.

312{
313 PWND Window;
314 PTHREADINFO pti;
315 PUSER_MESSAGE_QUEUE ThreadQueue;
316 BOOL Ret = FALSE;
317
318 TRACE("Enter NtUserCreateCaret\n");
320
322 {
323 goto Exit; // Return FALSE
324 }
325
326 if(Window->head.pti->pEThread != PsGetCurrentThread())
327 {
329 goto Exit; // Return FALSE
330 }
331
333 ThreadQueue = pti->MessageQueue;
334
335 if (ThreadQueue->CaretInfo.Visible)
336 {
338 co_IntHideCaret(&ThreadQueue->CaretInfo);
339 }
340
341 ThreadQueue->CaretInfo.hWnd = hWnd;
342 if(hBitmap)
343 {
344 ThreadQueue->CaretInfo.Bitmap = hBitmap;
345 ThreadQueue->CaretInfo.Size.cx = ThreadQueue->CaretInfo.Size.cy = 0;
346 }
347 else
348 {
349 if (nWidth == 0)
350 {
352 }
353 if (nHeight == 0)
354 {
356 }
357 ThreadQueue->CaretInfo.Bitmap = (HBITMAP)0;
358 ThreadQueue->CaretInfo.Size.cx = nWidth;
359 ThreadQueue->CaretInfo.Size.cy = nHeight;
360 }
361 ThreadQueue->CaretInfo.Visible = 0;
362 ThreadQueue->CaretInfo.Showing = 0;
363
365
366 IntNotifyWinEvent(EVENT_OBJECT_CREATE, Window, OBJID_CARET, CHILDID_SELF, 0);
367
368 Ret = TRUE;
369
370Exit:
371 TRACE("Leave NtUserCreateCaret, ret=%i\n", Ret);
372 UserLeave();
373 return Ret;
374}
static HBITMAP hBitmap
Definition: timezone.c:26
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
static HBITMAP
Definition: button.c:44
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
HBITMAP Bitmap
Definition: ntusrtyp.h:130
THRDCARETINFO CaretInfo
Definition: msgqueue.h:92
#define IDCARETTIMER
Definition: undocuser.h:81
VOID CALLBACK CaretSystemTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
Definition: caret.c:97
static BOOL FASTCALL co_IntHideCaret(PTHRDCARETINFO CaretInfo)
Definition: caret.c:143
LONG NTAPI UserGetSystemMetrics(ULONG Index)
Definition: metric.c:209
UINT_PTR FASTCALL IntSetTimer(PWND Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type)
Definition: timer.c:182
#define TMRF_SYSTEM
Definition: timer.h:20
#define OBJID_CARET
Definition: winable.h:23
#define CHILDID_SELF
Definition: winable.h:14
#define SM_CYBORDER
Definition: winuser.h:976
#define SM_CXBORDER
Definition: winuser.h:975

Referenced by CreateCaret().

◆ NtUserCreateDesktop()

HDESK NTAPI NtUserCreateDesktop ( POBJECT_ATTRIBUTES  poa,
PUNICODE_STRING  lpszDesktopDevice,
LPDEVMODEW  lpdmw,
DWORD  dwFlags,
ACCESS_MASK  dwDesiredAccess 
)

Definition at line 2562 of file desktop.c.

2568{
2570 HDESK hDesk;
2571 HDESK Ret = NULL;
2572
2573 TRACE("Enter NtUserCreateDesktop\n");
2575
2576 Status = IntCreateDesktop(&hDesk,
2578 UserMode,
2579 lpszDesktopDevice,
2580 lpdmw,
2581 dwFlags,
2582 dwDesiredAccess);
2583 if (!NT_SUCCESS(Status))
2584 {
2585 ERR("IntCreateDesktop failed, Status 0x%08lx\n", Status);
2586 // SetLastNtError(Status);
2587 goto Exit; // Return NULL
2588 }
2589
2590 Ret = hDesk;
2591
2592Exit:
2593 TRACE("Leave NtUserCreateDesktop, ret=0x%p\n", Ret);
2594 UserLeave();
2595 return Ret;
2596}
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
NTSTATUS FASTCALL IntCreateDesktop(OUT HDESK *phDesktop, IN POBJECT_ATTRIBUTES ObjectAttributes, IN KPROCESSOR_MODE AccessMode, IN PUNICODE_STRING lpszDesktopDevice OPTIONAL, IN LPDEVMODEW lpdmw OPTIONAL, IN DWORD dwFlags, IN ACCESS_MASK dwDesiredAccess)
Definition: desktop.c:2385

Referenced by CreateDesktopW().

◆ NtUserCreateInputContext()

HIMC NTAPI NtUserCreateInputContext ( _In_ ULONG_PTR  dwClientImcData)

Definition at line 1699 of file ime.c.

1700{
1701 PIMC pIMC;
1702 HIMC ret = NULL;
1703
1705
1706 if (!IS_IMM_MODE())
1707 {
1708 ERR("!IS_IMM_MODE()\n");
1710 goto Quit;
1711 }
1712
1713 if (!dwClientImcData)
1714 {
1716 goto Quit;
1717 }
1718
1719 pIMC = UserCreateInputContext(dwClientImcData);
1720 if (pIMC)
1721 ret = UserHMGetHandle(pIMC);
1722
1723Quit:
1724 UserLeave();
1725 return ret;
1726}
PIMC FASTCALL UserCreateInputContext(_In_ ULONG_PTR dwClientImcData)
Definition: ime.c:1651

Referenced by ImmCreateContext().

◆ NtUserCreateLocalMemHandle()

NTSTATUS NTAPI NtUserCreateLocalMemHandle ( HANDLE  hMem,
PVOID  pData,
DWORD  cbData,
DWORD pcbData 
)

Definition at line 1233 of file clipboard.c.

1238{
1239 PCLIPBOARDDATA pMemObj;
1241
1243
1244 /* Get Clipboard data object */
1246 if (!pMemObj)
1247 {
1249 goto cleanup;
1250 }
1251
1252 /* Don't overrun */
1253 if (cbData > pMemObj->cbData)
1254 cbData = pMemObj->cbData;
1255
1256 /* Copy data to usermode */
1257 _SEH2_TRY
1258 {
1259 if (pcbData)
1260 {
1261 ProbeForWrite(pcbData, sizeof(*pcbData), 1);
1262 *pcbData = pMemObj->cbData;
1263 }
1264
1266 memcpy(pData, pMemObj->Data, cbData);
1267 }
1269 {
1271 }
1272 _SEH2_END;
1273
1274cleanup:
1275 UserLeave();
1276
1277 return Status;
1278}
struct tagCLIPBOARDDATA * PCLIPBOARDDATA
_In_ _Out_writes_opt_ pcchValueName _Inout_opt_ LPDWORD _Out_opt_ _Out_writes_bytes_to_opt_ pcbData _Inout_opt_ LPDWORD pcbData
Definition: shlwapi.h:757
PVOID UserGetObject(PUSER_HANDLE_TABLE ht, HANDLE handle, HANDLE_TYPE type)
Definition: object.c:495

Referenced by getClipboardData(), and GetClipboardData().

◆ NtUserCreateWindowEx()

HWND NTAPI NtUserCreateWindowEx ( DWORD  dwExStyle,
PLARGE_STRING  plstrClassName,
PLARGE_STRING  plstrClsVersion,
PLARGE_STRING  plstrWindowName,
DWORD  dwStyle,
int  x,
int  y,
int  nWidth,
int  nHeight,
HWND  hWndParent,
HMENU  hMenu,
HINSTANCE  hInstance,
LPVOID  lpParam,
DWORD  dwFlags,
PVOID  acbiBuffer 
)
Todo:
Allow passing plstrClassName as ANSI.

Definition at line 2680 of file window.c.

2696{
2698 LARGE_STRING lstrWindowName;
2699 LARGE_STRING lstrClassName;
2700 LARGE_STRING lstrClsVersion;
2701 UNICODE_STRING ustrClassName;
2702 UNICODE_STRING ustrClsVersion;
2703 CREATESTRUCTW Cs;
2704 HWND hwnd = NULL;
2705 PWND pwnd;
2706
2707 lstrWindowName.Buffer = NULL;
2708 lstrClassName.Buffer = NULL;
2709 lstrClsVersion.Buffer = NULL;
2710
2711 if ( (dwStyle & (WS_POPUP|WS_CHILD)) != WS_CHILD)
2712 {
2713 /* check hMenu is valid handle */
2714 if (hMenu && !UserGetMenuObject(hMenu))
2715 {
2716 ERR("NtUserCreateWindowEx: Got an invalid menu handle!\n");
2718 return NULL;
2719 }
2720 }
2721
2722 /* Copy the window name to kernel mode */
2723 Status = ProbeAndCaptureLargeString(&lstrWindowName, plstrWindowName);
2724 if (!NT_SUCCESS(Status))
2725 {
2726 ERR("NtUserCreateWindowEx: failed to capture plstrWindowName\n");
2728 return NULL;
2729 }
2730
2731 plstrWindowName = &lstrWindowName;
2732
2733 /* Check if the class is an atom */
2734 if (IS_ATOM(plstrClassName))
2735 {
2736 /* It is, pass the atom in the UNICODE_STRING */
2737 ustrClassName.Buffer = (PVOID)plstrClassName;
2738 ustrClassName.Length = 0;
2739 ustrClassName.MaximumLength = 0;
2740 }
2741 else
2742 {
2743 /* It's not, capture the class name */
2744 Status = ProbeAndCaptureLargeString(&lstrClassName, plstrClassName);
2745 if (!NT_SUCCESS(Status))
2746 {
2747 ERR("NtUserCreateWindowEx: failed to capture plstrClassName\n");
2748 /* Set last error, cleanup and return */
2750 goto cleanup;
2751 }
2752
2753 /* We pass it on as a UNICODE_STRING */
2754 ustrClassName.Buffer = lstrClassName.Buffer;
2755 ustrClassName.Length = (USHORT)min(lstrClassName.Length, MAXUSHORT); // FIXME: LARGE_STRING truncated
2756 ustrClassName.MaximumLength = (USHORT)min(lstrClassName.MaximumLength, MAXUSHORT);
2757 }
2758
2759 /* Check if the class version is an atom */
2760 if (IS_ATOM(plstrClsVersion))
2761 {
2762 /* It is, pass the atom in the UNICODE_STRING */
2763 ustrClsVersion.Buffer = (PVOID)plstrClsVersion;
2764 ustrClsVersion.Length = 0;
2765 ustrClsVersion.MaximumLength = 0;
2766 }
2767 else
2768 {
2769 /* It's not, capture the class name */
2770 Status = ProbeAndCaptureLargeString(&lstrClsVersion, plstrClsVersion);
2771 if (!NT_SUCCESS(Status))
2772 {
2773 ERR("NtUserCreateWindowEx: failed to capture plstrClsVersion\n");
2774 /* Set last error, cleanup and return */
2776 goto cleanup;
2777 }
2778
2779 /* We pass it on as a UNICODE_STRING */
2780 ustrClsVersion.Buffer = lstrClsVersion.Buffer;
2781 ustrClsVersion.Length = (USHORT)min(lstrClsVersion.Length, MAXUSHORT); // FIXME: LARGE_STRING truncated
2782 ustrClsVersion.MaximumLength = (USHORT)min(lstrClsVersion.MaximumLength, MAXUSHORT);
2783 }
2784
2785 /* Fill the CREATESTRUCTW */
2786 /* we will keep here the original parameters */
2787 Cs.style = dwStyle;
2788 Cs.lpCreateParams = lpParam;
2789 Cs.hInstance = hInstance;
2790 Cs.hMenu = hMenu;
2792 Cs.cx = nWidth;
2793 Cs.cy = nHeight;
2794 Cs.x = x;
2795 Cs.y = y;
2796 Cs.lpszName = (LPCWSTR) plstrWindowName->Buffer;
2797 Cs.lpszClass = ustrClassName.Buffer;
2798 Cs.dwExStyle = dwExStyle;
2799
2801
2802 /* Call the internal function */
2803 pwnd = co_UserCreateWindowEx(&Cs, &ustrClsVersion, plstrWindowName, acbiBuffer, dwFlags);
2804
2805 if(!pwnd)
2806 {
2807 ERR("co_UserCreateWindowEx failed!\n");
2808 }
2809 hwnd = pwnd ? UserHMGetHandle(pwnd) : NULL;
2810
2811 UserLeave();
2812
2813cleanup:
2814 if (lstrWindowName.Buffer)
2815 {
2816 ExFreePoolWithTag(lstrWindowName.Buffer, TAG_STRING);
2817 }
2818 if (lstrClassName.Buffer)
2819 {
2820 ExFreePoolWithTag(lstrClassName.Buffer, TAG_STRING);
2821 }
2822 if (lstrClsVersion.Buffer)
2823 {
2824 ExFreePoolWithTag(lstrClsVersion.Buffer, TAG_STRING);
2825 }
2826
2827 return hwnd;
2828}
HINSTANCE hInstance
Definition: charmap.c:19
#define IS_ATOM(x)
Definition: class.h:3
#define TAG_STRING
Definition: oslist.h:22
ULONG Length
Definition: ntuser.h:91
ULONG MaximumLength
Definition: ntuser.h:92
PVOID Buffer
Definition: ntuser.h:94
USHORT MaximumLength
Definition: env_spec_w32.h:370
LPCWSTR lpszClass
Definition: winuser.h:3073
LPCWSTR lpszName
Definition: winuser.h:3072
LPVOID lpCreateParams
Definition: winuser.h:3063
HINSTANCE hInstance
Definition: winuser.h:3064
const uint16_t * LPCWSTR
Definition: typedefs.h:57
#define MAXUSHORT
Definition: typedefs.h:83
PWND FASTCALL co_UserCreateWindowEx(CREATESTRUCTW *Cs, PUNICODE_STRING ClassName, PLARGE_STRING WindowName, PVOID acbiBuffer, DWORD dwVer)
Definition: window.c:2177
NTSTATUS NTAPI ProbeAndCaptureLargeString(OUT PLARGE_STRING plstrSafe, IN PLARGE_STRING plstrUnsafe)
Definition: window.c:2623
#define ERROR_INVALID_MENU_HANDLE
Definition: winerror.h:1227

Referenced by CreateWnd(), User32CreateWindowEx(), and WIN_CreateWindowEx().

◆ NtUserCreateWindowStation()

HWINSTA NTAPI NtUserCreateWindowStation ( POBJECT_ATTRIBUTES  ObjectAttributes,
ACCESS_MASK  dwDesiredAccess,
DWORD  Unknown2,
DWORD  Unknown3,
DWORD  Unknown4,
DWORD  Unknown5,
DWORD  Unknown6 
)

◆ NtUserCtxDisplayIOCtl()

DWORD NTAPI NtUserCtxDisplayIOCtl ( DWORD  dwUnknown1,
DWORD  dwUnknown2,
DWORD  dwUnknown3 
)

Definition at line 899 of file ntstubs.c.

903{
904 STUB;
905 return 0;
906}

◆ NtUserDbgWin32HeapFail()

DWORD APIENTRY NtUserDbgWin32HeapFail ( DWORD  Unknown0,
DWORD  Unknown1 
)

Definition at line 266 of file ntstubs.c.

269{
270 STUB
271
272 return 0;
273}

◆ NtUserDbgWin32HeapStat()

DWORD APIENTRY NtUserDbgWin32HeapStat ( DWORD  Unknown0,
DWORD  Unknown1 
)

Definition at line 277 of file ntstubs.c.

280{
281 STUB
282
283 return 0;
284}

◆ NtUserDdeGetQualityOfService()

BOOL NTAPI NtUserDdeGetQualityOfService ( IN HWND  hwndClient,
IN HWND  hWndServer,
OUT PSECURITY_QUALITY_OF_SERVICE  pqosPrev 
)

Definition at line 430 of file dde.c.

434{
435 STUB
436
437 return 0;
438}

◆ NtUserDdeInitialize()

DWORD NTAPI NtUserDdeInitialize ( DWORD  Unknown0,
DWORD  Unknown1,
DWORD  Unknown2,
DWORD  Unknown3,
DWORD  Unknown4 
)

Definition at line 465 of file dde.c.

471{
472 STUB
473
474 return 0;
475}

◆ NtUserDdeSetQualityOfService()

BOOL NTAPI NtUserDdeSetQualityOfService ( IN HWND  hwndClient,
IN PSECURITY_QUALITY_OF_SERVICE  pqosNew,
OUT PSECURITY_QUALITY_OF_SERVICE  pqosPrev 
)

Definition at line 442 of file dde.c.

446{
447 STUB
448
449 return 0;
450}

◆ NtUserDeferWindowPos()

HDWP NTAPI NtUserDeferWindowPos ( HDWP  WinPosInfo,
HWND  Wnd,
HWND  WndInsertAfter,
int  x,
int  y,
int  cx,
int  cy,
UINT  Flags 
)

Definition at line 3316 of file winpos.c.

3324{
3325 PWND pWnd, pWndIA;
3326 HDWP Ret = NULL;
3330
3331 TRACE("Enter NtUserDeferWindowPos\n");
3333
3334 if ( Flags & Tmp )
3335 {
3337 goto Exit;
3338 }
3339
3340 pWnd = UserGetWindowObject(Wnd);
3341 if (!pWnd || UserIsDesktopWindow(pWnd) || UserIsMessageWindow(pWnd))
3342 {
3343 goto Exit;
3344 }
3345
3346 if ( WndInsertAfter &&
3347 WndInsertAfter != HWND_BOTTOM &&
3348 WndInsertAfter != HWND_TOPMOST &&
3349 WndInsertAfter != HWND_NOTOPMOST )
3350 {
3351 pWndIA = UserGetWindowObject(WndInsertAfter);
3352 if (!pWndIA || UserIsDesktopWindow(pWndIA) || UserIsMessageWindow(pWndIA))
3353 {
3354 goto Exit;
3355 }
3356 }
3357
3358 Ret = IntDeferWindowPos(WinPosInfo, Wnd, WndInsertAfter, x, y, cx, cy, Flags);
3359
3360Exit:
3361 TRACE("Leave NtUserDeferWindowPos, ret=%p\n", Ret);
3362 UserLeave();
3363 return Ret;
3364}
#define UserIsMessageWindow(pWnd)
Definition: desktop.h:197
#define UserIsDesktopWindow(pWnd)
Definition: desktop.h:194
HDWP FASTCALL IntDeferWindowPos(HDWP hdwp, HWND hwnd, HWND hwndAfter, INT x, INT y, INT cx, INT cy, UINT flags)
Definition: winpos.c:3119
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
#define ERROR_INVALID_FLAGS
Definition: winerror.h:907
#define SWP_NOREDRAW
Definition: winuser.h:1257
#define SWP_NOREPOSITION
Definition: winuser.h:1261
#define HWND_TOPMOST
Definition: winuser.h:1219
#define SWP_DEFERERASE
Definition: winuser.h:1263
#define SWP_NOCOPYBITS
Definition: winuser.h:1254
#define SWP_SHOWWINDOW
Definition: winuser.h:1259
#define SWP_HIDEWINDOW
Definition: winuser.h:1252
#define SWP_NOSENDCHANGING
Definition: winuser.h:1262
#define HWND_NOTOPMOST
Definition: winuser.h:1217

Referenced by DeferWindowPos().

◆ NtUserDefSetText()

BOOL NTAPI NtUserDefSetText ( HWND  WindowHandle,
PLARGE_STRING  WindowText 
)

Definition at line 4466 of file window.c.

4467{
4468 PWND Wnd;
4469 LARGE_STRING SafeText;
4471 BOOL Ret = TRUE;
4472
4473 TRACE("Enter NtUserDefSetText\n");
4474
4475 if (WindowText != NULL)
4476 {
4477 _SEH2_TRY
4478 {
4479 SafeText = ProbeForReadLargeString(WindowText);
4480 }
4482 {
4483 Ret = FALSE;
4485 }
4486 _SEH2_END;
4487
4488 if (!Ret)
4489 return FALSE;
4490 }
4491 else
4492 return TRUE;
4493
4495
4496 if(!(Wnd = UserGetWindowObject(hWnd)))
4497 {
4498 UserLeave();
4499 return FALSE;
4500 }
4501
4502 // ReactOS uses Unicode and not mixed. Up/Down converting will take time.
4503 // Brought to you by: The Wine Project! Dysfunctional Thought Processes!
4504 // Now we know what the bAnsi is for.
4506 if (SafeText.Buffer)
4507 {
4508 _SEH2_TRY
4509 {
4510 if (SafeText.bAnsi)
4511 ProbeForRead(SafeText.Buffer, SafeText.Length, sizeof(CHAR));
4512 else
4513 ProbeForRead(SafeText.Buffer, SafeText.Length, sizeof(WCHAR));
4515 }
4517 {
4518 Ret = FALSE;
4520 }
4521 _SEH2_END;
4522 if (!Ret) goto Exit;
4523 }
4524
4525 if (UnicodeString.Length != 0)
4526 {
4527 if (Wnd->strName.MaximumLength > 0 &&
4529 {
4530 ASSERT(Wnd->strName.Buffer != NULL);
4531
4533 Wnd->strName.Buffer[UnicodeString.Length / sizeof(WCHAR)] = L'\0';
4537 }
4538 else
4539 {
4540 PWCHAR buf;
4541 Wnd->strName.MaximumLength = Wnd->strName.Length = 0;
4542 buf = Wnd->strName.Buffer;
4543 Wnd->strName.Buffer = NULL;
4544 if (buf != NULL)
4545 {
4547 }
4548
4551 if (Wnd->strName.Buffer != NULL)
4552 {
4553 Wnd->strName.Buffer[UnicodeString.Length / sizeof(WCHAR)] = L'\0';
4559 }
4560 else
4561 {
4563 Ret = FALSE;
4564 goto Exit;
4565 }
4566 }
4567 }
4568 else
4569 {
4570 Wnd->strName.Length = 0;
4571 if (Wnd->strName.Buffer != NULL)
4572 Wnd->strName.Buffer[0] = L'\0';
4573 }
4574
4575 // FIXME: HAX! Windows does not do this in here!
4576 // In User32, these are called after: NotifyWinEvent EVENT_OBJECT_NAMECHANGE than
4577 // RepaintButton, StaticRepaint, NtUserCallHwndLock HWNDLOCK_ROUTINE_REDRAWFRAMEANDHOOK, etc.
4578 /* Send shell notifications */
4579 if (!Wnd->spwndOwner && !IntGetParent(Wnd))
4580 {
4581 co_IntShellHookNotify(HSHELL_REDRAW, (WPARAM) hWnd, FALSE); // FIXME Flashing?
4582 }
4583
4584 Ret = TRUE;
4585Exit:
4587 TRACE("Leave NtUserDefSetText, ret=%i\n", Ret);
4588 UserLeave();
4589 return Ret;
4590}
static __inline PVOID DesktopHeapAlloc(IN PDESKTOP Desktop, IN SIZE_T Bytes)
Definition: desktop.h:204
static __inline BOOL DesktopHeapFree(IN PDESKTOP Desktop, IN PVOID lpMem)
Definition: desktop.h:215
#define L(x)
Definition: resources.c:13
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
BOOL NTAPI RtlLargeStringToUnicodeString(PUNICODE_STRING, PLARGE_STRING)
Definition: rtlstr.c:67
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define UNICODE_NULL
ULONG bAnsi
Definition: ntuser.h:93
struct _DESKTOP * rpdesk
Definition: ntuser.h:194
struct _WND * spwndOwner
Definition: ntuser.h:715
LARGE_UNICODE_STRING strName
Definition: ntuser.h:736
uint16_t * PWCHAR
Definition: typedefs.h:56
WDF_EXTERN_C_START typedef _Must_inspect_result_ _In_opt_ PCUNICODE_STRING UnicodeString
Definition: wdfstring.h:64

Referenced by DefSetText().

◆ NtUserDeleteMenu()

BOOL NTAPI NtUserDeleteMenu ( HMENU  hMenu,
UINT  uPosition,
UINT  uFlags 
)

Definition at line 5635 of file menu.c.

5639{
5640 PMENU Menu;
5641 BOOL Ret = FALSE;
5642
5643 TRACE("Enter NtUserDeleteMenu\n");
5645
5646 Menu = UserGetMenuObject(hMenu);
5647 if (Menu)
5648 {
5649 Ret = IntRemoveMenuItem(Menu, uPosition, uFlags, TRUE);
5650 }
5651
5652 UserLeave();
5653 TRACE("Leave NtUserDeleteMenu, ret=%i\n", Ret);
5654 return Ret;
5655}
UINT uFlags
Definition: api.c:59
BOOL FASTCALL IntRemoveMenuItem(PMENU pMenu, UINT nPos, UINT wFlags, BOOL bRecurse)
Definition: menu.c:596

Referenced by DeleteMenu().

◆ NtUserDestroyAcceleratorTable()

BOOLEAN NTAPI NtUserDestroyAcceleratorTable ( HACCEL  Table)

Definition at line 340 of file accelerator.c.

342{
343 PACCELERATOR_TABLE Accel;
344 BOOLEAN Ret = FALSE;
345
346 /* FIXME: If the handle table is from a call to LoadAcceleratorTable, decrement it's
347 usage count (and return TRUE).
348 FIXME: Destroy only tables created using CreateAcceleratorTable.
349 */
350
351 TRACE("NtUserDestroyAcceleratorTable(Table %p)\n", hAccel);
353
354 Accel = UserGetAccelObject(hAccel);
355 if (Accel)
356 {
357 Ret = UserDestroyAccelTable(Accel);
358 }
359
360 TRACE("Leave NtUserDestroyAcceleratorTable(Table %p) = %u\n", hAccel, Ret);
361 UserLeave();
362 return Ret;
363}
BOOLEAN UserDestroyAccelTable(PVOID Object)
Definition: accelerator.c:324

Referenced by DestroyAcceleratorTable().

◆ NtUserDestroyCursor()

BOOL NTAPI NtUserDestroyCursor ( _In_ HANDLE  Handle,
_In_ BOOL  bForce 
)

Definition at line 795 of file cursoricon.c.

798{
799 BOOL ret;
800 PCURICON_OBJECT CurIcon = NULL;
801
802 TRACE("Enter NtUserDestroyCursorIcon (%p, %i)\n", hCurIcon, bForce);
804
805 CurIcon = UserGetCurIconObject(hCurIcon);
806 if (!CurIcon)
807 {
808 ret = FALSE;
809 goto leave;
810 }
811
812 if (!bForce)
813 {
814 /* Can not destroy global objects */
815 if (CurIcon->head.ppi == NULL)
816 {
817 ERR("Trying to delete global cursor!\n");
818 ret = TRUE;
819 goto leave;
820 }
821
822 /* Maybe we have good reasons not to destroy this object */
823 if (CurIcon->head.ppi != PsGetCurrentProcessWin32Process())
824 {
825 /* No way, you're not touching my cursor */
826 ret = FALSE;
827 goto leave;
828 }
829
830 if (CurIcon->CURSORF_flags & CURSORF_CURRENT)
831 {
832 WARN("Trying to delete current cursor!\n");
833 ret = FALSE;
834 goto leave;
835 }
836
837 if (CurIcon->CURSORF_flags & CURSORF_LRSHARED)
838 {
839 WARN("Trying to delete shared cursor.\n");
840 /* This one is not an error */
841 ret = TRUE;
842 goto leave;
843 }
844 }
845
846 /* Destroy the handle */
847 ret = IntDestroyCurIconObject(CurIcon);
848
849leave:
850 if (CurIcon)
851 UserDereferenceObject(CurIcon);
852 TRACE("Leave NtUserDestroyCursorIcon, ret=%i\n", ret);
853 UserLeave();
854 return ret;
855}
#define WARN(fmt,...)
Definition: precomp.h:61
#define leave
Definition: btrfs_drv.h:138
#define CURSORF_LRSHARED
Definition: ntuser.h:1201
#define CURSORF_CURRENT
Definition: ntuser.h:1207
PROCMARKHEAD head
Definition: cursoricon.h:11
ULONG CURSORF_flags
Definition: cursoricon.h:16
struct _PROCESSINFO * ppi
Definition: ntuser.h:227
PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon)
Definition: cursoricon.c:200
BOOLEAN IntDestroyCurIconObject(_In_ PVOID Object)
Definition: cursoricon.c:317

Referenced by CreateIconFromResourceEx(), CreateIconIndirect(), CURSORICON_CopyImage(), CURSORICON_LoadFromFileW(), CURSORICON_LoadImageW(), DestroyCursor(), DestroyIcon(), START_TEST(), and Test_OneParamRoutine_CreateEmptyCurObject().

◆ NtUserDestroyInputContext()

BOOL NTAPI NtUserDestroyInputContext ( _In_ HIMC  hIMC)

Definition at line 1628 of file ime.c.

1629{
1630 BOOL ret = FALSE;
1631 PIMC pIMC;
1632
1634
1635 if (!IS_IMM_MODE())
1636 {
1638 goto Quit;
1639 }
1640
1642 if (pIMC)
1644
1645Quit:
1646 UserLeave();
1647 return ret;
1648}
static BOOL IntDestroyInputContext(_In_ PIMC pIMC)
Definition: ime.c:1588

Referenced by Imm32DestroyInputContext().

◆ NtUserDestroyMenu()

BOOL NTAPI NtUserDestroyMenu ( HMENU  hMenu)

Definition at line 5842 of file menu.c.

5844{
5845 PMENU Menu;
5846 BOOL Ret = FALSE;
5847
5848 TRACE("Enter NtUserDestroyMenu\n");
5850
5851 if(!(Menu = UserGetMenuObject(hMenu)))
5852 {
5853 goto Exit; // Return FALSE
5854 }
5855 if (Menu->head.rpdesk != gptiCurrent->rpdesk)
5856 {
5858 goto Exit; // Return FALSE
5859 }
5860 Ret = IntDestroyMenuObject(Menu, TRUE);
5861
5862Exit:
5863 UserLeave();
5864 TRACE("Leave NtUserDestroyMenu, ret=%i\n", Ret);
5865 return Ret;
5866}
struct _DESKTOP * rpdesk
Definition: ntuser.h:219
PROCDESKHEAD head
Definition: ntuser.h:417
BOOL FASTCALL IntDestroyMenuObject(PMENU Menu, BOOL bRecurse)
Definition: menu.c:317

Referenced by DestroyMenu(), and WIN_CreateWindowEx().

◆ NtUserDestroyWindow()

BOOLEAN NTAPI NtUserDestroyWindow ( HWND  Wnd)

Definition at line 3049 of file window.c.

3050{
3051 PWND Window;
3052 BOOLEAN ret = FALSE;
3054
3055 TRACE("Enter NtUserDestroyWindow\n");
3057
3059 if (Window)
3060 {
3061 UserRefObjectCo(Window, &Ref); // FIXME: Dunno if win should be reffed during destroy...
3063 UserDerefObjectCo(Window); // FIXME: Dunno if win should be reffed during destroy...
3064 }
3065
3066 TRACE("Leave NtUserDestroyWindow, ret=%u\n", ret);
3067 UserLeave();
3068 return ret;
3069}
BOOLEAN co_UserDestroyWindow(PVOID Object)
Definition: window.c:2865

Referenced by DestroyWindow(), and User32DestroyImeUIWindow().

◆ NtUserDisableThreadIme()

BOOL NTAPI NtUserDisableThreadIme ( _In_ DWORD  dwThreadID)

Definition at line 905 of file ime.c.

906{
907 PTHREADINFO pti, ptiCurrent;
908 PPROCESSINFO ppi;
909 BOOL ret = FALSE;
910
912
913 if (!IS_IMM_MODE())
914 {
915 ERR("!IS_IMM_MODE()\n");
917 goto Quit;
918 }
919
920 ptiCurrent = GetW32ThreadInfo();
921
922 if (dwThreadID == INVALID_THREAD_ID)
923 {
924 ppi = ptiCurrent->ppi;
925 ppi->W32PF_flags |= W32PF_DISABLEIME;
926
927Retry:
928 for (pti = ppi->ptiList; pti; pti = pti->ptiSibling)
929 {
931
932 if (pti->spwndDefaultIme)
933 {
935 pti->spwndDefaultIme = NULL;
936 goto Retry; /* The contents of ppi->ptiList may be changed. */
937 }
938 }
939 }
940 else
941 {
942 if (dwThreadID == 0)
943 {
944 pti = ptiCurrent;
945 }
946 else
947 {
948 pti = IntTID2PTI(UlongToHandle(dwThreadID));
949
950 /* The thread needs to reside in the current process. */
951 if (!pti || pti->ppi != ptiCurrent->ppi)
952 goto Quit;
953 }
954
956
957 if (pti->spwndDefaultIme)
958 {
960 pti->spwndDefaultIme = NULL;
961 }
962 }
963
964 ret = TRUE;
965
966Quit:
967 UserLeave();
968 return ret;
969}
_In_ PSCSI_REQUEST_BLOCK _Out_ NTSTATUS _Inout_ BOOLEAN * Retry
Definition: classpnp.h:312
#define TIF_DISABLEIME
Definition: ntuser.h:288
PTHREADINFO ptiList
Definition: win32.h:257
PTHREADINFO ptiSibling
Definition: win32.h:116
FLONG TIF_flags
Definition: win32.h:95
struct _WND * spwndDefaultIme
Definition: win32.h:131
BOOLEAN co_UserDestroyWindow(PVOID Object)
Definition: window.c:2865
#define W32PF_DISABLEIME
Definition: win32.h:28

Referenced by ImmDisableIME().

◆ NtUserDispatchMessage()

LRESULT NTAPI NtUserDispatchMessage ( PMSG  pMsg)

Definition at line 2464 of file message.c.

2465{
2466 LRESULT Res = 0;
2467 MSG SafeMsg;
2468
2469 _SEH2_TRY
2470 {
2471 ProbeForRead(UnsafeMsgInfo, sizeof(MSG), 1);
2472 RtlCopyMemory(&SafeMsg, UnsafeMsgInfo, sizeof(MSG));
2473 }
2475 {
2477 _SEH2_YIELD(return FALSE);
2478 }
2479 _SEH2_END;
2480
2482
2483 Res = IntDispatchMessage(&SafeMsg);
2484
2485 UserLeave();
2486 return Res;
2487}
LRESULT FASTCALL IntDispatchMessage(PMSG pMsg)
Definition: message.c:890

Referenced by DispatchMessageA(), and DispatchMessageW().

◆ NtUserDragDetect()

BOOL NTAPI NtUserDragDetect ( HWND  hWnd,
POINT  pt 
)

Functions

Definition at line 2205 of file message.c.

2208{
2209 MSG msg;
2210 RECT rect;
2211 ULONG wDragWidth, wDragHeight;
2212 BOOL Ret = FALSE;
2213
2214 TRACE("Enter NtUserDragDetect(%p)\n", hWnd);
2216
2217 wDragWidth = UserGetSystemMetrics(SM_CXDRAG);
2218 wDragHeight= UserGetSystemMetrics(SM_CYDRAG);
2219
2220 rect.left = pt.x - wDragWidth;
2221 rect.right = pt.x + wDragWidth;
2222
2223 rect.top = pt.y - wDragHeight;
2224 rect.bottom = pt.y + wDragHeight;
2225
2227
2228 for (;;)
2229 {
2233 {
2234 if ( msg.message == WM_LBUTTONUP )
2235 {
2237 goto Exit; // Return FALSE
2238 }
2239 if ( msg.message == WM_MOUSEMOVE )
2240 {
2241 POINT tmp;
2242 tmp.x = (short)LOWORD(msg.lParam);
2243 tmp.y = (short)HIWORD(msg.lParam);
2244 if( !RECTL_bPointInRect( &rect, tmp.x, tmp.y ) )
2245 {
2247 Ret = TRUE;
2248 goto Exit;
2249 }
2250 }
2251 if ( msg.message == WM_KEYDOWN )
2252 {
2253 if ( msg.wParam == VK_ESCAPE )
2254 {
2256 Ret = TRUE;
2257 goto Exit;
2258 }
2259 }
2260 if ( msg.message == WM_QUEUESYNC )
2261 {
2263 }
2264 }
2265 co_IntWaitMessage(NULL, 0, 0);
2266 }
2267
2268Exit:
2269 TRACE("Leave NtUserDragDetect, ret=%i\n", Ret);
2270 UserLeave();
2271 return Ret;
2272}
RECT rect
Definition: combotst.c:67
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
#define pt(x, y)
Definition: drawing.c:79
HWND FASTCALL co_UserSetCapture(HWND hWnd)
Definition: focus.c:1453
LRESULT APIENTRY co_HOOK_CallHooks(INT HookId, INT Code, WPARAM wParam, LPARAM lParam)
Definition: hook.c:1102
#define LOWORD(l)
Definition: pedump.c:82
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
#define HIWORD(l)
Definition: typedefs.h:247
FORCEINLINE BOOL RECTL_bPointInRect(_In_ const RECTL *prcl, _In_ INT x, _In_ INT y)
Definition: rect.h:52
BOOL FASTCALL co_IntWaitMessage(PWND Window, UINT MsgFilterMin, UINT MsgFilterMax)
Definition: message.c:1180
BOOL APIENTRY co_IntGetPeekMessage(PMSG pMsg, HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax, UINT RemoveMsg, BOOL bGMSG)
Definition: message.c:1226
#define WM_MOUSEFIRST
Definition: winuser.h:1802
#define SM_CXDRAG
Definition: winuser.h:1039
#define WM_MOUSELAST
Definition: winuser.h:1829
#define WM_KEYFIRST
Definition: winuser.h:1742
#define WM_MOUSEMOVE
Definition: winuser.h:1803
#define WH_CBT
Definition: winuser.h:35
#define WM_QUEUESYNC
Definition: winuser.h:1667
#define PM_REMOVE
Definition: winuser.h:1207
#define HCBT_QS
Definition: winuser.h:57
#define WM_LBUTTONUP
Definition: winuser.h:1805
#define WM_KEYDOWN
Definition: winuser.h:1743
#define SM_CYDRAG
Definition: winuser.h:1040
#define WM_KEYLAST
Definition: winuser.h:1756
#define VK_ESCAPE
Definition: winuser.h:2250

Referenced by DragDetect().

◆ NtUserDragObject()

DWORD NTAPI NtUserDragObject ( HWND  hwnd1,
HWND  hwnd2,
UINT  u1,
DWORD  dw1,
HCURSOR  hc1 
)

Definition at line 48 of file ntstubs.c.

55{
56 STUB
57
58 return 0;
59}

Referenced by DragObject().

◆ NtUserDrawAnimatedRects()

BOOL NTAPI NtUserDrawAnimatedRects ( HWND  hwnd,
INT  idAni,
RECT lprcFrom,
RECT lprcTo 
)

Definition at line 63 of file ntstubs.c.

68{
69 STUB
70
71 return 0;
72}

Referenced by DrawAnimatedRects().

◆ NtUserDrawCaption()

BOOL NTAPI NtUserDrawCaption ( HWND  hWnd,
HDC  hDc,
LPCRECT  lpRc,
UINT  uFlags 
)

Definition at line 2454 of file painting.c.

2458{
2459 return NtUserDrawCaptionTemp(hWnd, hDC, lpRc, 0, 0, NULL, uFlags);
2460}
BOOL APIENTRY NtUserDrawCaptionTemp(HWND hWnd, HDC hDC, LPCRECT lpRc, HFONT hFont, HICON hIcon, const PUNICODE_STRING str, UINT uFlags)
Definition: painting.c:2371

Referenced by DrawCaption(), RealUserDrawCaption(), and UserPaintCaption().

◆ NtUserDrawCaptionTemp()

BOOL NTAPI NtUserDrawCaptionTemp ( HWND  hWnd,
HDC  hDC,
LPCRECT  lpRc,
HFONT  hFont,
HICON  hIcon,
const PUNICODE_STRING  str,
UINT  uFlags 
)

Definition at line 2371 of file painting.c.

2379{
2380 PWND pWnd = NULL;
2381 UNICODE_STRING SafeStr = {0};
2383 RECTL SafeRect;
2384 BOOL Ret;
2385
2387
2388 if (hWnd != NULL)
2389 {
2390 if(!(pWnd = UserGetWindowObject(hWnd)))
2391 {
2392 UserLeave();
2393 return FALSE;
2394 }
2395 }
2396
2397 _SEH2_TRY
2398 {
2399 ProbeForRead(lpRc, sizeof(RECTL), sizeof(ULONG));
2400 RtlCopyMemory(&SafeRect, lpRc, sizeof(RECTL));
2401 if (str != NULL)
2402 {
2403 SafeStr = ProbeForReadUnicodeString(str);
2404 if (SafeStr.Length != 0)
2405 {
2406 ProbeForRead( SafeStr.Buffer,
2407 SafeStr.Length,
2408 sizeof(WCHAR));
2409 }
2410 }
2411 }
2413 {
2415 }
2416 _SEH2_END;
2417
2418 if (Status != STATUS_SUCCESS)
2419 {
2421 UserLeave();
2422 return FALSE;
2423 }
2424
2425 if (str != NULL)
2426 Ret = UserDrawCaption(pWnd, hDC, &SafeRect, hFont, hIcon, &SafeStr, uFlags);
2427 else
2428 {
2429 if ( RECTL_bIsEmptyRect(&SafeRect) && hFont == 0 && hIcon == 0 )
2430 {
2431 Ret = TRUE;
2433 {
2434 ERR("NC Caption Mode\n");
2436 goto Exit;
2437 }
2438 else if (uFlags & DC_DRAWFRAMEMD)
2439 {
2440 ERR("NC Paint Mode\n");
2441 NC_DoNCPaint(pWnd, hDC, uFlags); // Update Menus too!
2442 goto Exit;
2443 }
2444 }
2445 Ret = UserDrawCaption(pWnd, hDC, &SafeRect, hFont, hIcon, NULL, uFlags);
2446 }
2447Exit:
2448 UserLeave();
2449 return Ret;
2450}
HFONT hFont
Definition: main.c:53
HICON hIcon
Definition: msconfig.c:44
const WCHAR * str
#define ProbeForReadUnicodeString(Ptr)
Definition: probe.h:77
#define DC_DRAWCAPTIONMD
Definition: undocuser.h:152
#define DC_DRAWFRAMEMD
Definition: undocuser.h:154
BOOL UserDrawCaption(PWND pWnd, HDC hDc, RECTL *lpRc, HFONT hFont, HICON hIcon, const PUNICODE_STRING Str, UINT uFlags)
Definition: painting.c:2189
FORCEINLINE BOOL RECTL_bIsEmptyRect(_In_ const RECTL *prcl)
Definition: rect.h:44
VOID UserDrawCaptionBar(PWND pWnd, HDC hDC, INT Flags)
Definition: nonclient.c:955
LRESULT NC_DoNCPaint(PWND pWnd, HDC hDC, INT Flags)
Definition: nonclient.c:1097

Referenced by DrawCaptionTempW(), and NtUserDrawCaption().

◆ NtUserDrawIconEx()

BOOL NTAPI NtUserDrawIconEx ( HDC  hdc,
int  xLeft,
int  yTop,
HICON  hIcon,
int  cxWidth,
int  cyWidth,
UINT  istepIfAniCur,
HBRUSH  hbrFlickerFreeDraw,
UINT  diFlags,
BOOL  bMetaHDC,
PVOID  pDIXData 
)

Definition at line 2086 of file cursoricon.c.

2098{
2099 PCURICON_OBJECT pIcon;
2100 BOOL Ret;
2101
2102 TRACE("Enter NtUserDrawIconEx\n");
2104
2105 if (!(pIcon = UserGetCurIconObject(hIcon)))
2106 {
2107 ERR("UserGetCurIconObject(0x%p) failed!\n", hIcon);
2108 UserLeave();
2109 return FALSE;
2110 }
2111
2112 Ret = UserDrawIconEx(hdc,
2113 xLeft,
2114 yTop,
2115 pIcon,
2116 cxWidth,
2117 cyHeight,
2118 istepIfAniCur,
2119 hbrFlickerFreeDraw,
2120 diFlags);
2121
2122 UserDereferenceObject(pIcon);
2123
2124 UserLeave();
2125 return Ret;
2126}
BOOL UserDrawIconEx(HDC hDc, INT xLeft, INT yTop, PCURICON_OBJECT pIcon, INT cxWidth, INT cyHeight, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags)
Definition: cursoricon.c:1691

Referenced by DrawIconEx().

◆ NtUserDrawMenuBarTemp()

DWORD NTAPI NtUserDrawMenuBarTemp ( HWND  hWnd,
HDC  hDC,
PRECT  hRect,
HMENU  hMenu,
HFONT  hFont 
)

Definition at line 6248 of file menu.c.

6254{
6255 PMENU Menu;
6256 PWND Window;
6257 RECT Rect;
6259 DWORD Ret = 0;
6260
6261 ERR("Enter NtUserDrawMenuBarTemp\n");
6263
6265 {
6267 goto Exit; // Return 0
6268 }
6269
6270 if(!(Menu = UserGetMenuObject(hMenu)))
6271 {
6273 goto Exit; // Return 0
6274 }
6275
6276 _SEH2_TRY
6277 {
6278 ProbeForRead(pRect, sizeof(RECT), sizeof(ULONG));
6279 RtlCopyMemory(&Rect, pRect, sizeof(RECT));
6280 }
6282 {
6284 }
6285 _SEH2_END;
6286
6287 if (Status != STATUS_SUCCESS)
6288 {
6290 goto Exit; // Return 0
6291 }
6292
6293 Ret = IntDrawMenuBarTemp(Window, hDC, &Rect, Menu, hFont);
6294
6295Exit:
6296 UserLeave();
6297 ERR("Leave NtUserDrawMenuBarTemp, ret=%lu\n", Ret);
6298 return Ret;
6299}
DWORD WINAPI IntDrawMenuBarTemp(PWND pWnd, HDC hDC, LPRECT Rect, PMENU pMenu, HFONT Font)
Definition: menu.c:2685

◆ NtUserEmptyClipboard()

BOOL NTAPI NtUserEmptyClipboard ( VOID  )

Definition at line 722 of file clipboard.c.

723{
724 BOOL bRet;
725
726 TRACE("NtUserEmptyClipboard()\n");
727
729 bRet = UserEmptyClipboard();
730 UserLeave();
731
732 return bRet;
733}
BOOL NTAPI UserEmptyClipboard(VOID)
Definition: clipboard.c:680

Referenced by EmptyClipboard().

◆ NtUserEnableMenuItem()

UINT NTAPI NtUserEnableMenuItem ( HMENU  hMenu,
UINT  uIDEnableItem,
UINT  uEnable 
)

Definition at line 5872 of file menu.c.

5876{
5877 PMENU Menu;
5878 UINT Ret = (UINT)-1;
5879
5880 TRACE("Enter NtUserEnableMenuItem\n");
5882
5883 Menu = UserGetMenuObject(hMenu);
5884 if (Menu)
5885 {
5886 Ret = IntEnableMenuItem(Menu, uIDEnableItem, uEnable);
5887 }
5888
5889 UserLeave();
5890 TRACE("Leave NtUserEnableMenuItem, ret=%u\n", Ret);
5891 return Ret;
5892}
UINT FASTCALL IntEnableMenuItem(PMENU MenuObject, UINT uIDEnableItem, UINT uEnable)
Definition: menu.c:1217

Referenced by EnableMenuItem().

◆ NtUserEnableScrollBar()

BOOL NTAPI NtUserEnableScrollBar ( HWND  hWnd,
UINT  wSBflags,
UINT  wArrows 
)

Definition at line 1253 of file scrollbar.c.

1257{
1258 UINT OrigArrows;
1259 PWND Window = NULL;
1260 PSCROLLBARINFO InfoV = NULL, InfoH = NULL;
1261 BOOL Chg = FALSE;
1262 BOOL Ret = FALSE;
1264
1265 TRACE("Enter NtUserEnableScrollBar\n");
1267
1269 goto Cleanup; // Return FALSE
1270
1271 UserRefObjectCo(Window, &Ref);
1272
1274 goto Cleanup; // Return FALSE
1275
1276 OrigArrows = Window->pSBInfo->WSBflags;
1277 Window->pSBInfo->WSBflags = wArrows;
1278
1279 if (wSBflags == SB_CTL)
1280 {
1281 if ((wArrows == ESB_DISABLE_BOTH || wArrows == ESB_ENABLE_BOTH))
1282 IntEnableWindow(hWnd, (wArrows == ESB_ENABLE_BOTH));
1283
1284 Ret = TRUE;
1285 goto Cleanup;
1286 }
1287
1288 if(wSBflags != SB_BOTH && !SBID_IS_VALID(wSBflags))
1289 {
1291 ERR("Trying to set scrollinfo for unknown scrollbar type %u\n", wSBflags);
1292 goto Cleanup; // Return FALSE
1293 }
1294
1295 switch(wSBflags)
1296 {
1297 case SB_BOTH:
1299 // Fall through
1300 case SB_HORZ:
1302 break;
1303 case SB_VERT:
1305 break;
1306 default:
1307 goto Cleanup; // Return FALSE
1308 }
1309
1310 if(InfoV)
1311 Chg = IntEnableScrollBar(FALSE, InfoV, wArrows);
1312
1313 if(InfoH)
1314 Chg = (IntEnableScrollBar(TRUE, InfoH, wArrows) || Chg);
1315
1316 ERR("FIXME: EnableScrollBar wSBflags %u wArrows %u Chg %d\n", wSBflags, wArrows, Chg);
1317// Done in user32:
1318// SCROLL_RefreshScrollBar(hwnd, nBar, TRUE, TRUE);
1319
1320 Ret = Chg;
1321 goto Cleanup; // FIXME
1322
1323 if (OrigArrows == wArrows)
1324 {
1325 Ret = FALSE;
1326 goto Cleanup;
1327 }
1328
1329 Ret = TRUE;
1330
1331Cleanup:
1332 if (Window)
1334
1335 TRACE("Leave NtUserEnableScrollBar, ret=%i\n", Ret);
1336 UserLeave();
1337 return Ret;
1338}
BOOL FASTCALL co_IntCreateScrollBars(PWND Window)
Definition: scrollbar.c:758
BOOL APIENTRY IntEnableScrollBar(BOOL Horz, PSCROLLBARINFO Info, UINT wArrows)
Definition: scrollbar.c:824
#define SBID_IS_VALID(id)
Definition: scroll.h:40
#define IntGetScrollbarInfoFromWindow(Window, i)
Definition: scroll.h:33
#define SB_VERT
Definition: winuser.h:553
#define ESB_DISABLE_BOTH
Definition: winuser.h:556
#define SB_BOTH
Definition: winuser.h:555
#define SB_CTL
Definition: winuser.h:554
#define ESB_ENABLE_BOTH
Definition: winuser.h:563
#define SB_HORZ
Definition: winuser.h:552

Referenced by EnableScrollBar(), and ResetUserApiHook().

◆ NtUserEndDeferWindowPosEx()

BOOL NTAPI NtUserEndDeferWindowPosEx ( HDWP  WinPosInfo,
BOOL  bAsync 
)

Definition at line 3300 of file winpos.c.

3302{
3303 BOOL Ret;
3304 TRACE("Enter NtUserEndDeferWindowPosEx\n");
3306 Ret = IntEndDeferWindowPosEx(WinPosInfo, bAsync);
3307 TRACE("Leave NtUserEndDeferWindowPosEx, ret=%i\n", Ret);
3308 UserLeave();
3309 return Ret;
3310}
BOOL FASTCALL IntEndDeferWindowPosEx(HDWP hdwp, BOOL bAsync)
Definition: winpos.c:3207
UINT8 bAsync
Definition: wlntfytests.c:96

Referenced by CascadeWindows(), EndDeferWindowPos(), and TileWindows().

◆ NtUserEndMenu()

BOOL NTAPI NtUserEndMenu ( VOID  )

Definition at line 5898 of file menu.c.

5899{
5900 //PWND pWnd;
5901 TRACE("Enter NtUserEndMenu\n");
5903 /* if ( gptiCurrent->pMenuState &&
5904 gptiCurrent->pMenuState->pGlobalPopupMenu )
5905 {
5906 pWnd = IntGetMSWND(gptiCurrent->pMenuState);
5907 if (pWnd)
5908 {
5909 UserPostMessage( UserHMGetHandle(pWnd), WM_CANCELMODE, 0, 0);
5910 }
5911 else
5912 gptiCurrent->pMenuState->fInsideMenuLoop = FALSE;
5913 }*/
5915 {
5918 }
5919 UserLeave();
5920 TRACE("Leave NtUserEndMenu\n");
5921 return TRUE;
5922}
static HWND top_popup
Definition: menu.c:22
BOOL fInsideMenuLoop
Definition: menu.c:25
#define WM_CANCELMODE
Definition: winuser.h:1663

◆ NtUserEndPaint()

BOOL NTAPI NtUserEndPaint ( HWND  hWnd,
CONST PAINTSTRUCT lPs 
)

Definition at line 1658 of file painting.c.

1659{
1661 PWND Window;
1662 PAINTSTRUCT Ps;
1664 BOOL Ret = FALSE;
1665
1666 TRACE("Enter NtUserEndPaint\n");
1668
1670 {
1671 goto Cleanup; // Return FALSE
1672 }
1673
1674 UserRefObjectCo(Window, &Ref); // Here for the exception.
1675
1676 _SEH2_TRY
1677 {
1678 ProbeForRead(pUnsafePs, sizeof(*pUnsafePs), 1);
1679 RtlCopyMemory(&Ps, pUnsafePs, sizeof(PAINTSTRUCT));
1680 }
1682 {
1684 }
1685 _SEH2_END
1686 if (!NT_SUCCESS(Status))
1687 {
1688 goto Cleanup; // Return FALSE
1689 }
1690
1691 Ret = IntEndPaint(Window, &Ps);
1692
1693Cleanup:
1695
1696 TRACE("Leave NtUserEndPaint, ret=%i\n", Ret);
1697 UserLeave();
1698 return Ret;
1699}
BOOL FASTCALL IntEndPaint(PWND Wnd, PPAINTSTRUCT Ps)
Definition: painting.c:1537

Referenced by EndPaint().

◆ NtUserEnumDisplayDevices()

BOOL NTAPI NtUserEnumDisplayDevices ( PUNICODE_STRING  lpDevice,
DWORD  iDevNum,
PDISPLAY_DEVICEW  lpDisplayDevice,
DWORD  dwFlags 
)

Definition at line 377 of file display.c.

382{
383 UNICODE_STRING ustrDevice;
384 WCHAR awcDevice[CCHDEVICENAME];
385 DISPLAY_DEVICEW dispdev;
387
388 TRACE("Enter NtUserEnumDisplayDevices(%wZ, %lu)\n",
389 pustrDevice, iDevNum);
390
391 dispdev.cb = sizeof(dispdev);
392
393 if (pustrDevice)
394 {
395 /* Initialize destination string */
396 RtlInitEmptyUnicodeString(&ustrDevice, awcDevice, sizeof(awcDevice));
397
399 {
400 /* Probe the UNICODE_STRING and the buffer */
401 ProbeForRead(pustrDevice, sizeof(UNICODE_STRING), 1);
402 ProbeForRead(pustrDevice->Buffer, pustrDevice->Length, 1);
403
404 /* Copy the string */
405 RtlCopyUnicodeString(&ustrDevice, pustrDevice);
406 }
408 {
409// _SEH2_YIELD(return _SEH2_GetExceptionCode());
411 }
413
414 if (ustrDevice.Length > 0)
415 pustrDevice = &ustrDevice;
416 else
417 pustrDevice = NULL;
418 }
419
420 /* Acquire global USER lock */
422
423 /* Call the internal function */
424 Status = UserEnumDisplayDevices(pustrDevice, iDevNum, &dispdev, dwFlags);
425
426 /* Release lock */
427 UserLeave();
428
429 /* On success copy data to caller */
430 if (NT_SUCCESS(Status))
431 {
432 /* Enter SEH */
434 {
435 /* First probe the cb field */
436 ProbeForWrite(&pDisplayDevice->cb, sizeof(DWORD), 1);
437
438 /* Check the buffer size */
439 if (pDisplayDevice->cb)
440 {
441 /* Probe the output buffer */
442 pDisplayDevice->cb = min(pDisplayDevice->cb, sizeof(dispdev));
443 ProbeForWrite(pDisplayDevice, pDisplayDevice->cb, 1);
444
445 /* Copy as much as the given buffer allows */
446 RtlCopyMemory(pDisplayDevice, &dispdev, pDisplayDevice->cb);
447 }
448 }
450 {
452 }
454 }
455
456 TRACE("Leave NtUserEnumDisplayDevices, Status = 0x%lx\n", Status);
457 /* Return the result */
458// return Status;
459 return NT_SUCCESS(Status); // FIXME
460}
NTSTATUS NTAPI UserEnumDisplayDevices(PUNICODE_STRING pustrDevice, DWORD iDevNum, PDISPLAY_DEVICEW pdispdev, DWORD dwFlags)
Definition: display.c:217

Referenced by EnumDisplayDevicesA(), and EnumDisplayDevicesW().

◆ NtUserEnumDisplayMonitors()

INT NTAPI NtUserEnumDisplayMonitors ( OPTIONAL IN HDC  hDC,
OPTIONAL IN LPCRECT  pRect,
OPTIONAL OUT HMONITOR hMonitorList,
OPTIONAL OUT LPRECT  monitorRectList,
OPTIONAL IN DWORD  listSize 
)

Referenced by EnumDisplayMonitors(), and START_TEST().

◆ NtUserEnumDisplaySettings()

NTSTATUS NTAPI NtUserEnumDisplaySettings ( PUNICODE_STRING  lpszDeviceName,
DWORD  iModeNum,
LPDEVMODEW  lpDevMode,
DWORD  dwFlags 
)

Referenced by START_TEST().

◆ NtUserEvent()

DWORD NTAPI NtUserEvent ( DWORD  Unknown0)

Definition at line 76 of file ntstubs.c.

78{
79 STUB
80
81 return 0;
82}

◆ NtUserExcludeUpdateRgn()

INT NTAPI NtUserExcludeUpdateRgn ( HDC  hDC,
HWND  hWnd 
)

Definition at line 2516 of file painting.c.

2519{
2520 INT ret = ERROR;
2521 PWND pWnd;
2522
2523 TRACE("Enter NtUserExcludeUpdateRgn\n");
2525
2526 pWnd = UserGetWindowObject(hWnd);
2527
2528 if (hDC && pWnd)
2530
2531 TRACE("Leave NtUserExcludeUpdateRgn, ret=%i\n", ret);
2532
2533 UserLeave();
2534 return ret;
2535}
#define ERROR(name)
Definition: error_private.h:53
INT FASTCALL co_UserExcludeUpdateRgn(HDC hDC, PWND Window)
Definition: painting.c:2463

Referenced by ExcludeUpdateRgn().

◆ NtUserFillWindow()

BOOL NTAPI NtUserFillWindow ( HWND  hWndPaint,
HWND  hWndPaint1,
HDC  hDC,
HBRUSH  hBrush 
)

Definition at line 1708 of file painting.c.

1712{
1713 BOOL ret = FALSE;
1714 PWND pWnd, pWndParent = NULL;
1716
1717 TRACE("Enter NtUserFillWindow\n");
1719
1720 if (!hDC)
1721 {
1722 goto Exit;
1723 }
1724
1725 if (!(pWnd = UserGetWindowObject(hWnd)))
1726 {
1727 goto Exit;
1728 }
1729
1730 if (hWndParent && !(pWndParent = UserGetWindowObject(hWndParent)))
1731 {
1732 goto Exit;
1733 }
1734
1735 UserRefObjectCo(pWnd, &Ref);
1736 ret = IntFillWindow( pWndParent, pWnd, hDC, hBrush );
1737 UserDerefObjectCo(pWnd);
1738
1739Exit:
1740 TRACE("Leave NtUserFillWindow, ret=%i\n",ret);
1741 UserLeave();
1742 return ret;
1743}
BOOL FASTCALL IntFillWindow(PWND pWndParent, PWND pWnd, HDC hDC, HBRUSH hBrush)
Definition: painting.c:1559

◆ NtUserFindExistingCursorIcon()

HICON NTAPI NtUserFindExistingCursorIcon ( _In_ PUNICODE_STRING  pustrModule,
_In_ PUNICODE_STRING  pustrRsrc,
_In_ FINDEXISTINGCURICONPARAM param 
)

Definition at line 863 of file cursoricon.c.

867{
868 PCURICON_OBJECT CurIcon;
869 HICON Ret = NULL;
870 UNICODE_STRING ustrModuleSafe, ustrRsrcSafe;
871 FINDEXISTINGCURICONPARAM paramSafe;
874 RTL_ATOM atomModName;
875
876 TRACE("Enter NtUserFindExistingCursorIcon\n");
877
879 {
880 ProbeForRead(param, sizeof(*param), 1);
881 RtlCopyMemory(&paramSafe, param, sizeof(paramSafe));
882 }
884 {
886 }
888
889 /* Capture resource name (it can be an INTRESOURCE == ATOM) */
890 Status = ProbeAndCaptureUnicodeStringOrAtom(&ustrRsrcSafe, pustrRsrc);
891 if (!NT_SUCCESS(Status))
892 return NULL;
893 Status = ProbeAndCaptureUnicodeString(&ustrModuleSafe, UserMode, pustrModule);
894 if (!NT_SUCCESS(Status))
895 goto done;
896 Status = RtlLookupAtomInAtomTable(gAtomTable, ustrModuleSafe.Buffer, &atomModName);
897 ReleaseCapturedUnicodeString(&ustrModuleSafe, UserMode);
898 if (!NT_SUCCESS(Status))
899 {
900 /* The module is not in the atom table. No chance to find the cursor */
901 goto done;
902 }
903
905 CurIcon = pProcInfo->pCursorCache;
906 while (CurIcon)
907 {
908 /* Icon/cursor */
909 if (paramSafe.bIcon != is_icon(CurIcon))
910 {
911 CurIcon = CurIcon->pcurNext;
912 continue;
913 }
914 /* See if module names match */
915 if (atomModName == CurIcon->atomModName)
916 {
917 /* They do. Now see if this is the same resource */
918 if (IS_INTRESOURCE(CurIcon->strName.Buffer) != IS_INTRESOURCE(ustrRsrcSafe.Buffer))
919 {
920 /* One is an INT resource and the other is not -> no match */
921 CurIcon = CurIcon->pcurNext;
922 continue;
923 }
924
925 if (IS_INTRESOURCE(CurIcon->strName.Buffer))
926 {
927 if (CurIcon->strName.Buffer == ustrRsrcSafe.Buffer)
928 {
929 /* INT resources match */
930 break;
931 }
932 }
933 else if (RtlCompareUnicodeString(&ustrRsrcSafe, &CurIcon->strName, TRUE) == 0)
934 {
935 /* Resource name strings match */
936 break;
937 }
938 }
939 CurIcon = CurIcon->pcurNext;
940 }
941
942 /* Now search Global Cursors or Icons. */
943 if (CurIcon == NULL)
944 {
945 CurIcon = gcurFirst;
946 while (CurIcon)
947 {
948 /* Icon/cursor */
949 if (paramSafe.bIcon != is_icon(CurIcon))
950 {
951 CurIcon = CurIcon->pcurNext;
952 continue;
953 }
954 /* See if module names match */
955 if (atomModName == CurIcon->atomModName)
956 {
957 /* They do. Now see if this is the same resource */
958 if (IS_INTRESOURCE(CurIcon->strName.Buffer) != IS_INTRESOURCE(ustrRsrcSafe.Buffer))
959 {
960 /* One is an INT resource and the other is not -> no match */
961 CurIcon = CurIcon->pcurNext;
962 continue;
963 }
964 if (IS_INTRESOURCE(CurIcon->strName.Buffer))
965 {
966 if (CurIcon->strName.Buffer == ustrRsrcSafe.Buffer)
967 {
968 /* INT resources match */
969 break;
970 }
971 }
972 else if (RtlCompareUnicodeString(&ustrRsrcSafe, &CurIcon->strName, TRUE) == 0)
973 {
974 /* Resource name strings match */
975 break;
976 }
977 }
978 CurIcon = CurIcon->pcurNext;
979 }
980 }
981 if (CurIcon)
982 Ret = UserHMGetHandle(CurIcon);
983 UserLeave();
984
985done:
986 if (!IS_INTRESOURCE(ustrRsrcSafe.Buffer))
987 ExFreePoolWithTag(ustrRsrcSafe.Buffer, TAG_STRING);
988
989 return Ret;
990}
#define IS_INTRESOURCE(x)
Definition: loader.c:613
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
Definition: string_lib.cpp:31
GLfloat param
Definition: glext.h:5796
static HICON
Definition: imagelist.c:80
unsigned short RTL_ATOM
Definition: atom.c:42
NTSYSAPI NTSTATUS NTAPI RtlLookupAtomInAtomTable(_In_ PRTL_ATOM_TABLE AtomTable, _In_ PWSTR AtomName, _Out_ PRTL_ATOM Atom)
static __inline NTSTATUS ProbeAndCaptureUnicodeString(OUT PUNICODE_STRING Dest, IN KPROCESSOR_MODE CurrentMode, IN const UNICODE_STRING *UnsafeSrc)
Definition: probe.h:142
static __inline VOID ReleaseCapturedUnicodeString(IN PUNICODE_STRING CapturedString, IN KPROCESSOR_MODE CurrentMode)
Definition: probe.h:239
struct _CURICON_OBJECT * pcurNext
Definition: cursoricon.h:12
UNICODE_STRING strName
Definition: cursoricon.h:13
USHORT atomModName
Definition: cursoricon.h:14
struct _CURICON_OBJECT * pCursorCache
Definition: win32.h:273
_Must_inspect_result_ NTSTATUS NTAPI ProbeAndCaptureUnicodeStringOrAtom(_Out_ _When_(return >=0, _At_(pustrOut->Buffer, _Post_ _Notnull_)) PUNICODE_STRING pustrOut, __in_data_source(USER_MODE) _In_ PUNICODE_STRING pustrUnsafe)
Definition: class.c:152
FORCEINLINE BOOL is_icon(PCURICON_OBJECT object)
Definition: cursoricon.c:194
PCURICON_OBJECT gcurFirst
Definition: cursoricon.c:27
PRTL_ATOM_TABLE gAtomTable
Definition: session.c:13

Referenced by CURSORICON_LoadImageW().

◆ NtUserFindWindowEx()

HWND NTAPI NtUserFindWindowEx ( HWND  hwndParent,
HWND  hwndChildAfter,
PUNICODE_STRING  ucClassName,
PUNICODE_STRING  ucWindowName,
DWORD  dwUnknown 
)

Definition at line 3155 of file window.c.

3160{
3161 PWND Parent, ChildAfter;
3162 UNICODE_STRING ClassName = {0}, WindowName = {0};
3163 HWND Desktop, Ret = NULL;
3164 BOOL DoMessageWnd = FALSE;
3165 RTL_ATOM ClassAtom = (RTL_ATOM)0;
3166
3167 TRACE("Enter NtUserFindWindowEx\n");
3169
3170 if (ucClassName != NULL || ucWindowName != NULL)
3171 {
3172 _SEH2_TRY
3173 {
3174 if (ucClassName != NULL)
3175 {
3176 ClassName = ProbeForReadUnicodeString(ucClassName);
3177 if (ClassName.Length != 0)
3178 {
3179 ProbeForRead(ClassName.Buffer,
3180 ClassName.Length,
3181 sizeof(WCHAR));
3182 }
3183 else if (!IS_ATOM(ClassName.Buffer))
3184 {
3187 }
3188
3189 if (!IntGetAtomFromStringOrAtom(&ClassName,
3190 &ClassAtom))
3191 {
3194 }
3195 }
3196
3197 if (ucWindowName != NULL)
3198 {
3199 WindowName = ProbeForReadUnicodeString(ucWindowName);
3200 if (WindowName.Length != 0)
3201 {
3202 ProbeForRead(WindowName.Buffer,
3203 WindowName.Length,
3204 sizeof(WCHAR));
3205 }
3206 }
3207 }
3209 {
3211 _SEH2_YIELD(goto Exit); // Return NULL
3212 }
3213 _SEH2_END;
3214
3215 if (ucClassName != NULL)
3216 {
3217 if (ClassName.Length == 0 && ClassName.Buffer != NULL &&
3218 !IS_ATOM(ClassName.Buffer))
3219 {
3221 goto Exit; // Return NULL
3222 }
3223 else if (ClassAtom == (RTL_ATOM)0)
3224 {
3225 /* LastError code was set by IntGetAtomFromStringOrAtom */
3226 goto Exit; // Return NULL
3227 }
3228 }
3229 }
3230
3232
3233 if(hwndParent == NULL)
3234 {
3236 DoMessageWnd = TRUE;
3237 }
3238 else if(hwndParent == HWND_MESSAGE)
3239 {
3241 }
3242
3244 {
3245 goto Exit; // Return NULL
3246 }
3247
3248 ChildAfter = NULL;
3249 if(hwndChildAfter && !(ChildAfter = UserGetWindowObject(hwndChildAfter)))
3250 {
3251 goto Exit; // Return NULL
3252 }
3253
3254 _SEH2_TRY
3255 {
3257 {
3258 HWND *List, *phWnd;
3259 PWND TopLevelWindow;
3260 BOOLEAN CheckWindowName;
3261 BOOLEAN WindowMatches;
3262 BOOLEAN ClassMatches;
3263
3264 /* windows searches through all top-level windows if the parent is the desktop
3265 window */
3266
3268 {
3269 phWnd = List;
3270
3271 if(ChildAfter)
3272 {
3273 /* skip handles before and including ChildAfter */
3274 while(*phWnd && (*(phWnd++) != UserHMGetHandle(ChildAfter)))
3275 ;
3276 }
3277
3278 CheckWindowName = WindowName.Buffer != 0;
3279
3280 /* search children */
3281 while(*phWnd)
3282 {
3283 UNICODE_STRING ustr;
3284
3285 if(!(TopLevelWindow = UserGetWindowObject(*(phWnd++))))
3286 {
3287 continue;
3288 }
3289
3290 /* Do not send WM_GETTEXT messages in the kernel mode version!
3291 The user mode version however calls GetWindowText() which will
3292 send WM_GETTEXT messages to windows belonging to its processes */
3293 ustr.Buffer = TopLevelWindow->strName.Buffer;
3294 ustr.Length = (USHORT)min(TopLevelWindow->strName.Length, MAXUSHORT); // FIXME:LARGE_STRING truncated
3295 ustr.MaximumLength = (USHORT)min(TopLevelWindow->strName.MaximumLength, MAXUSHORT);
3296 WindowMatches = !CheckWindowName ||
3297 (TopLevelWindow->strName.Length < 0xFFFF &&
3298 !RtlCompareUnicodeString(&WindowName, &ustr, TRUE));
3299 ClassMatches = (ClassAtom == (RTL_ATOM)0) ||
3300 ClassAtom == TopLevelWindow->pcls->atomNVClassName;
3301
3302 if (WindowMatches && ClassMatches)
3303 {
3304 Ret = UserHMGetHandle(TopLevelWindow);
3305 break;
3306 }
3307
3308 if (IntFindWindow(TopLevelWindow, NULL, ClassAtom, &WindowName))
3309 {
3310 /* window returns the handle of the top-level window, in case it found
3311 the child window */
3312 Ret = UserHMGetHandle(TopLevelWindow);
3313 break;
3314 }
3315
3316 }
3318 }
3319 }
3320 else
3321 {
3322 TRACE("FindWindowEx: Not Desktop Parent!\n");
3323 Ret = IntFindWindow(Parent, ChildAfter, ClassAtom, &WindowName);
3324 }
3325
3326 if (Ret == NULL && DoMessageWnd)
3327 {
3328 PWND MsgWindows;
3329
3330 if((MsgWindows = UserGetWindowObject(IntGetMessageWindow())))
3331 {
3332 Ret = IntFindWindow(MsgWindows, ChildAfter, ClassAtom, &WindowName);
3333 }
3334 }
3335 }
3337 {
3339 Ret = NULL;
3340 }
3341 _SEH2_END;
3342
3343Exit:
3344 TRACE("Leave NtUserFindWindowEx, ret %p\n", Ret);
3345 UserLeave();
3346 return Ret;
3347}
#define _SEH2_LEAVE
Definition: pseh2_64.h:206
ATOM atomNVClassName
Definition: ntuser.h:569
PCLS pcls
Definition: ntuser.h:720
HWND FASTCALL IntGetCurrentThreadDesktopWindow(VOID)
Definition: desktop.c:1436
HWND FASTCALL IntGetMessageWindow(VOID)
Definition: desktop.c:1414
HWND FASTCALL IntFindWindow(PWND Parent, PWND ChildAfter, RTL_ATOM ClassAtom, PUNICODE_STRING WindowName)
Definition: window.c:3073
#define ERROR_CANNOT_FIND_WND_CLASS
Definition: winerror.h:1233
#define HWND_MESSAGE
Definition: winuser.h:1221

Referenced by FindWindowExW(), and START_TEST().

◆ NtUserFlashWindowEx()

BOOL NTAPI NtUserFlashWindowEx ( IN PFLASHWINFO  pfwi)

Definition at line 1749 of file painting.c.

1750{
1751 PWND pWnd;
1752 FLASHWINFO finfo = {0};
1753 BOOL Ret = FALSE;
1754
1756
1757 _SEH2_TRY
1758 {
1759 ProbeForRead(pfwi, sizeof(FLASHWINFO), 1);
1760 RtlCopyMemory(&finfo, pfwi, sizeof(FLASHWINFO));
1761 }
1763 {
1765 _SEH2_YIELD(goto Exit);
1766 }
1767 _SEH2_END
1768
1769 if (!( pWnd = ValidateHwndNoErr(finfo.hwnd)) ||
1770 finfo.cbSize != sizeof(FLASHWINFO) ||
1771 finfo.dwFlags & ~(FLASHW_ALL|FLASHW_TIMER|FLASHW_TIMERNOFG) )
1772 {
1774 goto Exit;
1775 }
1776
1777 Ret = IntFlashWindowEx(pWnd, &finfo);
1778
1779Exit:
1780 UserLeave();
1781 return Ret;
1782}
BOOL FASTCALL IntFlashWindowEx(PWND pWnd, PFLASHWINFO pfwi)
Definition: painting.c:1311

Referenced by FlashWindow(), and FlashWindowEx().

◆ NtUserGetAltTabInfo()

BOOL NTAPI NtUserGetAltTabInfo ( HWND  hwnd,
INT  iItem,
PALTTABINFO  pati,
LPWSTR  pszItemText,
UINT  cchItemText,
BOOL  Ansi 
)

Definition at line 86 of file ntstubs.c.

93{
94 STUB
95
96 return 0;
97}

Referenced by GetAltTabInfoA(), and GetAltTabInfoW().

◆ NtUserGetAncestor()

HWND NTAPI NtUserGetAncestor ( _In_ HWND  hWnd,
_In_ UINT  uType 
)

Definition at line 3415 of file window.c.

3416{
3417 PWND Window, pwndAncestor;
3418 HWND hwndAncestor = NULL;
3419
3420 TRACE("Enter NtUserGetAncestor\n");
3422
3424 if (!Window)
3425 goto Quit;
3426
3427 if (!uType || uType > GA_ROOTOWNER)
3428 {
3430 goto Quit;
3431 }
3432
3433 pwndAncestor = UserGetAncestor(Window, uType);
3434 if (pwndAncestor)
3435 hwndAncestor = UserHMGetHandle(pwndAncestor);
3436
3437Quit:
3438 UserLeave();
3439 TRACE("Leave NtUserGetAncestor returning %p\n", hwndAncestor);
3440 return hwndAncestor;
3441}
PWND FASTCALL UserGetAncestor(_In_ PWND pWnd, _In_ UINT uType)
Definition: window.c:3351
#define GA_ROOTOWNER
Definition: winuser.h:2894

Referenced by GetAncestor().

◆ NtUserGetAppImeLevel()

DWORD NTAPI NtUserGetAppImeLevel ( _In_ HWND  hWnd)

Definition at line 973 of file ime.c.

974{
975 DWORD ret = 0;
976 PWND pWnd;
977 PTHREADINFO pti;
978
980
981 pWnd = ValidateHwndNoErr(hWnd);
982 if (!pWnd)
983 {
984 ERR("Invalid HWND %p\n", hWnd);
985 goto Quit;
986 }
987
988 if (!IS_IMM_MODE())
989 {
990 ERR("!IS_IMM_MODE()\n");
992 goto Quit;
993 }
994
996 if (pWnd->head.pti->ppi == pti->ppi)
998
999Quit:
1000 UserLeave();
1001 return ret;
1002}
ATOM AtomImeLevel
Definition: ntuser.c:28

Referenced by ImmGenerateMessage(), and ImmPostMessages().

◆ NtUserGetAsyncKeyState()

SHORT NTAPI NtUserGetAsyncKeyState ( INT  Key)

Definition at line 649 of file keyboard.c.

650{
651 WORD wRet = 0;
652
653 TRACE("Enter NtUserGetAsyncKeyState\n");
654
655 if (Key >= 0x100 || Key < 0)
656 {
658 ERR("Invalid parameter Key\n");
659 return 0;
660 }
661
663
665 wRet |= 0x8000; // If down, windows returns 0x8000.
666 if (gafAsyncKeyStateRecentDown[Key / 8] & (1 << (Key % 8)))
667 wRet |= 0x1;
668 gafAsyncKeyStateRecentDown[Key / 8] &= ~(1 << (Key % 8));
669
670 UserLeave();
671
672 TRACE("Leave NtUserGetAsyncKeyState, ret=%u\n", wRet);
673 return wRet;
674}
unsigned short WORD
Definition: ntddk_ex.h:93
#define IS_KEY_DOWN(ks, vk)
Definition: input.h:102
BYTE gafAsyncKeyState[256 *2/8]
Definition: keyboard.c:13
static BYTE gafAsyncKeyStateRecentDown[256/8]
Definition: keyboard.c:14

Referenced by GetAsyncKeyState(), and START_TEST().

◆ NtUserGetCaretBlinkTime()

UINT NTAPI NtUserGetCaretBlinkTime ( VOID  )

Definition at line 378 of file caret.c.

379{
380 UINT ret;
381
383
384 ASSERT(gpsi);
385 ret = gpsi->dtCaretBlink;
386
387 UserLeave();
388
389 return ret;
390}

Referenced by GetCaretBlinkTime().

◆ NtUserGetCaretPos()

BOOL NTAPI NtUserGetCaretPos ( LPPOINT  lpPoint)

Definition at line 394 of file caret.c.

396{
397 PTHREADINFO pti;
398 PUSER_MESSAGE_QUEUE ThreadQueue;
400 BOOL Ret = TRUE;
401
402 TRACE("Enter NtUserGetCaretPos\n");
404
406 ThreadQueue = pti->MessageQueue;
407
408 Status = MmCopyToCaller(lpPoint, &ThreadQueue->CaretInfo.Pos, sizeof(POINT));
409 if(!NT_SUCCESS(Status))
410 {
412 Ret = FALSE;
413 }
414
415 TRACE("Leave NtUserGetCaretPos, ret=%i\n", Ret);
416 UserLeave();
417 return Ret;
418}

Referenced by GetCaretPos().

◆ NtUserGetClassInfo()

BOOL NTAPI NtUserGetClassInfo ( HINSTANCE  hInstance,
PUNICODE_STRING  ClassName,
LPWNDCLASSEXW  wcex,
LPWSTR ppszMenuName,
BOOL  Ansi 
)

Definition at line 2779 of file class.c.

2785{
2786 UNICODE_STRING SafeClassName;
2787 WNDCLASSEXW Safewcexw;
2788 PCLS Class;
2789 RTL_ATOM ClassAtom = 0;
2790 PPROCESSINFO ppi;
2791 BOOL Ret = TRUE;
2793
2794 _SEH2_TRY
2795 {
2796 ProbeForWrite( lpWndClassEx, sizeof(WNDCLASSEXW), sizeof(ULONG));
2797 RtlCopyMemory( &Safewcexw, lpWndClassEx, sizeof(WNDCLASSEXW));
2798 if (ppszMenuName)
2799 {
2800 ProbeForWrite(ppszMenuName, sizeof(*ppszMenuName), sizeof(PVOID));
2801 }
2802 }
2804 {
2806 _SEH2_YIELD(return FALSE);
2807 }
2808 _SEH2_END;
2809
2810 Status = ProbeAndCaptureUnicodeStringOrAtom(&SafeClassName, ClassName);
2811 if (!NT_SUCCESS(Status))
2812 {
2813 ERR("Error capturing the class name\n");
2815 return FALSE;
2816 }
2817
2818 // If null instance use client.
2820
2821 TRACE("GetClassInfo(%wZ, %p)\n", &SafeClassName, hInstance);
2822
2823 /* NOTE: Need exclusive lock because getting the wndproc might require the
2824 creation of a call procedure handle */
2826
2827 ppi = GetW32ProcessInfo();
2828 if (!(ppi->W32PF_flags & W32PF_CLASSESREGISTERED))
2829 {
2831 }
2832
2833 ClassAtom = IntGetClassAtom(&SafeClassName,
2834 hInstance,
2835 ppi,
2836 &Class,
2837 NULL);
2838 if (ClassAtom != (RTL_ATOM)0)
2839 {
2840 ClassAtom = Class->atomNVClassName;
2841 Ret = UserGetClassInfo(Class, &Safewcexw, bAnsi, hInstance);
2842 }
2843 else
2844 {
2846 Ret = FALSE;
2847 }
2848
2849 UserLeave();
2850
2851 if (Ret)
2852 {
2853 _SEH2_TRY
2854 {
2855 /* Emulate Function. */
2856 if (ppszMenuName) *ppszMenuName = (LPWSTR)Safewcexw.lpszMenuName;
2857
2858 RtlCopyMemory(lpWndClassEx, &Safewcexw, sizeof(WNDCLASSEXW));
2859
2860 // From Wine:
2861 /* We must return the atom of the class here instead of just TRUE. */
2862 /* Undocumented behavior! Return the class atom as a BOOL! */
2863 Ret = (BOOL)ClassAtom;
2864 }
2866 {
2868 Ret = FALSE;
2869 }
2870 _SEH2_END;
2871 }
2872
2873 if (!IS_ATOM(SafeClassName.Buffer))
2874 ExFreePoolWithTag(SafeClassName.Buffer, TAG_STRING);
2875
2876 return Ret;
2877}
struct _PROCESSINFO * GetW32ProcessInfo(VOID)
Definition: misc.c:800
HINSTANCE hModClient
Definition: ntuser.c:25
Definition: ntuser.h:566
LPCWSTR lpszMenuName
Definition: winuser.h:3333
uint16_t * LPWSTR
Definition: typedefs.h:56
#define W32PF_CLASSESREGISTERED
Definition: win32.h:17
static BOOL UserGetClassInfo(IN PCLS Class, OUT PWNDCLASSEXW lpwcx, IN BOOL Ansi, HINSTANCE hInstance)
Definition: class.c:2280
RTL_ATOM IntGetClassAtom(_In_ PUNICODE_STRING ClassName, IN HINSTANCE hInstance OPTIONAL, IN PPROCESSINFO pi OPTIONAL, OUT PCLS *BaseClass OPTIONAL, OUT PCLS **Link OPTIONAL)
Definition: class.c:1377
BOOL FASTCALL UserRegisterSystemClasses(VOID)
Definition: class.c:2337
#define ERROR_CLASS_DOES_NOT_EXIST
Definition: winerror.h:1237

Referenced by GetClassInfoExA(), GetClassInfoExW(), and START_TEST().

◆ NtUserGetClassName()

INT NTAPI NtUserGetClassName ( HWND  hWnd,
BOOL  Real,
PUNICODE_STRING  ClassName 
)

Referenced by START_TEST().

◆ NtUserGetClipboardData()

HANDLE NTAPI NtUserGetClipboardData ( UINT  fmt,
PGETCLIPBDATA  pgcd 
)

Definition at line 897 of file clipboard.c.

898{
899 HANDLE hRet = NULL;
900 PCLIP pElement;
901 PWINSTATION_OBJECT pWinStaObj;
902 UINT uSourceFmt = fmt;
903
904 TRACE("NtUserGetClipboardData(%x, %p)\n", fmt, pgcd);
905
907
908 pWinStaObj = IntGetWinStaForCbAccess();
909 if (!pWinStaObj)
910 goto cleanup;
911
912 /* Check if the clipboard has been opened */
913 if (!IntIsClipboardOpenByMe(pWinStaObj))
914 {
916 goto cleanup;
917 }
918
919 pElement = IntGetFormatElement(pWinStaObj, fmt);
920 if (!pElement)
921 goto cleanup;
922
923 if (IS_DATA_SYNTHESIZED(pElement))
924 {
925 /* Note: Data is synthesized in usermode */
926 /* TODO: Add more formats */
927 switch (fmt)
928 {
929 case CF_UNICODETEXT:
930 case CF_TEXT:
931 case CF_OEMTEXT:
932 uSourceFmt = CF_UNICODETEXT;
933 pElement = IntGetFormatElement(pWinStaObj, uSourceFmt);
934 if (IS_DATA_SYNTHESIZED(pElement))
935 {
936 uSourceFmt = CF_TEXT;
937 pElement = IntGetFormatElement(pWinStaObj, uSourceFmt);
938 }
939 if (IS_DATA_SYNTHESIZED(pElement))
940 {
941 uSourceFmt = CF_OEMTEXT;
942 pElement = IntGetFormatElement(pWinStaObj, uSourceFmt);
943 }
944 break;
945
946 case CF_BITMAP:
947 IntSynthesizeBitmap(pWinStaObj, pElement);
948 break;
949
950 case CF_METAFILEPICT:
951 uSourceFmt = CF_ENHMETAFILE;
952 pElement = IntGetFormatElement(pWinStaObj, uSourceFmt);
953 break;
954
955 case CF_ENHMETAFILE:
956 uSourceFmt = CF_METAFILEPICT;
957 pElement = IntGetFormatElement(pWinStaObj, uSourceFmt);
958 break;
959
960 default:
961 ASSERT(FALSE);
962 }
963 }
964
965 if (pElement && IS_DATA_DELAYED(pElement) && pWinStaObj->spwndClipOwner)
966 {
967 /* Send WM_RENDERFORMAT message */
968 pWinStaObj->fInDelayedRendering = TRUE;
970 pWinStaObj->fInDelayedRendering = FALSE;
971
972 /* Data should be in clipboard now */
973 pElement = IntGetFormatElement(pWinStaObj, uSourceFmt);
974 }
975
976 if (!pElement || IS_DATA_DELAYED(pElement))
977 goto cleanup;
978
980 {
981 ProbeForWrite(pgcd, sizeof(*pgcd), 1);
982 pgcd->uFmtRet = pElement->fmt;
983 pgcd->fGlobalHandle = pElement->fGlobalHandle;
984
985 /* Text and bitmap needs more data */
986 if (fmt == CF_TEXT)
987 {
988 PCLIP pLocaleEl;
989
990 pLocaleEl = IntGetFormatElement(pWinStaObj, CF_LOCALE);
991 if (pLocaleEl && !IS_DATA_DELAYED(pLocaleEl))
992 pgcd->hLocale = pLocaleEl->hData;
993 }
994 else if (fmt == CF_BITMAP)
995 {
996 PCLIP pPaletteEl;
997
998 pPaletteEl = IntGetFormatElement(pWinStaObj, CF_PALETTE);
999 if (pPaletteEl && !IS_DATA_DELAYED(pPaletteEl))
1000 pgcd->hPalette = pPaletteEl->hData;
1001 }
1002
1003 hRet = pElement->hData;
1004 }
1006 {
1008 }
1009 _SEH2_END;
1010
1011cleanup:
1012 if (pWinStaObj)
1013 ObDereferenceObject(pWinStaObj);
1014
1015 UserLeave();
1016
1017 TRACE("NtUserGetClipboardData returns %p\n", hRet);
1018
1019 return hRet;
1020}
#define CF_UNICODETEXT
Definition: constants.h:408
#define CF_METAFILEPICT
Definition: constants.h:398
#define CF_BITMAP
Definition: constants.h:397
#define CF_PALETTE
Definition: constants.h:404
#define CF_LOCALE
Definition: constants.h:411
#define CF_ENHMETAFILE
Definition: constants.h:409
#define CF_TEXT
Definition: constants.h:396
#define CF_OEMTEXT
Definition: constants.h:402
Definition: clipboard.h:4
HANDLE hData
Definition: clipboard.h:6
BOOL fGlobalHandle
Definition: clipboard.h:7
UINT fmt
Definition: clipboard.h:5
INT fInDelayedRendering
Definition: winsta.h:34
PWND spwndClipOwner
Definition: winsta.h:28
Definition: dsound.c:943
BOOL fGlobalHandle
Definition: ntuser.h:1158
HANDLE hPalette
Definition: ntuser.h:1162
HANDLE hLocale
Definition: ntuser.h:1161
static BOOL FASTCALL IntIsClipboardOpenByMe(PWINSTATION_OBJECT pWinSta)
Definition: clipboard.c:136
#define IS_DATA_SYNTHESIZED(ce)
Definition: clipboard.c:18
static PCLIP FASTCALL IntGetFormatElement(PWINSTATION_OBJECT pWinStaObj, UINT fmt)
Definition: clipboard.c:41
static VOID WINAPI IntSynthesizeBitmap(PWINSTATION_OBJECT pWinStaObj, PCLIP pBmEl)
Definition: clipboard.c:230
#define IS_DATA_DELAYED(ce)
Definition: clipboard.c:17
#define ERROR_CLIPBOARD_NOT_OPEN
Definition: winerror.h:1244
#define WM_RENDERFORMAT
Definition: winuser.h:1894

Referenced by getClipboardData(), and GetClipboardData().

◆ NtUserGetClipboardFormatName()

INT NTAPI NtUserGetClipboardFormatName ( UINT  uFormat,
LPWSTR  lpszFormatName,
INT  cchMaxCount 
)

Definition at line 736 of file clipboard.c.

737{
738 INT iRet = 0;
739
741
742 /* If the format is built-in we fail */
743 if (fmt < 0xc000 || fmt > 0xffff)
744 {
745 /* Registetrated formats are >= 0xc000 */
746 goto cleanup;
747 }
748
749 if (cchMaxCount < 1 || !lpszFormatName)
750 {
752 goto cleanup;
753 }
754
756 {
757 ProbeForWrite(lpszFormatName, cchMaxCount * sizeof(WCHAR), 1);
758
760 lpszFormatName,
761 cchMaxCount * sizeof(WCHAR));
762 iRet /= sizeof(WCHAR);
763 }
765 {
767 }
768 _SEH2_END;
769
770cleanup:
771 UserLeave();
772
773 return iRet;
774}
ULONG FASTCALL IntGetAtomName(RTL_ATOM nAtom, LPWSTR lpBuffer, ULONG cjBufSize)
Definition: useratom.c:37

Referenced by GetClipboardFormatNameA(), and GetClipboardFormatNameW().

◆ NtUserGetClipboardOwner()

HWND NTAPI NtUserGetClipboardOwner ( VOID  )

Definition at line 777 of file clipboard.c.

778{
779 HWND hWnd = NULL;
780 PWINSTATION_OBJECT pWinStaObj;
781
783
784 pWinStaObj = IntGetWinStaForCbAccess();
785 if (!pWinStaObj)
786 goto cleanup;
787
788 if (pWinStaObj->spwndClipOwner)
789 hWnd = UserHMGetHandle(pWinStaObj->spwndClipOwner);
790
791 ObDereferenceObject(pWinStaObj);
792
793cleanup:
794 UserLeave();
795
796 return hWnd;
797}

Referenced by GetClipboardOwner().

◆ NtUserGetClipboardSequenceNumber()

DWORD NTAPI NtUserGetClipboardSequenceNumber ( VOID  )

Definition at line 1164 of file clipboard.c.

1165{
1166 DWORD dwRet = 0;
1167 PWINSTATION_OBJECT pWinStaObj;
1168
1170
1171 pWinStaObj = IntGetWinStaForCbAccess();
1172 if (!pWinStaObj)
1173 goto cleanup;
1174
1175 /* Get windowstation sequence number */
1176 dwRet = (DWORD)pWinStaObj->iClipSequenceNumber;
1177
1178 ObDereferenceObject(pWinStaObj);
1179
1180cleanup:
1181 UserLeave();
1182
1183 return dwRet;
1184}
INT iClipSequenceNumber
Definition: winsta.h:32

Referenced by GetClipboardSequenceNumber().

◆ NtUserGetClipboardViewer()

HWND NTAPI NtUserGetClipboardViewer ( VOID  )

Definition at line 800 of file clipboard.c.

801{
802 HWND hWnd = NULL;
803 PWINSTATION_OBJECT pWinStaObj;
804
806
807 pWinStaObj = IntGetWinStaForCbAccess();
808 if (!pWinStaObj)
809 goto cleanup;
810
811 if (pWinStaObj->spwndClipViewer)
812 hWnd = UserHMGetHandle(pWinStaObj->spwndClipViewer);
813
814 ObDereferenceObject(pWinStaObj);
815
816cleanup:
817 UserLeave();
818
819 return hWnd;
820}

Referenced by GetClipboardViewer().

◆ NtUserGetClipCursor()

BOOL NTAPI NtUserGetClipCursor ( RECT lpRect)

Referenced by GetClipCursor().

◆ NtUserGetComboBoxInfo()

BOOL NTAPI NtUserGetComboBoxInfo ( HWND  hWnd,
PCOMBOBOXINFO  pcbi 
)

Definition at line 3479 of file window.c.

3482{
3483 PWND Wnd;
3484 PPROCESSINFO ppi;
3485 BOOL NotSameppi = FALSE;
3486 BOOL Ret = TRUE;
3487
3488 TRACE("Enter NtUserGetComboBoxInfo\n");
3490
3491 if (!(Wnd = UserGetWindowObject(hWnd)))
3492 {
3493 Ret = FALSE;
3494 goto Exit;
3495 }
3496 _SEH2_TRY
3497 {
3498 ProbeForWrite(pcbi, sizeof(COMBOBOXINFO), 1);
3499 }
3501 {
3503 Ret = FALSE;
3504 _SEH2_YIELD(goto Exit);
3505 }
3506 _SEH2_END;
3507
3508 if (pcbi->cbSize < sizeof(COMBOBOXINFO))
3509 {
3511 Ret = FALSE;
3512 goto Exit;
3513 }
3514
3515 // Pass the user pointer, it was already probed.
3517 {
3519 goto Exit;
3520 }
3521
3523 NotSameppi = ppi != Wnd->head.pti->ppi;
3524 if (NotSameppi)
3525 {
3526 KeAttachProcess(&Wnd->head.pti->ppi->peProcess->Pcb);
3527 }
3528
3529 _SEH2_TRY
3530 {
3531 LPHEADCOMBO lphc = ((PWND2CBOX)Wnd)->pCBox;
3532 pcbi->rcItem = lphc->textRect;
3533 pcbi->rcButton = lphc->buttonRect;
3534 pcbi->stateButton = 0;
3535 if (lphc->wState & CBF_BUTTONDOWN)
3537 if (RECTL_bIsEmptyRect(&lphc->buttonRect))
3539 pcbi->hwndCombo = lphc->self;
3540 pcbi->hwndItem = lphc->hWndEdit;
3541 pcbi->hwndList = lphc->hWndLBox;
3542 }
3544 {
3545 Ret = FALSE;
3547 }
3548 _SEH2_END;
3549
3550Exit:
3551 if (NotSameppi) KeDetachProcess();
3552 TRACE("Leave NtUserGetComboBoxInfo, ret=%i\n", Ret);
3553 UserLeave();
3554 return Ret;
3555}
#define ICLS_COMBOBOX
Definition: ntuser.h:917
#define FNID_COMBOBOX
Definition: ntuser.h:867
VOID NTAPI KeDetachProcess(VOID)
Definition: procobj.c:621
VOID NTAPI KeAttachProcess(IN PKPROCESS Process)
Definition: procobj.c:582
RECT buttonRect
Definition: comctl32.h:158
RECT textRect
Definition: comctl32.h:157
UINT wState
Definition: comctl32.h:155
HWND hWndLBox
Definition: comctl32.h:154
HWND hWndEdit
Definition: comctl32.h:153
HWND self
Definition: comctl32.h:150
RTL_ATOM atomClassName
Definition: ntuser.h:568
DWORD stateButton
Definition: winuser.h:3820
ATOM atomSysClass[ICLS_NOTUSED+1]
Definition: ntuser.h:1060
struct _WND2CBOX * PWND2CBOX
#define CBF_BUTTONDOWN
Definition: window.c:3473
#define STATE_SYSTEM_PRESSED
Definition: winuser.h:2972
#define CB_GETCOMBOBOXINFO
Definition: winuser.h:1970
#define STATE_SYSTEM_INVISIBLE
Definition: winuser.h:2984

Referenced by GetComboBoxInfo().

◆ NtUserGetControlBrush()

HBRUSH NTAPI NtUserGetControlBrush ( HWND  hwnd,
HDC  hdc,
UINT  ctlType 
)

Definition at line 190 of file misc.c.

194{
195 PWND pwnd;
196 HBRUSH hBrush = NULL;
197
199 if ( (pwnd = UserGetWindowObject(hwnd)) &&
200 ((ctlType - WM_CTLCOLORMSGBOX) < CTLCOLOR_MAX) &&
201 hdc )
202 {
203 hBrush = GetControlBrush(pwnd, hdc, ctlType);
204 }
205 UserLeave();
206 return hBrush;
207}
HBRUSH FASTCALL GetControlBrush(PWND pwnd, HDC hdc, UINT ctlType)
Definition: misc.c:179
#define WM_CTLCOLORMSGBOX
Definition: winuser.h:1794
#define CTLCOLOR_MAX
Definition: winuser.h:969

Referenced by GetControlBrush().

◆ NtUserGetControlColor()

HBRUSH NTAPI NtUserGetControlColor ( HWND  hwndParent,
HWND  hwnd,
HDC  hdc,
UINT  CtlMsg 
)

Definition at line 214 of file misc.c.

219{
220 PWND pwnd, pwndParent = NULL;
221 HBRUSH hBrush = NULL;
222
224 if ( (pwnd = UserGetWindowObject(hwnd)) &&
225 ((CtlMsg - WM_CTLCOLORMSGBOX) < CTLCOLOR_MAX) &&
226 hdc )
227 {
228 if (hwndParent) pwndParent = UserGetWindowObject(hwndParent);
229 hBrush = GetControlColor( pwndParent, pwnd, hdc, CtlMsg);
230 }
231 UserLeave();
232 return hBrush;
233}
HBRUSH FASTCALL GetControlColor(PWND pwndParent, PWND pwnd, HDC hdc, UINT CtlMsg)
Definition: misc.c:153

Referenced by GetControlColor().

◆ NtUserGetCPD()

ULONG_PTR NTAPI NtUserGetCPD ( HWND  hWnd,
GETCPD  Flags,
ULONG_PTR  Proc 
)

Definition at line 176 of file callproc.c.

180{
181 PWND Wnd;
182 ULONG_PTR Result = 0;
183
185 if (!(Wnd = UserGetWindowObject(hWnd)))
186 {
187 goto Cleanup;
188 }
189
190 // Processing Window only from User space.
192 Result = UserGetCPD(Wnd, Flags, ProcIn);
193
194Cleanup:
195 UserLeave();
196 return Result;
197}
ULONG_PTR FASTCALL UserGetCPD(PVOID pvClsWnd, GETCPD Flags, ULONG_PTR ProcIn)
Definition: callproc.c:107

Referenced by IntGetClsWndProc(), and IntGetWndProc().

◆ NtUserGetCursorFrameInfo()

HCURSOR NTAPI NtUserGetCursorFrameInfo ( HCURSOR  hCursor,
DWORD  istep,
INT rate_jiffies,
DWORD num_steps 
)

Definition at line 2133 of file cursoricon.c.

2138{
2139 PCURICON_OBJECT CurIcon;
2140 HCURSOR ret;
2141 INT jiffies = 0;
2142 DWORD steps = 1;
2144
2145 TRACE("Enter NtUserGetCursorFrameInfo\n");
2147
2148 if (!(CurIcon = UserGetCurIconObject(hCursor)))
2149 {
2150 UserLeave();
2151 return NULL;
2152 }
2153
2154 ret = UserHMGetHandle(CurIcon);
2155
2156 if (CurIcon->CURSORF_flags & CURSORF_ACON)
2157 {
2158 PACON AniCurIcon = (PACON)CurIcon;
2159 if (istep >= AniCurIcon->cicur)
2160 {
2161 UserDereferenceObject(CurIcon);
2162 UserLeave();
2163 return NULL;
2164 }
2165 jiffies = AniCurIcon->ajifRate[istep];
2166 steps = AniCurIcon->cicur;
2167 ret = UserHMGetHandle(AniCurIcon->aspcur[AniCurIcon->aicur[istep]]);
2168 }
2169
2170 _SEH2_TRY
2171 {
2172 ProbeForWrite(rate_jiffies, sizeof(INT), 1);
2173 ProbeForWrite(num_steps, sizeof(DWORD), 1);
2174 *rate_jiffies = jiffies;
2175 *num_steps = steps;
2176 }
2178 {
2180 }
2181 _SEH2_END
2182
2183 if (!NT_SUCCESS(Status))
2184 {
2185 WARN("Status: 0x%08lx\n", Status);
2187 ret = NULL;
2188 }
2189
2190 UserDereferenceObject(CurIcon);
2191 UserLeave();
2192
2193 TRACE("Leaving NtUserGetCursorFrameInfo, ret = 0x%p\n", ret);
2194
2195 return ret;
2196}
struct tagACON * PACON
#define CURSORF_ACON
Definition: ntuser.h:1202
#define jiffies
Definition: module.h:1085
static DWORD DWORD DWORD DWORD * steps
Definition: cursoricon.c:1804
static DWORD DWORD istep
Definition: cursoricon.c:1804
UINT cicur
Definition: cursoricon.h:38
DWORD * aicur
Definition: cursoricon.h:40
PCURICON_OBJECT * aspcur
Definition: cursoricon.h:39
INT * ajifRate
Definition: cursoricon.h:41
HICON HCURSOR
Definition: windef.h:99

Referenced by GetCursorFrameInfo().

◆ NtUserGetCursorInfo()

BOOL NTAPI NtUserGetCursorInfo ( PCURSORINFO  pci)

Definition at line 649 of file cursoricon.c.

651{
652 CURSORINFO SafeCi;
653 PSYSTEM_CURSORINFO CurInfo;
655 PCURICON_OBJECT CurIcon;
656 BOOL Ret = FALSE;
657
658 TRACE("Enter NtUserGetCursorInfo\n");
660
661 CurInfo = IntGetSysCursorInfo();
662 CurIcon = (PCURICON_OBJECT)CurInfo->CurrentCursorObject;
663
664 SafeCi.cbSize = sizeof(CURSORINFO);
665 SafeCi.flags = ((CurIcon && CurInfo->ShowingCursor >= 0) ? CURSOR_SHOWING : 0);
666 SafeCi.hCursor = (CurIcon ? UserHMGetHandle(CurIcon) : NULL);
667
668 SafeCi.ptScreenPos = gpsi->ptCursor;
669
671 {
672 ProbeForWrite(pci, sizeof(CURSORINFO), 1);
673
674 if (pci->cbSize == sizeof(CURSORINFO))
675 {
676 RtlCopyMemory(pci, &SafeCi, sizeof(CURSORINFO));
677 Ret = TRUE;
678 }
679 else
680 {
682 }
683 }
685 {
687 }
688 _SEH2_END;
689 if (!NT_SUCCESS(Status))
690 {
692 }
693
694 UserLeave();
695 TRACE("Leave NtUserGetCursorInfo, ret=%i\n", Ret);
696
697 return Ret;
698}
struct _CURICON_OBJECT * PCURICON_OBJECT
PCURICON_OBJECT CurrentCursorObject
Definition: cursoricon.h:74
DWORD flags
Definition: winuser.h:3828
DWORD cbSize
Definition: winuser.h:3827
HCURSOR hCursor
Definition: winuser.h:3829
POINT ptScreenPos
Definition: winuser.h:3830
PSYSTEM_CURSORINFO IntGetSysCursorInfo(VOID)
Definition: cursoricon.c:187
#define CURSOR_SHOWING
Definition: winuser.h:2700

Referenced by GetCursorInfo(), and START_TEST().

◆ NtUserGetDC()

HDC NTAPI NtUserGetDC ( HWND  hWnd)

Definition at line 1014 of file windc.c.

1015{
1016 TRACE("NtUGetDC -> %p:%x\n", hWnd, !hWnd ? DCX_CACHE | DCX_WINDOW : DCX_USESTYLE);
1017
1019}
#define DCX_USESTYLE
Definition: GetDCEx.c:10
HDC APIENTRY NtUserGetDCEx(HWND hWnd OPTIONAL, HANDLE ClipRegion, ULONG Flags)
Definition: windc.c:974
#define DCX_WINDOW
Definition: winuser.h:2149

Referenced by GetDC().

◆ NtUserGetDCEx()

HDC NTAPI NtUserGetDCEx ( HWND  hWnd,
HANDLE  hRegion,
ULONG  Flags 
)

Definition at line 974 of file windc.c.

975{
976 PWND Wnd=NULL;
977 HDC Ret = NULL;
978
979 TRACE("Enter NtUserGetDCEx: hWnd %p, ClipRegion %p, Flags %x.\n",
980 hWnd, ClipRegion, Flags);
982
983 if (hWnd && !(Wnd = UserGetWindowObject(hWnd)))
984 {
985 goto Exit; // Return NULL
986 }
987 Ret = UserGetDCEx(Wnd, ClipRegion, Flags);
988
989Exit:
990 TRACE("Leave NtUserGetDCEx, ret=%p\n", Ret);
991 UserLeave();
992 return Ret;
993}
HDC FASTCALL UserGetDCEx(PWND Wnd OPTIONAL, HANDLE ClipRegion, ULONG Flags)
Definition: windc.c:345

Referenced by GetDCEx(), NtUserGetDC(), and NtUserGetWindowDC().

◆ NtUserGetDoubleClickTime()

UINT NTAPI NtUserGetDoubleClickTime ( VOID  )

Definition at line 387 of file misc.c.

388{
389 UINT Result;
390
391 TRACE("Enter NtUserGetDoubleClickTime\n");
393
394 // FIXME: Check if this works on non-interactive winsta
396
397 TRACE("Leave NtUserGetDoubleClickTime, ret=%u\n", Result);
398 UserLeave();
399 return Result;
400}
INT iDblClickTime
Definition: sysparams.h:90

Referenced by GetDoubleClickTime().

◆ NtUserGetForegroundWindow()

HWND NTAPI NtUserGetForegroundWindow ( VOID  )

Definition at line 1643 of file focus.c.

1644{
1645 HWND Ret;
1646
1647 TRACE("Enter NtUserGetForegroundWindow\n");
1649
1651
1652 TRACE("Leave NtUserGetForegroundWindow, ret=%p\n", Ret);
1653 UserLeave();
1654 return Ret;
1655}
HWND FASTCALL UserGetForegroundWindow(VOID)
Definition: focus.c:1418

Referenced by GetForegroundWindow().

◆ NtUserGetGuiResources()

DWORD NTAPI NtUserGetGuiResources ( HANDLE  hProcess,
DWORD  uiFlags 
)

Definition at line 535 of file misc.c.

538{
540 PPROCESSINFO W32Process;
542 DWORD Ret = 0;
543
544 TRACE("Enter NtUserGetGuiResources\n");
546
551 (PVOID*)&Process,
552 NULL);
553
554 if(!NT_SUCCESS(Status))
555 {
557 goto Exit; // Return 0
558 }
559
560 W32Process = (PPROCESSINFO)Process->Win32Process;
561 if(!W32Process)
562 {
565 goto Exit; // Return 0
566 }
567
568 switch(uiFlags)
569 {
570 case GR_GDIOBJECTS:
571 {
572 Ret = (DWORD)W32Process->GDIHandleCount;
573 break;
574 }
575 case GR_USEROBJECTS:
576 {
577 Ret = (DWORD)W32Process->UserHandleCount;
578 break;
579 }
580 default:
581 {
583 break;
584 }
585 }
586
588
589Exit:
590 TRACE("Leave NtUserGetGuiResources, ret=%lu\n", Ret);
591 UserLeave();
592 return Ret;
593}
#define ExGetPreviousMode
Definition: ex.h:143
#define PROCESS_QUERY_INFORMATION
Definition: pstypes.h:162
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:71
POBJECT_TYPE PsProcessType
Definition: process.c:20
struct _PROCESSINFO * PPROCESSINFO
Definition: ntwin32.h:5

Referenced by GetGuiResources().

◆ NtUserGetGUIThreadInfo()

BOOL NTAPI NtUserGetGUIThreadInfo ( DWORD  idThread,
LPGUITHREADINFO  lpgui 
)

Definition at line 404 of file misc.c.

407{
409 PTHRDCARETINFO CaretInfo;
410 GUITHREADINFO SafeGui;
412 PUSER_MESSAGE_QUEUE MsgQueue;
413 PTHREADINFO W32Thread, pti;
414 BOOL Ret = FALSE;
415
416 TRACE("Enter NtUserGetGUIThreadInfo\n");
418
419 Status = MmCopyFromCaller(&SafeGui, lpgui, sizeof(DWORD));
420 if(!NT_SUCCESS(Status))
421 {
423 goto Exit; // Return FALSE
424 }
425
426 if(SafeGui.cbSize != sizeof(GUITHREADINFO))
427 {
429 goto Exit; // Return FALSE
430 }
431
432 if (idThread)
433 {
435
436 // Validate Tread ID
437 W32Thread = IntTID2PTI(UlongToHandle(idThread));
438
439 if ( !W32Thread )
440 {
442 goto Exit; // Return FALSE
443 }
444
445 Desktop = W32Thread->rpdesk;
446
447 // Check Desktop and it must be the same as current.
448 if ( !Desktop || Desktop != pti->rpdesk )
449 {
451 goto Exit; // Return FALSE
452 }
453
454 if ( W32Thread->MessageQueue )
455 MsgQueue = W32Thread->MessageQueue;
456 else
457 {
458 MsgQueue = Desktop->ActiveMessageQueue;
459 }
460 }
461 else
462 { /* Get the foreground thread */
463 /* FIXME: Handle NULL queue properly? */
464 MsgQueue = IntGetFocusMessageQueue();
465 if(!MsgQueue)
466 {
468 goto Exit; // Return FALSE
469 }
470 }
471
472 CaretInfo = &MsgQueue->CaretInfo;
473
474 SafeGui.flags = (CaretInfo->Visible ? GUI_CARETBLINKING : 0);
475/*
476 if (W32Thread->pMenuState->pGlobalPopupMenu)
477 {
478 SafeGui.flags |= GUI_INMENUMODE;
479
480 if (W32Thread->pMenuState->pGlobalPopupMenu->spwndNotify)
481 SafeGui.hwndMenuOwner = UserHMGetHandle(W32Thread->pMenuState->pGlobalPopupMenu->spwndNotify);
482
483 if (W32Thread->pMenuState->pGlobalPopupMenu->fHasMenuBar)
484 {
485 if (W32Thread->pMenuState->pGlobalPopupMenu->fIsSysMenu)
486 {
487 SafeGui.flags |= GUI_SYSTEMMENUMODE;
488 }
489 }
490 else
491 {
492 SafeGui.flags |= GUI_POPUPMENUMODE;
493 }
494 }
495 */
496 SafeGui.hwndMenuOwner = MsgQueue->MenuOwner;
497
498 if (MsgQueue->MenuOwner)
499 SafeGui.flags |= GUI_INMENUMODE | MsgQueue->MenuState;
500
501 if (MsgQueue->MoveSize)
502 SafeGui.flags |= GUI_INMOVESIZE;
503
504 /* FIXME: Add flag GUI_16BITTASK */
505
506 SafeGui.hwndActive = MsgQueue->spwndActive ? UserHMGetHandle(MsgQueue->spwndActive) : 0;
507 SafeGui.hwndFocus = MsgQueue->spwndFocus ? UserHMGetHandle(MsgQueue->spwndFocus) : 0;
508 SafeGui.hwndCapture = MsgQueue->spwndCapture ? UserHMGetHandle(MsgQueue->spwndCapture) : 0;
509 SafeGui.hwndMoveSize = MsgQueue->MoveSize;
510 SafeGui.hwndCaret = CaretInfo->hWnd;
511
512 SafeGui.rcCaret.left = CaretInfo->Pos.x;
513 SafeGui.rcCaret.top = CaretInfo->Pos.y;
514 SafeGui.rcCaret.right = SafeGui.rcCaret.left + CaretInfo->Size.cx;
515 SafeGui.rcCaret.bottom = SafeGui.rcCaret.top + CaretInfo->Size.cy;
516
517 Status = MmCopyToCaller(lpgui, &SafeGui, sizeof(GUITHREADINFO));
518 if(!NT_SUCCESS(Status))
519 {
521 goto Exit; // Return FALSE
522 }
523
524 Ret = TRUE;
525
526Exit:
527 TRACE("Leave NtUserGetGUIThreadInfo, ret=%i\n", Ret);
528 UserLeave();
529 return Ret;
530}
#define MmCopyFromCaller
Definition: polytest.cpp:29
HWND hwndCaret
Definition: winable.h:77
HWND hwndFocus
Definition: winable.h:73
HWND hwndMenuOwner
Definition: winable.h:75
HWND hwndMoveSize
Definition: winable.h:76
DWORD cbSize
Definition: winable.h:70
HWND hwndCapture
Definition: winable.h:74
HWND hwndActive
Definition: winable.h:72
PUSER_MESSAGE_QUEUE FASTCALL IntGetFocusMessageQueue(VOID)
Definition: desktop.c:1324
#define GUI_INMENUMODE
Definition: winable.h:29
#define GUI_CARETBLINKING
Definition: winable.h:27
#define GUI_INMOVESIZE
Definition: winable.h:28

Referenced by GetActiveWindow(), GetCapture(), GetFocus(), and GetGUIThreadInfo().

◆ NtUserGetIconSize()

BOOL NTAPI NtUserGetIconSize ( HANDLE  Handle,
UINT  istepIfAniCur,
LONG plcx,
LONG plcy 
)

◆ NtUserGetImeHotKey()

BOOL NTAPI NtUserGetImeHotKey ( _In_ DWORD  dwHotKeyId,
_Out_ PUINT  lpuModifiers,
_Out_ PUINT  lpuVirtualKey,
_Out_opt_ LPHKL  lphKL 
)

Definition at line 429 of file ime.c.

434{
435 PIMEHOTKEY pNode = NULL;
436
438
440 {
441 ProbeForWrite(lpuModifiers, sizeof(UINT), 1);
442 ProbeForWrite(lpuVirtualKey, sizeof(UINT), 1);
443 if (lphKL)
444 ProbeForWrite(lphKL, sizeof(HKL), 1);
445 }
447 {
448 ERR("Exception in NtUserGetImeHotKey: %p, %p, %p\n", lpuModifiers, lpuVirtualKey, lphKL);
449 _SEH2_YIELD(goto Quit);
450 }
451 _SEH2_END;
452
453 pNode = IntGetImeHotKeyById(gpImeHotKeyList, dwHotKeyId);
454 if (!pNode)
455 goto Quit;
456
458 {
459 *lpuModifiers = pNode->uModifiers;
460 *lpuVirtualKey = pNode->uVirtualKey;
461 if (lphKL)
462 *lphKL = pNode->hKL;
463 }
465 {
466 ERR("Exception in NtUserGetImeHotKey: %p, %p, %p, %p\n", pNode, lpuModifiers, lpuVirtualKey, lphKL);
467 pNode = NULL;
468 }
469 _SEH2_END;
470
471Quit:
472 UserLeave();
473 return !!pNode;
474}
static PIMEHOTKEY FASTCALL IntGetImeHotKeyById(_In_ PIMEHOTKEY pList, _In_ DWORD dwHotKeyId)
Definition: ime.c:152
PIMEHOTKEY gpImeHotKeyList
Definition: ime.c:35
UINT uModifiers
Definition: ime.c:31
HKL hKL
Definition: ime.c:32
UINT uVirtualKey
Definition: ime.c:30

Referenced by CliSetDefaultImeHotKeys(), and ImmGetHotKey().

◆ NtUserGetImeInfoEx()

BOOL NTAPI NtUserGetImeInfoEx ( _Inout_ PIMEINFOEX  pImeInfoEx,
_In_ IMEINFOEXCLASS  SearchType 
)

Definition at line 1069 of file ime.c.

1072{
1073 IMEINFOEX ImeInfoEx;
1074 BOOL ret = FALSE;
1075 PWINSTATION_OBJECT pWinSta;
1076
1078
1079 if (!IS_IMM_MODE())
1080 {
1081 ERR("!IS_IMM_MODE()\n");
1083 goto Quit;
1084 }
1085
1086 _SEH2_TRY
1087 {
1088 ProbeForRead(pImeInfoEx, sizeof(*pImeInfoEx), 1);
1089 ImeInfoEx = *pImeInfoEx;
1090 }
1092 {
1093 ERR("Exception in NtUserGetImeInfoEx: %p\n", pImeInfoEx);
1094 _SEH2_YIELD(goto Quit);
1095 }
1096 _SEH2_END;
1097
1099 ret = UserGetImeInfoEx(pWinSta, &ImeInfoEx, SearchType);
1100 if (!ret)
1101 goto Quit;
1102
1103 _SEH2_TRY
1104 {
1105 ProbeForWrite(pImeInfoEx, sizeof(*pImeInfoEx), 1);
1106 *pImeInfoEx = ImeInfoEx;
1107 }
1109 {
1110 ERR("Exception in NtUserGetImeInfoEx: %p\n", pImeInfoEx);
1111 ret = FALSE;
1112 }
1113 _SEH2_END;
1114
1115Quit:
1116 UserLeave();
1117 return ret;
1118}
BOOL FASTCALL UserGetImeInfoEx(_Inout_ PWINSTATION_OBJECT pWinSta, _Inout_ PIMEINFOEX pInfoEx, _In_ IMEINFOEXCLASS SearchType)
Definition: ime.c:1005

Referenced by ImmGetImeInfoEx().

◆ NtUserGetInternalWindowPos()

DWORD NTAPI NtUserGetInternalWindowPos ( HWND  hwnd,
LPRECT  rectWnd,
LPPOINT  ptIcon 
)

Definition at line 3370 of file winpos.c.

3373{
3374 PWND Window;
3375 DWORD Ret = 0;
3376 BOOL Hit = FALSE;
3377 WINDOWPLACEMENT wndpl;
3378
3380
3382 {
3383 Hit = FALSE;
3384 goto Exit;
3385 }
3386
3387 _SEH2_TRY
3388 {
3389 if(rectWnd)
3390 {
3391 ProbeForWrite(rectWnd,
3392 sizeof(RECT),
3393 1);
3394 }
3395 if(ptIcon)
3396 {
3397 ProbeForWrite(ptIcon,
3398 sizeof(POINT),
3399 1);
3400 }
3401
3402 }
3404 {
3406 Hit = TRUE;
3407 }
3408 _SEH2_END;
3409
3410 wndpl.length = sizeof(WINDOWPLACEMENT);
3411
3412 if (IntGetWindowPlacement(Window, &wndpl) && !Hit)
3413 {
3414 _SEH2_TRY
3415 {
3416 if (rectWnd)
3417 {
3418 RtlCopyMemory(rectWnd, &wndpl.rcNormalPosition , sizeof(RECT));
3419 }
3420 if (ptIcon)
3421 {
3422 RtlCopyMemory(ptIcon, &wndpl.ptMinPosition, sizeof(POINT));
3423 }
3424
3425 }
3427 {
3429 Hit = TRUE;
3430 }
3431 _SEH2_END;
3432
3433 if (!Hit) Ret = wndpl.showCmd;
3434 }
3435Exit:
3436 UserLeave();
3437 return Ret;
3438}
BOOL FASTCALL IntGetWindowPlacement(PWND Wnd, WINDOWPLACEMENT *lpwndpl)
Definition: winpos.c:564
RECT rcNormalPosition
Definition: winuser.h:3403
POINT ptMinPosition
Definition: winuser.h:3401
struct _WINDOWPLACEMENT WINDOWPLACEMENT

◆ NtUserGetKeyboardLayout()

HKL NTAPI NtUserGetKeyboardLayout ( DWORD  dwThreadid)

◆ NtUserGetKeyboardLayoutList()

UINT NTAPI NtUserGetKeyboardLayoutList ( ULONG  nItems,
HKL pHklBuff 
)

Definition at line 1038 of file kbdlayout.c.

1041{
1042 UINT ret = 0;
1043 PWINSTATION_OBJECT pWinSta;
1044
1045 if (!pHklBuff)
1046 nBuff = 0;
1047
1049
1050 if (nBuff > MAXULONG / sizeof(HKL))
1051 {
1053 goto Quit;
1054 }
1055
1056 _SEH2_TRY
1057 {
1058 ProbeForWrite(pHklBuff, nBuff * sizeof(HKL), 1);
1059 }
1061 {
1063 goto Quit;
1064 }
1065 _SEH2_END;
1066
1068
1069 _SEH2_TRY
1070 {
1071 ret = IntGetKeyboardLayoutList(pWinSta, nBuff, pHklBuff);
1072 }
1074 {
1076 goto Quit;
1077 }
1078 _SEH2_END;
1079
1080Quit:
1081 UserLeave();
1082 return ret;
1083}
#define MAXULONG
Definition: typedefs.h:251
static UINT APIENTRY IntGetKeyboardLayoutList(_Inout_ PWINSTATION_OBJECT pWinSta, _In_ ULONG nBuff, _Out_ HKL *pHklBuff)
Definition: kbdlayout.c:96

Referenced by CliImmInitializeHotKeys().

◆ NtUserGetKeyboardLayoutName()

BOOL NTAPI NtUserGetKeyboardLayoutName ( _Inout_ PUNICODE_STRING  pustrName)

Definition at line 1092 of file kbdlayout.c.

1094{
1095 BOOL bRet = FALSE;
1096 PKL pKl;
1097 PTHREADINFO pti;
1098 UNICODE_STRING ustrNameSafe;
1100
1102
1104 pKl = pti->KeyboardLayout;
1105
1106 if (!pKl)
1107 goto cleanup;
1108
1109 _SEH2_TRY
1110 {
1111 ProbeForWriteUnicodeString(pustrName);
1112 ustrNameSafe = *pustrName;
1113
1114 ProbeForWrite(ustrNameSafe.Buffer, ustrNameSafe.MaximumLength, 1);
1115
1116 if (IS_IME_HKL(pKl->hkl))
1117 {
1118 Status = RtlIntegerToUnicodeString(HandleToUlong(pKl->hkl), 16, &ustrNameSafe);
1119 }
1120 else
1121 {
1122 if (ustrNameSafe.MaximumLength < KL_NAMELENGTH * sizeof(WCHAR))
1123 {
1125 goto cleanup;
1126 }
1127
1128 /* FIXME: Do not use awchKF */
1129 ustrNameSafe.Length = 0;
1130 Status = RtlAppendUnicodeToString(&ustrNameSafe, pKl->spkf->awchKF);
1131 }
1132
1133 if (NT_SUCCESS(Status))
1134 {
1135 *pustrName = ustrNameSafe;
1136 bRet = TRUE;
1137 }
1138 }
1140 {
1142 }
1143 _SEH2_END;
1144
1145cleanup:
1146 UserLeave();
1147 return bRet;
1148}
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
Definition: string_lib.cpp:62
#define IS_IME_HKL(hKL)
Definition: imm32_undoc.h:21
NTSYSAPI NTSTATUS NTAPI RtlIntegerToUnicodeString(ULONG Value, ULONG Base, PUNICODE_STRING String)
#define ProbeForWriteUnicodeString(Ptr)
Definition: probe.h:48
struct tagKL * KeyboardLayout
Definition: win32.h:90
WCHAR awchKF[20]
Definition: input.h:19
Definition: input.h:27
PKBDFILE spkf
Definition: input.h:33
HKL hkl
Definition: input.h:32
#define KL_NAMELENGTH
Definition: winuser.h:122

Referenced by GetKeyboardLayoutNameA(), GetKeyboardLayoutNameW(), and START_TEST().

◆ NtUserGetKeyboardState()

DWORD NTAPI NtUserGetKeyboardState ( LPBYTE  Unknown0)

Definition at line 2578 of file msgqueue.c.

2579{
2580 DWORD i, ret = TRUE;
2581 PTHREADINFO pti;
2582 PUSER_MESSAGE_QUEUE MessageQueue;
2583
2585
2587 MessageQueue = pti->MessageQueue;
2588
2589 _SEH2_TRY
2590 {
2591 /* Probe and copy key state to an array */
2592 ProbeForWrite(lpKeyState, 256 * sizeof(BYTE), 1);
2593 for (i = 0; i < 256; ++i)
2594 {
2595 lpKeyState[i] = 0;
2596 if (IS_KEY_DOWN(MessageQueue->afKeyState, i))
2597 lpKeyState[i] |= KS_DOWN_BIT;
2598 if (IS_KEY_LOCKED(MessageQueue->afKeyState, i))
2599 lpKeyState[i] |= KS_LOCK_BIT;
2600 }
2601 }
2603 {
2605 ret = FALSE;
2606 }
2607 _SEH2_END;
2608
2609 UserLeave();
2610
2611 return ret;
2612}
BYTE afKeyState[256 *2/8]
Definition: msgqueue.h:84
#define KS_DOWN_BIT
Definition: input.h:51
#define KS_LOCK_BIT
Definition: input.h:52
#define IS_KEY_LOCKED(ks, vk)
Definition: input.h:103
unsigned char BYTE
Definition: xxhash.c:193

Referenced by GetKeyboardState().

◆ NtUserGetKeyboardType()

DWORD NTAPI NtUserGetKeyboardType ( DWORD  TypeFlag)

◆ NtUserGetKeyNameText()

DWORD NTAPI NtUserGetKeyNameText ( LONG  lParam,
LPWSTR  lpString,
int  nSize 
)

Definition at line 1807 of file keyboard.c.

1808{
1809 PTHREADINFO pti;
1810 DWORD i, dwRet = 0;
1811 SIZE_T cchKeyName;
1812 WORD wScanCode = (lParam >> 16) & 0xFF;
1813 BOOL bExtKey = (HIWORD(lParam) & KF_EXTENDED) ? TRUE : FALSE;
1814 PKBDTABLES pKbdTbl;
1815 VSC_LPWSTR *pKeyNames = NULL;
1816 CONST WCHAR *pKeyName = NULL;
1817 WCHAR KeyNameBuf[2];
1818
1819 TRACE("Enter NtUserGetKeyNameText\n");
1820
1822
1823 /* Get current keyboard layout */
1825 pKbdTbl = pti ? pti->KeyboardLayout->spkf->pKbdTbl : NULL;
1826
1827 if (!pKbdTbl || cchSize < 1)
1828 {
1829 ERR("Invalid parameter\n");
1830 goto cleanup;
1831 }
1832
1833 /* "Do not care" flag */
1835 {
1836 /* Note: We could do vsc -> vk -> vsc conversion, instead of using
1837 hardcoded scan codes, but it's not what Windows does */
1838 if (wScanCode == SCANCODE_RSHIFT && !bExtKey)
1839 wScanCode = SCANCODE_LSHIFT;
1840 else if (wScanCode == SCANCODE_CTRL || wScanCode == SCANCODE_ALT)
1841 bExtKey = FALSE;
1842 }
1843
1844 if (bExtKey)
1845 pKeyNames = pKbdTbl->pKeyNamesExt;
1846 else
1847 pKeyNames = pKbdTbl->pKeyNames;
1848
1849 for (i = 0; pKeyNames[i].pwsz; i++)
1850 {
1851 if (pKeyNames[i].vsc == wScanCode)
1852 {
1853 pKeyName = pKeyNames[i].pwsz;
1854 break;
1855 }
1856 }
1857
1858 if (!pKeyName)
1859 {
1860 WORD wVk = IntVscToVk(wScanCode, pKbdTbl);
1861
1862 if (wVk)
1863 {
1864 KeyNameBuf[0] = IntVkToChar(wVk, pKbdTbl);
1865 KeyNameBuf[1] = 0;
1866 if (KeyNameBuf[0])
1867 pKeyName = KeyNameBuf;
1868 }
1869 }
1870
1871 if (pKeyName)
1872 {
1873 cchKeyName = wcslen(pKeyName);
1874 if (cchKeyName > (cchSize - 1UL))
1875 cchKeyName = cchSize - 1UL; // Don't count '\0'
1876
1877 _SEH2_TRY
1878 {
1879 ProbeForWrite(lpString, (cchKeyName + 1) * sizeof(WCHAR), 1);
1880 RtlCopyMemory(lpString, pKeyName, cchKeyName * sizeof(WCHAR));
1881 lpString[cchKeyName] = UNICODE_NULL;
1882 dwRet = cchKeyName;
1883 }
1885 {
1887 }
1888 _SEH2_END;
1889 }
1890 else
1891 {
1893 }
1894
1895cleanup:
1896 UserLeave();
1897 TRACE("Leave NtUserGetKeyNameText, ret=%lu\n", dwRet);
1898 return dwRet;
1899}
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2983
#define SCANCODE_LSHIFT
Definition: kbd.h:128
#define SCANCODE_ALT
Definition: kbd.h:131
#define SCANCODE_RSHIFT
Definition: kbd.h:129
#define SCANCODE_CTRL
Definition: kbd.h:130
#define CONST
Definition: pedump.c:81
Definition: kbd.h:95
VSC_LPWSTR * pKeyNamesExt
Definition: kbd.h:100
VSC_LPWSTR * pKeyNames
Definition: kbd.h:99
LPWSTR pwsz
Definition: kbd.h:68
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define LP_DO_NOT_CARE_BIT
Definition: input.h:56
static WCHAR FASTCALL IntVkToChar(WORD wVk, PKBDTABLES pKbdTbl)
Definition: keyboard.c:622
static WORD FASTCALL IntVscToVk(WORD wScanCode, PKBDTABLES pKbdTbl)
Definition: keyboard.c:579
#define KF_EXTENDED
Definition: winuser.h:2482

Referenced by GetKeyNameTextA(), and GetKeyNameTextW().

◆ NtUserGetKeyState()

SHORT NTAPI NtUserGetKeyState ( INT  VirtKey)

Definition at line 2562 of file msgqueue.c.

2563{
2564 DWORD Ret;
2565
2567
2568 Ret = UserGetKeyState(key);
2569
2570 UserLeave();
2571
2572 return (SHORT)Ret;
2573}
DWORD FASTCALL UserGetKeyState(DWORD dwKey)
Definition: msgqueue.c:221
short SHORT
Definition: pedump.c:59
Definition: copy.c:22

Referenced by GetKeyState().

◆ NtUserGetLayeredWindowAttributes()

BOOL NTAPI NtUserGetLayeredWindowAttributes ( HWND  hwnd,
COLORREF pcrKey,
BYTE pbAlpha,
DWORD pdwFlags 
)

Definition at line 241 of file layered.c.

246{
247 PLRD_PROP pLrdProp;
248 PWND pWnd;
249 BOOL Ret = FALSE;
250
251 TRACE("Enter NtUserGetLayeredWindowAttributes\n");
253
254 if (!(pWnd = UserGetWindowObject(hwnd)) ||
255 !(pWnd->ExStyle & WS_EX_LAYERED) )
256 {
257 ERR("Not a Layered Window!\n");
258 goto Exit;
259 }
260
261 pLrdProp = UserGetProp(pWnd, AtomLayer, TRUE);
262
263 if (!pLrdProp)
264 {
265 TRACE("No Prop!\n");
266 goto Exit;
267 }
268
269 if (pLrdProp->is_Layered == 0)
270 {
271 goto Exit;
272 }
273
275 {
276 if (pcrKey)
277 {
278 ProbeForWrite(pcrKey, sizeof(*pcrKey), 1);
279 *pcrKey = pLrdProp->Key;
280 }
281 if (pbAlpha)
282 {
283 ProbeForWrite(pbAlpha, sizeof(*pbAlpha), 1);
284 *pbAlpha = pLrdProp->Alpha;
285 }
286 if (pdwFlags)
287 {
288 ProbeForWrite(pdwFlags, sizeof(*pdwFlags), 1);
289 *pdwFlags = pLrdProp->Flags;
290 }
291 }
293 {
295 _SEH2_YIELD(goto Exit);
296 }
297 _SEH2_END;
298
299 Ret = TRUE;
300
301Exit:
302 TRACE("Leave NtUserGetLayeredWindowAttributes, ret=%i\n", Ret);
303 UserLeave();
304 return Ret;
305}
ATOM AtomLayer
Definition: ntuser.c:21
BYTE is_Layered
Definition: layered.c:17
DWORD Flags
Definition: layered.c:19
BYTE Alpha
Definition: layered.c:16
COLORREF Key
Definition: layered.c:15
#define WS_EX_LAYERED
Definition: winuser.h:389

◆ NtUserGetListBoxInfo()

DWORD NTAPI NtUserGetListBoxInfo ( HWND  hWnd)

Definition at line 3590 of file window.c.

3592{
3593 PWND Wnd;
3594 PPROCESSINFO ppi;
3595 BOOL NotSameppi = FALSE;
3596 DWORD Ret = 0;
3597
3598 TRACE("Enter NtUserGetListBoxInfo\n");
3600
3601 if (!(Wnd = UserGetWindowObject(hWnd)))
3602 {
3603 goto Exit; // Return 0
3604 }
3605
3606 if ((Wnd->pcls->atomClassName != gpsi->atomSysClass[ICLS_LISTBOX]) && Wnd->fnid != FNID_LISTBOX)
3607 {
3608 Ret = (DWORD)co_IntSendMessage(UserHMGetHandle(Wnd), LB_GETLISTBOXINFO, 0, 0);
3609 goto Exit;
3610 }
3611
3612 // wine lisbox:test_GetListBoxInfo lb_getlistboxinfo = 0, should not send a message!
3614 NotSameppi = ppi != Wnd->head.pti->ppi;
3615 if (NotSameppi)
3616 {
3617 KeAttachProcess(&Wnd->head.pti->ppi->peProcess->Pcb);
3618 }
3619
3620 _SEH2_TRY
3621 {
3622 LB_DESCR *descr = ((PWND2LB)Wnd)->pLBiv;
3623 // See Controls ListBox.c:LB_GETLISTBOXINFO must match...
3624 Ret = descr->page_size;
3625 }
3627 {
3628 Ret = 0;
3630 }
3631 _SEH2_END;
3632
3633Exit:
3634 if (NotSameppi) KeDetachProcess();
3635 TRACE("Leave NtUserGetListBoxInfo, ret=%lu\n", Ret);
3636 UserLeave();
3637 return Ret;
3638}
#define ICLS_LISTBOX
Definition: ntuser.h:915
#define FNID_LISTBOX
Definition: ntuser.h:871
const char * descr
Definition: boot.c:45
struct _WND2LB * PWND2LB

Referenced by GetListBoxInfo().

◆ NtUserGetMenuBarInfo()

BOOL NTAPI NtUserGetMenuBarInfo ( HWND  hwnd,
LONG  idObject,
LONG  idItem,
PMENUBARINFO  pmbi 
)

Definition at line 5928 of file menu.c.

5933{
5934 PWND pWnd;
5935 HMENU hMenu;
5936 MENUBARINFO kmbi;
5937 BOOL Ret = FALSE;
5938 PPOPUPMENU pPopupMenu;
5941 PMENU Menu = NULL;
5942
5943 TRACE("Enter NtUserGetMenuBarInfo\n");
5945
5946 if (!(pWnd = UserGetWindowObject(hwnd)))
5947 {
5949 goto Cleanup; // Return FALSE
5950 }
5951
5952 UserRefObjectCo(pWnd, &Ref);
5953
5955 kmbi.hMenu = NULL;
5956 kmbi.hwndMenu = NULL;
5957 kmbi.fBarFocused = FALSE;
5958 kmbi.fFocused = FALSE;
5959
5960 switch (idObject)
5961 {
5962 case OBJID_CLIENT:
5963 if (!pWnd->pcls->fnid)
5964 goto Cleanup; // Return FALSE
5965 if (pWnd->pcls->fnid != FNID_MENU)
5966 {
5967 WARN("called on invalid window: %u\n", pWnd->pcls->fnid);
5969 goto Cleanup; // Return FALSE
5970 }
5971 // Windows does this! Wine checks for Atom and uses GetWindowLongPtrW.
5972 hMenu = (HMENU)co_IntSendMessage(hwnd, MN_GETHMENU, 0, 0);
5973 pPopupMenu = ((PMENUWND)pWnd)->ppopupmenu;
5974 if (pPopupMenu && pPopupMenu->spmenu)
5975 {
5976 if (UserHMGetHandle(pPopupMenu->spmenu) != hMenu)
5977 {
5978 ERR("Window Pop Up hMenu %p not the same as Get hMenu %p!\n", UserHMGetHandle(pPopupMenu->spmenu), hMenu);
5979 }
5980 }
5981 break;
5982 case OBJID_MENU:
5983 if (pWnd->style & WS_CHILD)
5984 goto Cleanup; // Return FALSE
5985 hMenu = UlongToHandle(pWnd->IDMenu);
5986 TRACE("GMBI: OBJID_MENU hMenu %p\n",hMenu);
5987 break;
5988 case OBJID_SYSMENU:
5989 if (!(pWnd->style & WS_SYSMENU))
5990 goto Cleanup; // Return FALSE
5991 Menu = IntGetSystemMenu(pWnd, FALSE);
5992 hMenu = UserHMGetHandle(Menu);
5993 break;
5994 default:
5995 goto Cleanup; // Return FALSE
5996 }
5997
5998 if (!hMenu)
5999 goto Cleanup; // Return FALSE
6000
6001 _SEH2_TRY
6002 {
6003 ProbeForRead(pmbi, sizeof(MENUBARINFO), 1);
6004 kmbi.cbSize = pmbi->cbSize;
6005 }
6007 {
6008 kmbi.cbSize = 0;
6009 }
6010 _SEH2_END
6011
6012 if (kmbi.cbSize != sizeof(MENUBARINFO))
6013 {
6015 goto Cleanup; // Return FALSE
6016 }
6017
6018 if (!Menu)
6019 {
6020 Menu = UserGetMenuObject(hMenu);
6021 if (!Menu)
6022 goto Cleanup; // Return FALSE
6023 }
6024
6025 if ((idItem < 0) || ((ULONG)idItem > Menu->cItems))
6026 goto Cleanup; // Return FALSE
6027
6028 if (idItem == 0)
6029 {
6030 Ret = IntGetMenuItemRect(pWnd, Menu, 0, &kmbi.rcBar);
6031 kmbi.rcBar.right = kmbi.rcBar.left + Menu->cxMenu;
6032 kmbi.rcBar.bottom = kmbi.rcBar.top + Menu->cyMenu;
6033 TRACE("idItem a 0 %d\n",Ret);
6034 }
6035 else
6036 {
6037 Ret = IntGetMenuItemRect(pWnd, Menu, idItem-1, &kmbi.rcBar);
6038 TRACE("idItem b %d %d\n", idItem-1, Ret);
6039 }
6040
6041 kmbi.hMenu = hMenu;
6042 kmbi.fBarFocused = top_popup_hmenu == hMenu;
6043 TRACE("GMBI: top p hm %p hMenu %p\n",top_popup_hmenu, hMenu);
6044 if (idItem)
6045 {
6046 kmbi.fFocused = Menu->iItem == idItem-1;
6047 if (kmbi.fFocused && (Menu->rgItems[idItem - 1].spSubMenu))
6048 {
6049 kmbi.hwndMenu = Menu->rgItems[idItem - 1].spSubMenu->hWnd;
6050 }
6051 }
6052 else
6053 {
6054 kmbi.fFocused = kmbi.fBarFocused;
6055 }
6056
6057 _SEH2_TRY
6058 {
6059 ProbeForWrite(pmbi, sizeof(MENUBARINFO), 1);
6060 RtlCopyMemory(pmbi, &kmbi, sizeof(MENUBARINFO));
6061 }
6063 {
6065 }
6066 _SEH2_END
6067
6068 if (!NT_SUCCESS(Status))
6069 {
6071 Ret = FALSE;
6072 goto Cleanup;
6073 }
6074
6075 Ret = TRUE;
6076
6077Cleanup:
6078 if (pWnd) UserDerefObjectCo(pWnd);
6079 UserLeave();
6080 TRACE("Leave NtUserGetMenuBarInfo, ret=%i\n", Ret);
6081 return Ret;
6082}
struct _MENUWND * PMENUWND
#define FNID_MENU
Definition: ntuser.h:861
#define WS_SYSMENU
Definition: pedump.c:629
DWORD fnid
Definition: ntuser.h:570
DWORD style
Definition: ntuser.h:706
UINT_PTR IDMenu
Definition: ntuser.h:731
struct tagMENU * spSubMenu
Definition: ntuser.h:375
BOOL fBarFocused
Definition: winuser.h:3838
DWORD cbSize
Definition: winuser.h:3834
INT iItem
Definition: ntuser.h:419
UINT cItems
Definition: ntuser.h:421
ULONG cxMenu
Definition: ntuser.h:422
PITEM rgItems
Definition: ntuser.h:426
PMENU spmenu
Definition: ntuser.h:473
FORCEINLINE VOID RECTL_vSetEmptyRect(_Out_ RECTL *prcl)
Definition: rect.h:20
PMENU FASTCALL IntGetSystemMenu(PWND Window, BOOL bRevert)
Definition: menu.c:5409
static HMENU top_popup_hmenu
Definition: menu.c:23
BOOL FASTCALL IntGetMenuItemRect(PWND pWnd, PMENU Menu, UINT uItem, PRECTL Rect)
Definition: menu.c:5256
#define OBJID_MENU
Definition: winable.h:18
#define OBJID_SYSMENU
Definition: winable.h:16
#define OBJID_CLIENT
Definition: winable.h:19
#define MN_GETHMENU
Definition: winuser.h:1801

◆ NtUserGetMenuIndex()

UINT NTAPI NtUserGetMenuIndex ( HMENU  hMenu,
HMENU  hSubMenu 
)

Definition at line 6088 of file menu.c.

6091{
6092 PMENU Menu, SubMenu;
6093 PITEM MenuItem;
6094 UINT i;
6095 UINT Ret = 0xFFFFFFFF;
6096
6097 TRACE("Enter NtUserGetMenuIndex\n");
6099
6100 if ( !(Menu = UserGetMenuObject(hMenu)) ||
6101 !(SubMenu = UserGetMenuObject(hSubMenu)) )
6102 goto Exit; // Return 0xFFFFFFFF
6103
6104 MenuItem = Menu->rgItems;
6105 for (i = 0; i < Menu->cItems; i++, MenuItem++)
6106 {
6107 if (MenuItem->spSubMenu == SubMenu)
6108 {
6109 Ret = MenuItem->wID;
6110 break;
6111 }
6112 }
6113
6114Exit:
6115 UserLeave();
6116 TRACE("Leave NtUserGetMenuIndex, ret=%u\n", Ret);
6117 return Ret;
6118}
UINT wID
Definition: ntuser.h:374

Referenced by GetMenuIndex().

◆ NtUserGetMenuItemRect()

BOOL NTAPI NtUserGetMenuItemRect ( HWND  hWnd,
HMENU  hMenu,
UINT  uItem,
LPRECT  lprcItem 
)

Referenced by GetMenuItemRect().

◆ NtUserGetMessage()

BOOL APIENTRY NtUserGetMessage ( PMSG  pMsg,
HWND  hWnd,
UINT  MsgFilterMin,
UINT  MsgFilterMax 
)

Definition at line 2343 of file message.c.

2347{
2348 MSG Msg;
2349 BOOL Ret;
2350
2351 if ( (MsgFilterMin|MsgFilterMax) & ~WM_MAXIMUM )
2352 {
2354 return FALSE;
2355 }
2356
2358
2359 RtlZeroMemory(&Msg, sizeof(MSG));
2360
2361 Ret = co_IntGetPeekMessage(&Msg, hWnd, MsgFilterMin, MsgFilterMax, PM_REMOVE, TRUE);
2362
2363 UserLeave();
2364
2365 if (Ret)
2366 {
2367 _SEH2_TRY
2368 {
2369 ProbeForWrite(pMsg, sizeof(MSG), 1);
2370 RtlCopyMemory(pMsg, &Msg, sizeof(MSG));
2371 }
2373 {
2375 Ret = FALSE;
2376 }
2377 _SEH2_END;
2378 }
2379
2380 if ((INT)Ret != -1)
2381 Ret = Ret ? (WM_QUIT != pMsg->message) : FALSE;
2382
2383 return Ret;
2384}
UINT message
Definition: winuser.h:3223
#define WM_MAXIMUM
Definition: undocuser.h:65
#define WM_QUIT
Definition: winuser.h:1651

Referenced by GetMessageA(), and GetMessageW().

◆ NtUserGetMonitorInfo()

BOOL NTAPI NtUserGetMonitorInfo ( IN HMONITOR  hMonitor,
OUT LPMONITORINFO  pMonitorInfo 
)

Definition at line 737 of file monitor.c.

740{
741 PMONITOR pMonitor;
742 MONITORINFOEXW MonitorInfo;
744 BOOL bRet = FALSE;
745 PWCHAR pwstrDeviceName;
746
747 TRACE("Enter NtUserGetMonitorInfo\n");
749
750 /* Get monitor object */
751 pMonitor = UserGetMonitorObject(hMonitor);
752 if (!pMonitor)
753 {
754 TRACE("Couldnt find monitor %p\n", hMonitor);
755 goto cleanup;
756 }
757
758 /* Check if pMonitorInfoUnsafe is valid */
759 if(pMonitorInfoUnsafe == NULL)
760 {
762 goto cleanup;
763 }
764
765 pwstrDeviceName = ((PPDEVOBJ)(pMonitor->hDev))->pGraphicsDevice->szWinDeviceName;
766
767 /* Get size of pMonitorInfoUnsafe */
768 Status = MmCopyFromCaller(&MonitorInfo.cbSize, &pMonitorInfoUnsafe->cbSize, sizeof(MonitorInfo.cbSize));
769 if (!NT_SUCCESS(Status))
770 {
772 goto cleanup;
773 }
774
775 /* Check if size of struct is valid */
776 if (MonitorInfo.cbSize != sizeof(MONITORINFO) &&
777 MonitorInfo.cbSize != sizeof(MONITORINFOEXW))
778 {
780 goto cleanup;
781 }
782
783 /* Fill monitor info */
784 MonitorInfo.rcMonitor = pMonitor->rcMonitor;
785 MonitorInfo.rcWork = pMonitor->rcWork;
786 MonitorInfo.dwFlags = 0;
787 if (pMonitor->IsPrimary)
788 MonitorInfo.dwFlags |= MONITORINFOF_PRIMARY;
789
790 /* Fill device name */
791 if (MonitorInfo.cbSize == sizeof(MONITORINFOEXW))
792 {
793 RtlStringCbCopyNExW(MonitorInfo.szDevice,
794 sizeof(MonitorInfo.szDevice),
795 pwstrDeviceName,
796 (wcslen(pwstrDeviceName)+1) * sizeof(WCHAR),
798 }
799
800 /* Output data */
801 Status = MmCopyToCaller(pMonitorInfoUnsafe, &MonitorInfo, MonitorInfo.cbSize);
802 if (!NT_SUCCESS(Status))
803 {
804 TRACE("GetMonitorInfo: MmCopyToCaller failed\n");
806 goto cleanup;
807 }
808
809 TRACE("GetMonitorInfo: success\n");
810 bRet = TRUE;
811
812cleanup:
813 TRACE("Leave NtUserGetMonitorInfo, ret=%i\n", bRet);
814 UserLeave();
815 return bRet;
816}
struct _PDEVOBJ * PPDEVOBJ
Definition: mdevobj.h:6
NTSTRSAFEAPI RtlStringCbCopyNExW(_Out_writes_bytes_(cbDest) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_reads_bytes_(cbToCopy) STRSAFE_LPCWSTR pszSrc, _In_ size_t cbToCopy, _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, _Out_opt_ size_t *pcbRemaining, _In_ STRSAFE_DWORD dwFlags)
Definition: ntstrsafe.h:547
#define STRSAFE_FILL_BEHIND_NULL
Definition: ntstrsafe.h:32
RECT rcWork
Definition: monitor.h:19
HDEV hDev
Definition: monitor.h:23
RECT rcMonitor
Definition: monitor.h:18
DWORD IsPrimary
Definition: monitor.h:15
WCHAR szDevice[CCHDEVICENAME]
Definition: winuser.h:3912
PMONITOR NTAPI UserGetMonitorObject(IN HMONITOR hMonitor)
Definition: monitor.c:74

Referenced by GetMonitorInfoA(), and GetMonitorInfoW().

◆ NtUserGetMouseMovePointsEx()

DWORD NTAPI NtUserGetMouseMovePointsEx ( UINT  cbSize,
LPMOUSEMOVEPOINT  lppt,
LPMOUSEMOVEPOINT  lpptBuf,
int  nBufPoints,
DWORD  resolution 
)

Definition at line 543 of file mouse.c.

549{
550 MOUSEMOVEPOINT Safeppt;
551 //BOOL Hit;
552 INT iRet = -1;
553
554 TRACE("Enter NtUserGetMouseMovePointsEx\n");
555
556 if ((cbSize != sizeof(MOUSEMOVEPOINT)) || (nBufPoints < 0) || (nBufPoints > 64))
557 {
559 return (DWORD)-1;
560 }
561
562 if (!lpptIn || (!lpptOut && nBufPoints))
563 {
565 return (DWORD)-1;
566 }
567
569 {
570 ProbeForRead(lpptIn, cbSize, 1);
571 RtlCopyMemory(&Safeppt, lpptIn, cbSize);
572 }
574 {
576 _SEH2_YIELD(return (DWORD)-1);
577 }
578 _SEH2_END;
579
581
582 // https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getmousemovepointsex
583 // This explains the math issues in transforming points.
584 iRet = gcMouseHistoryOfMoves; // FIFO is forward so retrieve backward.
585 //Hit = FALSE;
586 do
587 {
588 if (Safeppt.x == 0 && Safeppt.y == 0)
589 break; // No test.
590 // Finds the point, it returns the last nBufPoints prior to and including the supplied point.
591 if (gMouseHistoryOfMoves[iRet].x == Safeppt.x && gMouseHistoryOfMoves[iRet].y == Safeppt.y)
592 {
593 if (Safeppt.time) // Now test time and it seems to be absolute.
594 {
595 if (Safeppt.time == gMouseHistoryOfMoves[iRet].time)
596 {
597 //Hit = TRUE;
598 break;
599 }
600 else
601 {
602 if (--iRet < 0) iRet = 63;
603 continue;
604 }
605 }
606 //Hit = TRUE;
607 break;
608 }
609 if (--iRet < 0) iRet = 63;
610 }
611 while (iRet != gcMouseHistoryOfMoves);
612
613 switch(resolution)
614 {
615 case GMMP_USE_DISPLAY_POINTS:
616 if (nBufPoints)
617 {
619 {
620 ProbeForWrite(lpptOut, cbSize, 1);
621 }
623 {
625 iRet = -1;
626 _SEH2_YIELD(goto cleanup);
627 }
628 _SEH2_END;
629 }
630 iRet = nBufPoints;
631 break;
632 case GMMP_USE_HIGH_RESOLUTION_POINTS:
633 break;
634 default:
636 iRet = -1;
637 }
638
639cleanup:
640 TRACE("Leave NtUserGetMouseMovePointsEx, ret=%i\n", iRet);
641 UserLeave();
642 return (DWORD)iRet;
643}
MOUSEMOVEPOINT gMouseHistoryOfMoves[64]
Definition: mouse.c:13
INT gcMouseHistoryOfMoves
Definition: mouse.c:14
#define ERROR_POINT_NOT_FOUND
Definition: winerror.h:1017
#define ERROR_NOACCESS
Definition: winerror.h:902

◆ NtUserGetObjectInformation()

BOOL NTAPI NtUserGetObjectInformation ( HANDLE  hObject,
DWORD  nIndex,
PVOID  pvInformation,
DWORD  nLength,
PDWORD  nLengthNeeded 
)

Definition at line 1109 of file winsta.c.

1115{
1117 PWINSTATION_OBJECT WinStaObject = NULL;
1118 PDESKTOP DesktopObject = NULL;
1119 POBJECT_HEADER ObjectHeader;
1120 POBJECT_HEADER_NAME_INFO NameInfo;
1121 OBJECT_HANDLE_INFORMATION HandleInfo;
1122 USEROBJECTFLAGS ObjectFlags;
1123 PUNICODE_STRING pStrNameU = NULL;
1124 PVOID pvData = NULL;
1125 SIZE_T nDataSize = 0;
1126
1127 _SEH2_TRY
1128 {
1129 if (nLengthNeeded)
1130 ProbeForWrite(nLengthNeeded, sizeof(*nLengthNeeded), 1);
1131 ProbeForWrite(pvInformation, nLength, 1);
1132 }
1134 {
1136 return FALSE;
1137 }
1138 _SEH2_END;
1139
1140 /* Try window station */
1141 TRACE("Trying to open window station 0x%p\n", hObject);
1143 0,
1145 UserMode,
1146 (PVOID*)&WinStaObject,
1147 &HandleInfo);
1148
1150 {
1151 /* Try desktop */
1152 TRACE("Trying to open desktop %p\n", hObject);
1153 WinStaObject = NULL;
1155 UserMode,
1156 0,
1157 &DesktopObject);
1158 }
1159
1160 if (!NT_SUCCESS(Status))
1161 {
1162 ERR("Failed: 0x%x\n", Status);
1163 goto Exit;
1164 }
1165
1166 TRACE("WinSta or Desktop opened!\n");
1167
1168 /* Get data */
1169 switch (nIndex)
1170 {
1171 case UOI_FLAGS:
1172 {
1173 ObjectFlags.fReserved = FALSE;
1174 ObjectFlags.fInherit = !!(HandleInfo.HandleAttributes & OBJ_INHERIT);
1175
1176 ObjectFlags.dwFlags = 0;
1177 if (WinStaObject != NULL)
1178 {
1179 if (!(WinStaObject->Flags & WSS_NOIO))
1180 ObjectFlags.dwFlags |= WSF_VISIBLE;
1181 }
1182 else if (DesktopObject != NULL)
1183 {
1184 FIXME("Setting DF_ALLOWOTHERACCOUNTHOOK is unimplemented.\n");
1185 }
1186 else
1187 {
1188 ERR("No associated WinStaObject nor DesktopObject!\n");
1189 }
1190
1191 pvData = &ObjectFlags;
1192 nDataSize = sizeof(ObjectFlags);
1194 break;
1195 }
1196
1197 case UOI_NAME:
1198 {
1199 if (WinStaObject != NULL)
1200 {
1201 ObjectHeader = OBJECT_TO_OBJECT_HEADER(WinStaObject);
1202 NameInfo = OBJECT_HEADER_TO_NAME_INFO(ObjectHeader);
1203
1204 if (NameInfo && (NameInfo->Name.Length > 0))
1205 {
1206 /* Named window station */
1207 pStrNameU = &NameInfo->Name;
1208 nDataSize = pStrNameU->Length + sizeof(UNICODE_NULL);
1209 }
1210 else
1211 {
1212 /* Unnamed window station (should never happen!) */
1213 ASSERT(FALSE);
1214 pStrNameU = NULL;
1215 nDataSize = sizeof(UNICODE_NULL);
1216 }
1218 }
1219 else if (DesktopObject != NULL)
1220 {
1221 pvData = DesktopObject->pDeskInfo->szDesktopName;
1222 nDataSize = (wcslen(DesktopObject->pDeskInfo->szDesktopName) + 1) * sizeof(WCHAR);
1224 }
1225 else
1226 {
1228 }
1229 break;
1230 }
1231
1232 case UOI_TYPE:
1233 {
1234 if (WinStaObject != NULL)
1235 {
1236 ObjectHeader = OBJECT_TO_OBJECT_HEADER(WinStaObject);
1237 pStrNameU = &ObjectHeader->Type->Name;
1238 nDataSize = pStrNameU->Length + sizeof(UNICODE_NULL);
1240 }
1241 else if (DesktopObject != NULL)
1242 {
1243 ObjectHeader = OBJECT_TO_OBJECT_HEADER(DesktopObject);
1244 pStrNameU = &ObjectHeader->Type->Name;
1245 nDataSize = pStrNameU->Length + sizeof(UNICODE_NULL);
1247 }
1248 else
1249 {
1251 }
1252 break;
1253 }
1254
1255 case UOI_USER_SID:
1257 ERR("UOI_USER_SID unimplemented!\n");
1258 break;
1259
1260 default:
1262 break;
1263 }
1264
1265Exit:
1266 if ((Status == STATUS_SUCCESS) && (nLength < nDataSize))
1268
1269 _SEH2_TRY
1270 {
1271 if (nLengthNeeded)
1272 *nLengthNeeded = nDataSize;
1273
1274 /* Try to copy data to caller */
1275 if (Status == STATUS_SUCCESS && (nDataSize > 0))
1276 {
1277 TRACE("Trying to copy data to caller (len = %lu, len needed = %lu)\n", nLength, nDataSize);
1278 if (pvData)
1279 {
1280 /* Copy the data */
1281 RtlCopyMemory(pvInformation, pvData, nDataSize);
1282 }
1283 else if (pStrNameU)
1284 {
1285 /* Copy and NULL-terminate the string */
1286 RtlCopyMemory(pvInformation, pStrNameU->Buffer, pStrNameU->Length);
1287 ((PWCHAR)pvInformation)[pStrNameU->Length / sizeof(WCHAR)] = UNICODE_NULL;
1288 }
1289 else
1290 {
1291 /* Zero the memory */
1292 RtlZeroMemory(pvInformation, nDataSize);
1293 }
1294 }
1295 }
1297 {
1299 }
1300 _SEH2_END;
1301
1302 /* Release objects */
1303 if (DesktopObject != NULL)
1304 ObDereferenceObject(DesktopObject);
1305 if (WinStaObject != NULL)
1306 ObDereferenceObject(WinStaObject);
1307
1308 if (!NT_SUCCESS(Status))
1309 {
1311 return FALSE;
1312 }
1313
1314 return TRUE;
1315}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define STATUS_OBJECT_TYPE_MISMATCH
Definition: d3dkmdt.h:46
#define OBJECT_HEADER_TO_NAME_INFO(h)
Definition: obtypes.h:114
#define OBJECT_TO_OBJECT_HEADER(o)
Definition: obtypes.h:111
_In_ LPWSTR _In_ DWORD _In_ LPCVOID pvData
Definition: netsh.h:116
#define OBJ_INHERIT
Definition: winternl.h:225
WCHAR szDesktopName[1]
Definition: ntuser.h:158
PDESKTOPINFO pDeskInfo
Definition: desktop.h:8
UNICODE_STRING Name
Definition: obtypes.h:433
POBJECT_TYPE Type
Definition: obtypes.h:493
UNICODE_STRING Name
Definition: obtypes.h:383
POBJECT_TYPE ExWindowStationObjectType
Definition: win32k.c:21
#define WSS_NOIO
Definition: winsta.h:9
WINBASEAPI _In_ DWORD nLength
Definition: wincon.h:682
#define UOI_NAME
Definition: winuser.h:1095
#define UOI_TYPE
Definition: winuser.h:1096
#define UOI_USER_SID
Definition: winuser.h:1097
#define WSF_VISIBLE
Definition: winuser.h:2488
#define UOI_FLAGS
Definition: winuser.h:1094

Referenced by GetUserObjectInformationW().

◆ NtUserGetOpenClipboardWindow()

HWND NTAPI NtUserGetOpenClipboardWindow ( VOID  )

Definition at line 601 of file clipboard.c.

602{
603 HWND hWnd = NULL;
604 PWINSTATION_OBJECT pWinStaObj;
605
607
608 pWinStaObj = IntGetWinStaForCbAccess();
609 if (!pWinStaObj)
610 goto cleanup;
611
612 if (pWinStaObj->spwndClipOpen)
613 hWnd = UserHMGetHandle(pWinStaObj->spwndClipOpen);
614
615 ObDereferenceObject(pWinStaObj);
616
617cleanup:
618 UserLeave();
619
620 return hWnd;
621}
PWND spwndClipOpen
Definition: winsta.h:26

Referenced by GetOpenClipboardWindow().

◆ NtUserGetPriorityClipboardFormat()

INT NTAPI NtUserGetPriorityClipboardFormat ( UINT paFormatPriorityList,
INT  cFormats 
)

Definition at line 823 of file clipboard.c.

824{
825 INT i, iRet = 0;
826 PWINSTATION_OBJECT pWinStaObj;
827
829
830 pWinStaObj = IntGetWinStaForCbAccess();
831 if (!pWinStaObj)
832 goto cleanup;
833
834 if (pWinStaObj->pClipBase == NULL)
835 {
836 iRet = 0;
837 }
838 else
839 {
841 {
842 ProbeForRead(paFormatPriorityList, cFormats * sizeof(UINT), sizeof(UINT));
843
844 iRet = -1;
845
846 for (i = 0; i < cFormats; ++i)
847 {
848 if (IntIsFormatAvailable(pWinStaObj, paFormatPriorityList[i]))
849 {
850 iRet = paFormatPriorityList[i];
851 break;
852 }
853 }
854 }
856 {
858 }
859 _SEH2_END;
860 }
861
862 ObDereferenceObject(pWinStaObj);
863
864cleanup:
865 UserLeave();
866
867 return iRet;
868
869}
PCLIP pClipBase
Definition: winsta.h:29
static BOOL FASTCALL IntIsFormatAvailable(PWINSTATION_OBJECT pWinStaObj, UINT fmt)
Definition: clipboard.c:55

Referenced by GetPriorityClipboardFormat().

◆ NtUserGetProcessWindowStation()

HWINSTA NTAPI NtUserGetProcessWindowStation ( VOID  )

Definition at line 1386 of file winsta.c.

1387{
1389}

Referenced by CreateDesktopW(), and GetProcessWindowStation().

◆ NtUserGetRawInputBuffer()

DWORD NTAPI NtUserGetRawInputBuffer ( PRAWINPUT  pData,
PUINT  pcbSize,
UINT  cbSizeHeader 
)

Definition at line 393 of file ntstubs.c.

397{
398 STUB;
399 return 0;
400}

◆ NtUserGetRawInputData()

DWORD NTAPI NtUserGetRawInputData ( HRAWINPUT  hRawInput,
UINT  uiCommand,
LPVOID  pData,
PUINT  pcbSize,
UINT  cbSizeHeader 
)

Definition at line 404 of file ntstubs.c.

410{
411 STUB;
412 return 0;
413}

◆ NtUserGetRawInputDeviceInfo()

DWORD NTAPI NtUserGetRawInputDeviceInfo ( HANDLE  hDevice,
UINT  uiCommand,
LPVOID  pData,
PUINT  pcbSize 
)

Definition at line 417 of file ntstubs.c.

423{
424 STUB;
425 return 0;
426}

Referenced by GetRawInputDeviceInfoA().

◆ NtUserGetRawInputDeviceList()

DWORD NTAPI NtUserGetRawInputDeviceList ( PRAWINPUTDEVICELIST  pRawInputDeviceList,
PUINT  puiNumDevices,
UINT  cbSize 
)

Definition at line 430 of file ntstubs.c.

434{
435 STUB;
436 return 0;
437}

◆ NtUserGetRegisteredRawInputDevices()

DWORD NTAPI NtUserGetRegisteredRawInputDevices ( PRAWINPUTDEVICE  pRawInputDevices,
PUINT  puiNumDevices,
UINT  cbSize 
)

Definition at line 441 of file ntstubs.c.

445{
446 STUB;
447 return 0;
448}

◆ NtUserGetScrollBarInfo()

BOOL NTAPI NtUserGetScrollBarInfo ( HWND  hWnd,
LONG  idObject,
PSCROLLBARINFO  psbi 
)

Definition at line 1153 of file scrollbar.c.

1154{
1157 PWND Window;
1158 BOOL Ret = FALSE;
1160
1161 TRACE("Enter NtUserGetScrollBarInfo\n");
1163
1164 Status = MmCopyFromCaller(&sbi, psbi, sizeof(SCROLLBARINFO));
1165 if(!NT_SUCCESS(Status) || (sbi.cbSize != sizeof(SCROLLBARINFO)))
1166 {
1168 goto Exit; // Return FALSE
1169 }
1170
1172 goto Exit; // Return FALSE
1173
1174 UserRefObjectCo(Window, &Ref);
1175 Ret = co_IntGetScrollBarInfo(Window, idObject, &sbi);
1177
1178 Status = MmCopyToCaller(psbi, &sbi, sizeof(SCROLLBARINFO));
1179 if(!NT_SUCCESS(Status))
1180 {
1182 Ret = FALSE;
1183 }
1184
1185Exit:
1186 TRACE("Leave NtUserGetScrollBarInfo, ret=%i\n", Ret);
1187 UserLeave();
1188 return Ret;
1189}
static SYSTEM_BASIC_INFORMATION sbi
Definition: virtual.c:53
BOOL FASTCALL co_IntGetScrollBarInfo(PWND Window, LONG idObject, PSCROLLBARINFO psbi)
Definition: scrollbar.c:671

Referenced by GetScrollBarInfo(), IntGetScrollBarInfo(), and ScrollBarWndProc_common().

◆ NtUserGetSystemMenu()

HMENU NTAPI NtUserGetSystemMenu ( HWND  hWnd,
BOOL  bRevert 
)

Definition at line 5685 of file menu.c.

5686{
5687 PWND Window;
5688 PMENU Menu;
5689 HMENU Ret = NULL;
5690
5691 TRACE("Enter NtUserGetSystemMenu\n");
5693
5695 {
5696 goto Exit; // Return NULL
5697 }
5698
5699 if (!(Menu = IntGetSystemMenu(Window, bRevert)))
5700 {
5701 goto Exit; // Return NULL
5702 }
5703
5704 Ret = UserHMGetHandle(Menu);
5705
5706Exit:
5707 UserLeave();
5708 TRACE("Leave NtUserGetSystemMenu, ret=%p\n", Ret);
5709 return Ret;
5710}

Referenced by GetSystemMenu().

◆ NtUserGetThreadDesktop()

HDESK NTAPI NtUserGetThreadDesktop ( DWORD  dwThreadId,
HDESK  hConsoleDesktop 
)

Definition at line 3066 of file desktop.c.

3067{
3068 HDESK hDesk;
3070 PTHREADINFO pti;
3072 PDESKTOP DesktopObject;
3074
3076 TRACE("Enter NtUserGetThreadDesktop\n");
3077
3078 if (!dwThreadId)
3079 {
3081 hDesk = NULL;
3082 goto Quit;
3083 }
3084
3085 /* Validate the Win32 thread and retrieve its information */
3087 if (pti)
3088 {
3089 /* Get the desktop handle of the thread */
3090 hDesk = pti->hdesk;
3091 Process = pti->ppi->peProcess;
3092 }
3093 else if (hConsoleDesktop)
3094 {
3095 /*
3096 * The thread may belong to a console, so attempt to use the provided
3097 * console desktop handle as a fallback. Otherwise this means that the
3098 * thread is either not Win32 or invalid.
3099 */
3100 hDesk = hConsoleDesktop;
3102 }
3103 else
3104 {
3106 hDesk = NULL;
3107 goto Quit;
3108 }
3109
3110 if (!hDesk)
3111 {
3112 ERR("Desktop information of thread 0x%x broken!?\n", dwThreadId);
3113 goto Quit;
3114 }
3115
3117 {
3118 /*
3119 * Just return the handle, since we queried the desktop handle
3120 * of a thread running in the same context.
3121 */
3122 goto Quit;
3123 }
3124
3125 /*
3126 * We could just use the cached rpdesk instead of looking up the handle,
3127 * but it may actually be safer to validate the desktop and get a temporary
3128 * reference to it so that it does not disappear under us (e.g. when the
3129 * desktop is being destroyed) during the operation.
3130 */
3131 /*
3132 * Switch into the context of the thread we are trying to get
3133 * the desktop from, so we can use the handle.
3134 */
3135 KeAttachProcess(&Process->Pcb);
3137 0,
3139 UserMode,
3140 (PVOID*)&DesktopObject,
3143
3144 if (NT_SUCCESS(Status))
3145 {
3146 /*
3147 * Lookup our handle table if we can find a handle to the desktop object.
3148 * If not, create one.
3149 * QUESTION: Do we really need to create a handle in case it doesn't exist??
3150 */
3151 hDesk = IntGetDesktopObjectHandle(DesktopObject);
3152
3153 /* All done, we got a valid handle to the desktop */
3154 ObDereferenceObject(DesktopObject);
3155 }
3156 else
3157 {
3158 /* The handle could not be found, there is nothing to get... */
3159 hDesk = NULL;
3160 }
3161
3162 if (!hDesk)
3163 {
3164 ERR("Could not retrieve or access desktop for thread 0x%x\n", dwThreadId);
3166 }
3167
3168Quit:
3169 TRACE("Leave NtUserGetThreadDesktop, hDesk = 0x%p\n", hDesk);
3170 UserLeave();
3171 return hDesk;
3172}
HDESK FASTCALL IntGetDesktopObjectHandle(PDESKTOP DesktopObject)
Definition: desktop.c:1288
_In_ ACCESS_MASK _In_opt_ POBJECT_TYPE _In_ KPROCESSOR_MODE _Out_ PVOID _Out_opt_ POBJECT_HANDLE_INFORMATION HandleInformation
Definition: obfuncs.h:44

Referenced by GetThreadDesktop().

◆ NtUserGetThreadState()

DWORD_PTR NTAPI NtUserGetThreadState ( DWORD  Routine)

Definition at line 239 of file misc.c.

241{
242 DWORD_PTR ret = 0;
243 PTHREADINFO pti;
244
245 TRACE("Enter NtUserGetThreadState\n");
246 if (Routine != THREADSTATE_GETTHREADINFO)
247 {
249 }
250 else
251 {
253 }
254
256
257 switch (Routine)
258 {
260 ret = TRUE;
261 break;
264 break;
266 /* FIXME: Should use UserEnterShared */
268 break;
269 case THREADSTATE_PROGMANWINDOW: /* FIXME: Delete this HACK */
270 ret = (DWORD_PTR)GetW32ThreadInfo()->pDeskInfo->hProgmanWindow;
271 break;
272 case THREADSTATE_TASKMANWINDOW: /* FIXME: Delete this HACK */
273 ret = (DWORD_PTR)GetW32ThreadInfo()->pDeskInfo->hTaskManWindow;
274 break;
277 break;
279 {
282 TRACE("THREADSTATE_INSENDMESSAGE\n");
283
284 ret = ISMEX_NOSEND;
285 if (Message)
286 {
287 if (Message->ptiSender)
288 ret = ISMEX_SEND;
289 else
290 {
291 if (Message->CompletionCallback)
292 ret = ISMEX_CALLBACK;
293 else
294 ret = ISMEX_NOTIFY;
295 }
296 /* If ReplyMessage */
297 if (Message->QS_Flags & QS_SMRESULT) ret |= ISMEX_REPLIED;
298 }
299
300 break;
301 }
304 break;
305
307 pti->pcti->timeLastRead = EngGetTickCount32();
308 break;
309
312 break;
313
316 break;
318 ret = (DWORD_PTR) (GetW32ThreadInfo()->MessageQueue->CursorObject ?
319 UserHMGetHandle(GetW32ThreadInfo()->MessageQueue->CursorObject) : 0);
320 break;
323 break;
325 if (pti->spwndDefaultIme)
327 break;
329 if (pti->spDefaultImc)
331 break;
333 ret = pti->pcti->fsChangeBits;
334 break;
336 ret = pti->ppi->dwImeCompatFlags;
337 break;
339 ret = (ULONG_PTR)pti->hklPrev;
340 break;
343 break;
345 FIXME("stub\n");
346 break;
348 ret = (IntTID2PTI(UlongToHandle(pti->rpdesk->dwConsoleThreadId)) == pti);
349 break;
350 }
351
352 TRACE("Leave NtUserGetThreadState, ret=%lu\n", ret);
353 UserLeave();
354
355 return ret;
356}
static const WCHAR Message[]
Definition: register.c:74
#define ULONG_PTR
Definition: config.h:101
#define EngGetTickCount32()
Definition: eng.h:43
HWND FASTCALL IntGetThreadFocusWindow(VOID)
Definition: focus.c:43
HWND APIENTRY IntGetCapture(VOID)
Definition: focus.c:1436
HWND FASTCALL UserGetActiveWindow(VOID)
Definition: focus.c:1426
LPARAM FASTCALL MsqGetMessageExtraInfo(VOID)
Definition: msgqueue.c:2467
HANDLE NTAPI PsGetCurrentProcessId(VOID)
Definition: process.c:1123
HANDLE gpidLogon
Definition: simplecall.c:15
DWORD dwImeCompatFlags
Definition: win32.h:277
struct _DESKTOPINFO * pDeskInfo
Definition: win32.h:93
struct tagIMC * spDefaultImc
Definition: win32.h:132
HKL hklPrev
Definition: win32.h:133
struct _CLIENTTHREADINFO * pcti
Definition: win32.h:91
#define QS_SMRESULT
Definition: undocuser.h:96
PTHREADINFO GetW32ThreadInfo(VOID)
Definition: misc.c:806
#define QS_KEY
Definition: winuser.h:885
#define QS_SENDMESSAGE
Definition: winuser.h:891
#define QS_TIMER
Definition: winuser.h:889
#define QS_MOUSEBUTTON
Definition: winuser.h:887
#define QS_INPUT
Definition: winuser.h:910
#define QS_PAINT
Definition: winuser.h:890

Referenced by CheckThreadState(), DIALOG_CreateIndirect(), DoTest_BUTTON(), DoTest_EDIT(), GetActiveWindow(), GetCapture(), GetCursor(), GetFocus(), GetInputState(), GetMessageTime(), GetProgmanWindow(), GetTaskmanWindow(), GetW32ThreadInfo(), ImeWnd_OnImeSetContext(), Imm32CurrentPti(), Imm32ImeNonImeToggle(), Imm32InquireIme(), ImmCreateContext(), ImmDllInitialize(), ImmGetDefaultIMEWnd(), ImmGetSaveContext(), ImmLockClientImc(), ImmWINNLSEnableIME(), InSendMessage(), InSendMessageEx(), IsGUIThread(), NtUserxGetMessageExtraInfo(), and PeekMessageWorker().

◆ NtUserGetTitleBarInfo()

BOOLEAN NTAPI NtUserGetTitleBarInfo ( HWND  hwnd,
PTITLEBARINFO  pti 
)

Definition at line 5759 of file menu.c.

5762{
5763 PWND WindowObject;
5764 TITLEBARINFO bartitleinfo;
5765 BOOLEAN retValue = FALSE;
5766
5767 TRACE("Enter NtUserGetTitleBarInfo\n");
5769
5770 /* Validate the window handle */
5771 if (!(WindowObject = UserGetWindowObject(hwnd)))
5772 {
5774 goto Exit;
5775 }
5776
5777 /* Copy user mode buffer to local buffer */
5778 _SEH2_TRY
5779 {
5780 ProbeForRead(bti, sizeof(TITLEBARINFO), 1);
5781 RtlCopyMemory(&bartitleinfo, bti, sizeof(TITLEBARINFO));
5782 }
5784 {
5786 _SEH2_YIELD(goto Exit);
5787 }
5788 _SEH2_END
5789
5790 /* Get the tile bar info */
5791 retValue = intGetTitleBarInfo(WindowObject, &bartitleinfo);
5792 if (!retValue)
5793 {
5794 // intGetTitleBarInfo() set LastError.
5795 goto Exit;
5796 }
5797
5798 /* Copy local buffer back to user mode buffer */
5799 _SEH2_TRY
5800 {
5801 ProbeForWrite(bti, sizeof(TITLEBARINFO), 1);
5802 RtlCopyMemory(bti, &bartitleinfo, sizeof(TITLEBARINFO));
5803 }
5805 {
5807 retValue = FALSE;
5808 }
5809 _SEH2_END;
5810
5811Exit:
5812 UserLeave();
5813 TRACE("Leave NtUserGetTitleBarInfo, ret=%u\n", retValue);
5814 return retValue;
5815}
BOOLEAN APIENTRY intGetTitleBarInfo(PWND pWindowObject, PTITLEBARINFO bti)
Definition: menu.c:4830

Referenced by GetTitleBarInfo(), and START_TEST().

◆ NtUserGetUpdateRect()

BOOL NTAPI NtUserGetUpdateRect ( HWND  hWnd,
LPRECT  lpRect,
BOOL  fErase 
)

Definition at line 1959 of file painting.c.

1960{
1961 PWND Window;
1962 RECTL Rect;
1964 BOOL Ret = FALSE;
1965
1966 TRACE("Enter NtUserGetUpdateRect\n");
1968
1970 {
1971 goto Exit; // Return FALSE
1972 }
1973
1974 Ret = co_UserGetUpdateRect(Window, &Rect, bErase);
1975
1976 if (UnsafeRect != NULL)
1977 {
1978 Status = MmCopyToCaller(UnsafeRect, &Rect, sizeof(RECTL));
1979 if (!NT_SUCCESS(Status))
1980 {
1982 Ret = FALSE;
1983 }
1984 }
1985
1986Exit:
1987 TRACE("Leave NtUserGetUpdateRect, ret=%i\n", Ret);
1988 UserLeave();
1989 return Ret;
1990}
BOOL FASTCALL co_UserGetUpdateRect(PWND Window, PRECT pRect, BOOL bErase)
Definition: painting.c:1860

Referenced by GetUpdateRect().

◆ NtUserGetUpdateRgn()

INT NTAPI NtUserGetUpdateRgn ( HWND  hWnd,
HRGN  hRgn,
BOOL  bErase 
)

Definition at line 1932 of file painting.c.

1933{
1934 PWND Window;
1935 INT ret = ERROR;
1936
1937 TRACE("Enter NtUserGetUpdateRgn\n");
1939
1941 if (Window)
1942 {
1943 ret = co_UserGetUpdateRgn(Window, hRgn, bErase);
1944 }
1945
1946 TRACE("Leave NtUserGetUpdateRgn, ret=%i\n", ret);
1947 UserLeave();
1948 return ret;
1949}
static HRGN hRgn
Definition: mapping.c:33
INT FASTCALL co_UserGetUpdateRgn(PWND Window, HRGN hRgn, BOOL bErase)
Definition: painting.c:1788

Referenced by GetUpdateRgn().

◆ NtUserGetWindowDC()

HDC NTAPI NtUserGetWindowDC ( HWND  hWnd)

Definition at line 1008 of file windc.c.

1009{
1011}

Referenced by GetWindowDC().

◆ NtUserGetWindowPlacement()

BOOL NTAPI NtUserGetWindowPlacement ( HWND  hWnd,
WINDOWPLACEMENT lpwndpl 
)

Definition at line 3444 of file winpos.c.

3446{
3447 PWND Wnd;
3448 WINDOWPLACEMENT Safepl;
3450 BOOL Ret = FALSE;
3451
3452 TRACE("Enter NtUserGetWindowPlacement\n");
3454
3455 if (!(Wnd = UserGetWindowObject(hWnd)))
3456 goto Exit; // Return FALSE
3457
3458 Status = MmCopyFromCaller(&Safepl, lpwndpl, sizeof(WINDOWPLACEMENT));
3459 if (!NT_SUCCESS(Status))
3460 {
3462 goto Exit; // Return FALSE
3463 }
3464
3465 // This function doesn't check the length. Just overwrite it
3466 Safepl.length = sizeof(WINDOWPLACEMENT);
3467
3468 IntGetWindowPlacement(Wnd, &Safepl);
3469
3470 Status = MmCopyToCaller(lpwndpl, &Safepl, sizeof(WINDOWPLACEMENT));
3471 if (!NT_SUCCESS(Status))
3472 {
3474 goto Exit; // Return FALSE
3475 }
3476
3477 Ret = TRUE;
3478
3479Exit:
3480 TRACE("Leave NtUserGetWindowPlacement, ret=%i\n", Ret);
3481 UserLeave();
3482 return Ret;
3483}

Referenced by GetWindowPlacement().

◆ NtUserGetWOWClass()

PCLS NTAPI NtUserGetWOWClass ( HINSTANCE  hInstance,
PUNICODE_STRING  ClassName 
)

Definition at line 2941 of file class.c.

2944{
2945 UNICODE_STRING SafeClassName;
2947 PCLS Class = NULL;
2948 RTL_ATOM ClassAtom = 0;
2950
2951 Status = ProbeAndCaptureUnicodeStringOrAtom(&SafeClassName, ClassName);
2952 if (!NT_SUCCESS(Status))
2953 {
2954 ERR("Error capturing the class name\n");
2956 return FALSE;
2957 }
2958
2960
2962
2963 ClassAtom = IntGetClassAtom(&SafeClassName,
2964 hInstance,
2965 pi,
2966 &Class,
2967 NULL);
2968 if (!ClassAtom)
2969 {
2971 }
2972
2973
2974 if (SafeClassName.Buffer && !IS_ATOM(SafeClassName.Buffer))
2975 ExFreePoolWithTag(SafeClassName.Buffer, TAG_STRING);
2976
2977 UserLeave();
2978//
2979// Don't forget to use DesktopPtrToUser( ? ) with return pointer in user space.
2980//
2981 return Class;
2982}
static PROCESS_INFORMATION pi
Definition: debugger.c:2303

Referenced by START_TEST().

◆ NtUserHardErrorControl()

DWORD NTAPI NtUserHardErrorControl ( DWORD  dwUnknown1,
DWORD  dwUnknown2,
DWORD  dwUnknown3 
)

Definition at line 452 of file ntstubs.c.

456{
457 STUB;
458 return 0;
459}

◆ NtUserHideCaret()

BOOL NTAPI NtUserHideCaret ( HWND  hWnd)

Definition at line 450 of file caret.c.

451{
452 PWND Window = NULL;
454 BOOL ret = FALSE;
455
456 TRACE("Enter NtUserHideCaret\n");
458
460 {
461 goto Exit; // Return FALSE
462 }
463
464 if (Window) UserRefObjectCo(Window, &Ref);
465
467
469
470Exit:
471 TRACE("Leave NtUserHideCaret, ret=%i\n", ret);
472 UserLeave();
473 return ret;
474}
BOOL FASTCALL co_UserHideCaret(PWND Window OPTIONAL)
Definition: caret.c:224

Referenced by HideCaret().

◆ NtUserHiliteMenuItem()

BOOL NTAPI NtUserHiliteMenuItem ( HWND  hWnd,
HMENU  hMenu,
UINT  uItemHilite,
UINT  uHilite 
)

Definition at line 6210 of file menu.c.

6215{
6216 PMENU Menu;
6217 PWND Window;
6218 BOOL Ret = FALSE;
6219
6220 TRACE("Enter NtUserHiliteMenuItem\n");
6222
6224 {
6226 goto Exit; // Return FALSE
6227 }
6228
6229 if(!(Menu = UserGetMenuObject(hMenu)))
6230 {
6232 goto Exit; // Return FALSE
6233 }
6234
6235 Ret = IntHiliteMenuItem(Window, Menu, uItemHilite, uHilite);
6236
6237Exit:
6238 UserLeave();
6239 TRACE("Leave NtUserHiliteMenuItem, ret=%i\n", Ret);
6240 return Ret;
6241}
BOOL FASTCALL IntHiliteMenuItem(PWND WindowObject, PMENU MenuObject, UINT uItemHilite, UINT uHilite)
Definition: menu.c:4804

◆ NtUserImpersonateDdeClientWindow()

BOOL NTAPI NtUserImpersonateDdeClientWindow ( HWND  hWndClient,
HWND  hWndServer 
)

Definition at line 454 of file dde.c.

457{
458 STUB
459
460 return 0;
461}

◆ NtUserInitialize()

NTSTATUS NTAPI NtUserInitialize ( DWORD  dwWinVersion,
HANDLE  hPowerRequestEvent,
HANDLE  hMediaRequestEvent 
)

Definition at line 171 of file ntuser.c.

175{
177
178 TRACE("Enter NtUserInitialize(%lx, %p, %p)\n",
179 dwWinVersion, hPowerRequestEvent, hMediaRequestEvent);
180
181 /* Check if we are already initialized */
182 if (gpepCSRSS)
183 return STATUS_UNSUCCESSFUL;
184
185 /* Check Windows USER subsystem version */
186 if (dwWinVersion != USER_VERSION)
187 {
188 /* No match, bugcheck */
189 KeBugCheckEx(WIN32K_INIT_OR_RIT_FAILURE, 0, 0, dwWinVersion, USER_VERSION);
190 }
191
192 /* Acquire exclusive lock */
194
195 /* Save the EPROCESS of CSRSS */
196 InitCsrProcess(/*PsGetCurrentProcess()*/);
197
198 /* Initialize Power Request List */
199 Status = IntInitWin32PowerManagement(hPowerRequestEvent);
200 if (!NT_SUCCESS(Status))
201 {
202 UserLeave();
203 return Status;
204 }
205
206// Initialize Media Change (use hMediaRequestEvent).
207
208 /* Initialize various GDI stuff (DirectX, fonts, language ID etc.) */
209 if (!InitializeGreCSRSS())
210 return STATUS_UNSUCCESSFUL;
211
212 /* Initialize USER */
214
215 /* Return */
216 UserLeave();
217 return Status;
218}
DECLSPEC_NORETURN VOID NTAPI KeBugCheckEx(IN ULONG BugCheckCode, IN ULONG_PTR BugCheckParameter1, IN ULONG_PTR BugCheckParameter2, IN ULONG_PTR BugCheckParameter3, IN ULONG_PTR BugCheckParameter4)
Definition: debug.c:485
VOID InitCsrProcess(VOID)
Definition: csr.c:20
#define USER_VERSION
Definition: ntuser.h:1149
NTSTATUS NTAPI UserInitialize(VOID)
Definition: ntuser.c:116
BOOL InitializeGreCSRSS(VOID)
Definition: init.c:79
NTSTATUS NTAPI IntInitWin32PowerManagement(_In_ HANDLE hPowerRequestEvent)
Initializes the power management side of Win32 kernel-mode subsystem component. This enables communic...
Definition: power.c:271

Referenced by CSR_SERVER_DLL_INIT().

◆ NtUserInitializeClientPfnArrays()

NTSTATUS NTAPI NtUserInitializeClientPfnArrays ( PPFNCLIENT  pfnClientA,
PPFNCLIENT  pfnClientW,
PPFNCLIENTWORKER  pfnClientWorker,
HINSTANCE  hmodUser 
)

Definition at line 101 of file ntstubs.c.

106{
108 TRACE("Enter NtUserInitializeClientPfnArrays User32 0x%p\n", hmodUser);
109
110 if (ClientPfnInit) return Status;
111
113
115 {
116 ProbeForRead( pfnClientA, sizeof(PFNCLIENT), 1);
117 ProbeForRead( pfnClientW, sizeof(PFNCLIENT), 1);
122
126
127 hModClient = hmodUser;
129 }
131 {
133 }
135
136 if (!NT_SUCCESS(Status))
137 {
138 ERR("Failed reading Client Pfns from user space.\n");
140 }
141
142 UserLeave();
143 return Status;
144}
BOOL ClientPfnInit
Definition: ntuser.c:26
static PFNCLIENT pfnClientA
Definition: regcontrol.c:15
static PFNCLIENT pfnClientW
Definition: regcontrol.c:16
static PFNCLIENTWORKER pfnClientWorker
Definition: regcontrol.c:17
PFNCLIENT apfnClientA
Definition: ntuser.h:1056
PFNCLIENT apfnClientW
Definition: ntuser.h:1057
WNDPROC aStoCidPfn[FNID_NUMSERVERPROC]
Definition: ntuser.h:1054
PFNCLIENTWORKER apfnClientWorker
Definition: ntuser.h:1058

Referenced by RegisterClientPFN().

◆ NtUserInitTask()

DWORD NTAPI NtUserInitTask ( DWORD  Unknown0,
DWORD  Unknown1,
DWORD  Unknown2,
DWORD  Unknown3,
DWORD  Unknown4,
DWORD  Unknown5,
DWORD  Unknown6,
DWORD  Unknown7,
DWORD  Unknown8,
DWORD  Unknown9,
DWORD  Unknown10,
DWORD  Unknown11 
)

Definition at line 148 of file ntstubs.c.

161{
162 STUB
163
164 return 0;
165}

◆ NtUserInternalGetWindowText()

INT NTAPI NtUserInternalGetWindowText ( HWND  hWnd,
LPWSTR  lpString,
INT  nMaxCount 
)

Definition at line 4600 of file window.c.

4601{
4602 PWND Wnd;
4604 INT Result = 0;
4605
4606 TRACE("Enter NtUserInternalGetWindowText\n");
4608
4609 if(lpString && (nMaxCount <= 1))
4610 {
4612 goto Exit; // Return 0
4613 }
4614
4615 if(!(Wnd = UserGetWindowObject(hWnd)))
4616 {
4617 goto Exit; // Return 0
4618 }
4619
4620 Result = Wnd->strName.Length / sizeof(WCHAR);
4621 if(lpString)
4622 {
4623 const WCHAR Terminator = L'\0';
4624 INT Copy;
4625 WCHAR *Buffer = (WCHAR*)lpString;
4626
4627 Copy = min(nMaxCount - 1, Result);
4628 if(Copy > 0)
4629 {
4630 Status = MmCopyToCaller(Buffer, Wnd->strName.Buffer, Copy * sizeof(WCHAR));
4631 if(!NT_SUCCESS(Status))
4632 {
4634 Result = 0;
4635 goto Exit;
4636 }
4637 Buffer += Copy;
4638 }
4639
4640 Status = MmCopyToCaller(Buffer, &Terminator, sizeof(WCHAR));
4641 if(!NT_SUCCESS(Status))
4642 {
4644 Result = 0;
4645 goto Exit;
4646 }
4647
4648 Result = Copy;
4649 }
4650
4651Exit:
4652 TRACE("Leave NtUserInternalGetWindowText, ret=%i\n", Result);
4653 UserLeave();
4654 return Result;
4655}
Definition: bufpool.h:45
VOID Copy(PVOID Src, PVOID Dst, ULONG NumBytes)
Definition: mmixer.c:126
_In_ int nMaxCount
Definition: winuser.h:5034

Referenced by GetWindowTextA(), GetWindowTextW(), and InternalGetWindowText().

◆ NtUserInvalidateRect()

BOOL NTAPI NtUserInvalidateRect ( HWND  hWnd,
CONST RECT lpRect,
BOOL  bErase 
)

Definition at line 2539 of file painting.c.

2543{
2544 UINT flags = RDW_INVALIDATE | (bErase ? RDW_ERASE : 0);
2545 if (!hWnd)
2546 {
2548 lpUnsafeRect = NULL;
2549 }
2550 return NtUserRedrawWindow(hWnd, lpUnsafeRect, NULL, flags);
2551}
GLbitfield flags
Definition: glext.h:7161
BOOL APIENTRY NtUserRedrawWindow(HWND hWnd, CONST RECT *lprcUpdate, HRGN hrgnUpdate, UINT flags)
Definition: painting.c:2000
#define RDW_ERASE
Definition: winuser.h:1222
#define RDW_ERASENOW
Definition: winuser.h:1230
#define RDW_FRAME
Definition: winuser.h:1223
#define RDW_INVALIDATE
Definition: winuser.h:1225

Referenced by ComboWndProc_common(), and InvalidateRect().

◆ NtUserInvalidateRgn()

BOOL NTAPI NtUserInvalidateRgn ( HWND  hWnd,
HRGN  hRgn,
BOOL  bErase 
)

Definition at line 2555 of file painting.c.

2559{
2560 if (!hWnd)
2561 {
2563 return FALSE;
2564 }
2565 return NtUserRedrawWindow(hWnd, NULL, hRgn, RDW_INVALIDATE | (bErase? RDW_ERASE : 0));
2566}

Referenced by InvalidateRgn().

◆ NtUserIsClipboardFormatAvailable()

BOOL NTAPI NtUserIsClipboardFormatAvailable ( UINT  format)

Definition at line 872 of file clipboard.c.

873{
874 BOOL bRet = FALSE;
875 PWINSTATION_OBJECT pWinStaObj;
876
877 TRACE("NtUserIsClipboardFormatAvailable(%x)\n", fmt);
878
880
881 pWinStaObj = IntGetWinStaForCbAccess();
882 if (!pWinStaObj)
883 goto cleanup;
884
885 if (IntIsFormatAvailable(pWinStaObj, fmt))
886 bRet = TRUE;
887
888 ObDereferenceObject(pWinStaObj);
889
890cleanup:
891 UserLeave();
892
893 return bRet;
894}

Referenced by IsClipboardFormatAvailable().

◆ NtUserKillTimer()

BOOL NTAPI NtUserKillTimer ( HWND  hWnd,
UINT_PTR  uIDEvent 
)

Definition at line 661 of file timer.c.

666{
667 PWND Window = NULL;
668 BOOL ret;
669
670 TRACE("Enter NtUserKillTimer\n");
673
674 ret = IntKillTimer(Window, uIDEvent, FALSE);
675
676 UserLeave();
677
678 TRACE("Leave NtUserKillTimer, ret=%i\n", ret);
679 return ret;
680}

Referenced by KillTimer().

◆ NtUserLoadKeyboardLayoutEx()

HKL NTAPI NtUserLoadKeyboardLayoutEx ( IN HANDLE  hFile,
IN DWORD  offTable,
IN PVOID  pTables,
IN HKL  hOldKL,
IN PUNICODE_STRING  puszKLID,
IN DWORD  dwNewKL,
IN UINT  Flags 
)

Definition at line 1161 of file kbdlayout.c.

1169{
1170 HKL hRetKL;
1172 UNICODE_STRING uszSafeKLID;
1173 PWINSTATION_OBJECT pWinSta;
1174 HANDLE hSafeFile;
1175
1176 UNREFERENCED_PARAMETER(offTable);
1177 UNREFERENCED_PARAMETER(pTables);
1178
1181 KLF_RESET|KLF_SHIFTLOCK))
1182 {
1183 ERR("Invalid flags: %x\n", Flags);
1185 return NULL;
1186 }
1187
1188 RtlInitEmptyUnicodeString(&uszSafeKLID, Buffer, sizeof(Buffer));
1189 _SEH2_TRY
1190 {
1191 ProbeForRead(puszKLID, sizeof(*puszKLID), 1);
1192 ProbeForRead(puszKLID->Buffer, sizeof(puszKLID->Length), 1);
1193 RtlCopyUnicodeString(&uszSafeKLID, puszKLID);
1194 }
1196 {
1198 _SEH2_YIELD(return NULL);
1199 }
1200 _SEH2_END;
1201
1203
1204 hSafeFile = (hFile ? IntVerifyKeyboardFileHandle(hFile) : NULL);
1206 hRetKL = co_IntLoadKeyboardLayoutEx(pWinSta,
1207 hSafeFile,
1208 hOldKL,
1209 &uszSafeKLID,
1210 UlongToHandle(dwNewKL),
1211 Flags);
1212 if (hSafeFile)
1213 ZwClose(hSafeFile);
1214
1215 UserLeave();
1216 return hRetKL;
1217}
_In_ HANDLE hFile
Definition: mswsock.h:90
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
HKL APIENTRY co_IntLoadKeyboardLayoutEx(IN OUT PWINSTATION_OBJECT pWinSta, IN HANDLE hSafeFile, IN HKL hOldKL, IN PUNICODE_STRING puszSafeKLID, IN HKL hNewKL, IN UINT Flags)
Definition: kbdlayout.c:885
HANDLE FASTCALL IntVerifyKeyboardFileHandle(HANDLE hFile)
Definition: kbdlayout.c:963
#define KLF_SETFORPROCESS
Definition: winuser.h:117
#define KLF_REPLACELANG
Definition: winuser.h:115
#define KLF_ACTIVATE
Definition: winuser.h:111
#define KLF_REORDER
Definition: winuser.h:114
#define KLF_SUBSTITUTE_OK
Definition: winuser.h:112
#define KLF_NOTELLSHELL
Definition: winuser.h:116
#define KLF_UNLOADPREVIOUS
Definition: winuser.h:113

Referenced by IntLoadKeyboardLayout().

◆ NtUserLockWindowStation()

BOOL NTAPI NtUserLockWindowStation ( HWINSTA  hWindowStation)

Definition at line 1551 of file winsta.c.

1552{
1555
1556 TRACE("About to set process window station with handle (%p)\n",
1557 hWindowStation);
1558
1560 {
1561 ERR("Unauthorized process attempted to lock the window station!\n");
1563 return FALSE;
1564 }
1565
1566 Status = IntValidateWindowStationHandle(hWindowStation,
1567 UserMode,
1568 0,
1569 &Object,
1570 NULL);
1571 if (!NT_SUCCESS(Status))
1572 {
1573 TRACE("Validation of window station handle (%p) failed\n",
1574 hWindowStation);
1576 return FALSE;
1577 }
1578
1579 Object->Flags |= WSS_LOCKED;
1580
1582 return TRUE;
1583}
#define WSS_LOCKED
Definition: winsta.h:7

Referenced by LockWindowStation().

◆ NtUserLockWindowUpdate()

BOOL NTAPI NtUserLockWindowUpdate ( HWND  hWnd)

Definition at line 912 of file ntstubs.c.

913{
914 STUB;
915 return FALSE;
916}

Referenced by LockWindowUpdate().

◆ NtUserLockWorkStation()

BOOL NTAPI NtUserLockWorkStation ( VOID  )

Definition at line 1988 of file winsta.c.

1989{
1990 BOOL ret;
1992
1994
1995 if (pti->rpdesk == IntGetActiveDesktop())
1996 {
1998 }
1999 else
2000 {
2001 ret = FALSE;
2002 }
2003
2004 UserLeave();
2005
2006 return ret;
2007}
#define LN_LOCK_WORKSTATION
Definition: undocuser.h:119

Referenced by LockWorkStation().

◆ NtUserMapVirtualKeyEx()

UINT NTAPI NtUserMapVirtualKeyEx ( UINT  keyCode,
UINT  transType,
DWORD  keyboardId,
HKL  dwhkl 
)

Definition at line 1662 of file keyboard.c.

1663{
1664 PKBDTABLES pKbdTbl = NULL;
1665 UINT ret = 0;
1666
1667 TRACE("Enter NtUserMapVirtualKeyEx\n");
1669
1670 if (!dwhkl)
1671 {
1672 PTHREADINFO pti;
1673
1675 if (pti && pti->KeyboardLayout)
1676 pKbdTbl = pti->KeyboardLayout->spkf->pKbdTbl;
1677 }
1678 else
1679 {
1680 PKL pKl;
1681
1682 pKl = UserHklToKbl(dwhkl);
1683 if (pKl)
1684 pKbdTbl = pKl->spkf->pKbdTbl;
1685 }
1686
1687 if (pKbdTbl)
1688 ret = IntMapVirtualKeyEx(uCode, uType, pKbdTbl);
1689
1690 UserLeave();
1691 TRACE("Leave NtUserMapVirtualKeyEx, ret=%u\n", ret);
1692 return ret;
1693}
struct _KBDTABLES * pKbdTbl
Definition: input.h:21
PKL NTAPI UserHklToKbl(HKL hKl)
Definition: kbdlayout.c:539
static UINT IntMapVirtualKeyEx(UINT uCode, UINT Type, PKBDTABLES pKbdTbl)
Definition: keyboard.c:1616

Referenced by MapVirtualKeyExA(), MapVirtualKeyExW(), and MapVirtualKeyW().

◆ NtUserMenuItemFromPoint()

int NTAPI NtUserMenuItemFromPoint ( HWND  hWnd,
HMENU  hMenu,
DWORD  X,
DWORD  Y 
)

Definition at line 6305 of file menu.c.

6310{
6311 PMENU Menu;
6312 PWND Window = NULL;
6313 PITEM mi;
6314 ULONG i;
6315 int Ret = -1;
6316
6317 TRACE("Enter NtUserMenuItemFromPoint\n");
6319
6320 if (!(Menu = UserGetMenuObject(hMenu)))
6321 {
6322 goto Exit; // Return -1
6323 }
6324
6325 if (!(Window = UserGetWindowObject(Menu->hWnd)))
6326 {
6327 goto Exit; // Return -1
6328 }
6329
6330 X -= Window->rcWindow.left;
6331 Y -= Window->rcWindow.top;
6332
6333 mi = Menu->rgItems;
6334 for (i = 0; i < Menu->cItems; i++, mi++)
6335 {
6336 RECTL Rect;
6337
6338 Rect.left = mi->xItem;
6339 Rect.top = mi->yItem;
6340 Rect.right = mi->cxItem;
6341 Rect.bottom = mi->cyItem;
6342
6344
6345 if (RECTL_bPointInRect(&Rect, X, Y))
6346 {
6347 break;
6348 }
6349 }
6350
6351 Ret = (mi ? i : NO_SELECTED_ITEM);
6352
6353Exit:
6354 UserLeave();
6355 TRACE("Leave NtUserMenuItemFromPoint, ret=%i\n", Ret);
6356 return Ret;
6357}
#define Y(I)
#define NO_SELECTED_ITEM
Definition: ntuser.h:413
static MONITORINFO mi
Definition: win.c:9400
HWND hWnd
Definition: ntuser.h:437
VOID FASTCALL MENU_AdjustMenuItemRect(PMENU menu, PRECTL rect)
Definition: menu.c:1462

◆ NtUserMessageCall()

BOOL NTAPI NtUserMessageCall ( HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam,
ULONG_PTR  ResultInfo,
DWORD  dwType,
BOOL  Ansi 
)

Definition at line 2527 of file message.c.

2534{
2535 LRESULT lResult = 0;
2536 BOOL Ret = FALSE;
2537 PWND Window = NULL;
2539
2541
2542 switch(dwType)
2543 {
2544 case FNID_SCROLLBAR:
2545 {
2546 lResult = ScrollBarWndProc(hWnd, Msg, wParam, lParam);
2547 break;
2548 }
2549 case FNID_DESKTOP:
2550 {
2552 if (Window)
2553 {
2554 //ERR("FNID_DESKTOP IN\n");
2555 Ret = DesktopWindowProc(Window, Msg, wParam, lParam, &lResult);
2556 //ERR("FNID_DESKTOP OUT\n");
2557 }
2558 break;
2559 }
2560 case FNID_MENU:
2561 {
2563 if (Window)
2564 {
2565 Ret = PopupMenuWndProc( Window, Msg, wParam, lParam, &lResult);
2566 }
2567 break;
2568 }
2569 case FNID_MESSAGEWND:
2570 {
2572 if (Window)
2573 {
2574 Ret = !UserMessageWindowProc(Window, Msg, wParam, lParam, &lResult);
2575 }
2576 break;
2577 }
2578 case FNID_DEFWINDOWPROC:
2579 /* Validate input */
2580 if (hWnd)
2581 {
2583 if (!Window)
2584 {
2585 UserLeave();
2586 return FALSE;
2587 }
2588 UserRefObjectCo(Window, &Ref);
2589 }
2590 lResult = IntDefWindowProc(Window, Msg, wParam, lParam, Ansi);
2591 Ret = TRUE;
2592 if (hWnd)
2594 break;
2597 break;
2599 {
2600 BROADCASTPARM parm, *retparam;
2601 DWORD_PTR RetVal = 0;
2602
2603 if (ResultInfo)
2604 {
2605 _SEH2_TRY
2606 {
2607 ProbeForWrite((PVOID)ResultInfo, sizeof(BROADCASTPARM), 1);
2608 RtlCopyMemory(&parm, (PVOID)ResultInfo, sizeof(BROADCASTPARM));
2609 }
2611 {
2612 _SEH2_YIELD(break);
2613 }
2614 _SEH2_END;
2615 }
2616 else
2617 break;
2618
2619 if ( parm.recipients & BSM_ALLDESKTOPS ||
2621 {
2622 PLIST_ENTRY DesktopEntry;
2623 PDESKTOP rpdesk;
2624 HWND *List, hwndDenied = NULL;
2625 HDESK hDesk = NULL;
2626 PWND pwnd, pwndDesk;
2627 ULONG i;
2628 UINT fuFlags;
2629
2630 for (DesktopEntry = InputWindowStation->DesktopListHead.Flink;
2631 DesktopEntry != &InputWindowStation->DesktopListHead;
2632 DesktopEntry = DesktopEntry->Flink)
2633 {
2634 rpdesk = CONTAINING_RECORD(DesktopEntry, DESKTOP, ListEntry);
2635 pwndDesk = rpdesk->pDeskInfo->spwnd;
2636 List = IntWinListChildren(pwndDesk);
2637
2638 if (parm.flags & BSF_QUERY)
2639 {
2640 if (List != NULL)
2641 {
2642 if (parm.flags & BSF_FORCEIFHUNG || parm.flags & BSF_NOHANG)
2643 {
2644 fuFlags = SMTO_ABORTIFHUNG;
2645 }
2646 else if (parm.flags & BSF_NOTIMEOUTIFNOTHUNG)
2647 {
2648 fuFlags = SMTO_NOTIMEOUTIFNOTHUNG;
2649 }
2650 else
2651 {
2652 fuFlags = SMTO_NORMAL;
2653 }
2655 Msg,
2656 wParam,
2657 lParam,
2658 fuFlags,
2659 2000,
2660 &RetVal);
2661 Ret = TRUE;
2662 for (i = 0; List[i]; i++)
2663 {
2664 pwnd = UserGetWindowObject(List[i]);
2665 if (!pwnd) continue;
2666
2667 if ( pwnd->fnid == FNID_MENU ||
2669 continue;
2670
2671 if ( parm.flags & BSF_IGNORECURRENTTASK )
2672 {
2673 if ( pwnd->head.pti == gptiCurrent )
2674 continue;
2675 }
2677 Msg,
2678 wParam,
2679 lParam,
2680 fuFlags,
2681 2000,
2682 &RetVal);
2683
2684 if (!RetVal && EngGetLastError() == ERROR_TIMEOUT)
2685 {
2686 if (!(parm.flags & BSF_FORCEIFHUNG))
2687 Ret = FALSE;
2688 }
2689 if (RetVal == BROADCAST_QUERY_DENY)
2690 {
2691 hwndDenied = List[i];
2692 hDesk = UserHMGetHandle(pwndDesk);
2693 Ret = FALSE;
2694 }
2695 }
2697 _SEH2_TRY
2698 {
2699 retparam = (PBROADCASTPARM) ResultInfo;
2700 retparam->hDesk = hDesk;
2701 retparam->hWnd = hwndDenied;
2702 }
2704 {
2705 _SEH2_YIELD(break);
2706 }
2707 _SEH2_END;
2708 if (!Ret) break; // Have a hit! Let everyone know!
2709 }
2710 }
2711 else if (parm.flags & BSF_POSTMESSAGE)
2712 {
2713 if (List != NULL)
2714 {
2716
2717 for (i = 0; List[i]; i++)
2718 {
2719 pwnd = UserGetWindowObject(List[i]);
2720 if (!pwnd) continue;
2721
2722 if ( pwnd->fnid == FNID_MENU ||
2724 continue;
2725
2726 if ( parm.flags & BSF_IGNORECURRENTTASK )
2727 {
2728 if ( pwnd->head.pti == gptiCurrent )
2729 continue;
2730 }
2732 }
2734 }
2735 Ret = TRUE;
2736 }
2737 else
2738 {
2739 if (List != NULL)
2740 {
2742
2743 for (i = 0; List[i]; i++)
2744 {
2745 pwnd = UserGetWindowObject(List[i]);
2746 if (!pwnd) continue;
2747
2748 if ( pwnd->fnid == FNID_MENU ||
2750 continue;
2751
2752 if ( parm.flags & BSF_IGNORECURRENTTASK )
2753 {
2754 if ( pwnd->head.pti == gptiCurrent )
2755 continue;
2756 }
2758 }
2760 }
2761 if (lParam && !wParam && _wcsicmp((WCHAR*)lParam, L"Environment") == 0)
2762 {
2763 /* Handle Broadcast of WM_SETTINGCHAGE for Environment */
2765 0, (LPARAM)L"Environment", 0);
2766 }
2767 Ret = TRUE;
2768 }
2769 }
2770 }
2771 else if (parm.recipients & BSM_APPLICATIONS)
2772 {
2773 HWND *List, hwndDenied = NULL;
2774 HDESK hDesk = NULL;
2775 PWND pwnd, pwndDesk;
2776 ULONG i;
2777 UINT fuFlags;
2778
2779 pwndDesk = UserGetDesktopWindow();
2780 List = IntWinListChildren(pwndDesk);
2781
2782 if (parm.flags & BSF_QUERY)
2783 {
2784 if (List != NULL)
2785 {
2786 if (parm.flags & BSF_FORCEIFHUNG || parm.flags & BSF_NOHANG)
2787 {
2788 fuFlags = SMTO_ABORTIFHUNG;
2789 }
2790 else if (parm.flags & BSF_NOTIMEOUTIFNOTHUNG)
2791 {
2792 fuFlags = SMTO_NOTIMEOUTIFNOTHUNG;
2793 }
2794 else
2795 {
2796 fuFlags = SMTO_NORMAL;
2797 }
2799 Msg,
2800 wParam,
2801 lParam,
2802 fuFlags,
2803 2000,
2804 &RetVal);
2805 Ret = TRUE;
2806 for (i = 0; List[i]; i++)
2807 {
2808 pwnd = UserGetWindowObject(List[i]);
2809 if (!pwnd) continue;
2810
2811 if ( pwnd->fnid == FNID_MENU ||
2813 continue;
2814
2815 if ( parm.flags & BSF_IGNORECURRENTTASK )
2816 {
2817 if ( pwnd->head.pti == gptiCurrent )
2818 continue;
2819 }
2821 Msg,
2822 wParam,
2823 lParam,
2824 fuFlags,
2825 2000,
2826 &RetVal);
2827
2828 if (!RetVal && EngGetLastError() == ERROR_TIMEOUT)
2829 {
2830 if (!(parm.flags & BSF_FORCEIFHUNG))
2831 Ret = FALSE;
2832 }
2833 if (RetVal == BROADCAST_QUERY_DENY)
2834 {
2835 hwndDenied = List[i];
2836 hDesk = UserHMGetHandle(pwndDesk);
2837 Ret = FALSE;
2838 }
2839 }
2841 _SEH2_TRY
2842 {
2843 retparam = (PBROADCASTPARM) ResultInfo;
2844 retparam->hDesk = hDesk;
2845 retparam->hWnd = hwndDenied;
2846 }
2848 {
2849 _SEH2_YIELD(break);
2850 }
2851 _SEH2_END;
2852 }
2853 }
2854 else if (parm.flags & BSF_POSTMESSAGE)
2855 {
2856 if (List != NULL)
2857 {
2859
2860 for (i = 0; List[i]; i++)
2861 {
2862 pwnd = UserGetWindowObject(List[i]);
2863 if (!pwnd) continue;
2864
2865 if ( pwnd->fnid == FNID_MENU ||
2867 continue;
2868
2869 if ( parm.flags & BSF_IGNORECURRENTTASK )
2870 {
2871 if ( pwnd->head.pti == gptiCurrent )
2872 continue;
2873 }
2875 }
2877 }
2878 Ret = TRUE;
2879 }
2880 else
2881 {
2882 if (List != NULL)
2883 {
2885
2886 for (i = 0; List[i]; i++)
2887 {
2888 pwnd = UserGetWindowObject(List[i]);
2889 if (!pwnd) continue;
2890
2891 if ( pwnd->fnid == FNID_MENU ||
2893 continue;
2894
2895 if ( parm.flags & BSF_IGNORECURRENTTASK )
2896 {
2897 if ( pwnd->head.pti == gptiCurrent )
2898 continue;
2899 }
2901 }
2903 }
2904 Ret = TRUE;
2905 }
2906 }
2907 }
2908 break;
2910 {
2911 CALL_BACK_INFO CallBackInfo;
2912 ULONG_PTR uResult;
2913
2914 _SEH2_TRY
2915 {
2916 ProbeForRead((PVOID)ResultInfo, sizeof(CALL_BACK_INFO), 1);
2917 RtlCopyMemory(&CallBackInfo, (PVOID)ResultInfo, sizeof(CALL_BACK_INFO));
2918 }
2920 {
2921 _SEH2_YIELD(break);
2922 }
2923 _SEH2_END;
2924
2926 {
2928 break;
2929 }
2930
2932 CallBackInfo.CallBack, CallBackInfo.Context, &uResult)))
2933 {
2934 ERR("Callback failure!\n");
2935 }
2936 }
2937 break;
2938 case FNID_SENDMESSAGE:
2939 {
2940 lResult = co_IntDoSendMessage(hWnd, Msg, wParam, lParam, 0);
2941 Ret = TRUE;
2942
2943 if (ResultInfo)
2944 {
2945 _SEH2_TRY
2946 {
2947 ProbeForWrite((PVOID)ResultInfo, sizeof(ULONG_PTR), 1);
2948 RtlCopyMemory((PVOID)ResultInfo, &lResult, sizeof(ULONG_PTR));
2949 }
2951 {
2952 Ret = FALSE;
2953 _SEH2_YIELD(break);
2954 }
2955 _SEH2_END;
2956 }
2957 break;
2958 }
2959 case FNID_SENDMESSAGEFF:
2961 {
2962 DOSENDMESSAGE dsm, *pdsm = (PDOSENDMESSAGE)ResultInfo;
2963 if (ResultInfo)
2964 {
2965 _SEH2_TRY
2966 {
2967 ProbeForRead(pdsm, sizeof(DOSENDMESSAGE), 1);
2968 RtlCopyMemory(&dsm, pdsm, sizeof(DOSENDMESSAGE));
2969 }
2971 {
2972 _SEH2_YIELD(break);
2973 }
2974 _SEH2_END;
2975 }
2976
2977 Ret = co_IntDoSendMessage( hWnd, Msg, wParam, lParam, pdsm ? &dsm : NULL );
2978
2979 if (pdsm)
2980 {
2981 _SEH2_TRY
2982 {
2983 ProbeForWrite(pdsm, sizeof(DOSENDMESSAGE), 1);
2984 RtlCopyMemory(pdsm, &dsm, sizeof(DOSENDMESSAGE));
2985 }
2987 {
2988 Ret = FALSE;
2989 _SEH2_YIELD(break);
2990 }
2991 _SEH2_END;
2992 }
2993 break;
2994 }
2995 // CallNextHook bypass.
2996 case FNID_CALLWNDPROC:
2998 {
2999 PTHREADINFO pti;
3001 PHOOK NextObj, Hook;
3002
3003 pti = GetW32ThreadInfo();
3004
3005 Hook = pti->sphkCurrent;
3006
3007 if (!Hook) break;
3008
3009 NextObj = Hook->phkNext;
3010 ClientInfo = pti->pClientInfo;
3011 _SEH2_TRY
3012 {
3013 ClientInfo->phkCurrent = NextObj;
3014 }
3016 {
3017 ClientInfo = NULL;
3018 }
3019 _SEH2_END;
3020
3021 if (!ClientInfo || !NextObj) break;
3022
3023 NextObj->phkNext = IntGetNextHook(NextObj);
3024
3025 if ( Hook->HookId == WH_CALLWNDPROC)
3026 {
3027 CWPSTRUCT CWP;
3028 CWP.hwnd = hWnd;
3029 CWP.message = Msg;
3030 CWP.wParam = wParam;
3031 CWP.lParam = lParam;
3032 TRACE("WH_CALLWNDPROC: Hook %p NextHook %p\n", Hook, NextObj);
3033
3034 lResult = co_IntCallHookProc( Hook->HookId,
3035 HC_ACTION,
3036 ((ClientInfo->CI_flags & CI_CURTHPRHOOK) ? 1 : 0),
3037 (LPARAM)&CWP,
3038 Hook->Proc,
3039 Hook->ihmod,
3040 Hook->offPfn,
3041 Hook->Ansi,
3042 &Hook->ModuleName);
3043 }
3044 else
3045 {
3046 CWPRETSTRUCT CWPR;
3047 CWPR.hwnd = hWnd;
3048 CWPR.message = Msg;
3049 CWPR.wParam = wParam;
3050 CWPR.lParam = lParam;
3051 CWPR.lResult = ClientInfo->dwHookData;
3052
3053 lResult = co_IntCallHookProc( Hook->HookId,
3054 HC_ACTION,
3055 ((ClientInfo->CI_flags & CI_CURTHPRHOOK) ? 1 : 0),
3056 (LPARAM)&CWPR,
3057 Hook->Proc,
3058 Hook->ihmod,
3059 Hook->offPfn,
3060 Hook->Ansi,
3061 &Hook->ModuleName);
3062 }
3063 }
3064 break;
3065 }
3066
3067 switch(dwType)
3068 {
3069 case FNID_DEFWINDOWPROC:
3070 case FNID_CALLWNDPROC:
3072 case FNID_SCROLLBAR:
3073 case FNID_DESKTOP:
3074 case FNID_MENU:
3075 if (ResultInfo)
3076 {
3077 _SEH2_TRY
3078 {
3079 ProbeForWrite((PVOID)ResultInfo, sizeof(LRESULT), 1);
3080 RtlCopyMemory((PVOID)ResultInfo, &lResult, sizeof(LRESULT));
3081 }
3083 {
3084 Ret = FALSE;
3085 }
3086 _SEH2_END;
3087 }
3088 break;
3089 default:
3090 break;
3091 }
3092
3093 UserLeave();
3094
3095 return Ret;
3096}
#define BSF_POSTMESSAGE
Definition: dbt.h:58
#define BSF_NOTIMEOUTIFNOTHUNG
Definition: dbt.h:57
#define BSF_NOHANG
Definition: dbt.h:56
#define BSF_IGNORECURRENTTASK
Definition: dbt.h:55
#define BSF_QUERY
Definition: dbt.h:59
#define BSM_APPLICATIONS
Definition: dbt.h:48
#define BSF_FORCEIFHUNG
Definition: dbt.h:54
#define BSM_ALLDESKTOPS
Definition: dbt.h:49
#define BSM_ALLCOMPONENTS
Definition: dbt.h:47
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:159
#define FNID_SENDMESSAGEFF
Definition: ntuser.h:883
#define FNID_SCROLLBAR
Definition: ntuser.h:859
#define FNID_DEFWINDOWPROC
Definition: ntuser.h:863
#define FNID_DESKTOP
Definition: ntuser.h:862
#define FNID_SENDMESSAGECALLBACK
Definition: ntuser.h:890
#define FNID_SENDMESSAGEWTOOPTION
Definition: ntuser.h:885
#define FNID_CALLWNDPROCRET
Definition: ntuser.h:877
#define FNID_CALLWNDPROC
Definition: ntuser.h:876
#define ICLS_SWITCH
Definition: ntuser.h:932
#define CI_CURTHPRHOOK
Definition: ntuser.h:304
struct tagDOSENDMESSAGE * PDOSENDMESSAGE
#define FNID_SENDMESSAGE
Definition: ntuser.h:882
struct _BROADCASTPARM * PBROADCASTPARM
#define FNID_BROADCASTSYSTEMMESSAGE
Definition: ntuser.h:887
#define FNID_MESSAGEWND
Definition: ntuser.h:864
#define FNID_SENDNOTIFYMESSAGE
Definition: ntuser.h:889
LRESULT FASTCALL IntDefWindowProc(PWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL Ansi)
Definition: defwnd.c:633
PWINSTATION_OBJECT InputWindowStation
Definition: winsta.c:21
DWORD recipients
Definition: ntuser.h:1109
DWORD flags
Definition: ntuser.h:1108
HDESK hDesk
Definition: ntuser.h:1110
SENDASYNCPROC CallBack
Definition: callback.h:45
ULONG_PTR Context
Definition: callback.h:46
struct _WND * spwnd
Definition: ntuser.h:137
LIST_ENTRY DesktopListHead
Definition: winsta.h:19
WPARAM wParam
Definition: winuser.h:3127
LRESULT lResult
Definition: winuser.h:3125
LPARAM lParam
Definition: winuser.h:3126
LPARAM lParam
Definition: winuser.h:3133
WPARAM wParam
Definition: winuser.h:3134
UINT message
Definition: winuser.h:3135
INT_PTR ihmod
Definition: ntuser.h:245
HOOKPROC Proc
Definition: ntuser.h:250
ULONG_PTR offPfn
Definition: ntuser.h:243
int HookId
Definition: ntuser.h:242
UNICODE_STRING ModuleName
Definition: ntuser.h:252
LRESULT APIENTRY co_IntCallHookProc(INT HookId, INT Code, WPARAM wParam, LPARAM lParam, HOOKPROC Proc, INT Mod, ULONG_PTR offPfn, BOOLEAN Ansi, PUNICODE_STRING ModuleName)
Definition: callback.c:508
BOOL FASTCALL DesktopWindowProc(PWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *lResult)
Definition: desktop.c:1451
BOOL FASTCALL UserMessageWindowProc(PWND pwnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *lResult)
Definition: desktop.c:1537
BOOL WINAPI PopupMenuWndProc(PWND Wnd, UINT Message, WPARAM wParam, LPARAM lParam, LRESULT *lResult)
Definition: menu.c:4657
static int is_pointer_message(UINT message, WPARAM wparam)
Definition: message.c:120
static LRESULT FASTCALL co_IntDoSendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, PDOSENDMESSAGE dsm)
Definition: message.c:2004
LRESULT FASTCALL co_IntSendMessageWithCallBack(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, SENDASYNCPROC CompletionCallback, ULONG_PTR CompletionCallbackContext, ULONG_PTR *uResult)
Definition: message.c:1785
BOOL FASTCALL UserSendNotifyMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2090
LRESULT FASTCALL co_IntSendMessageTimeout(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, UINT uFlags, UINT uTimeout, ULONG_PTR *uResult)
Definition: message.c:1707
LRESULT APIENTRY ScrollBarWndProc(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: scrollbar.c:1134
ENGAPI ULONG APIENTRY EngGetLastError(VOID)
Definition: error.c:9
#define ERROR_MESSAGE_SYNC_ONLY
Definition: winerror.h:1005
#define ERROR_TIMEOUT
Definition: winerror.h:1286
#define HWND_BROADCAST
Definition: winuser.h:1215
#define HC_ACTION
Definition: winuser.h:48
#define WM_SETTINGCHANGE
Definition: winuser.h:1657
#define SMTO_ABORTIFHUNG
Definition: winuser.h:1234
#define BROADCAST_QUERY_DENY
Definition: winuser.h:178
#define SMTO_NORMAL
Definition: winuser.h:1236
#define WH_CALLWNDPROC
Definition: winuser.h:34

Referenced by CallNextHookEx(), DefWndHandleSysCommand(), DesktopWndProcW(), IntBroadcastSystemMessage(), IntScrollCreateScrollBar(), MenuWindowProcA(), MenuWindowProcW(), PopupMenuWndProcW(), SendMessageA(), SendMessageCallbackA(), SendMessageCallbackW(), SendMessageTimeoutA(), SendMessageTimeoutW(), SendMessageW(), SendNotifyMessageW(), and User32DefWindowProc().

◆ NtUserMinMaximize()

DWORD NTAPI NtUserMinMaximize ( HWND  hWnd,
UINT  cmd,
BOOL  Hide 
)

Definition at line 3487 of file winpos.c.

3491{
3492 PWND pWnd;
3493
3494 TRACE("Enter NtUserMinMaximize\n");
3496
3497 pWnd = UserGetWindowObject(hWnd);
3498 if (!pWnd || UserIsDesktopWindow(pWnd) || UserIsMessageWindow(pWnd))
3499 {
3500 goto Exit;
3501 }
3502
3503 if ( cmd > SW_MAX || pWnd->state2 & WNDS2_INDESTROY)
3504 {
3506 goto Exit;
3507 }
3508
3509 cmd |= Hide ? SW_HIDE : 0;
3510
3511 co_WinPosShowWindow(pWnd, cmd);
3512
3513Exit:
3514 TRACE("Leave NtUserMinMaximize\n");
3515 UserLeave();
3516 return 0; // Always NULL?
3517}
#define WNDS2_INDESTROY
Definition: ntuser.h:648
BOOLEAN FASTCALL co_WinPosShowWindow(PWND Wnd, INT Cmd)
Definition: winpos.c:2622
DWORD state2
Definition: ntuser.h:702
Definition: ftp_var.h:139
#define SW_HIDE
Definition: winuser.h:779
#define SW_MAX
Definition: winuser.h:793

◆ NtUserMNDragLeave()

DWORD NTAPI NtUserMNDragLeave ( VOID  )

Definition at line 169 of file ntstubs.c.

170{
171 STUB
172
173 return 0;
174}

◆ NtUserMNDragOver()

DWORD NTAPI NtUserMNDragOver ( DWORD  Unknown0,
DWORD  Unknown1 
)

Definition at line 178 of file ntstubs.c.

181{
182 STUB
183
184 return 0;
185}

◆ NtUserModifyUserStartupInfoFlags()

DWORD NTAPI NtUserModifyUserStartupInfoFlags ( DWORD  Unknown0,
DWORD  Unknown1 
)

Definition at line 189 of file ntstubs.c.

192{
193 STUB
194
195 return 0;
196}

◆ NtUserMonitorFromPoint()

HMONITOR NTAPI NtUserMonitorFromPoint ( _In_ POINT  point,
_In_ DWORD  dwFlags 
)

Definition at line 836 of file monitor.c.

839{
840 RECTL rc;
841 HMONITOR hMonitor = NULL;
842
843 /* Check if flags are valid */
844 if (dwFlags != MONITOR_DEFAULTTONULL &&
845 dwFlags != MONITOR_DEFAULTTOPRIMARY &&
846 dwFlags != MONITOR_DEFAULTTONEAREST)
847 {
849 return NULL;
850 }
851
852 /* Fill rect (bottom-right exclusive) */
853 rc.left = pt.x;
854 rc.right = pt.x + 1;
855 rc.top = pt.y;
856 rc.bottom = pt.y + 1;
857
859
860 /* Find intersecting monitor */
861 IntGetMonitorsFromRect(&rc, &hMonitor, NULL, 1, dwFlags);
862
863 UserLeave();
864 return hMonitor;
865}
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
static UINT IntGetMonitorsFromRect(OPTIONAL IN LPCRECTL pRect, OPTIONAL OUT HMONITOR *phMonitorList, OPTIONAL OUT PRECTL prcMonitorList, OPTIONAL IN DWORD dwListSize, OPTIONAL IN DWORD dwFlags)
Definition: monitor.c:310

Referenced by MonitorFromPoint().

◆ NtUserMonitorFromRect()

HMONITOR NTAPI NtUserMonitorFromRect ( _In_ LPCRECT  pRect,
_In_ DWORD  dwFlags 
)

Referenced by MonitorFromRect().

◆ NtUserMonitorFromWindow()

HMONITOR NTAPI NtUserMonitorFromWindow ( _In_ HWND  hWnd,
_In_ DWORD  dwFlags 
)

Definition at line 927 of file monitor.c.

930{
931 PWND pWnd;
932 HMONITOR hMonitor = NULL;
933 RECTL Rect = {0, 0, 0, 0};
934
935 TRACE("Enter NtUserMonitorFromWindow\n");
936
937 /* Check if flags are valid */
938 if (dwFlags != MONITOR_DEFAULTTONULL &&
939 dwFlags != MONITOR_DEFAULTTOPRIMARY &&
940 dwFlags != MONITOR_DEFAULTTONEAREST)
941 {
943 return NULL;
944 }
945
947
948 if (hWnd)
949 {
950 /* Get window object */
952 if (pWnd)
953 {
954 Rect = ((pWnd->style & WS_MINIMIZE) ? pWnd->InternalPos.NormalRect : pWnd->rcWindow);
956 {
957 Rect.right = Rect.left + 1;
958 Rect.bottom = Rect.top + 1;
959 }
960 }
961 }
962
963 hMonitor = IntGetMonitorFromRect(&Rect, dwFlags);
964
965 UserLeave();
966
967 TRACE("Leave NtUserMonitorFromWindow, ret=%p\n", hMonitor);
968 return hMonitor;
969}
struct _WND::@5529 InternalPos
RECT rcWindow
Definition: ntuser.h:716
HMONITOR FASTCALL IntGetMonitorFromRect(_In_ LPCRECTL pRect, _In_ DWORD dwFlags)
Definition: monitor.c:405

Referenced by MonitorFromWindow().

◆ NtUserMoveWindow()

BOOL NTAPI NtUserMoveWindow ( HWND  hWnd,
int  X,
int  Y,
int  nWidth,
int  nHeight,
BOOL  bRepaint 
)

Definition at line 3523 of file winpos.c.

3530{
3531 return NtUserSetWindowPos(hWnd, 0, X, Y, nWidth, nHeight,
3532 (bRepaint ? SWP_NOZORDER | SWP_NOACTIVATE :
3534}
BOOL APIENTRY NtUserSetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags)
Definition: winpos.c:3560

Referenced by MoveWindow().

◆ NtUserNotifyIMEStatus()

DWORD NTAPI NtUserNotifyIMEStatus ( _In_ HWND  hwnd,
_In_ BOOL  fOpen,
_In_ DWORD  dwConversion 
)

Definition at line 850 of file ime.c.

854{
855 PWND pwnd;
856 PTHREADINFO pti;
857 HKL hKL;
858
860
861 if (!IS_IMM_MODE())
862 {
863 ERR("!IS_IMM_MODE()\n");
864 goto Quit;
865 }
866
867 pwnd = ValidateHwndNoErr(hwnd);
868 if (!pwnd)
869 {
870 ERR("Invalid HWND %p\n", hwnd);
871 goto Quit;
872 }
873
874 pti = pwnd->head.pti;
875 if (!pti || !gptiForeground)
876 goto Quit;
878 goto Quit;
879 if (ghIMC == pwnd->hImc && gfImeOpen == !!fOpen && gdwImeConversion == dwConversion)
880 goto Quit;
881
882 ghIMC = pwnd->hImc;
883 if (ghIMC)
884 {
885 gfImeOpen = !!fOpen;
886 gdwImeConversion = dwConversion;
887 UserSetImeConversionKeyState(pti, (fOpen ? dwConversion : IME_CMODE_ALPHANUMERIC));
888 }
889
890 if (ISITHOOKED(WH_SHELL))
891 {
892 hKL = (pti->KeyboardLayout ? pti->KeyboardLayout->hkl : NULL);
893 co_HOOK_CallHooks(WH_SHELL, HSHELL_LANGUAGE, (WPARAM)hwnd, (LPARAM)hKL);
894 }
895
896 // TODO:
897
898Quit:
899 UserLeave();
900 return 0;
901}
PTHREADINFO gptiForeground
Definition: focus.c:15
#define ISITHOOKED(HookId)
Definition: hook.h:6
#define IME_CMODE_ALPHANUMERIC
Definition: imm.h:336
HIMC ghIMC
Definition: ime.c:21
DWORD gdwImeConversion
Definition: ime.c:23
static VOID FASTCALL UserSetImeConversionKeyState(PTHREADINFO pti, DWORD dwConversion)
Definition: ime.c:791
BOOL gfImeOpen
Definition: ime.c:22
HIMC hImc
Definition: ntuser.h:740
#define WH_SHELL
Definition: winuser.h:40

Referenced by ImeWnd_OnImeNotify(), Imm32SendNotificationProc(), ImmSetActiveContext(), ImmSetConversionStatus(), and ImmSetOpenStatus().

◆ NtUserNotifyProcessCreate()

BOOL NTAPI NtUserNotifyProcessCreate ( HANDLE  NewProcessId,
HANDLE  ParentThreadId,
ULONG  dwUnknown,
ULONG  CreateFlags 
)

Definition at line 463 of file ntstubs.c.

468{
469 // STUB;
470 TRACE("NtUserNotifyProcessCreate is UNIMPLEMENTED\n");
471 return FALSE;
472}

Referenced by CSR_SERVER_DLL_INIT().

◆ NtUserNotifyWinEvent()

VOID NTAPI NtUserNotifyWinEvent ( DWORD  Event,
HWND  hWnd,
LONG  idObject,
LONG  idChild 
)

Definition at line 254 of file event.c.

259{
260 PWND Window = NULL;
263
264 /* Validate input */
265 if (hWnd && (hWnd != INVALID_HANDLE_VALUE))
266 {
268 if (!Window)
269 {
270 UserLeave();
271 return;
272 }
273 }
274
276 {
277 if (Window) UserRefObjectCo(Window, &Ref);
278 IntNotifyWinEvent( Event, Window, idObject, idChild, WEF_SETBYWNDPTI);
280 }
281 UserLeave();
282}
#define WEF_SETBYWNDPTI
Definition: ntuser.h:236
DWORD dwInstalledEventHooks
Definition: ntuser.h:1071
static DWORD FASTCALL GetMaskFromEvent(DWORD Event)
Definition: event.c:26

Referenced by NotifyWinEvent().

◆ NtUserOpenClipboard()

BOOL NTAPI NtUserOpenClipboard ( HWND  hWnd,
DWORD  Unknown1 
)

Definition at line 533 of file clipboard.c.

534{
535 BOOL bRet;
536
538 bRet = UserOpenClipboard(hWnd);
539 UserLeave();
540
541 return bRet;
542}
BOOL NTAPI UserOpenClipboard(HWND hWnd)
Definition: clipboard.c:488

Referenced by OpenClipboard().

◆ NtUserOpenDesktop()

HDESK NTAPI NtUserOpenDesktop ( POBJECT_ATTRIBUTES  ObjectAttributes,
DWORD  dwFlags,
ACCESS_MASK  dwDesiredAccess 
)

Definition at line 2621 of file desktop.c.

2625{
2627 HDESK Desktop;
2628
2632 UserMode,
2633 NULL,
2634 dwDesiredAccess,
2635 NULL,
2636 (HANDLE*)&Desktop);
2637
2638 if (!NT_SUCCESS(Status))
2639 {
2640 ERR("Failed to open desktop\n");
2642 return NULL;
2643 }
2644
2645 TRACE("Opened desktop %S with handle 0x%p\n", ObjectAttributes->ObjectName->Buffer, Desktop);
2646
2647 return Desktop;
2648}
NTSTATUS NTAPI ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, IN PACCESS_STATE PassedAccessState, IN ACCESS_MASK DesiredAccess, IN OUT PVOID ParseContext, OUT PHANDLE Handle)
Definition: obhandle.c:2532

Referenced by OpenDesktopW().

◆ NtUserOpenInputDesktop()

HDESK NTAPI NtUserOpenInputDesktop ( DWORD  dwFlags,
BOOL  fInherit,
ACCESS_MASK  dwDesiredAccess 
)

Definition at line 2715 of file desktop.c.

2719{
2720 HDESK hdesk;
2721
2723 TRACE("Enter NtUserOpenInputDesktop gpdeskInputDesktop 0x%p\n", gpdeskInputDesktop);
2724
2725 hdesk = UserOpenInputDesktop(dwFlags, fInherit, dwDesiredAccess);
2726
2727 TRACE("NtUserOpenInputDesktop returning 0x%p\n", hdesk);
2728 UserLeave();
2729 return hdesk;
2730}
HDESK UserOpenInputDesktop(DWORD dwFlags, BOOL fInherit, ACCESS_MASK dwDesiredAccess)
Definition: desktop.c:2650
PDESKTOP gpdeskInputDesktop
Definition: desktop.c:52

Referenced by OpenInputDesktop().

◆ NtUserOpenWindowStation()

HWINSTA NTAPI NtUserOpenWindowStation ( POBJECT_ATTRIBUTES  ObjectAttributes,
ACCESS_MASK  dwDesiredAccess 
)

◆ NtUserPaintDesktop()

BOOL NTAPI NtUserPaintDesktop ( HDC  hDC)

Definition at line 2812 of file desktop.c.

2813{
2814 BOOL Ret;
2815
2817 TRACE("Enter NtUserPaintDesktop\n");
2818
2819 Ret = IntPaintDesktop(hDC);
2820
2821 TRACE("Leave NtUserPaintDesktop, ret=%i\n", Ret);
2822 UserLeave();
2823 return Ret;
2824}
BOOL FASTCALL IntPaintDesktop(HDC hDC)
Definition: desktop.c:1849

Referenced by PaintDesktop().

◆ NtUserPaintMenuBar()

DWORD NTAPI NtUserPaintMenuBar ( HWND  hWnd,
HDC  hDC,
ULONG  left,
ULONG  right,
ULONG  top,
BOOL  bActive 
)

Definition at line 6362 of file menu.c.

6369{
6370 PWND Window;
6371 RECT Rect;
6372 DWORD ret;
6373
6375
6377 {
6378 UserLeave();
6380 return 0;
6381 }
6382
6383 Rect.left = leftBorder;
6384 Rect.right = Window->rcWindow.right - Window->rcWindow.left - rightBorder;
6385 Rect.top = top;
6386 Rect.bottom = 0;
6387
6389
6390 UserLeave();
6391 return ret;
6392}

◆ NtUserPeekMessage()

BOOL APIENTRY NtUserPeekMessage ( PMSG  pMsg,
HWND  hWnd,
UINT  MsgFilterMin,
UINT  MsgFilterMax,
UINT  RemoveMsg 
)

Definition at line 2387 of file message.c.

2392{
2393 MSG Msg;
2394 BOOL Ret;
2395
2396 if ( RemoveMsg & PM_BADMSGFLAGS )
2397 {
2399 return FALSE;
2400 }
2401
2403
2404 RtlZeroMemory(&Msg, sizeof(MSG));
2405
2406 Ret = co_IntGetPeekMessage(&Msg, hWnd, MsgFilterMin, MsgFilterMax, RemoveMsg, FALSE);
2407
2408 UserLeave();
2409
2410 if (Ret)
2411 {
2412 _SEH2_TRY
2413 {
2414 ProbeForWrite(pMsg, sizeof(MSG), 1);
2415 RtlCopyMemory(pMsg, &Msg, sizeof(MSG));
2416 }
2418 {
2420 Ret = FALSE;
2421 }
2422 _SEH2_END;
2423 }
2424
2425 return Ret;
2426}
#define PM_BADMSGFLAGS
Definition: message.c:14

Referenced by PeekMessageWorker().

◆ NtUserPostMessage()

BOOL NTAPI NtUserPostMessage ( HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 2275 of file message.c.

2279{
2280 BOOL ret;
2281
2283
2285
2286 UserLeave();
2287
2288 return ret;
2289}

Referenced by PostMessageA(), and PostMessageW().

◆ NtUserPostThreadMessage()

BOOL NTAPI NtUserPostThreadMessage ( DWORD  idThread,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 2292 of file message.c.

2296{
2297 BOOL ret = FALSE;
2298 PETHREAD peThread;
2299 PTHREADINFO pThread;
2301
2303
2304 Status = PsLookupThreadByThreadId(UlongToHandle(idThread), &peThread);
2305
2306 if ( Status == STATUS_SUCCESS )
2307 {
2308 pThread = (PTHREADINFO)peThread->Tcb.Win32Thread;
2309 if( !pThread ||
2310 !pThread->MessageQueue ||
2311 (pThread->TIF_flags & TIF_INCLEANUP))
2312 {
2313 ObDereferenceObject( peThread );
2314 goto exit;
2315 }
2316 ret = UserPostThreadMessage( pThread, Msg, wParam, lParam);
2317 ObDereferenceObject( peThread );
2318 }
2319 else
2320 {
2322 }
2323exit:
2324 UserLeave();
2325 return ret;
2326}
#define TIF_INCLEANUP
Definition: ntuser.h:263
#define exit(n)
Definition: config.h:202
BOOL FASTCALL UserPostThreadMessage(PTHREADINFO pti, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1358

Referenced by PostThreadMessageA(), and PostThreadMessageW().

◆ NtUserPrintWindow()

BOOL NTAPI NtUserPrintWindow ( HWND  hwnd,
HDC  hdcBlt,
UINT  nFlags 
)

Definition at line 2570 of file painting.c.

2574{
2575 PWND Window;
2576 BOOL Ret = FALSE;
2577
2579
2580 if (hwnd)
2581 {
2582 if (!(Window = UserGetWindowObject(hwnd)) ||
2584 {
2585 goto Exit;
2586 }
2587
2588 if ( Window )
2589 {
2590 /* Validate flags and check it as a mask for 0 or 1. */
2591 if ( (nFlags & PW_CLIENTONLY) == nFlags)
2592 Ret = IntPrintWindow( Window, hdcBlt, nFlags);
2593 else
2595 }
2596 }
2597Exit:
2598 UserLeave();
2599 return Ret;
2600}
BOOL FASTCALL IntPrintWindow(PWND pwnd, HDC hdcBlt, UINT nFlags)
Definition: painting.c:1259

◆ NtUserProcessConnect()

NTSTATUS NTAPI NtUserProcessConnect ( IN HANDLE  ProcessHandle,
OUT PUSERCONNECT  pUserConnect,
IN ULONG  Size 
)

Definition at line 476 of file ntstubs.c.

480{
483 PPROCESSINFO W32Process;
484
485 TRACE("NtUserProcessConnect\n");
486
487 if (pUserConnect == NULL ||
488 Size != sizeof(*pUserConnect))
489 {
490 return STATUS_UNSUCCESSFUL;
491 }
492
493 /* Get the process object the user handle was referencing */
497 UserMode,
498 (PVOID*)&Process,
499 NULL);
500 if (!NT_SUCCESS(Status)) return Status;
501
503
504 /* Get Win32 process information */
505 W32Process = PsGetProcessWin32Process(Process);
506
508 {
509 UINT i;
510
511 // FIXME: Check that pUserConnect->ulVersion == USER_VERSION;
512 // FIXME: Check the value of pUserConnect->dwDispatchCount.
513
514 ProbeForWrite(pUserConnect, sizeof(*pUserConnect), sizeof(PVOID));
515
516 // FIXME: Instead of assuming that the mapping of the heap desktop
517 // also holds there, we **MUST** create and map instead the shared
518 // section! Its client base must be stored in W32Process->pClientBase.
519 // What is currently done (ReactOS-specific only), is that within the
520 // IntUserHeapCommitRoutine()/MapGlobalUserHeap() routines we assume
521 // it's going to be also called early, so that we manually add a very
522 // first memory mapping that corresponds to the "global user heap",
523 // and that we use instead of a actual win32 "shared USER section"
524 // (see slide 29 of https://paper.bobylive.com/Meeting_Papers/BlackHat/USA-2011/BH_US_11_Mandt_win32k_Slides.pdf )
525
526 pUserConnect->siClient.ulSharedDelta =
529
530#define SERVER_TO_CLIENT(ptr) \
531 ((PVOID)((ULONG_PTR)ptr - pUserConnect->siClient.ulSharedDelta))
532
533 ASSERT(gpsi);
535
536 pUserConnect->siClient.psi = SERVER_TO_CLIENT(gpsi);
537 pUserConnect->siClient.aheList = SERVER_TO_CLIENT(gHandleTable);
538 pUserConnect->siClient.pDispInfo = NULL;
539
540 // NOTE: kernel server should also have a SHAREDINFO gSharedInfo;
541 // FIXME: These USER window-proc data should be used somehow!
542
543 pUserConnect->siClient.DefWindowMsgs.maxMsgs = 0;
544 pUserConnect->siClient.DefWindowMsgs.abMsgs = NULL;
545 pUserConnect->siClient.DefWindowSpecMsgs.maxMsgs = 0;
546 pUserConnect->siClient.DefWindowSpecMsgs.abMsgs = NULL;
547
548 for (i = 0; i < ARRAYSIZE(pUserConnect->siClient.awmControl); ++i)
549 {
550 pUserConnect->siClient.awmControl[i].maxMsgs = 0;
551 pUserConnect->siClient.awmControl[i].abMsgs = NULL;
552 }
553#undef SERVER_TO_CLIENT
554 }
556 {
558 }
559 _SEH2_END;
560
561 if (!NT_SUCCESS(Status))
563
564 UserLeave();
565
566 /* Dereference the process object */
568
569 return Status;
570}
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define PROCESS_VM_OPERATION
Definition: pstypes.h:156
_In_ HANDLE ProcessHandle
Definition: mmfuncs.h:403
PVOID NTAPI PsGetProcessWin32Process(PEPROCESS Process)
Definition: process.c:1193
#define SERVER_TO_CLIENT(ptr)
W32HEAP_USER_MAPPING HeapMappings
Definition: win32.h:291
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539

Referenced by ClientThreadSetupHelper(), Init(), START_TEST(), and UserClientConnect().

◆ NtUserQueryInformationThread()

NTSTATUS NTAPI NtUserQueryInformationThread ( IN HANDLE  ThreadHandle,
IN USERTHREADINFOCLASS  ThreadInformationClass,
OUT PVOID  ThreadInformation,
IN ULONG  ThreadInformationLength 
)

Definition at line 574 of file ntstubs.c.

578{
581
582 /* Allow only CSRSS to perform this operation */
585
587
588 /* Get the Thread */
589 Status = ObReferenceObjectByHandle(ThreadHandle,
592 UserMode,
593 (PVOID)&Thread,
594 NULL);
595 if (!NT_SUCCESS(Status)) goto Quit;
596
598 {
599 default:
600 {
601 STUB;
603 break;
604 }
605 }
606
608
609Quit:
610 UserLeave();
611 return Status;
612}
#define THREAD_QUERY_INFORMATION
Definition: pstypes.h:145
_In_ THREADINFOCLASS ThreadInformationClass
Definition: psfuncs.h:841
POBJECT_TYPE PsThreadType
Definition: thread.c:20

◆ NtUserQueryInputContext()

DWORD_PTR NTAPI NtUserQueryInputContext ( HIMC  hIMC,
DWORD  dwType 
)

Definition at line 1894 of file ime.c.

1895{
1896 PIMC pIMC;
1897 PTHREADINFO ptiIMC;
1898 DWORD_PTR ret = 0;
1899
1901
1902 if (!IS_IMM_MODE())
1903 goto Quit;
1904
1906 if (!pIMC)
1907 {
1908 ERR("Invalid HIMC %p\n", hIMC);
1909 goto Quit;
1910 }
1911
1912 ptiIMC = pIMC->head.pti;
1913
1914 switch (dwType)
1915 {
1916 case QIC_INPUTPROCESSID:
1917 ret = (DWORD_PTR)PsGetThreadProcessId(ptiIMC->pEThread);
1918 break;
1919
1920 case QIC_INPUTTHREADID:
1921 ret = (DWORD_PTR)PsGetThreadId(ptiIMC->pEThread);
1922 break;
1923
1925 if (ptiIMC->spwndDefaultIme)
1927 break;
1928
1929 case QIC_DEFAULTIMC:
1930 if (ptiIMC->spDefaultImc)
1932 break;
1933
1934 default:
1935 {
1936 FIXME("dwType: %ld\n", dwType);
1937 break;
1938 }
1939 }
1940
1941Quit:
1942 UserLeave();
1943 return ret;
1944}
HANDLE NTAPI PsGetThreadId(IN PETHREAD Thread)
Definition: thread.c:705
HANDLE NTAPI PsGetThreadProcessId(IN PETHREAD Thread)
Definition: thread.c:745
THRDESKHEAD head
Definition: ntuser.h:200
@ QIC_DEFAULTWINDOWIME
Definition: undocuser.h:414
@ QIC_DEFAULTIMC
Definition: undocuser.h:415
@ QIC_INPUTTHREADID
Definition: undocuser.h:413
@ QIC_INPUTPROCESSID
Definition: undocuser.h:412

Referenced by CtfImmGenerateMessage(), CtfImmGetGuidAtom(), CtfImmIsGuidMapEnable(), CtfImmTIMCreateInputContext(), Imm32CheckImcProcess(), Imm32InternalLockIMC(), Imm32IsCrossThreadAccess(), Imm32MakeIMENotify(), ImmGetImeMenuItemsAW(), ImmGetImeMenuItemsInterProcess(), and ImmSetCompositionStringAW().

◆ NtUserQuerySendMessage()

DWORD NTAPI NtUserQuerySendMessage ( DWORD  Unknown0)

Definition at line 919 of file ntstubs.c.

920{
921 STUB;
922
923 return 0;
924}

◆ NtUserQueryUserCounters()

DWORD NTAPI NtUserQueryUserCounters ( DWORD  Unknown0,
DWORD  Unknown1,
DWORD  Unknown2,
DWORD  Unknown3,
DWORD  Unknown4 
)

Definition at line 200 of file ntstubs.c.

206{
207 STUB
208
209 return 0;
210}

◆ NtUserQueryWindow()

DWORD_PTR NTAPI NtUserQueryWindow ( HWND  hWnd,
DWORD  Index 
)

Definition at line 4202 of file window.c.

4203{
4204/* Console Leader Process CID Window offsets */
4205#define GWLP_CONSOLE_LEADER_PID 0
4206#define GWLP_CONSOLE_LEADER_TID 4
4207
4208 DWORD_PTR Result = 0;
4209 PWND pWnd, pwndActive;
4210 PTHREADINFO pti, ptiActive;
4211
4212 TRACE("Enter NtUserQueryWindow\n");
4214
4215 if (!(pWnd = UserGetWindowObject(hWnd)))
4216 {
4217 goto Exit; // Return 0
4218 }
4219
4220 switch(Index)
4221 {
4223 {
4224 if ( (pWnd->head.pti->TIF_flags & TIF_CSRSSTHREAD) &&
4226 {
4227 // IntGetWindowLong(offset == GWLP_CONSOLE_LEADER_PID)
4228 Result = (DWORD_PTR)(*((LONG_PTR*)((PCHAR)(pWnd + 1) + GWLP_CONSOLE_LEADER_PID)));
4229 }
4230 else
4231 {
4233 }
4234 break;
4235 }
4236
4238 {
4239 if ( (pWnd->head.pti->TIF_flags & TIF_CSRSSTHREAD) &&
4241 {
4242 // IntGetWindowLong(offset == GWLP_CONSOLE_LEADER_TID)
4243 Result = (DWORD_PTR)(*((LONG_PTR*)((PCHAR)(pWnd + 1) + GWLP_CONSOLE_LEADER_TID)));
4244 }
4245 else
4246 {
4248 }
4249 break;
4250 }
4251
4253 Result = (DWORD_PTR)(pWnd->head.pti->MessageQueue->spwndActive ? UserHMGetHandle(pWnd->head.pti->MessageQueue->spwndActive) : 0);
4254 break;
4255
4256 case QUERY_WINDOW_FOCUS:
4257 Result = (DWORD_PTR)(pWnd->head.pti->MessageQueue->spwndFocus ? UserHMGetHandle(pWnd->head.pti->MessageQueue->spwndFocus) : 0);
4258 break;
4259
4261 Result = (pWnd->fnid == FNID_GHOST) || MsqIsHung(pWnd->head.pti, MSQ_HUNG);
4262 break;
4263
4265 Result = (DWORD_PTR)pWnd->head.pti->pEThread->Cid.UniqueProcess;
4266 break;
4267
4269 Result = (pWnd->head.pti->MessageQueue == gpqForeground);
4270 break;
4271
4272 case QUERY_WINDOW_DEFAULT_IME: /* default IME window */
4273 if (pWnd->head.pti->spwndDefaultIme)
4274 Result = (DWORD_PTR)UserHMGetHandle(pWnd->head.pti->spwndDefaultIme);
4275 break;
4276
4277 case QUERY_WINDOW_DEFAULT_ICONTEXT: /* default input context handle */
4278 if (pWnd->head.pti->spDefaultImc)
4279 Result = (DWORD_PTR)UserHMGetHandle(pWnd->head.pti->spDefaultImc);
4280 break;
4281
4284 {
4285 pwndActive = gpqForeground->spwndActive;
4287 if (pti->rpdesk == pwndActive->head.rpdesk)
4288 {
4289 ptiActive = pwndActive->head.pti;
4290 if (ptiActive->spwndDefaultIme)
4292 }
4293 }
4294 break;
4295 }
4296
4297Exit:
4298 TRACE("Leave NtUserQueryWindow, ret=%u\n", Result);
4299 UserLeave();
4300 return Result;
4301}
#define QUERY_WINDOW_DEFAULT_ICONTEXT
Definition: ntuser.h:2855
#define QUERY_WINDOW_UNIQUE_THREAD_ID
Definition: ntuser.h:2848
#define QUERY_WINDOW_ACTIVE_IME
Definition: ntuser.h:2856
#define TIF_CSRSSTHREAD
Definition: ntuser.h:266
#define QUERY_WINDOW_FOCUS
Definition: ntuser.h:2850
#define QUERY_WINDOW_ACTIVE
Definition: ntuser.h:2849
#define QUERY_WINDOW_REAL_ID
Definition: ntuser.h:2852
#define QUERY_WINDOW_FOREGROUND
Definition: ntuser.h:2853
#define FNID_GHOST
Definition: ntuser.h:875
#define QUERY_WINDOW_UNIQUE_PROCESS_ID
Definition: ntuser.h:2847
#define QUERY_WINDOW_ISHUNG
Definition: ntuser.h:2851
#define QUERY_WINDOW_DEFAULT_IME
Definition: ntuser.h:2854
#define PCHAR
Definition: match.c:90
BOOL FASTCALL MsqIsHung(PTHREADINFO pti, DWORD TimeOut)
Definition: msgqueue.c:2149
#define MSQ_HUNG
Definition: msgqueue.h:3
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
char * PCHAR
Definition: typedefs.h:51
#define GWLP_CONSOLE_LEADER_PID
#define GWLP_CONSOLE_LEADER_TID
#define IntGetWndThreadId(WndObj)
Definition: window.h:35
#define IntGetWndProcessId(WndObj)
Definition: window.h:38

Referenced by DIALOG_CreateIndirect(), GetRealWindowOwner(), GetWindowThreadProcessId(), ImeWnd_OnImeSetContext(), Imm32IsCrossProcessAccess(), ImmAssociateContext(), ImmAssociateContextEx(), ImmGetDefaultIMEWnd(), ImmGetSaveContext(), IsHungAppWindow(), PostMessageA(), PostMessageW(), TestWindowProcess(), and UserPaintCaption().

◆ NtUserRealChildWindowFromPoint()

HWND NTAPI NtUserRealChildWindowFromPoint ( HWND  Parent,
LONG  x,
LONG  y 
)

Definition at line 3540 of file winpos.c.

3543{
3544 PWND pwndParent;
3545 TRACE("Enter NtUserRealChildWindowFromPoint\n");
3547 if ((pwndParent = UserGetWindowObject(Parent)))
3548 {
3549 pwndParent = IntRealChildWindowFromPoint(pwndParent, x, y);
3550 }
3551 UserLeave();
3552 TRACE("Leave NtUserRealChildWindowFromPoint\n");
3553 return pwndParent ? UserHMGetHandle(pwndParent) : NULL;
3554}
PWND FASTCALL IntRealChildWindowFromPoint(PWND Parent, LONG x, LONG y)
Definition: winpos.c:3025

Referenced by RealChildWindowFromPoint().

◆ NtUserRealInternalGetMessage()

BOOL NTAPI NtUserRealInternalGetMessage ( LPMSG  lpMsg,
HWND  hWnd,
UINT  wMsgFilterMin,
UINT  wMsgFilterMax,
UINT  wRemoveMsg,
BOOL  bGMSG 
)

Definition at line 616 of file ntstubs.c.

623{
624 STUB;
625 return 0;
626}

Referenced by ResetMessagePumpHook().

◆ NtUserRealWaitMessageEx()

BOOL NTAPI NtUserRealWaitMessageEx ( DWORD  dwWakeMask,
UINT  uTimeout 
)

Definition at line 630 of file ntstubs.c.

633{
634 STUB;
635 return 0;
636}

Referenced by ResetMessagePumpHook().

◆ NtUserRedrawWindow()

BOOL NTAPI NtUserRedrawWindow ( HWND  hWnd,
CONST RECT lprcUpdate,
HRGN  hrgnUpdate,
UINT  flags 
)

Definition at line 2000 of file painting.c.

2005{
2006 RECTL SafeUpdateRect;
2007 PWND Wnd;
2008 BOOL Ret = FALSE;
2011 PREGION RgnUpdate = NULL;
2012
2013 TRACE("Enter NtUserRedrawWindow\n");
2015
2017 {
2018 goto Exit; // Return FALSE
2019 }
2020
2021 if (lprcUpdate)
2022 {
2023 _SEH2_TRY
2024 {
2025 ProbeForRead(lprcUpdate, sizeof(RECTL), 1);
2026 RtlCopyMemory(&SafeUpdateRect, lprcUpdate, sizeof(RECTL));
2027 }
2029 {
2031 }
2032 _SEH2_END
2033 if (!NT_SUCCESS(Status))
2034 {
2036 goto Exit; // Return FALSE
2037 }
2038 }
2039
2043 {
2044 /* RedrawWindow fails only in case that flags are invalid */
2046 goto Exit; // Return FALSE
2047 }
2048
2049 /* We can't hold lock on GDI objects while doing roundtrips to user mode,
2050 * so it will be copied.
2051 */
2052 if (hrgnUpdate > HRGN_WINDOW)
2053 {
2054 RgnUpdate = REGION_LockRgn(hrgnUpdate);
2055 if (!RgnUpdate)
2056 {
2058 goto Exit; // Return FALSE
2059 }
2060 REGION_UnlockRgn(RgnUpdate);
2061 }
2062 else if (hrgnUpdate == HRGN_WINDOW) // Trap it out.
2063 {
2064 ERR("NTRW: Caller is passing Window Region 1\n");
2065 }
2066
2067 UserRefObjectCo(Wnd, &Ref);
2068
2069 Ret = co_UserRedrawWindow( Wnd,
2070 lprcUpdate ? &SafeUpdateRect : NULL,
2071 RgnUpdate,
2072 flags);
2073
2074 UserDerefObjectCo(Wnd);
2075
2076Exit:
2077 TRACE("Leave NtUserRedrawWindow, ret=%i\n", Ret);
2078 UserLeave();
2079 return Ret;
2080}
#define HRGN_WINDOW
Definition: ntuser.h:361
#define RDW_NOINTERNALPAINT
Definition: winuser.h:1228
#define RDW_UPDATENOW
Definition: winuser.h:1231
#define RDW_NOCHILDREN
Definition: winuser.h:1233
#define RDW_NOFRAME
Definition: winuser.h:1227
#define RDW_INTERNALPAINT
Definition: winuser.h:1224
#define RDW_NOERASE
Definition: winuser.h:1226

Referenced by NtUserInvalidateRect(), NtUserInvalidateRgn(), NtUserValidateRect(), RedrawWindow(), SpiSetWallpaper(), START_TEST(), UpdateWindow(), and ValidateRgn().

◆ NtUserRegisterClassExWOW()

RTL_ATOM NTAPI NtUserRegisterClassExWOW ( WNDCLASSEXW lpwcx,
PUNICODE_STRING  pustrClassName,
PUNICODE_STRING  pustrCVersion,
PCLSMENUNAME  pClassMenuName,
DWORD  fnID,
DWORD  Flags,
LPDWORD  pWow 
)

Definition at line 2444 of file class.c.

2462{
2463 WNDCLASSEXW CapturedClassInfo = {0};
2464 UNICODE_STRING CapturedName = {0}, CapturedMenuName = {0}, CapturedVersion = {0};
2465 RTL_ATOM Ret = (RTL_ATOM)0;
2467 BOOL Exception = FALSE;
2468
2469 if (Flags & ~(CSF_ANSIPROC))
2470 {
2471 ERR("NtUserRegisterClassExWOW Bad Flags!\n");
2473 return Ret;
2474 }
2475
2477
2478 TRACE("NtUserRegisterClassExWOW ClsN %wZ\n",ClassName);
2479
2480 if ( !(ppi->W32PF_flags & W32PF_CLASSESREGISTERED ))
2481 {
2483 }
2484
2485 _SEH2_TRY
2486 {
2487 /* Probe the parameters and basic parameter checks */
2488 if (ProbeForReadUint(&lpwcx->cbSize) != sizeof(WNDCLASSEXW))
2489 {
2490 ERR("NtUserRegisterClassExWOW Wrong cbSize!\n");
2491 goto InvalidParameter;
2492 }
2493
2494 ProbeForRead(lpwcx,
2495 sizeof(WNDCLASSEXW),
2496 sizeof(ULONG));
2497 RtlCopyMemory(&CapturedClassInfo,
2498 lpwcx,
2499 sizeof(WNDCLASSEXW));
2500
2501 CapturedName = ProbeForReadUnicodeString(ClassName);
2502 CapturedVersion = ProbeForReadUnicodeString(ClsVersion);
2503
2504 ProbeForRead(pClassMenuName,
2505 sizeof(CLSMENUNAME),
2506 1);
2507
2508 CapturedMenuName = ProbeForReadUnicodeString(pClassMenuName->pusMenuName);
2509
2510 if ( (CapturedName.Length & 1) ||
2511 (CapturedMenuName.Length & 1) ||
2512 (CapturedClassInfo.cbClsExtra < 0) ||
2513 ((CapturedClassInfo.cbClsExtra + CapturedName.Length +
2514 CapturedMenuName.Length + sizeof(CLS))
2515 < (ULONG)CapturedClassInfo.cbClsExtra) ||
2516 (CapturedClassInfo.cbWndExtra < 0) ||
2517 (CapturedClassInfo.hInstance == NULL) )
2518 {
2519 ERR("NtUserRegisterClassExWOW Invalid Parameter Error!\n");
2520 goto InvalidParameter;
2521 }
2522
2523 if (CapturedName.Length != 0)
2524 {
2525 ProbeForRead(CapturedName.Buffer,
2526 CapturedName.Length,
2527 sizeof(WCHAR));
2528 }
2529 else
2530 {
2531 if (!IS_ATOM(CapturedName.Buffer))
2532 {
2533 ERR("NtUserRegisterClassExWOW ClassName Error!\n");
2534 goto InvalidParameter;
2535 }
2536 }
2537
2538 if (CapturedVersion.Length != 0)
2539 {
2540 ProbeForRead(CapturedVersion.Buffer,
2541 CapturedVersion.Length,
2542 sizeof(WCHAR));
2543 }
2544 else
2545 {
2546 if (!IS_ATOM(CapturedVersion.Buffer))
2547 {
2548 ERR("NtUserRegisterClassExWOW ClassName Error!\n");
2549 goto InvalidParameter;
2550 }
2551 }
2552
2553 if (CapturedMenuName.Length != 0)
2554 {
2555 ProbeForRead(CapturedMenuName.Buffer,
2556 CapturedMenuName.Length,
2557 sizeof(WCHAR));
2558 }
2559 else if (CapturedMenuName.Buffer != NULL &&
2560 !IS_INTRESOURCE(CapturedMenuName.Buffer))
2561 {
2562 ERR("NtUserRegisterClassExWOW MenuName Error!\n");
2566 }
2567
2568 if (IsCallProcHandle(lpwcx->lpfnWndProc))
2569 { // Never seen this yet, but I'm sure it's a little haxxy trick!
2570 // If this pops up we know what todo!
2571 ERR("NtUserRegisterClassExWOW WndProc is CallProc!!\n");
2572 }
2573
2574 TRACE("NtUserRegisterClassExWOW MnuN %wZ\n",&CapturedMenuName);
2575 }
2577 {
2578 ERR("NtUserRegisterClassExWOW Exception Error!\n");
2580 Exception = TRUE;
2581 }
2582 _SEH2_END;
2583
2584 if (!Exception)
2585 {
2586 /* Register the class */
2587 Ret = UserRegisterClass(&CapturedClassInfo,
2588 &CapturedName,
2589 &CapturedVersion,
2590 &CapturedMenuName,
2591 fnID,
2592 Flags);
2593 }
2594
2595 if (!Ret)
2596 {
2597 TRACE("NtUserRegisterClassExWOW Null Return!\n");
2598 }
2599
2600 UserLeave();
2601
2602 return Ret;
2603}
static __inline BOOL IsCallProcHandle(IN WNDPROC lpWndProc)
Definition: class.h:13
@ InvalidParameter
Definition: gdiplustypes.h:28
#define CSF_ANSIPROC
Definition: ntuser.h:557
#define ProbeForReadUint(Ptr)
Definition: probe.h:67
PUNICODE_STRING pusMenuName
Definition: ntuser.h:500
WNDPROC lpfnWndProc
Definition: winuser.h:3326
UINT cbSize
Definition: winuser.h:3324
int cbWndExtra
Definition: winuser.h:3328
HINSTANCE hInstance
Definition: winuser.h:3329
int cbClsExtra
Definition: winuser.h:3327
RTL_ATOM UserRegisterClass(IN CONST WNDCLASSEXW *lpwcx, IN PUNICODE_STRING ClassName, IN PUNICODE_STRING ClassVersion, IN PUNICODE_STRING MenuName, IN DWORD fnID, IN DWORD dwFlags)
Definition: class.c:1504

Referenced by RegisterClassExWOWW(), and START_TEST().

◆ NtUserRegisterHotKey()

BOOL NTAPI NtUserRegisterHotKey ( HWND  hWnd,
int  id,
UINT  fsModifiers,
UINT  vk 
)

Definition at line 535 of file hotkey.c.

539{
540 PWND pWnd = NULL;
541 BOOL bRet = FALSE;
542
543 TRACE("Enter NtUserRegisterHotKey\n");
544
545 // FIXME: Does Win2k3 support MOD_NOREPEAT?
546 if (fsModifiers & ~(MOD_ALT | MOD_CONTROL | MOD_SHIFT | MOD_WIN))
547 {
548 WARN("Invalid modifiers: %x\n", fsModifiers);
550 return FALSE;
551 }
552
554
555 /* Check the hotkey thread */
556 if (hWnd == NULL)
557 {
558 pWnd = NULL;
559 }
560 else
561 {
563 if (!pWnd)
564 goto cleanup;
565
566 /* FIXME?? "Fix" wine msg "Window on another thread" test_hotkey */
567 if (pWnd->head.pti != gptiCurrent)
568 {
570 WARN("Must be from the same Thread.\n");
571 goto cleanup;
572 }
573 }
574
575 bRet = UserRegisterHotKey(pWnd, id, fsModifiers, vk);
576
577cleanup:
578 TRACE("Leave NtUserRegisterHotKey, ret=%i\n", bRet);
579 UserLeave();
580 return bRet;
581}
unsigned short vk
Definition: console.c:118
#define MOD_ALT
Definition: imm.h:184
#define MOD_SHIFT
Definition: imm.h:186
#define MOD_CONTROL
Definition: imm.h:185
BOOL FASTCALL UserRegisterHotKey(PWND pWnd, int id, UINT fsModifiers, UINT vk)
Definition: hotkey.c:447
#define ERROR_WINDOW_OF_OTHER_THREAD
Definition: winerror.h:1234
#define MOD_WIN
Definition: winuser.h:2686

Referenced by RegisterHotKey().

◆ NtUserRegisterRawInputDevices()

BOOL NTAPI NtUserRegisterRawInputDevices ( IN PCRAWINPUTDEVICE  pRawInputDevices,
IN UINT  uiNumDevices,
IN UINT  cbSize 
)

Definition at line 640 of file ntstubs.c.

644{
645 STUB;
646 return 0;
647}

◆ NtUserRegisterTasklist()

DWORD NTAPI NtUserRegisterTasklist ( DWORD  Unknown0)

Definition at line 214 of file ntstubs.c.

216{
217 STUB
218
219 return 0;
220}

Referenced by RegisterTasklist().

◆ NtUserRegisterUserApiHook()

BOOL NTAPI NtUserRegisterUserApiHook ( PUNICODE_STRING  m_dllname1,
PUNICODE_STRING  m_funname1,
DWORD  dwUnknown3,
DWORD  dwUnknown4 
)

Definition at line 1722 of file hook.c.

1727{
1728 BOOL ret;
1729 UNICODE_STRING strDllNameSafe;
1730 UNICODE_STRING strFuncNameSafe;
1732
1733 /* Probe and capture parameters */
1734 Status = ProbeAndCaptureUnicodeString(&strDllNameSafe, UserMode, m_dllname1);
1735 if(!NT_SUCCESS(Status))
1736 {
1738 return FALSE;
1739 }
1740
1741 Status = ProbeAndCaptureUnicodeString(&strFuncNameSafe, UserMode, m_funname1);
1742 if(!NT_SUCCESS(Status))
1743 {
1744 ReleaseCapturedUnicodeString(&strDllNameSafe, UserMode);
1746 return FALSE;
1747 }
1748
1750
1751 /* Call internal function */
1752 ret = UserRegisterUserApiHook(&strDllNameSafe, &strFuncNameSafe);
1753
1754 UserLeave();
1755
1756 /* Cleanup only in case of failure */
1757 if(ret == FALSE)
1758 {
1759 ReleaseCapturedUnicodeString(&strDllNameSafe, UserMode);
1760 ReleaseCapturedUnicodeString(&strFuncNameSafe, UserMode);
1761 }
1762
1763 return ret;
1764}
BOOL FASTCALL UserRegisterUserApiHook(PUNICODE_STRING pstrDllName, PUNICODE_STRING pstrFuncName)
Definition: hook.c:138

Referenced by RegisterUserApiHook().

◆ NtUserRegisterWindowMessage()

UINT NTAPI NtUserRegisterWindowMessage ( PUNICODE_STRING  MessageName)

Definition at line 4307 of file window.c.

4308{
4309 UNICODE_STRING SafeMessageName;
4311 UINT Ret = 0;
4312
4313 TRACE("Enter NtUserRegisterWindowMessage\n");
4315
4316 if(MessageNameUnsafe == NULL)
4317 {
4319 goto Exit; // Return 0
4320 }
4321
4322 Status = IntSafeCopyUnicodeStringTerminateNULL(&SafeMessageName, MessageNameUnsafe);
4323 if(!NT_SUCCESS(Status))
4324 {
4326 goto Exit; // Return 0
4327 }
4328
4329 Ret = (UINT)IntAddAtom(SafeMessageName.Buffer);
4330 if (SafeMessageName.Buffer)
4331 ExFreePoolWithTag(SafeMessageName.Buffer, TAG_STRING);
4332
4333Exit:
4334 TRACE("Leave NtUserRegisterWindowMessage, ret=%u\n", Ret);
4335 UserLeave();
4336 return Ret;
4337}
RTL_ATOM FASTCALL IntAddAtom(LPWSTR AtomName)
Definition: useratom.c:13
NTSTATUS FASTCALL IntSafeCopyUnicodeStringTerminateNULL(PUNICODE_STRING Dest, PUNICODE_STRING Source)
Definition: misc.c:684

Referenced by RegisterClipboardFormatA(), RegisterClipboardFormatW(), RegisterWindowMessageA(), and RegisterWindowMessageW().

◆ NtUserRemoteConnect()

DWORD NTAPI NtUserRemoteConnect ( DWORD  dwUnknown1,
DWORD  dwUnknown2,
DWORD  dwUnknown3 
)

Definition at line 860 of file ntstubs.c.

864{
865 STUB;
866 return 0;
867}

◆ NtUserRemoteRedrawRectangle()

DWORD NTAPI NtUserRemoteRedrawRectangle ( DWORD  dwUnknown1,
DWORD  dwUnknown2,
DWORD  dwUnknown3,
DWORD  dwUnknown4 
)

Definition at line 871 of file ntstubs.c.

876{
877 STUB;
878 return 0;
879}

◆ NtUserRemoteRedrawScreen()

DWORD NTAPI NtUserRemoteRedrawScreen ( VOID  )

Definition at line 883 of file ntstubs.c.

884{
885 STUB;
886 return 0;
887}

◆ NtUserRemoteStopScreenUpdates()

DWORD NTAPI NtUserRemoteStopScreenUpdates ( VOID  )

Definition at line 891 of file ntstubs.c.

892{
893 STUB;
894 return 0;
895}

◆ NtUserRemoveMenu()

BOOL NTAPI NtUserRemoveMenu ( HMENU  hMenu,
UINT  uPosition,
UINT  uFlags 
)

Definition at line 6398 of file menu.c.

6402{
6403 PMENU Menu;
6404 BOOL Ret = FALSE;
6405
6406 TRACE("Enter NtUserRemoveMenu\n");
6408
6409 Menu = UserGetMenuObject(hMenu);
6410 if (Menu)
6411 {
6412 Ret = IntRemoveMenuItem(Menu, uPosition, uFlags, FALSE);
6413 }
6414
6415 UserLeave();
6416 TRACE("Leave NtUserRemoveMenu, ret=%i\n", Ret);
6417 return Ret;
6418}

Referenced by RemoveMenu().

◆ NtUserRemoveProp()

HANDLE NTAPI NtUserRemoveProp ( HWND  hWnd,
ATOM  Atom 
)

◆ NtUserResolveDesktop()

HDESK NTAPI NtUserResolveDesktop ( IN HANDLE  ProcessHandle,
IN PUNICODE_STRING  DesktopPath,
IN BOOL  bInherit,
OUT HWINSTA *  phWinSta 
)

Definition at line 2862 of file desktop.c.

2867{
2870 HWINSTA hWinSta = NULL;
2871 HDESK hDesktop = NULL;
2872 UNICODE_STRING CapturedDesktopPath;
2873
2874 /* Allow only the Console Server to perform this operation (via CSRSS) */
2876 return NULL;
2877
2878 /* Get the process object the user handle was referencing */
2882 UserMode,
2883 (PVOID*)&Process,
2884 NULL);
2885 if (!NT_SUCCESS(Status))
2886 return NULL;
2887
2889
2890 _SEH2_TRY
2891 {
2892 /* Probe the handle pointer */
2893 // ProbeForWriteHandle
2894 ProbeForWrite(phWinSta, sizeof(HWINSTA), sizeof(HWINSTA));
2895 }
2897 {
2899 _SEH2_YIELD(goto Quit);
2900 }
2901 _SEH2_END;
2902
2903 /* Capture the user desktop path string */
2904 Status = ProbeAndCaptureUnicodeString(&CapturedDesktopPath,
2905 UserMode,
2906 DesktopPath);
2907 if (!NT_SUCCESS(Status))
2908 goto Quit;
2909
2910 /* Call the internal function */
2912 &CapturedDesktopPath,
2913 bInherit,
2914 &hWinSta,
2915 &hDesktop);
2916 if (!NT_SUCCESS(Status))
2917 {
2918 ERR("IntResolveDesktop failed, Status 0x%08lx\n", Status);
2919 hWinSta = NULL;
2920 hDesktop = NULL;
2921 }
2922
2923 _SEH2_TRY
2924 {
2925 /* Return the window station handle */
2926 *phWinSta = hWinSta;
2927 }
2929 {
2931
2932 /* We failed, close the opened desktop and window station */
2933 if (hDesktop) ObCloseHandle(hDesktop, UserMode);
2934 hDesktop = NULL;
2935 if (hWinSta) ObCloseHandle(hWinSta, UserMode);
2936 }
2937 _SEH2_END;
2938
2939 /* Free the captured string */
2940 ReleaseCapturedUnicodeString(&CapturedDesktopPath, UserMode);
2941
2942Quit:
2943 UserLeave();
2944
2945 /* Dereference the process object */
2947
2948 /* Return the desktop handle */
2949 return hDesktop;
2950}
NTSTATUS FASTCALL IntResolveDesktop(IN PEPROCESS Process, IN PUNICODE_STRING DesktopPath, IN BOOL bInherit, OUT HWINSTA *phWinSta, OUT HDESK *phDesktop)
Definition: desktop.c:568

Referenced by GuiInit().

◆ NtUserResolveDesktopForWOW()

DWORD NTAPI NtUserResolveDesktopForWOW ( DWORD  Unknown0)

Definition at line 650 of file ntstubs.c.

651{
652 STUB
653 return 0;
654}

◆ NtUserSBGetParms()

BOOL NTAPI NtUserSBGetParms ( HWND  hwnd,
int  fnBar,
PSBDATA  pSBData,
LPSCROLLINFO  lpsi 
)

Definition at line 1193 of file scrollbar.c.

1198{
1199 PWND Window;
1200 SCROLLINFO psi;
1201 BOOL Ret = FALSE;
1202 SBDATA SBDataSafe;
1204
1205 TRACE("Enter NtUserGetScrollInfo\n");
1207
1208 _SEH2_TRY
1209 {
1210 RtlCopyMemory(&psi, lpsi, sizeof(SCROLLINFO));
1211 if (pSBData)
1212 RtlCopyMemory(&SBDataSafe, pSBData, sizeof(SBDATA));
1213 }
1215 {
1216 ERR("NtUserGetScrollInfo Failed size\n");
1218 _SEH2_YIELD(goto Exit); // Return FALSE
1219 }
1220 _SEH2_END
1221
1223 {
1224 ERR("NtUserGetScrollInfo Bad window\n");
1225 goto Exit; // Return FALSE
1226 }
1227
1228 UserRefObjectCo(Window, &Ref);
1229 Ret = co_IntGetScrollInfo(Window, fnBar, &SBDataSafe, &psi);
1231
1232 _SEH2_TRY
1233 {
1234 RtlCopyMemory(lpsi, &psi, sizeof(SCROLLINFO));
1235 }
1237 {
1238 ERR("NtUserGetScrollInfo Failed copy to user\n");
1240 Ret = FALSE;
1241 _SEH2_YIELD(goto Exit);
1242 }
1243 _SEH2_END
1244
1245Exit:
1246 TRACE("Leave NtUserGetScrollInfo, ret=%i\n", Ret);
1247 UserLeave();
1248 return Ret;
1249}
static BOOL FASTCALL co_IntGetScrollInfo(PWND Window, INT nBar, PSBDATA pSBData, LPSCROLLINFO lpsi)
Definition: scrollbar.c:264

Referenced by RealGetScrollInfo(), and ScrollBarWndProc_common().

◆ NtUserScrollDC()

BOOL NTAPI NtUserScrollDC ( HDC  hDC,
int  dx,
int  dy,
CONST RECT lprcScroll,
CONST RECT lprcClip,
HRGN  hrgnUpdate,
LPRECT  lprcUpdate 
)

Referenced by ScrollDC(), and START_TEST().

◆ NtUserScrollWindowEx()

DWORD NTAPI NtUserScrollWindowEx ( HWND  hWnd,
INT  dx,
INT  dy,
const RECT rect,
const RECT clipRect,
HRGN  hrgnUpdate,
LPRECT  rcUpdate,
UINT  flags 
)

Definition at line 571 of file scrollex.c.

580{
583 PWND Window = NULL;
584 RECTL rcScroll, rcClip, rcUpdate;
586
587 TRACE("Enter NtUserScrollWindowEx\n");
589
592 {
593 Window = NULL; /* prevent deref at cleanup */
594 goto Cleanup; // Return ERROR
595 }
596 UserRefObjectCo(Window, &Ref);
597
599 {
600 if (prcUnsafeScroll)
601 {
602 ProbeForRead(prcUnsafeScroll, sizeof(*prcUnsafeScroll), 1);
603 rcScroll = *prcUnsafeScroll;
604 }
605
606 if (prcUnsafeClip)
607 {
608 ProbeForRead(prcUnsafeClip, sizeof(*prcUnsafeClip), 1);
609 rcClip = *prcUnsafeClip;
610 }
611 }
613 {
615 }
616 _SEH2_END;
617
618 if (!NT_SUCCESS(Status))
619 {
621 goto Cleanup; // Return ERROR
622 }
623
625 dx, dy,
626 prcUnsafeScroll ? &rcScroll : NULL,
627 prcUnsafeClip ? &rcClip : NULL,
628 hrgnUpdate,
629 prcUnsafeUpdate ? &rcUpdate : NULL,
630 flags);
631
632 if (prcUnsafeUpdate)
633 {
635 {
636 /* Probe here, to not fail on invalid pointer before scrolling */
637 ProbeForWrite(prcUnsafeUpdate, sizeof(*prcUnsafeUpdate), 1);
638 *prcUnsafeUpdate = rcUpdate;
639 }
641 {
643 }
644 _SEH2_END;
645
646 if (!NT_SUCCESS(Status))
647 {
649 Result = ERROR;
650 }
651 }
652
653Cleanup:
654 if (Window)
656
657 TRACE("Leave NtUserScrollWindowEx, ret=%lu\n", Result);
658 UserLeave();
659 return Result;
660}
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97
DWORD FASTCALL IntScrollWindowEx(PWND Window, INT dx, INT dy, const RECT *prcScroll, const RECT *prcClip, HRGN hrgnUpdate, LPRECT prcUpdate, UINT flags)
Definition: scrollex.c:228
BOOL FASTCALL IntIsWindowDrawable(PWND Wnd)
Definition: painting.c:868

Referenced by ScrollWindow(), and ScrollWindowEx().

◆ NtUserSelectPalette()

HPALETTE NTAPI NtUserSelectPalette ( HDC  hDC,
HPALETTE  hpal,
BOOL  ForceBackground 
)

Select logical palette into device context.

Parameters
hDChandle to the device context
hpalhandle to the palette
ForceBackgroundIf this value is FALSE the logical palette will be copied to the device palette only when the application is in the foreground. If this value is TRUE then map the colors in the logical palette to the device palette colors in the best way.
Returns
old palette
Todo:
implement ForceBackground == TRUE

Definition at line 1034 of file windc.c.

1037{
1038 HPALETTE oldPal;
1040 // Implement window checks
1041 oldPal = GdiSelectPalette( hDC, hpal, ForceBackground);
1042 UserLeave();
1043 return oldPal;
1044}
HPALETTE NTAPI GdiSelectPalette(_In_ HDC hDC, _In_ HPALETTE hpal, _In_ BOOL ForceBackground)

◆ NtUserSendInput()

UINT NTAPI NtUserSendInput ( UINT  nInputs,
LPINPUT  pInput,
INT  cbSize 
)

Definition at line 723 of file input.c.

727{
728 PTHREADINFO pti;
729 UINT uRet = 0;
730
731 TRACE("Enter NtUserSendInput\n");
733
735 ASSERT(pti);
736
737 if (!pti->rpdesk)
738 {
739 goto cleanup;
740 }
741
742 if (!nInputs || !pInput || cbSize != sizeof(INPUT))
743 {
745 goto cleanup;
746 }
747
748 /*
749 * FIXME: Check access rights of the window station
750 * e.g. services running in the service window station cannot block input
751 */
752 if (!ThreadHasInputAccess(pti) ||
754 {
756 goto cleanup;
757 }
758
759 while (nInputs--)
760 {
761 INPUT SafeInput;
763
764 Status = MmCopyFromCaller(&SafeInput, pInput++, sizeof(INPUT));
765 if (!NT_SUCCESS(Status))
766 {
768 goto cleanup;
769 }
770
771 switch (SafeInput.type)
772 {
773 case INPUT_MOUSE:
774 if (UserSendMouseInput(&SafeInput.mi, TRUE))
775 uRet++;
776 break;
777 case INPUT_KEYBOARD:
778 if (UserSendKeyboardInput(&SafeInput.ki, TRUE))
779 uRet++;
780 break;
781 case INPUT_HARDWARE:
782 FIXME("INPUT_HARDWARE not supported!\n");
783 break;
784 default:
785 ERR("SendInput(): Invalid input type: 0x%x\n", SafeInput.type);
786 break;
787 }
788 }
789
790cleanup:
791 TRACE("Leave NtUserSendInput, ret=%u\n", uRet);
792 UserLeave();
793 return uRet;
794}
#define IntIsActiveDesktop(Desktop)
Definition: desktop.h:172
KEYBDINPUT ki
Definition: winable.h:62
DWORD type
Definition: winable.h:59
MOUSEINPUT mi
Definition: winable.h:61
BOOL NTAPI UserSendKeyboardInput(KEYBDINPUT *pKbdInput, BOOL bInjected)
Definition: keyboard.c:1333
#define ThreadHasInputAccess(W32Thread)
Definition: input.h:65
BOOL NTAPI UserSendMouseInput(MOUSEINPUT *pMouseInput, BOOL bInjected)
Definition: mouse.c:168
#define INPUT_HARDWARE
Definition: winable.h:11
#define INPUT_KEYBOARD
Definition: winable.h:10
#define INPUT_MOUSE
Definition: winable.h:9

Referenced by keybd_event(), mouse_event(), and SendInput().

◆ NtUserSetActiveWindow()

HWND NTAPI NtUserSetActiveWindow ( HWND  Wnd)

Definition at line 1658 of file focus.c.

1659{
1661 HWND hWndPrev;
1662 PWND Window, pwndPrev;
1663 HWND Ret = NULL;
1664
1665 TRACE("Enter NtUserSetActiveWindow(%p)\n", hWnd);
1667
1668 Window = NULL;
1669 if (hWnd)
1670 {
1672 {
1673 ERR("NtUserSetActiveWindow: Invalid handle 0x%p!\n",hWnd);
1674 goto Exit; // Return NULL
1675 }
1676 }
1677
1678 if (!Window ||
1679 Window->head.pti->MessageQueue == gptiCurrent->MessageQueue)
1680 {
1681 pwndPrev = gptiCurrent->MessageQueue->spwndActive;
1682 hWndPrev = (pwndPrev ? UserHMGetHandle(pwndPrev) : NULL);
1683 if (Window) UserRefObjectCo(Window, &Ref);
1686 Ret = ((hWndPrev && IntIsWindow(hWndPrev)) ? hWndPrev : NULL);
1687 }
1688
1689Exit:
1690 TRACE("Leave NtUserSetActiveWindow, ret=%p\n", Ret);
1691 UserLeave();
1692 return Ret;
1693}

Referenced by SetActiveWindow().

◆ NtUserSetAppImeLevel()

BOOL NTAPI NtUserSetAppImeLevel ( HWND  hWnd,
DWORD  dwLevel 
)

◆ NtUserSetCapture()

HWND NTAPI NtUserSetCapture ( HWND  Wnd)

Definition at line 1699 of file focus.c.

1700{
1701 HWND Ret;
1702
1703 TRACE("Enter NtUserSetCapture(%p)\n", hWnd);
1705
1706 Ret = co_UserSetCapture(hWnd);
1707
1708 TRACE("Leave NtUserSetCapture, ret=%p\n", Ret);
1709 UserLeave();
1710 return Ret;
1711}

Referenced by SetCapture().

◆ NtUserSetClassLong()

ULONG_PTR NTAPI NtUserSetClassLong ( _In_ HWND  hWnd,
_In_ INT  Offset,
_In_ ULONG  dwNewLong,
_In_ BOOL  Ansi 
)

Definition at line 2706 of file class.c.

2711{
2712 return IntNtUserSetClassLongPtr(hWnd, Offset, dwNewLong, Ansi, sizeof(LONG));
2713}
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
ULONG_PTR APIENTRY IntNtUserSetClassLongPtr(HWND hWnd, INT Offset, ULONG_PTR dwNewLong, BOOL Ansi, ULONG Size)
Definition: class.c:2606

Referenced by SetClassLongA(), SetClassLongW(), and START_TEST().

◆ NtUserSetClassWord()

WORD NTAPI NtUserSetClassWord ( HWND  hWnd,
INT  nIndex,
WORD  wNewWord 
)

Definition at line 2732 of file class.c.

2736{
2737/*
2738 * NOTE: Obsoleted in 32-bit windows
2739 */
2740 return(0);
2741}

◆ NtUserSetClipboardData()

HANDLE NTAPI NtUserSetClipboardData ( UINT  fmt,
HANDLE  hMem,
PSETCLIPBDATA  scd 
)

Definition at line 1084 of file clipboard.c.

1085{
1086 SETCLIPBDATA scd;
1087 HANDLE hRet;
1088
1089 TRACE("NtUserSetClipboardData(%x %p %p)\n", fmt, hData, pUnsafeScd);
1090
1091 _SEH2_TRY
1092 {
1093 ProbeForRead(pUnsafeScd, sizeof(*pUnsafeScd), 1);
1094 RtlCopyMemory(&scd, pUnsafeScd, sizeof(scd));
1095 }
1097 {
1099 _SEH2_YIELD(return NULL;)
1100 }
1101 _SEH2_END
1102
1104
1105 /* Call internal function */
1106 hRet = UserSetClipboardData(fmt, hData, &scd);
1107
1108 UserLeave();
1109
1110 return hRet;
1111}
HANDLE NTAPI UserSetClipboardData(UINT fmt, HANDLE hData, PSETCLIPBDATA scd)
Definition: clipboard.c:1023

Referenced by GetClipboardData(), setClipboardData(), and SetClipboardData().

◆ NtUserSetClipboardViewer()

HWND NTAPI NtUserSetClipboardViewer ( HWND  hWndNewViewer)

Definition at line 1114 of file clipboard.c.

1115{
1116 HWND hWndNext = NULL;
1117 PWINSTATION_OBJECT pWinStaObj;
1118 PWND pWindow;
1119
1121
1122 pWinStaObj = IntGetWinStaForCbAccess();
1123 if (!pWinStaObj)
1124 goto cleanup;
1125
1126 pWindow = UserGetWindowObject(hWndNewViewer);
1127 if (!pWindow)
1128 {
1130 goto cleanup;
1131 }
1132
1133 /* Return previous viewer. New viever window should
1134 send messages to rest of the chain */
1135 if (pWinStaObj->spwndClipViewer)
1136 hWndNext = UserHMGetHandle(pWinStaObj->spwndClipViewer);
1137
1138 /* Set new viewer window */
1139 pWinStaObj->spwndClipViewer = pWindow;
1140
1141 /* Notify viewer windows in chain */
1142 pWinStaObj->fClipboardChanged = FALSE;
1143 if (pWinStaObj->spwndClipViewer)
1144 {
1145 TRACE("Clipboard: sending WM_DRAWCLIPBOARD to %p\n", UserHMGetHandle(pWinStaObj->spwndClipViewer));
1146 // For 32-bit applications this message is sent as a notification
1148 }
1149
1150cleanup:
1151 if (pWinStaObj)
1152 ObDereferenceObject(pWinStaObj);
1153
1154 UserLeave();
1155
1156 return hWndNext;
1157}
INT fClipboardChanged
Definition: winsta.h:33
LRESULT FASTCALL co_IntSendMessageNoWait(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1763
#define WM_DRAWCLIPBOARD
Definition: winuser.h:1897

Referenced by SetClipboardViewer().

◆ NtUserSetConsoleReserveKeys()

DWORD NTAPI NtUserSetConsoleReserveKeys ( DWORD  Unknown0,
DWORD  Unknown1 
)

Definition at line 224 of file ntstubs.c.

227{
228 STUB
229
230 return 0;
231}

◆ NtUserSetCursor()

HCURSOR NTAPI NtUserSetCursor ( HCURSOR  hCursor)

Definition at line 1051 of file cursoricon.c.

1053{
1054 PCURICON_OBJECT pcurOld, pcurNew;
1055 HCURSOR hOldCursor = NULL;
1056
1057 TRACE("Enter NtUserSetCursor: %p\n", hCursor);
1059
1060 if (hCursor)
1061 {
1062 pcurNew = UserGetCurIconObject(hCursor);
1063 if (!pcurNew)
1064 {
1066 goto leave;
1067 }
1068 pcurNew->CURSORF_flags |= CURSORF_CURRENT;
1069 }
1070 else
1071 {
1072 pcurNew = NULL;
1073 }
1074
1075 pcurOld = UserSetCursor(pcurNew, FALSE);
1076
1077 // If returning an old cursor than validate it, Justin Case!
1078 if ( pcurOld &&
1080 {
1081 hOldCursor = UserHMGetHandle(pcurOld);
1082 /*
1083 Problem:
1084
1085 System Global Cursors start out having at least 2 lock counts. If a system
1086 cursor is the default cursor and is returned to the caller twice in its
1087 life, the count will reach zero. Causing an assert to occur in objects.
1088
1089 This fixes a SeaMonkey crash while the mouse crosses a boundary.
1090 */
1091 if (pcurOld->CURSORF_flags & CURSORF_GLOBAL)
1092 {
1093 TRACE("Returning Global Cursor hcur %p\n",hOldCursor);
1094
1095 /*if (pcurOld->head.cLockObj > 2) // Throttle down to 2.
1096 {
1097 UserDereferenceObject(pcurOld);
1098 }
1099
1100 goto leave;*/
1101 }
1102
1103 /* See if it was destroyed in the meantime */
1104 if (UserObjectInDestroy(hOldCursor))
1105 hOldCursor = NULL;
1106 pcurOld->CURSORF_flags &= ~CURSORF_CURRENT;
1107 UserDereferenceObject(pcurOld);
1108 }
1109
1110leave:
1111 UserLeave();
1112 return hOldCursor;
1113}
#define CURSORF_GLOBAL
Definition: ntuser.h:1200
PCURICON_OBJECT FASTCALL UserSetCursor(PCURICON_OBJECT NewCursor, BOOL ForceChange)
Definition: msgqueue.c:93
BOOL FASTCALL UserObjectInDestroy(HANDLE h)
Definition: object.c:702
#define ERROR_INVALID_CURSOR_HANDLE
Definition: winerror.h:1228

Referenced by SetCursor().

◆ NtUserSetCursorContents()

BOOL NTAPI NtUserSetCursorContents ( HANDLE  Handle,
PICONINFO  IconInfo 
)

Definition at line 1121 of file cursoricon.c.

1124{
1125 FIXME(" is UNIMPLEMENTED.\n");
1126 return FALSE;
1127}

◆ NtUserSetCursorIconData()

BOOL NTAPI NtUserSetCursorIconData ( _In_ HCURSOR  hCursor,
_In_opt_ PUNICODE_STRING  pustrModule,
_In_opt_ PUNICODE_STRING  puSrcName,
_In_ const CURSORDATA pCursorData 
)

Definition at line 1512 of file cursoricon.c.

1517{
1518 CURSORDATA cursordata;
1519 UNICODE_STRING ustrModule, ustrRsrc;
1520 _SEH2_VOLATILE PVOID pvBuffer;
1521 CURSORDATA* aspcur;
1522 DWORD* aicur;
1523 PINT ajifRate;
1524 UINT cjSize;
1526 BOOL bResult = FALSE;
1527
1528 TRACE("Enter NtUserSetCursorIconData\n");
1529
1530 /* Initialize buffer, so we can handle cleanup */
1531 ustrRsrc.Buffer = NULL;
1532 ustrModule.Buffer = NULL;
1533 pvBuffer = NULL;
1534
1535 _SEH2_TRY
1536 {
1537 /* Probe and capture the cursor data structure */
1538 ProbeForRead(pCursorData, sizeof(*pCursorData), 1);
1539 cursordata = *pCursorData;
1540
1541 /* Check if this is an animated cursor */
1542 if (cursordata.CURSORF_flags & CURSORF_ACON)
1543 {
1544 /* Check of the range is ok */
1545 if ((cursordata.cpcur == 0) || (cursordata.cicur == 0) ||
1546 (cursordata.cpcur > 1000) || (cursordata.cicur > 1000))
1547 {
1548 ERR("Range error (cpcur = %u, cicur = %u)\n",
1549 cursordata.cpcur, cursordata.cicur);
1550 goto Exit;
1551 }
1552
1553 /* Calculate size: one cursor data structure for each frame,
1554 and a frame index and jiffies for each "step" */
1555 cjSize = (cursordata.cpcur * sizeof(CURSORDATA)) +
1556 (cursordata.cicur * sizeof(DWORD)) +
1557 (cursordata.cicur * sizeof(INT));
1558
1559 /* Allocate a buffer */
1561 if (pvBuffer == NULL)
1562 {
1563 ERR("Failed to allocate memory (cpcur = %u, cicur = %u)\n",
1564 cursordata.cpcur, cursordata.cicur);
1565 goto Exit;
1566 }
1567
1568 /* Calculate the kernel mode pointers */
1569 aspcur = (CURSORDATA*)pvBuffer;
1570 aicur = (DWORD*)&aspcur[cursordata.cpcur];
1571 ajifRate = (INT*)&aicur[cursordata.cicur];
1572
1573 /* Probe and copy aspcur */
1574 ProbeForRead(cursordata.aspcur, cursordata.cpcur * sizeof(CURSORDATA), 1);
1575 RtlCopyMemory(aspcur,
1576 cursordata.aspcur,
1577 cursordata.cpcur * sizeof(CURSORDATA));
1578
1579 /* Probe and copy aicur */
1580 ProbeForRead(cursordata.aicur, cursordata.cicur * sizeof(DWORD), 1);
1581 RtlCopyMemory(aicur,
1582 cursordata.aicur,
1583 cursordata.cicur * sizeof(DWORD));
1584
1585 /* Probe and copy ajifRate */
1586 ProbeForRead(cursordata.ajifRate, cursordata.cicur * sizeof(INT), 1);
1587 RtlCopyMemory(ajifRate,
1588 cursordata.ajifRate,
1589 cursordata.cicur * sizeof(INT));
1590
1591 /* Set the new pointers */
1592 cursordata.aspcur = aspcur;
1593 cursordata.aicur = aicur;
1594 cursordata.ajifRate = ajifRate;
1595 }
1596 else
1597 {
1598 /* This is a standard cursor, we don't use the pointers */
1599 cursordata.aspcur = NULL;
1600 cursordata.aicur = NULL;
1601 cursordata.ajifRate = NULL;
1602 }
1603 }
1605 {
1607 goto Exit;
1608 }
1609 _SEH2_END
1610
1611 /* Check if we got a module name */
1612 if (pustrModule != NULL)
1613 {
1614 /* Capture the name */
1615 status = ProbeAndCaptureUnicodeString(&ustrModule, UserMode, pustrModule);
1616 if (!NT_SUCCESS(status))
1617 {
1618 ERR("Failed to copy pustrModule: status 0x%08lx\n", status);
1619 goto Exit;
1620 }
1621 }
1622
1623 /* Check if we got a resource name */
1624 if (pustrRsrc != NULL)
1625 {
1626 /* We use this function, because INTRESOURCEs and ATOMs are the same */
1627 status = ProbeAndCaptureUnicodeStringOrAtom(&ustrRsrc, pustrRsrc);
1628 if (!NT_SUCCESS(status))
1629 {
1630 ERR("Failed to copy pustrRsrc: status 0x%08lx\n", status);
1631 goto Exit;
1632 }
1633 }
1634
1635 /* Make sure the caller doesn't give us invalid flags */
1636 if (cursordata.CURSORF_flags & ~CURSORF_USER_MASK)
1637 {
1638 ERR("Invalid cursor flags: 0x%08lx\n", cursordata.CURSORF_flags);
1639 goto Exit;
1640 }
1641
1642 /* Acquire the global user lock */
1644
1645 /* Call the internal function */
1646 bResult = UserSetCursorIconData(hcursor,
1647 pustrModule ? &ustrModule : NULL,
1648 pustrRsrc ? &ustrRsrc : NULL,
1649 &cursordata);
1650
1651 /* Release the global user lock */
1652 UserLeave();
1653
1654Exit:
1655
1656 /* Free the captured module name */
1657 if ((ustrModule.Buffer != NULL) && !IS_INTRESOURCE(ustrModule.Buffer))
1658 {
1660 }
1661
1662 if (pvBuffer != NULL)
1663 {
1665 }
1666
1667 /* Additional cleanup on failure */
1668 if (bResult == FALSE)
1669 {
1670 if ((ustrRsrc.Buffer != NULL) &&
1671 !IS_INTRESOURCE(ustrRsrc.Buffer))
1672 {
1674 }
1675 }
1676
1677 TRACE("Leave NtUserSetCursorIconData, bResult = %i\n", bResult);
1678
1679 return bResult;
1680}
#define CURSORF_USER_MASK
Definition: cursoricon.h:6
struct tagCURSORDATA CURSORDATA
int * PINT
Definition: minwindef.h:150
#define _SEH2_VOLATILE
Definition: pseh2_64.h:208
Definition: ps.c:97
DWORD * aicur
Definition: ntuser.h:1193
INT * ajifRate
Definition: ntuser.h:1194
ULONG CURSORF_flags
Definition: ntuser.h:1179
UINT cpcur
Definition: ntuser.h:1190
UINT cicur
Definition: ntuser.h:1191
struct tagCURSORDATA * aspcur
Definition: ntuser.h:1192
BOOL APIENTRY UserSetCursorIconData(_In_ HCURSOR hcursor, _In_opt_ PUNICODE_STRING pustrModule, _In_opt_ PUNICODE_STRING pustrRsrc, _In_ PCURSORDATA pcursordata)
Definition: cursoricon.c:1421
#define USERTAG_CURSOR
Definition: tags.h:209
_In_ ULONG cjSize
Definition: winddi.h:3634

Referenced by CreateIconFromResourceEx(), CreateIconIndirect(), CURSORICON_CopyImage(), CURSORICON_LoadFromFileW(), and CURSORICON_LoadImageW().

◆ NtUserSetDbgTag()

DWORD NTAPI NtUserSetDbgTag ( DWORD  Unknown0,
DWORD  Unknown1 
)

Definition at line 235 of file ntstubs.c.

238{
239 STUB;
240
241 return 0;
242}

◆ NtUserSetDbgTagCount()

DWORD APIENTRY NtUserSetDbgTagCount ( DWORD  Unknown0)

Definition at line 246 of file ntstubs.c.

248{
249 STUB;
250
251 return 0;
252}

◆ NtUserSetFocus()

HWND NTAPI NtUserSetFocus ( HWND  hWnd)

Definition at line 1717 of file focus.c.

1718{
1719 PWND Window;
1721 HWND ret = NULL;
1722
1723 TRACE("Enter NtUserSetFocus(%p)\n", hWnd);
1725
1726 if (hWnd)
1727 {
1729 {
1730 ERR("NtUserSetFocus: Invalid handle 0x%p!\n",hWnd);
1731 goto Exit; // Return NULL
1732 }
1733
1734 UserRefObjectCo(Window, &Ref);
1737 }
1738 else
1739 {
1741 }
1742
1743Exit:
1744 TRACE("Leave NtUserSetFocus, ret=%p\n", ret);
1745 UserLeave();
1746 return ret;
1747}
HWND FASTCALL co_UserSetFocus(PWND Window)
Definition: focus.c:1311

Referenced by SetFocus().

◆ NtUserSetImeHotKey()

BOOL NTAPI NtUserSetImeHotKey ( _In_ DWORD  dwHotKeyId,
_In_ UINT  uModifiers,
_In_ UINT  uVirtualKey,
_In_opt_ HKL  hKL,
_In_ DWORD  dwAction 
)

Definition at line 478 of file ime.c.

484{
485 BOOL ret;
487 ret = IntSetImeHotKey(dwHotKeyId, uModifiers, uVirtualKey, hKL, dwAction);
488 UserLeave();
489 return ret;
490}
static BOOL APIENTRY IntSetImeHotKey(_In_ DWORD dwHotKeyId, _In_ UINT uModifiers, _In_ UINT uVirtualKey, _In_opt_ HKL hKL, _In_ DWORD dwAction)
Definition: ime.c:357

Referenced by CliImmInitializeHotKeys(), and CliImmSetHotKeyWorker().

◆ NtUserSetImeInfoEx()

BOOL NTAPI NtUserSetImeInfoEx ( _In_ const IMEINFOEX pImeInfoEx)

Definition at line 1210 of file ime.c.

1211{
1212 BOOL ret = FALSE;
1213 IMEINFOEX ImeInfoEx;
1214 PWINSTATION_OBJECT pWinSta;
1215
1217
1218 if (!IS_IMM_MODE())
1219 {
1220 ERR("!IS_IMM_MODE()\n");
1221 goto Quit;
1222 }
1223
1224 _SEH2_TRY
1225 {
1226 ProbeForRead(pImeInfoEx, sizeof(*pImeInfoEx), 1);
1227 ImeInfoEx = *pImeInfoEx;
1228 }
1230 {
1231 ERR("Exception in NtUserSetImeInfoEx: pImeInfoEx=%p\n", pImeInfoEx);
1232 _SEH2_YIELD(goto Quit);
1233 }
1234 _SEH2_END;
1235
1237 ret = UserSetImeInfoEx(pWinSta, &ImeInfoEx);
1238
1239Quit:
1240 UserLeave();
1241 return ret;
1242}
BOOL FASTCALL UserSetImeInfoEx(_Inout_ PWINSTATION_OBJECT pWinSta, _Inout_ PIMEINFOEX pImeInfoEx)
Definition: ime.c:1170

Referenced by Imm32LoadIME().

◆ NtUserSetImeOwnerWindow()

BOOL NTAPI NtUserSetImeOwnerWindow ( _In_ HWND  hImeWnd,
_In_opt_ HWND  hwndFocus 
)

Definition at line 1446 of file ime.c.

1449{
1450 BOOL ret = FALSE;
1451 PWND pImeWnd, pwndFocus, pwndTopLevel, pwndNode, pwndActive;
1452 PTHREADINFO ptiIme;
1453
1455
1456 if (!IS_IMM_MODE())
1457 {
1458 ERR("!IS_IMM_MODE()\n");
1459 goto Quit;
1460 }
1461
1462 pImeWnd = ValidateHwndNoErr(hImeWnd);
1463 if (!pImeWnd || pImeWnd->fnid != FNID_IME)
1464 {
1465 ERR("Not IME window: %p\n", hImeWnd);
1466 goto Quit;
1467 }
1468
1469 pwndFocus = ValidateHwndNoErr(hwndFocus);
1470 if (pwndFocus)
1471 {
1472 if (IS_WND_IMELIKE(pwndFocus))
1473 goto Quit;
1474
1475 pwndTopLevel = IntGetTopLevelWindow(pwndFocus);
1476
1477 for (pwndNode = pwndTopLevel; pwndNode; pwndNode = pwndNode->spwndOwner)
1478 {
1479 if (pwndNode->pcls->atomClassName == gpsi->atomSysClass[ICLS_IME])
1480 {
1481 pwndTopLevel = NULL;
1482 break;
1483 }
1484 }
1485
1486 WndSetOwner(pImeWnd, pwndTopLevel);
1487 IntImeCheckTopmost(pImeWnd);
1488 }
1489 else
1490 {
1491 ptiIme = pImeWnd->head.pti;
1492 pwndActive = ptiIme->MessageQueue->spwndActive;
1493
1494 if (!pwndActive || pwndActive != pImeWnd->spwndOwner)
1495 {
1496 if (pwndActive && ptiIme == pwndActive->head.pti && !IS_WND_IMELIKE(pwndActive))
1497 {
1498 WndSetOwner(pImeWnd, pwndActive);
1499 }
1500 else
1501 {
1502 IntImeSetFutureOwner(pImeWnd, pImeWnd->spwndOwner);
1503 }
1504
1505 IntImeCheckTopmost(pImeWnd);
1506 }
1507 }
1508
1509 ret = TRUE;
1510
1511Quit:
1512 UserLeave();
1513 return ret;
1514}
#define ICLS_IME
Definition: ntuser.h:927
#define FNID_IME
Definition: ntuser.h:874
static VOID FASTCALL IntImeCheckTopmost(_In_ PWND pImeWnd)
Definition: ime.c:1430
PWND FASTCALL IntGetTopLevelWindow(_In_ PWND pwnd)
Definition: ime.c:516
VOID FASTCALL IntImeSetFutureOwner(PWND pImeWnd, PWND pwndOwner)
Definition: ime.c:1246
static VOID WndSetOwner(_Inout_ PWND pwnd, _In_opt_ PWND pwndOwner)
Definition: window.h:150
#define IS_WND_IMELIKE(pWnd)
Definition: window.h:114

Referenced by ImeWnd_OnImeSetContext().

◆ NtUserSetInformationProcess()

DWORD NTAPI NtUserSetInformationProcess ( DWORD  dwUnknown1,
DWORD  dwUnknown2,
DWORD  dwUnknown3,
DWORD  dwUnknown4 
)

Definition at line 658 of file ntstubs.c.

663{
664 STUB;
665 return 0;
666}

◆ NtUserSetInformationThread()

NTSTATUS NTAPI NtUserSetInformationThread ( IN HANDLE  ThreadHandle,
IN USERTHREADINFOCLASS  ThreadInformationClass,
IN PVOID  ThreadInformation,
IN ULONG  ThreadInformationLength 
)

Definition at line 673 of file ntstubs.c.

677{
680
681 /* Allow only CSRSS to perform this operation */
684
686
687 /* Get the Thread */
688 Status = ObReferenceObjectByHandle(ThreadHandle,
691 UserMode,
692 (PVOID)&Thread,
693 NULL);
694 if (!NT_SUCCESS(Status)) goto Quit;
695
697 {
699 {
700 ULONG CapturedFlags = 0;
701
702 TRACE("Shutdown initiated\n");
703
704 if (ThreadInformationLength != sizeof(CapturedFlags))
705 {
707 break;
708 }
709
710 /* Capture the caller value */
713 {
714 ProbeForWrite(ThreadInformation, sizeof(CapturedFlags), __alignof(CapturedFlags));
715 CapturedFlags = *(PULONG)ThreadInformation;
716 }
718 {
720 _SEH2_YIELD(break);
721 }
722 _SEH2_END;
723
724 Status = UserInitiateShutdown(Thread, &CapturedFlags);
725
726 /* Return the modified value to the caller */
728 {
729 *(PULONG)ThreadInformation = CapturedFlags;
730 }
732 {
734 }
735 _SEH2_END;
736
737 break;
738 }
739
741 {
742 NTSTATUS ShutdownStatus;
743
744 TRACE("Shutdown ended\n");
745
746 if (ThreadInformationLength != sizeof(ShutdownStatus))
747 {
749 break;
750 }
751
752 /* Capture the caller value */
755 {
756 ProbeForRead(ThreadInformation, sizeof(ShutdownStatus), __alignof(ShutdownStatus));
757 ShutdownStatus = *(NTSTATUS*)ThreadInformation;
758 }
760 {
762 _SEH2_YIELD(break);
763 }
764 _SEH2_END;
765
766 Status = UserEndShutdown(Thread, ShutdownStatus);
767 break;
768 }
769
771 {
772 HANDLE CsrPortHandle;
773
774
775 TRACE("Set CSR API Port for Win32k\n");
776 if (ThreadInformationLength != sizeof(CsrPortHandle))
777 {
779 break;
780 }
781
782 /* Capture the caller value */
785 {
786 ProbeForRead(ThreadInformation, sizeof(CsrPortHandle), __alignof(CsrPortHandle));
787 CsrPortHandle = *(PHANDLE)ThreadInformation;
788 }
790 {
792 _SEH2_YIELD(break);
793 }
794 _SEH2_END;
795
796 Status = InitCsrApiPort(CsrPortHandle);
797 break;
798 }
799
801 {
802 HDESK hdesk;
803
804 if (Thread != PsGetCurrentThread())
805 {
807 break;
808 }
809
812
813 break;
814 }
816 {
817 if (Thread != PsGetCurrentThread())
818 {
820 break;
821 }
822
824 break;
825 }
826 default:
827 {
828 STUB;
830 break;
831 }
832 }
833
835
836Quit:
837 UserLeave();
838 return Status;
839}
NTSTATUS InitCsrApiPort(IN HANDLE CsrPortHandle)
Definition: csr.c:38
_In_ THREADINFOCLASS _In_ ULONG ThreadInformationLength
Definition: psfuncs.h:844
#define THREAD_SET_INFORMATION
Definition: nt_native.h:1340
HDESK FASTCALL IntGetDesktopObjectHandle(PDESKTOP DesktopObject)
Definition: desktop.c:1288
uint32_t * PULONG
Definition: typedefs.h:59
BOOL IntSetThreadDesktop(IN HDESK hDesktop, IN BOOL FreeOnFailure)
Definition: desktop.c:3293
NTSTATUS UserEndShutdown(IN PETHREAD Thread, IN NTSTATUS ShutdownStatus)
Definition: shutdown.c:290
NTSTATUS UserInitiateShutdown(IN PETHREAD Thread, IN OUT PULONG pFlags)
Definition: shutdown.c:166

Referenced by CSR_API(), EndNowThreadProc(), UserClientConnect(), UserExitReactOS(), and UserServerHardError().

◆ NtUserSetInternalWindowPos()

DWORD NTAPI NtUserSetInternalWindowPos ( HWND  hwnd,
UINT  showCmd,
LPRECT  rect,
LPPOINT  pt 
)

Definition at line 3680 of file winpos.c.

3685{
3686 WINDOWPLACEMENT wndpl;
3687 UINT flags;
3688 PWND Wnd;
3689 RECT rect;
3690 POINT pt = {0};
3691 BOOL Ret = FALSE;
3693
3694 TRACE("Enter NtUserSetWindowPlacement\n");
3696
3697 if (!(Wnd = UserGetWindowObject(hwnd)) || // FIXME:
3699 {
3700 goto Exit; // Return FALSE
3701 }
3702
3703 _SEH2_TRY
3704 {
3705 if (lppt)
3706 {
3707 ProbeForRead(lppt, sizeof(POINT), 1);
3708 RtlCopyMemory(&pt, lppt, sizeof(POINT));
3709 }
3710 if (lprect)
3711 {
3712 ProbeForRead(lprect, sizeof(RECT), 1);
3713 RtlCopyMemory(&rect, lprect, sizeof(RECT));
3714 }
3715 }
3717 {
3719 _SEH2_YIELD(goto Exit); // Return FALSE
3720 }
3721 _SEH2_END
3722
3723 wndpl.length = sizeof(wndpl);
3724 wndpl.showCmd = showCmd;
3725 wndpl.flags = flags = 0;
3726
3727 if ( lppt )
3728 {
3729 flags |= PLACE_MIN;
3730 wndpl.flags |= WPF_SETMINPOSITION;
3731 wndpl.ptMinPosition = pt;
3732 }
3733 if ( lprect )
3734 {
3735 flags |= PLACE_RECT;
3736 wndpl.rcNormalPosition = rect;
3737 }
3738
3739 UserRefObjectCo(Wnd, &Ref);
3740 IntSetWindowPlacement(Wnd, &wndpl, flags);
3741 UserDerefObjectCo(Wnd);
3742 Ret = TRUE;
3743
3744Exit:
3745 TRACE("Leave NtUserSetWindowPlacement, ret=%i\n", Ret);
3746 UserLeave();
3747 return Ret;
3748}
BOOL FASTCALL IntSetWindowPlacement(PWND Wnd, WINDOWPLACEMENT *wpl, UINT Flags)
Definition: winpos.c:671
#define PLACE_RECT
Definition: winpos.c:32
#define PLACE_MIN
Definition: winpos.c:30
#define WPF_SETMINPOSITION
Definition: winuser.h:2569

◆ NtUserSetKeyboardState()

BOOL NTAPI NtUserSetKeyboardState ( LPBYTE  lpKeyState)

Definition at line 2616 of file msgqueue.c.

2617{
2618 UINT i;
2619 BOOL bRet = TRUE;
2620 PTHREADINFO pti;
2621 PUSER_MESSAGE_QUEUE MessageQueue;
2622
2624
2626 MessageQueue = pti->MessageQueue;
2627
2628 _SEH2_TRY
2629 {
2630 ProbeForRead(pKeyState, 256 * sizeof(BYTE), 1);
2631 for (i = 0; i < 256; ++i)
2632 {
2633 SET_KEY_DOWN(MessageQueue->afKeyState, i, pKeyState[i] & KS_DOWN_BIT);
2634 SET_KEY_LOCKED(MessageQueue->afKeyState, i, pKeyState[i] & KS_LOCK_BIT);
2635 }
2636 }
2638 {
2640 bRet = FALSE;
2641 }
2642 _SEH2_END;
2643
2644 UserLeave();
2645
2646 return bRet;
2647}
#define SET_KEY_DOWN(ks, vk, down)
Definition: input.h:104
#define SET_KEY_LOCKED(ks, vk, down)
Definition: input.h:107

Referenced by SetKeyboardState().

◆ NtUserSetLayeredWindowAttributes()

BOOL NTAPI NtUserSetLayeredWindowAttributes ( HWND  hwnd,
COLORREF  crKey,
BYTE  bAlpha,
DWORD  dwFlags 
)

Definition at line 311 of file layered.c.

315{
316 PWND pWnd;
317 BOOL Ret = FALSE;
318
319 TRACE("Enter NtUserSetLayeredWindowAttributes\n");
321
322 if (!(pWnd = UserGetWindowObject(hwnd)) ||
323 !(pWnd->ExStyle & WS_EX_LAYERED) )
324 {
325 ERR("Not a Layered Window!\n");
326 goto Exit;
327 }
328
329 Ret = IntSetLayeredWindowAttributes(pWnd, crKey, bAlpha, dwFlags);
330Exit:
331 TRACE("Leave NtUserSetLayeredWindowAttributes, ret=%i\n", Ret);
332 UserLeave();
333 return Ret;
334}
BOOL FASTCALL IntSetLayeredWindowAttributes(PWND pWnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags)
Definition: layered.c:46

◆ NtUserSetLogonNotifyWindow()

BOOL NTAPI NtUserSetLogonNotifyWindow ( HWND  hWnd)

Definition at line 1963 of file winsta.c.

1964{
1965 BOOL Ret = FALSE;
1966
1968
1969 if (!IntIsWindow(hWnd))
1970 goto Leave;
1971
1973 {
1975 goto Leave;
1976 }
1977
1978 hwndSAS = hWnd;
1979 Ret = TRUE;
1980
1981Leave:
1982 UserLeave();
1983 return Ret;
1984}

Referenced by SetLogonNotifyWindow().

◆ NtUserSetMenu()

BOOL NTAPI NtUserSetMenu ( HWND  hWnd,
HMENU  hMenu,
BOOL  bRepaint 
)

Definition at line 6424 of file menu.c.

6428{
6429 PWND Window;
6430 BOOL Changed;
6431 BOOL Ret = FALSE;
6432
6433 TRACE("Enter NtUserSetMenu\n");
6435
6437 {
6438 goto Exit; // Return FALSE
6439 }
6440
6441 if (!IntSetMenu(Window, Menu, &Changed))
6442 {
6443 goto Exit; // Return FALSE
6444 }
6445
6446 // Not minimized and please repaint!!!
6447 if (!(Window->style & WS_MINIMIZE) && (Repaint || Changed))
6448 {
6450 UserRefObjectCo(Window, &Ref);
6453 }
6454
6455 Ret = TRUE;
6456
6457Exit:
6458 UserLeave();
6459 TRACE("Leave NtUserSetMenu, ret=%i\n", Ret);
6460 return Ret;
6461}
BOOL FASTCALL IntSetMenu(PWND Wnd, HMENU Menu, BOOL *Changed)
Definition: menu.c:5485

Referenced by SetMenu().

◆ NtUserSetMenuContextHelpId()

BOOL NTAPI NtUserSetMenuContextHelpId ( HMENU  hmenu,
DWORD  dwContextHelpId 
)

Definition at line 6467 of file menu.c.

6470{
6471 PMENU Menu;
6472 BOOL Ret = FALSE;
6473
6474 TRACE("Enter NtUserSetMenuContextHelpId\n");
6476
6477 Menu = UserGetMenuObject(hMenu);
6478 if (Menu)
6479 {
6480 Ret = IntSetMenuContextHelpId(Menu, dwContextHelpId);
6481 }
6482
6483 UserLeave();
6484 TRACE("Leave NtUserSetMenuContextHelpId, ret=%i\n", Ret);
6485 return Ret;
6486}
BOOL FASTCALL IntSetMenuContextHelpId(PMENU Menu, DWORD dwContextHelpId)
Definition: menu.c:872

Referenced by SetMenuContextHelpId().

◆ NtUserSetMenuDefaultItem()

BOOL NTAPI NtUserSetMenuDefaultItem ( HMENU  hMenu,
UINT  uItem,
UINT  fByPos 
)

Definition at line 6492 of file menu.c.

6496{
6497 PMENU Menu;
6498 BOOL Ret = FALSE;
6499
6500 TRACE("Enter NtUserSetMenuDefaultItem\n");
6502
6503 Menu = UserGetMenuObject(hMenu);
6504 if (Menu)
6505 {
6506 Ret = UserSetMenuDefaultItem(Menu, uItem, fByPos);
6507 }
6508
6509 UserLeave();
6510 TRACE("Leave NtUserSetMenuDefaultItem, ret=%i\n", Ret);
6511 return Ret;
6512}
BOOL FASTCALL UserSetMenuDefaultItem(PMENU MenuObject, UINT uItem, UINT fByPos)
Definition: menu.c:1274

Referenced by SetMenuDefaultItem().

◆ NtUserSetMenuFlagRtoL()

BOOL NTAPI NtUserSetMenuFlagRtoL ( HMENU  hMenu)

Definition at line 6518 of file menu.c.

6520{
6521 PMENU Menu;
6522 BOOL Ret = FALSE;
6523
6524 TRACE("Enter NtUserSetMenuFlagRtoL\n");
6526
6527 Menu = UserGetMenuObject(hMenu);
6528 if (Menu)
6529 {
6530 Ret = IntSetMenuFlagRtoL(Menu);
6531 }
6532
6533 UserLeave();
6534 TRACE("Leave NtUserSetMenuFlagRtoL, ret=%i\n", Ret);
6535 return Ret;
6536}
BOOL FASTCALL IntSetMenuFlagRtoL(PMENU Menu)
Definition: menu.c:864

◆ NtUserSetObjectInformation()

BOOL NTAPI NtUserSetObjectInformation ( HANDLE  hObject,
DWORD  nIndex,
PVOID  pvInformation,
DWORD  nLength 
)

Definition at line 1349 of file winsta.c.

1354{
1355 /* FIXME: ZwQueryObject */
1356 /* FIXME: ZwSetInformationObject */
1358 return FALSE;
1359}

◆ NtUserSetParent()

HWND NTAPI NtUserSetParent ( HWND  hWndChild,
HWND  hWndNewParent 
)

Definition at line 3658 of file window.c.

3659{
3660 HWND Ret;
3661
3662 TRACE("Enter NtUserSetParent\n");
3664
3665 /*
3666 Check Parent first from user space, set it here.
3667 */
3668 if (!hWndNewParent)
3669 {
3670 hWndNewParent = IntGetDesktopWindow();
3671 }
3672 else if (hWndNewParent == HWND_MESSAGE)
3673 {
3674 hWndNewParent = IntGetMessageWindow();
3675 }
3676
3677 Ret = co_UserSetParent(hWndChild, hWndNewParent);
3678
3679 TRACE("Leave NtUserSetParent, ret=%p\n", Ret);
3680 UserLeave();
3681 return Ret;
3682}
HWND hWndChild[NUM_TABS]
Definition: main.h:74
HWND FASTCALL co_UserSetParent(HWND hWndChild, HWND hWndNewParent)
Definition: window.c:1295

Referenced by SetParent().

◆ NtUserSetProcessWindowStation()

BOOL NTAPI NtUserSetProcessWindowStation ( HWINSTA  hWindowStation)

Definition at line 1528 of file winsta.c.

1529{
1530 BOOL ret;
1531
1533
1534 ret = UserSetProcessWindowStation(hWindowStation);
1535
1536 UserLeave();
1537
1538 return ret;
1539}
BOOL FASTCALL UserSetProcessWindowStation(HWINSTA hWindowStation)
Definition: winsta.c:1392

Referenced by SetProcessWindowStation().

◆ NtUserSetProp()

BOOL NTAPI NtUserSetProp ( HWND  hWnd,
ATOM  Atom,
HANDLE  Data 
)

◆ NtUserSetRipFlags()

DWORD NTAPI NtUserSetRipFlags ( DWORD  Unknown0)

Definition at line 256 of file ntstubs.c.

258{
259 STUB;
260
261 return 0;
262}

◆ NtUserSetScrollBarInfo()

BOOL NTAPI NtUserSetScrollBarInfo ( HWND  hwnd,
LONG  idObject,
SETSCROLLBARINFO info 
)

Definition at line 1408 of file scrollbar.c.

1412{
1413 PWND Window = NULL;
1414 SETSCROLLBARINFO Safeinfo;
1416 LPSCROLLINFO psi;
1418 LONG Obj;
1419 BOOL Ret = FALSE;
1421
1422 TRACE("Enter NtUserSetScrollBarInfo\n");
1424
1426 goto Cleanup; // Return FALSE
1427
1428 UserRefObjectCo(Window, &Ref);
1429
1430 Obj = SBOBJ_TO_SBID(idObject);
1431 if(!SBID_IS_VALID(Obj))
1432 {
1434 ERR("Trying to set scrollinfo for unknown scrollbar type %d\n", Obj);
1435 goto Cleanup; // Return FALSE
1436 }
1437
1439 goto Cleanup; // Return FALSE
1440
1441 Status = MmCopyFromCaller(&Safeinfo, info, sizeof(SETSCROLLBARINFO));
1442 if(!NT_SUCCESS(Status))
1443 {
1445 goto Cleanup; // Return FALSE
1446 }
1447
1450
1451 psi->nTrackPos = Safeinfo.nTrackPos;
1452 sbi->reserved = Safeinfo.reserved;
1453 RtlCopyMemory(&sbi->rgstate, &Safeinfo.rgstate, sizeof(Safeinfo.rgstate));
1454
1455 Ret = TRUE;
1456
1457Cleanup:
1458 if (Window)
1460
1461 TRACE("Leave NtUserSetScrollBarInfo, ret=%i\n", Ret);
1462 UserLeave();
1463 return Ret;
1464}
#define IntGetScrollInfoFromWindow(Window, i)
Definition: scroll.h:36
#define SBOBJ_TO_SBID(Obj)
Definition: scroll.h:39
DWORD rgstate[CCHILDREN_SCROLLBAR+1]
Definition: ntuser.h:3649

Referenced by IntScrollHandleScrollEvent(), and IntUpdateScrollArrows().

◆ NtUserSetScrollInfo()

DWORD NTAPI NtUserSetScrollInfo ( HWND  hwnd,
int  fnBar,
LPCSCROLLINFO  lpsi,
BOOL  bRedraw 
)

Definition at line 1342 of file scrollbar.c.

1347{
1348 PWND Window = NULL;
1350 SCROLLINFO ScrollInfo;
1351 DWORD Ret = 0;
1353
1354 TRACE("Enter NtUserSetScrollInfo\n");
1356
1358 goto Cleanup; // Return 0
1359
1360 UserRefObjectCo(Window, &Ref);
1361
1362 Status = MmCopyFromCaller(&ScrollInfo, lpsi, sizeof(SCROLLINFO) - sizeof(ScrollInfo.nTrackPos));
1363 if(!NT_SUCCESS(Status))
1364 {
1366 goto Cleanup; // Return 0
1367 }
1368
1369 Ret = co_IntSetScrollInfo(Window, fnBar, &ScrollInfo, bRedraw);
1370
1371Cleanup:
1372 if (Window)
1374
1375 TRACE("Leave NtUserSetScrollInfo, ret=%lu\n", Ret);
1376 UserLeave();
1377 return Ret;
1378}
static DWORD FASTCALL co_IntSetScrollInfo(PWND Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
Definition: scrollbar.c:455

Referenced by IntScrollCreateScrollBar(), IntSetScrollInfo(), and RealSetScrollInfo().

◆ NtUserSetShellWindowEx()

BOOL NTAPI NtUserSetShellWindowEx ( HWND  hwndShell,
HWND  hwndShellListView 
)

Definition at line 3725 of file window.c.

3726{
3727 PWINSTATION_OBJECT WinStaObject;
3728 PWND WndShell, WndListView;
3729 BOOL Ret = FALSE;
3732 PTHREADINFO ti;
3733
3734 TRACE("Enter NtUserSetShellWindowEx\n");
3736
3737 if (!(WndShell = UserGetWindowObject(hwndShell)))
3738 {
3739 goto Exit; // Return FALSE
3740 }
3741
3742 if (!(WndListView = UserGetWindowObject(hwndListView)))
3743 {
3744 goto Exit; // Return FALSE
3745 }
3746
3748 UserMode,
3749 0,
3750 &WinStaObject,
3751 0);
3752
3753 if (!NT_SUCCESS(Status))
3754 {
3756 goto Exit; // Return FALSE
3757 }
3758
3759 /*
3760 * Test if we are permitted to change the shell window.
3761 */
3762 if (WinStaObject->ShellWindow)
3763 {
3764 ObDereferenceObject(WinStaObject);
3765 goto Exit; // Return FALSE
3766 }
3767
3768 /*
3769 * Move shell window into background.
3770 */
3771 if (hwndListView && hwndListView != hwndShell)
3772 {
3773 /*
3774 * Disabled for now to get Explorer working.
3775 * -- Filip, 01/nov/2003
3776 */
3777#if 0
3779#endif
3780
3781 if (WndListView->ExStyle & WS_EX_TOPMOST)
3782 {
3783 ObDereferenceObject(WinStaObject);
3784 goto Exit; // Return FALSE
3785 }
3786 }
3787
3788 if (WndShell->ExStyle & WS_EX_TOPMOST)
3789 {
3790 ObDereferenceObject(WinStaObject);
3791 goto Exit; // Return FALSE
3792 }
3793
3794 UserRefObjectCo(WndShell, &Ref);
3795 WndShell->state2 |= WNDS2_BOTTOMMOST;
3797
3798 WinStaObject->ShellWindow = hwndShell;
3799 WinStaObject->ShellListView = hwndListView;
3800
3801 ti = GetW32ThreadInfo();
3802 if (ti->pDeskInfo)
3803 {
3804 ti->pDeskInfo->hShellWindow = hwndShell;
3805 ti->pDeskInfo->spwndShell = WndShell;
3806 ti->pDeskInfo->spwndBkGnd = WndListView;
3807 ti->pDeskInfo->ppiShellProcess = ti->ppi;
3808 }
3809
3811
3812 UserDerefObjectCo(WndShell);
3813
3814 ObDereferenceObject(WinStaObject);
3815 Ret = TRUE;
3816
3817Exit:
3818 TRACE("Leave NtUserSetShellWindowEx, ret=%i\n", Ret);
3819 UserLeave();
3820 return Ret;
3821}
HWND hwndListView
Definition: eventvwr.c:66
#define WNDS2_BOTTOMMOST
Definition: ntuser.h:646
HANDLE ShellListView
Definition: winsta.h:44
HANDLE ShellWindow
Definition: winsta.h:43
#define SC_TASKLIST
Definition: winuser.h:2635

Referenced by SetShellWindow(), and SetShellWindowEx().

◆ NtUserSetSysColors()

BOOL NTAPI NtUserSetSysColors ( int  cElements,
IN CONST INT lpaElements,
IN CONST COLORREF lpaRgbValues,
FLONG  Flags 
)

Definition at line 288 of file ntstubs.c.

293{
294 DWORD Ret = TRUE;
295
296 if (cElements == 0)
297 return TRUE;
298
299 /* We need this check to prevent overflow later */
300 if ((ULONG)cElements >= 0x40000000)
301 {
303 return FALSE;
304 }
305
307
309 {
310 ProbeForRead(lpaElements, cElements * sizeof(INT), 1);
311 ProbeForRead(lpaRgbValues, cElements * sizeof(COLORREF), 1);
312
313 IntSetSysColors(cElements, lpaElements, lpaRgbValues);
314 }
316 {
318 Ret = FALSE;
319 }
320 _SEH2_END;
321
322 if (Ret)
323 {
325
327 }
328
329 UserLeave();
330 return Ret;
331}
VOID FASTCALL IntSetSysColors(UINT nColors, CONST INT *Elements, CONST COLORREF *Colors)
Definition: stockobj.c:300
VOID APIENTRY UserRedrawDesktop(VOID)
Definition: desktop.c:1611
DWORD COLORREF
Definition: windef.h:100
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1654

Referenced by SetSysColors().

◆ NtUserSetSystemCursor()

BOOL NTAPI NtUserSetSystemCursor ( HCURSOR  hcur,
DWORD  id 
)

Definition at line 2203 of file cursoricon.c.

2206{
2207 PCURICON_OBJECT pcur, pcurOrig = NULL;
2208 int i;
2209 PPROCESSINFO ppi;
2210 BOOL Ret = FALSE;
2212
2214 {
2215 goto Exit;
2216 }
2217
2218 if (hcur)
2219 {
2220 pcur = UserGetCurIconObject(hcur);
2221 if (!pcur)
2222 {
2224 goto Exit;
2225 }
2226
2228
2229 for (i = 0 ; i < 16; i++)
2230 {
2231 if (gasyscur[i].type == id)
2232 {
2233 pcurOrig = gasyscur[i].handle;
2234
2235 if (pcurOrig) break;
2236
2237 if (ppi->W32PF_flags & W32PF_CREATEDWINORDC)
2238 {
2239 gasyscur[i].handle = pcur;
2241 pcur->head.ppi = NULL;
2243 Ret = TRUE;
2244 }
2245 break;
2246 }
2247 }
2248 if (pcurOrig)
2249 {
2250 FIXME("Need to copy cursor data or do something! pcurOrig %p new pcur %p\n",pcurOrig,pcur);
2251 }
2252 }
2253Exit:
2254 UserLeave();
2255 return Ret;
2256}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
BOOL FASTCALL CheckWinstaAttributeAccess(ACCESS_MASK DesiredAccess)
Definition: winsta.c:388
PCURICON_OBJECT handle
Definition: cursoricon.h:99
#define W32PF_CREATEDWINORDC
Definition: win32.h:34
static VOID IntInsertCursorIntoList(_Inout_ PCURICON_OBJECT pcur)
Definition: cursoricon.c:80
SYSTEMCURICO gasyscur[]
Definition: cursoricon.c:32
#define WINSTA_WRITEATTRIBUTES
Definition: winuser.h:416

Referenced by LoadSystemCursors(), and SetSystemCursor().

◆ NtUserSetSystemMenu()

BOOL NTAPI NtUserSetSystemMenu ( HWND  hWnd,
HMENU  hMenu 
)

Definition at line 5720 of file menu.c.

5721{
5722 BOOL Result = FALSE;
5723 PWND Window;
5724 PMENU Menu;
5725
5726 TRACE("Enter NtUserSetSystemMenu\n");
5728
5730 {
5731 goto Exit; // Return FALSE
5732 }
5733
5734 if (hMenu)
5735 {
5736 /*
5737 * Assign new menu handle and Up the Lock Count.
5738 */
5739 if (!(Menu = IntGetMenuObject(hMenu)))
5740 {
5741 goto Exit; // Return FALSE
5742 }
5743
5745 }
5746 else
5748
5749Exit:
5750 UserLeave();
5751 TRACE("Leave NtUserSetSystemMenu, ret=%i\n", Result);
5752 return Result;
5753}
BOOL FASTCALL IntSetSystemMenu(PWND Window, PMENU Menu)
Definition: menu.c:5452

Referenced by SetSystemMenu().

◆ NtUserSetSystemTimer()

UINT_PTR NTAPI NtUserSetSystemTimer ( HWND  hWnd,
UINT_PTR  nIDEvent,
UINT  uElapse,
TIMERPROC  lpTimerFunc 
)

Definition at line 685 of file timer.c.

691{
693
695 TRACE("Enter NtUserSetSystemTimer\n");
696
697 ret = IntSetTimer(UserGetWindowObject(hWnd), nIDEvent, uElapse, NULL, TMRF_SYSTEM);
698
699 UserLeave();
700
701 TRACE("Leave NtUserSetSystemTimer, ret=%u\n", ret);
702 return ret;
703}

Referenced by SetSystemTimer().

◆ NtUserSetThreadDesktop()

BOOL NTAPI NtUserSetThreadDesktop ( HDESK  hDesktop)

Definition at line 3485 of file desktop.c.

3486{
3487 BOOL ret = FALSE;
3488
3490
3491 // FIXME: IntSetThreadDesktop validates the desktop handle, it should happen
3492 // here too and set the NT error level. Q. Is it necessary to have the validation
3493 // in IntSetThreadDesktop? Is it needed there too?
3494 if (hDesktop || (!hDesktop && PsGetCurrentProcess() == gpepCSRSS))
3495 ret = IntSetThreadDesktop(hDesktop, FALSE);
3496
3497 UserLeave();
3498
3499 return ret;
3500}

Referenced by SetThreadDesktop().

◆ NtUserSetThreadLayoutHandles()

DWORD NTAPI NtUserSetThreadLayoutHandles ( _In_ HKL  hNewKL,
_In_ HKL  hOldKL 
)

Definition at line 537 of file ime.c.

540{
541 PTHREADINFO pti;
542 PKL pOldKL, pNewKL;
543
545
546 pti = GetW32ThreadInfo();
547 pOldKL = pti->KeyboardLayout;
548 if (pOldKL && pOldKL->hkl != hOldKL)
549 goto Quit;
550
551 pNewKL = UserHklToKbl(hNewKL);
552 if (!pNewKL)
553 goto Quit;
554
555 if (IS_IME_HKL(hNewKL) != IS_IME_HKL(hOldKL))
556 pti->hklPrev = hOldKL;
557
558 UserAssignmentLock((PVOID*)&pti->KeyboardLayout, pNewKL);
559 pti->pClientInfo->hKL = pNewKL->hkl;
560
561Quit:
562 UserLeave();
563 return 0;
564}
PVOID FASTCALL UserAssignmentLock(PVOID *ppvObj, PVOID pvNew)
Definition: object.c:837

Referenced by ImmActivateLayout().

◆ NtUserSetThreadState()

DWORD NTAPI NtUserSetThreadState ( DWORD  Unknown0,
DWORD  Unknown1 
)

Definition at line 360 of file misc.c.

363{
364 PTHREADINFO pti;
365 DWORD Ret = 0;
366 // Test the only flags user can change.
371 if (pti->MessageQueue)
372 {
373 Ret = pti->MessageQueue->QF_flags; // Get the queue flags.
374 if (Set)
375 pti->MessageQueue->QF_flags |= (Set&Flags); // Set the queue flags.
376 else
377 {
378 if (Flags) pti->MessageQueue->QF_flags &= ~Flags; // Clr the queue flags.
379 }
380 }
381 UserLeave();
382 return Ret;
383}
#define QF_DIALOGACTIVE
Definition: msgqueue.h:106
#define QF_TABSWITCHING
Definition: msgqueue.h:101
#define QF_FMENUSTATUSBREAK
Definition: msgqueue.h:96
#define QF_FMENUSTATUS
Definition: msgqueue.h:97
#define QF_FF10STATUS
Definition: msgqueue.h:98
static BOOL Set
Definition: pageheap.c:10

Referenced by DEFDLG_Proc().

◆ NtUserSetTimer()

UINT_PTR NTAPI NtUserSetTimer ( HWND  hWnd,
UINT_PTR  nIDEvent,
UINT  uElapse,
TIMERPROC  lpTimerFunc 
)

Definition at line 635 of file timer.c.

642{
643 PWND Window = NULL;
645
646 TRACE("Enter NtUserSetTimer\n");
649
650 ret = IntSetTimer(Window, nIDEvent, uElapse, lpTimerFunc, TMRF_TIFROMWND);
651
652 UserLeave();
653 TRACE("Leave NtUserSetTimer, ret=%u\n", ret);
654
655 return ret;
656}
#define TMRF_TIFROMWND
Definition: timer.h:25

Referenced by SetTimer().

◆ NtUserSetWindowFNID()

BOOL NTAPI NtUserSetWindowFNID ( HWND  hWnd,
WORD  fnID 
)

Definition at line 4343 of file window.c.

4345{
4346 PWND Wnd;
4347 BOOL Ret = FALSE;
4348
4349 TRACE("Enter NtUserSetWindowFNID\n");
4351
4352 if (!(Wnd = UserGetWindowObject(hWnd)))
4353 {
4354 goto Exit; // Return FALSE
4355 }
4356
4357 if (Wnd->head.pti->ppi != PsGetCurrentProcessWin32Process())
4358 {
4360 goto Exit; // Return FALSE
4361 }
4362
4363 // From user land we only set these.
4364 if (fnID != FNID_DESTROY)
4365 {
4366 /* HACK: The minimum should be FNID_BUTTON, but menu code relies on this */
4367 if (fnID < FNID_FIRST || fnID > FNID_GHOST ||
4368 Wnd->fnid != 0)
4369 {
4371 goto Exit; // Return FALSE
4372 }
4373 }
4374
4375 Wnd->fnid |= fnID;
4376 Ret = TRUE;
4377
4378Exit:
4379 TRACE("Leave NtUserSetWindowFNID\n");
4380 UserLeave();
4381 return Ret;
4382}

Referenced by ButtonWndProc_common(), ComboWndProc_common(), EditWndProc_common(), Ghost_OnCreate(), Ghost_OnNCDestroy(), ImeWndProc_common(), ListBoxWndProc_common(), MDIClientWndProc_common(), MsgWindowProc(), ScrollBarWndProc_common(), StaticWndProc_common(), and SwitchWndProc_common().

◆ NtUserSetWindowLong()

LONG NTAPI NtUserSetWindowLong ( HWND  hWnd,
DWORD  Index,
LONG  NewValue,
BOOL  Ansi 
)

Definition at line 4056 of file window.c.

4057{
4058 LONG ret;
4059
4061
4062 if (hWnd == IntGetDesktopWindow())
4063 {
4065 UserLeave();
4066 return 0;
4067 }
4068
4069 ret = (LONG)co_IntSetWindowLongPtr(hWnd, Index, NewValue, Ansi, sizeof(LONG), FALSE);
4070
4071 UserLeave();
4072
4073 return ret;
4074}

Referenced by SetWindowLongA(), and SetWindowLongW().

◆ NtUserSetWindowPlacement()

BOOL NTAPI NtUserSetWindowPlacement ( HWND  hWnd,
WINDOWPLACEMENT lpwndpl 
)

Definition at line 3754 of file winpos.c.

3756{
3757 PWND Wnd;
3758 WINDOWPLACEMENT Safepl;
3759 UINT Flags;
3760 BOOL Ret = FALSE;
3762
3763 TRACE("Enter NtUserSetWindowPlacement\n");
3765
3766 _SEH2_TRY
3767 {
3768 ProbeForRead(lpwndpl, sizeof(*lpwndpl), 1);
3769 Safepl = *lpwndpl;
3770 }
3772 {
3774 _SEH2_YIELD(goto Exit); // Return FALSE
3775 }
3776 _SEH2_END
3777
3778 /* Backwards-compatibility: Win 3.x doesn't check the length */
3780 Safepl.length = sizeof(Safepl);
3781
3782 if (Safepl.length != sizeof(Safepl))
3783 {
3785 goto Exit;
3786 }
3787
3789 if (Safepl.flags & WPF_SETMINPOSITION)
3790 Flags |= PLACE_MIN;
3791
3793 if (!Wnd)
3794 goto Exit; // Return FALSE
3795
3796 UserRefObjectCo(Wnd, &Ref);
3797 if (!UserIsDesktopWindow(Wnd) && !UserIsMessageWindow(Wnd))
3798 Ret = IntSetWindowPlacement(Wnd, &Safepl, Flags);
3799 UserDerefObjectCo(Wnd);
3800
3801Exit:
3802 TRACE("Leave NtUserSetWindowPlacement, ret=%i\n", Ret);
3803 UserLeave();
3804 return Ret;
3805}
#define PLACE_MAX
Definition: winpos.c:31
DWORD dwExpWinVer
Definition: win32.h:112
#define WINVER_WINNT4
Definition: window.h:57

Referenced by SetWindowPlacement().

◆ NtUserSetWindowPos()

BOOL NTAPI NtUserSetWindowPos ( HWND  hWnd,
HWND  hWndInsertAfter,
int  X,
int  Y,
int  cx,
int  cy,
UINT  uFlags 
)

Definition at line 3560 of file winpos.c.

3568{
3569 PWND Window, pWndIA;
3570 BOOL ret = FALSE;
3572
3573 TRACE("Enter NtUserSetWindowPos\n");
3575
3576 if (!(Window = UserGetWindowObject(hWnd)) ||
3578 {
3579 ERR("NtUserSetWindowPos bad window handle!\n");
3580 goto Exit; // Return FALSE
3581 }
3582
3583 if ( hWndInsertAfter != HWND_TOP &&
3584 hWndInsertAfter != HWND_BOTTOM &&
3585 hWndInsertAfter != HWND_TOPMOST &&
3586 hWndInsertAfter != HWND_NOTOPMOST )
3587 {
3588 if (!(pWndIA = UserGetWindowObject(hWndInsertAfter)) ||
3589 UserIsDesktopWindow(pWndIA) || UserIsMessageWindow(pWndIA))
3590 {
3591 ERR("NtUserSetWindowPos bad insert window handle!\n");
3592 goto Exit; // Return FALSE
3593 }
3594 }
3595
3596 /* First make sure that coordinates are valid for WM_WINDOWPOSCHANGING */
3597 if (!(uFlags & SWP_NOMOVE))
3598 {
3599 if (X < -32768) X = -32768;
3600 else if (X > 32767) X = 32767;
3601 if (Y < -32768) Y = -32768;
3602 else if (Y > 32767) Y = 32767;
3603 }
3604 if (!(uFlags & SWP_NOSIZE))
3605 {
3606 if (cx < 0) cx = 0;
3607 else if (cx > 32767) cx = 32767;
3608 if (cy < 0) cy = 0;
3609 else if (cy > 32767) cy = 32767;
3610 }
3611
3612 UserRefObjectCo(Window, &Ref);
3613 ret = co_WinPosSetWindowPos(Window, hWndInsertAfter, X, Y, cx, cy, uFlags);
3615
3616Exit:
3617 TRACE("Leave NtUserSetWindowPos, ret=%i\n", ret);
3618 UserLeave();
3619 return ret;
3620}
#define HWND_TOP
Definition: winuser.h:1218

Referenced by BringWindowToTop(), NtUserMoveWindow(), and SetWindowPos().

◆ NtUserSetWindowRgn()

INT NTAPI NtUserSetWindowRgn ( HWND  hWnd,
HRGN  hRgn,
BOOL  bRedraw 
)

Definition at line 3626 of file winpos.c.

3630{
3631 HRGN hrgnCopy = NULL;
3632 PWND Window;
3634 INT Ret = 0;
3635
3636 TRACE("Enter NtUserSetWindowRgn\n");
3638
3639 if (!(Window = UserGetWindowObject(hWnd)) ||
3641 {
3642 goto Exit; // Return 0
3643 }
3644
3645 if (hRgn) // The region will be deleted in user32.
3646 {
3648 {
3649 hrgnCopy = NtGdiCreateRectRgn(0, 0, 0, 0);
3650 /* The coordinates of a window's window region are relative to the
3651 upper-left corner of the window, not the client area of the window. */
3652 NtGdiCombineRgn( hrgnCopy, hRgn, 0, RGN_COPY);
3653 }
3654 else
3655 goto Exit; // Return 0
3656 }
3657
3659 if (hrgnCopy)
3660 {
3661 Window->hrgnNewFrame = hrgnCopy; // Should be PSMWP->acvr->hrgnClip
3662 }
3663 else
3664 {
3665 Window->hrgnNewFrame = HRGN_WINDOW;
3666 }
3668 Ret = (INT)co_WinPosSetWindowPos(Window, HWND_TOP, 0, 0, 0, 0, bRedraw ? flags : (flags | SWP_NOREDRAW));
3669
3670Exit:
3671 TRACE("Leave NtUserSetWindowRgn, ret=%i\n", Ret);
3672 UserLeave();
3673 return Ret;
3674}
#define SWP_NOCLIENTSIZE
Definition: msg.h:31
#define SWP_NOCLIENTMOVE
Definition: msg.h:32
__kernel_entry W32KAPI INT APIENTRY NtGdiCombineRgn(_In_ HRGN hrgnDst, _In_ HRGN hrgnSrc1, _In_opt_ HRGN hrgnSrc2, _In_ INT iMode)
__kernel_entry W32KAPI HRGN APIENTRY NtGdiCreateRectRgn(_In_ INT xLeft, _In_ INT yTop, _In_ INT xRight, _In_ INT yBottom)
BOOL NTAPI GreIsHandleValid(HGDIOBJ hobj)
Definition: gdiobj.c:1153
#define RGN_COPY
Definition: wingdi.h:357

Referenced by ResetUserApiHook(), and SetWindowRgn().

◆ NtUserSetWindowsHookAW()

HHOOK NTAPI NtUserSetWindowsHookAW ( int  idHook,
HOOKPROC  lpfn,
BOOL  Ansi 
)

Definition at line 1419 of file hook.c.

1422{
1423 DWORD ThreadId;
1424 UNICODE_STRING USModuleName;
1425
1426 RtlInitUnicodeString(&USModuleName, NULL);
1428
1430 &USModuleName,
1431 ThreadId,
1432 idHook,
1433 lpfn,
1434 Ansi);
1435}
#define PtrToUint(p)
Definition: basetsd.h:79
#define NtCurrentTeb
HHOOK APIENTRY NtUserSetWindowsHookEx(HINSTANCE Mod, PUNICODE_STRING UnsafeModuleName, DWORD ThreadId, int HookId, HOOKPROC HookProc, BOOL Ansi)
Definition: hook.c:1439
HANDLE UniqueThread
Definition: compat.h:826
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1151

◆ NtUserSetWindowsHookEx()

HHOOK NTAPI NtUserSetWindowsHookEx ( HINSTANCE  Mod,
PUNICODE_STRING  ModuleName,
DWORD  ThreadId,
int  HookId,
HOOKPROC  HookProc,
BOOL  Ansi 
)

Definition at line 1439 of file hook.c.

1445{
1446 PWINSTATION_OBJECT WinStaObj;
1447 PHOOK Hook = NULL;
1450 HHOOK Handle;
1451 PTHREADINFO pti, ptiHook = NULL;
1452 HHOOK Ret = NULL;
1453
1454 TRACE("Enter NtUserSetWindowsHookEx\n");
1456
1458
1459 if (HookId < WH_MINHOOK || WH_MAXHOOK < HookId )
1460 {
1462 goto Cleanup; // Return NULL
1463 }
1464
1465 if (!HookProc)
1466 {
1468 goto Cleanup; // Return NULL
1469 }
1470
1471 if (ThreadId) /* thread-local hook */
1472 {
1473 if ( HookId == WH_JOURNALRECORD ||
1474 HookId == WH_JOURNALPLAYBACK ||
1475 HookId == WH_KEYBOARD_LL ||
1476 HookId == WH_MOUSE_LL ||
1477 HookId == WH_SYSMSGFILTER)
1478 {
1479 TRACE("Local hook installing Global HookId: %d\n",HookId);
1480 /* these can only be global */
1482 goto Cleanup; // Return NULL
1483 }
1484
1485 if ( !(ptiHook = IntTID2PTI( UlongToHandle(ThreadId) )))
1486 {
1487 ERR("Invalid thread id 0x%x\n", ThreadId);
1489 goto Cleanup; // Return NULL
1490 }
1491
1492 if ( ptiHook->rpdesk != pti->rpdesk) // gptiCurrent->rpdesk)
1493 {
1494 ERR("Local hook wrong desktop HookId: %d\n",HookId);
1496 goto Cleanup; // Return NULL
1497 }
1498
1499 if (ptiHook->ppi != pti->ppi)
1500 {
1501 if ( !Mod &&
1502 (HookId == WH_GETMESSAGE ||
1503 HookId == WH_CALLWNDPROC ||
1504 HookId == WH_CBT ||
1505 HookId == WH_HARDWARE ||
1506 HookId == WH_DEBUG ||
1507 HookId == WH_SHELL ||
1508 HookId == WH_FOREGROUNDIDLE ||
1509 HookId == WH_CALLWNDPROCRET) )
1510 {
1511 ERR("Local hook needs hMod HookId: %d\n",HookId);
1513 goto Cleanup; // Return NULL
1514 }
1515
1516 if ( (ptiHook->TIF_flags & (TIF_CSRSSTHREAD|TIF_SYSTEMTHREAD)) &&
1517 (HookId == WH_GETMESSAGE ||
1518 HookId == WH_CALLWNDPROC ||
1519 HookId == WH_CBT ||
1520 HookId == WH_HARDWARE ||
1521 HookId == WH_DEBUG ||
1522 HookId == WH_SHELL ||
1523 HookId == WH_FOREGROUNDIDLE ||
1524 HookId == WH_CALLWNDPROCRET) )
1525 {
1527 goto Cleanup; // Return NULL
1528 }
1529 }
1530 }
1531 else /* System-global hook */
1532 {
1533 ptiHook = pti; // gptiCurrent;
1534 if ( !Mod &&
1535 (HookId == WH_GETMESSAGE ||
1536 HookId == WH_CALLWNDPROC ||
1537 HookId == WH_CBT ||
1538 HookId == WH_SYSMSGFILTER ||
1539 HookId == WH_HARDWARE ||
1540 HookId == WH_DEBUG ||
1541 HookId == WH_SHELL ||
1542 HookId == WH_FOREGROUNDIDLE ||
1543 HookId == WH_CALLWNDPROCRET) )
1544 {
1545 ERR("Global hook needs hMod HookId: %d\n",HookId);
1547 goto Cleanup; // Return NULL
1548 }
1549 }
1550
1552 UserMode,
1553 0,
1554 &WinStaObj,
1555 0);
1556
1557 if (!NT_SUCCESS(Status))
1558 {
1560 goto Cleanup; // Return NULL
1561 }
1562 ObDereferenceObject(WinStaObj);
1563
1564 Hook = UserCreateObject(gHandleTable, NULL, ptiHook, (PHANDLE)&Handle, TYPE_HOOK, sizeof(HOOK));
1565
1566 if (!Hook)
1567 {
1568 goto Cleanup; // Return NULL
1569 }
1570
1571 Hook->ihmod = (INT_PTR)Mod; // Module Index from atom table, Do this for now.
1572 Hook->HookId = HookId;
1573 Hook->rpdesk = ptiHook->rpdesk;
1574 Hook->phkNext = NULL; /* Dont use as a chain! Use link lists for chaining. */
1575 Hook->Proc = HookProc;
1576 Hook->Ansi = Ansi;
1577
1578 TRACE("Set Hook Desk %p DeskInfo %p Handle Desk %p\n", pti->rpdesk, pti->pDeskInfo, Hook->head.rpdesk);
1579
1580 if (ThreadId) /* Thread-local hook */
1581 {
1582 InsertHeadList(&ptiHook->aphkStart[HOOKID_TO_INDEX(HookId)], &Hook->Chain);
1583 ptiHook->sphkCurrent = NULL;
1584 Hook->ptiHooked = ptiHook;
1585 ptiHook->fsHooks |= HOOKID_TO_FLAG(HookId);
1586
1587 if (ptiHook->pClientInfo)
1588 {
1589 if ( ptiHook->ppi == pti->ppi) /* gptiCurrent->ppi) */
1590 {
1591 _SEH2_TRY
1592 {
1593 ptiHook->pClientInfo->fsHooks = ptiHook->fsHooks;
1594 ptiHook->pClientInfo->phkCurrent = NULL;
1595 }
1597 {
1598 ERR("Problem writing to Local ClientInfo!\n");
1599 }
1600 _SEH2_END;
1601 }
1602 else
1603 {
1605
1606 KeStackAttachProcess(&ptiHook->ppi->peProcess->Pcb, &ApcState);
1607 _SEH2_TRY
1608 {
1609 ptiHook->pClientInfo->fsHooks = ptiHook->fsHooks;
1610 ptiHook->pClientInfo->phkCurrent = NULL;
1611 }
1613 {
1614 ERR("Problem writing to Remote ClientInfo!\n");
1615 }
1616 _SEH2_END;
1618 }
1619 }
1620 }
1621 else
1622 {
1623 InsertHeadList(&ptiHook->rpdesk->pDeskInfo->aphkStart[HOOKID_TO_INDEX(HookId)], &Hook->Chain);
1624 Hook->ptiHooked = NULL;
1625 //gptiCurrent->pDeskInfo->fsHooks |= HOOKID_TO_FLAG(HookId);
1626 ptiHook->rpdesk->pDeskInfo->fsHooks |= HOOKID_TO_FLAG(HookId);
1627 ptiHook->sphkCurrent = NULL;
1628 ptiHook->pClientInfo->phkCurrent = NULL;
1629 }
1630
1632
1633 if (Mod)
1634 {
1636 UnsafeModuleName,
1637 sizeof(UNICODE_STRING));
1638 if (!NT_SUCCESS(Status))
1639 {
1640 IntRemoveHook(Hook);
1642 goto Cleanup; // Return NULL
1643 }
1644
1646 ModuleName.MaximumLength,
1647 TAG_HOOK);
1648 if (NULL == Hook->ModuleName.Buffer)
1649 {
1650 IntRemoveHook(Hook);
1652 goto Cleanup; // Return NULL
1653 }
1654
1655 Hook->ModuleName.MaximumLength = ModuleName.MaximumLength;
1657 ModuleName.Buffer,
1658 ModuleName.MaximumLength);
1659 if (!NT_SUCCESS(Status))
1660 {
1662 Hook->ModuleName.Buffer = NULL;
1663 IntRemoveHook(Hook);
1665 goto Cleanup; // Return NULL
1666 }
1667
1671 FIXME("NtUserSetWindowsHookEx Setting process hMod instance addressing.\n");
1672 /* Make proc relative to the module base */
1673 Hook->offPfn = (ULONG_PTR)((char *)HookProc - (char *)Mod);
1674 }
1675 else
1676 Hook->offPfn = 0;
1677
1678 TRACE("Installing: HookId %d Global %s\n", HookId, !ThreadId ? "TRUE" : "FALSE");
1679 Ret = Handle;
1680
1681Cleanup:
1682 if (Hook)
1684 TRACE("Leave NtUserSetWindowsHookEx, ret=%p\n", Ret);
1685 UserLeave();
1686 return Ret;
1687}
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char * ModuleName
Definition: acpixf.h:1280
#define InsertHeadList(ListHead, Entry)
ULONG Handle
Definition: gdb_input.c:15
#define HOOKID_TO_INDEX(HookId)
Definition: hook.h:4
#define HOOKID_TO_FLAG(HookId)
Definition: hook.h:5
#define TIF_SYSTEMTHREAD
Definition: ntuser.h:265
_Out_ PKAPC_STATE ApcState
Definition: mm.h:1769
BOOLEAN IntRemoveHook(PVOID Object)
Definition: hook.c:1036
VOID NTAPI KeStackAttachProcess(IN PKPROCESS Process, OUT PRKAPC_STATE ApcState)
Definition: procobj.c:704
VOID NTAPI KeUnstackDetachProcess(IN PRKAPC_STATE ApcState)
Definition: procobj.c:756
ULONG fsHooks
Definition: win32.h:117
LIST_ENTRY aphkStart[NB_HOOKS]
FIXME!
Definition: win32.h:143
ACPI_SIZE Length
Definition: actypes.h:1053
THRDESKHEAD head
Definition: ntuser.h:240
LIST_ENTRY Chain
Definition: ntuser.h:249
struct _THREADINFO * ptiHooked
Definition: ntuser.h:246
struct _DESKTOP * rpdesk
Definition: ntuser.h:247
int32_t INT_PTR
Definition: typedefs.h:64
#define TAG_HOOK
Definition: tags.h:5
#define ERROR_HOOK_TYPE_NOT_ALLOWED
Definition: winerror.h:1284
#define ERROR_INVALID_FILTER_PROC
Definition: winerror.h:1253
#define ERROR_HOOK_NEEDS_HMOD
Definition: winerror.h:1254
#define ERROR_INVALID_HOOK_FILTER
Definition: winerror.h:1252
#define ERROR_GLOBAL_ONLY_HOOK
Definition: winerror.h:1255
#define WH_CALLWNDPROCRET
Definition: winuser.h:42
#define WH_MINHOOK
Definition: winuser.h:46
#define WH_MAXHOOK
Definition: winuser.h:47
#define WH_JOURNALPLAYBACK
Definition: winuser.h:31
#define WH_MOUSE_LL
Definition: winuser.h:44
#define WH_DEBUG
Definition: winuser.h:39
#define WH_HARDWARE
Definition: winuser.h:38
#define WH_KEYBOARD_LL
Definition: winuser.h:43
#define WH_GETMESSAGE
Definition: winuser.h:33
#define WH_SYSMSGFILTER
Definition: winuser.h:36
#define WH_FOREGROUNDIDLE
Definition: winuser.h:41
#define WH_JOURNALRECORD
Definition: winuser.h:30
KAPC_STATE
Definition: ketypes.h:1711

Referenced by IntSetWindowsHook(), and NtUserSetWindowsHookAW().

◆ NtUserSetWindowStationUser()

BOOL NTAPI NtUserSetWindowStationUser ( IN HWINSTA  hWindowStation,
IN PLUID  pluid,
IN PSID psid  OPTIONAL,
IN DWORD  size 
)

Definition at line 2011 of file winsta.c.

2016{
2017 BOOL Ret = FALSE;
2019 PWINSTATION_OBJECT WindowStation = NULL;
2020 LUID luidUser;
2021
2023
2025 {
2027 goto Leave;
2028 }
2029
2030 /* Validate the window station */
2031 Status = IntValidateWindowStationHandle(hWindowStation,
2032 UserMode,
2033 0,
2034 &WindowStation,
2035 NULL);
2036 if (!NT_SUCCESS(Status))
2037 {
2038 goto Leave;
2039 }
2040
2041 /* Capture the user LUID */
2042 _SEH2_TRY
2043 {
2044 ProbeForRead(pluid, sizeof(LUID), 1);
2045 luidUser = *pluid;
2046 }
2048 {
2050 _SEH2_YIELD(goto Leave);
2051 }
2052 _SEH2_END;
2053
2054 /* Reset the window station user LUID */
2055 RtlZeroMemory(&WindowStation->luidUser, sizeof(LUID));
2056
2057 /* Reset the window station user SID */
2058 if (WindowStation->psidUser)
2059 {
2061 WindowStation->psidUser = NULL;
2062 }
2063
2064 /* Copy the new user SID if one has been provided */
2065 if (psid)
2066 {
2068 if (WindowStation->psidUser == NULL)
2069 {
2071 goto Leave;
2072 }
2073
2075 _SEH2_TRY
2076 {
2077 ProbeForRead(psid, size, 1);
2078 RtlCopyMemory(WindowStation->psidUser, psid, size);
2079 }
2081 {
2083 }
2084 _SEH2_END;
2085
2086 if (!NT_SUCCESS(Status))
2087 {
2089 WindowStation->psidUser = NULL;
2090 goto Leave;
2091 }
2092 }
2093
2094 /* Copy the new user LUID */
2095 WindowStation->luidUser = luidUser;
2096
2097 Ret = TRUE;
2098
2099Leave:
2100 if (WindowStation)
2101 ObDereferenceObject(WindowStation);
2102
2103 UserLeave();
2104 return Ret;
2105}
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
GLsizeiptr size
Definition: glext.h:5919
PVOID psidUser
Definition: winsta.h:39
#define USERTAG_SECURITY
Definition: tags.h:275

Referenced by SetWindowStationUser().

◆ NtUserSetWindowWord()

WORD NTAPI NtUserSetWindowWord ( HWND  hWnd,
INT  Index,
WORD  NewVal 
)

Definition at line 4131 of file window.c.

4132{
4133 PWND Window;
4134 WORD OldValue;
4135 WORD Ret = 0;
4136
4137 TRACE("Enter NtUserSetWindowWord\n");
4139
4140 if (hWnd == IntGetDesktopWindow())
4141 {
4143 goto Exit; // Return 0
4144 }
4145
4147 {
4148 goto Exit; // Return 0
4149 }
4150
4151 switch (Index)
4152 {
4153 case GWL_ID:
4154 case GWL_HINSTANCE:
4155 case GWL_HWNDPARENT:
4157 goto Exit;
4158
4159 default:
4160 if (Index < 0)
4161 {
4163 goto Exit; // Return 0
4164 }
4165 }
4166
4167 if ((ULONG)Index > (Window->cbwndExtra - sizeof(WORD)))
4168 {
4170 goto Exit; // Return 0
4171 }
4172
4173 OldValue = *((WORD *)((PCHAR)(Window + 1) + Index));
4174 *((WORD *)((PCHAR)(Window + 1) + Index)) = NewValue;
4175
4176 Ret = OldValue;
4177
4178Exit:
4179 TRACE("Leave NtUserSetWindowWord, ret=%u\n", Ret);
4180 UserLeave();
4181 return Ret;
4182}
LONG FASTCALL co_UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
Definition: window.c:4033
#define ERROR_INVALID_INDEX
Definition: winerror.h:1239
#define GWL_HINSTANCE
Definition: winuser.h:866
#define GWL_ID
Definition: winuser.h:870
#define GWL_HWNDPARENT
Definition: winuser.h:868

Referenced by SetWindowWord().

◆ NtUserSetWinEventHook()

HWINEVENTHOOK NTAPI NtUserSetWinEventHook ( UINT  eventMin,
UINT  eventMax,
HMODULE  hmodWinEventProc,
PUNICODE_STRING  puString,
WINEVENTPROC  lpfnWinEventProc,
DWORD  idProcess,
DWORD  idThread,
UINT  dwflags 
)

Definition at line 286 of file event.c.

295{
296 PEVENTHOOK pEH;
297 HWINEVENTHOOK Ret = NULL;
300 PTHREADINFO pti;
301
302 TRACE("NtUserSetWinEventHook hmod %p, pfn %p\n", hmodWinEventProc, lpfnWinEventProc);
303
305
306 if ( !GlobalEvents )
307 {
309 if (GlobalEvents == NULL)
310 {
312 goto SetEventExit;
313 }
314 GlobalEvents->Counts = 0;
316 }
317
318 if (eventMin > eventMax)
319 {
321 goto SetEventExit;
322 }
323
324 if (!lpfnWinEventProc)
325 {
327 goto SetEventExit;
328 }
329
331 {
332 if (!hmodWinEventProc)
333 {
334 ERR("Hook needs a module\n");
336 goto SetEventExit;
337 }
338 if (puString == NULL)
339 {
340 ERR("Dll not found\n");
342 goto SetEventExit;
343 }
344 }
345 else
346 {
347 TRACE("Out of Context\n");
348 hmodWinEventProc = 0;
349 }
350
351 if (idThread)
352 {
355 if (!NT_SUCCESS(Status))
356 {
358 goto SetEventExit;
359 }
362 }
363 else
364 {
366 }
367 // Creator, pti is set here.
369 if (pEH)
370 {
373
375 pEH->eventMin = eventMin;
376 pEH->eventMax = eventMax;
377 pEH->idProcess = idProcess; // These are cmp'ed
378 pEH->idThread = idThread; // "
379 pEH->Flags = dwflags;
380 /*
381 If WINEVENT_INCONTEXT, set offset from hmod and proc. Save ihmod from
382 the atom index table where the hmod data is saved to be recalled later
383 if fSync set by WINEVENT_INCONTEXT.
384 If WINEVENT_OUTOFCONTEXT just use proc..
385 Do this instead....
386 */
387 if (hmodWinEventProc != NULL)
388 {
389 pEH->offPfn = (ULONG_PTR)((char *)lpfnWinEventProc - (char *)hmodWinEventProc);
390 pEH->ihmod = (INT_PTR)hmodWinEventProc;
391 pEH->Proc = lpfnWinEventProc;
392 }
393 else
394 {
395 pEH->Proc = lpfnWinEventProc;
396 pEH->offPfn = 0;
397 pEH->ihmod = (INT_PTR)hmodWinEventProc;
398 }
399
401
402 Ret = Handle;
403 IntSetSrvEventMask( eventMin, eventMax);
404 }
405
406SetEventExit:
407 UserLeave();
408 return Ret;
409}
#define InsertTailList(ListHead, Entry)
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define UserHMSetHandle(obj, handle)
Definition: ntuser.h:231
static HWINEVENTHOOK(WINAPI *pSetWinEventHook)(DWORD
PVOID NTAPI PsGetThreadWin32Thread(IN PETHREAD Thread)
Definition: thread.c:795
UINT eventMax
Definition: hook.h:20
DWORD idThread
Definition: hook.h:22
WINEVENTPROC Proc
Definition: hook.h:23
ULONG_PTR offPfn
Definition: hook.h:25
INT_PTR ihmod
Definition: hook.h:26
LIST_ENTRY Chain
Definition: hook.h:18
UINT eventMin
Definition: hook.h:19
ULONG Flags
Definition: hook.h:24
DWORD idProcess
Definition: hook.h:21
UINT Counts
Definition: hook.h:32
LIST_ENTRY Events
Definition: hook.h:31
static PEVENTTABLE GlobalEvents
Definition: event.c:19
static VOID FASTCALL IntSetSrvEventMask(UINT EventMin, UINT EventMax)
Definition: event.c:60
#define WINEVENT_INCONTEXT
Definition: winable.h:35
#define ERROR_INVALID_THREAD_ID
Definition: winerror.h:1270
#define ERROR_DLL_NOT_FOUND
Definition: winerror.h:1003

Referenced by SetWinEventHook().

◆ NtUserShowCaret()

BOOL NTAPI NtUserShowCaret ( HWND  hWnd)

Definition at line 422 of file caret.c.

423{
424 PWND Window = NULL;
426 BOOL ret = FALSE;
427
428 TRACE("Enter NtUserShowCaret\n");
430
432 {
433 goto Exit; // Return FALSE
434 }
435
436 if (Window) UserRefObjectCo(Window, &Ref);
437
439
441
442Exit:
443 TRACE("Leave NtUserShowCaret, ret=%i\n", ret);
444 UserLeave();
445 return ret;
446}
BOOL FASTCALL co_UserShowCaret(PWND Window OPTIONAL)
Definition: caret.c:259

Referenced by ShowCaret().

◆ NtUserShowScrollBar()

DWORD NTAPI NtUserShowScrollBar ( HWND  hWnd,
int  wBar,
DWORD  bShow 
)

Definition at line 1381 of file scrollbar.c.

1382{
1383 PWND Window;
1384 DWORD ret = 0;
1386
1387 TRACE("Enter NtUserShowScrollBar\n");
1389
1391 if (Window)
1392 {
1393 UserRefObjectCo(Window, &Ref);
1394 ret = co_UserShowScrollBar(Window, nBar, (nBar == SB_VERT) ? 0 : bShow,
1395 (nBar == SB_HORZ) ? 0 : bShow);
1397 }
1398
1399 TRACE("Leave NtUserShowScrollBar, ret=%lu\n", ret);
1400 UserLeave();
1401 return ret;
1402}
DWORD FASTCALL co_UserShowScrollBar(PWND Wnd, int nBar, BOOL fShowH, BOOL fShowV)
Definition: scrollbar.c:863

Referenced by ShowScrollBar().

◆ NtUserShowWindow()

BOOL NTAPI NtUserShowWindow ( HWND  hWnd,
LONG  nCmdShow 
)

Definition at line 3848 of file winpos.c.

3849{
3850 PWND Window;
3851 BOOL ret = FALSE;
3853
3854 TRACE("Enter NtUserShowWindow hWnd %p SW_ %d\n",hWnd, nCmdShow);
3856
3857 if (!(Window = UserGetWindowObject(hWnd)) ||
3859 {
3860 goto Exit; // Return FALSE
3861 }
3862
3863 if ( nCmdShow > SW_MAX || Window->state2 & WNDS2_INDESTROY)
3864 {
3866 goto Exit; // Return FALSE
3867 }
3868
3869 UserRefObjectCo(Window, &Ref);
3870 ret = co_WinPosShowWindow(Window, nCmdShow);
3872
3873Exit:
3874 TRACE("Leave NtUserShowWindow, ret=%i\n", ret);
3875 UserLeave();
3876 return ret;
3877}

Referenced by AnimateWindow(), CloseWindow(), OpenIcon(), ShowWindow(), SwitchToThisWindow(), and WIN_CreateWindowEx().

◆ NtUserShowWindowAsync()

BOOL NTAPI NtUserShowWindowAsync ( HWND  hWnd,
LONG  nCmdShow 
)

Definition at line 3811 of file winpos.c.

3812{
3813 PWND Window;
3815 BOOL ret = FALSE;
3817
3818 TRACE("Enter NtUserShowWindowAsync\n");
3820
3821 if (!(Window = UserGetWindowObject(hWnd)) ||
3823 {
3824 goto Exit; // Return FALSE
3825 }
3826
3827 if ( nCmdShow > SW_MAX )
3828 {
3830 goto Exit; // Return FALSE
3831 }
3832
3833 UserRefObjectCo(Window, &Ref);
3836 if (Result != -1 && Result != 0) ret = TRUE;
3837
3838Exit:
3839 TRACE("Leave NtUserShowWindowAsync, ret=%i\n", ret);
3840 UserLeave();
3841 return ret;
3842}
@ WM_ASYNC_SHOWWINDOW
Definition: msgqueue.h:117

Referenced by ShowWindowAsync().

◆ NtUserSoundSentry()

BOOL NTAPI NtUserSoundSentry ( VOID  )

Definition at line 843 of file ntstubs.c.

844{
845 STUB;
846 return 0;
847}

◆ NtUserSwitchDesktop()

BOOL NTAPI NtUserSwitchDesktop ( HDESK  hDesktop)

Definition at line 2969 of file desktop.c.

2970{
2971 PDESKTOP pdesk;
2973 BOOL bRedrawDesktop;
2974 BOOL Ret = FALSE;
2975
2977 TRACE("Enter NtUserSwitchDesktop(0x%p)\n", hdesk);
2978
2979 Status = IntValidateDesktopHandle(hdesk, UserMode, 0, &pdesk);
2980 if (!NT_SUCCESS(Status))
2981 {
2982 ERR("Validation of desktop handle 0x%p failed\n", hdesk);
2983 goto Exit; // Return FALSE
2984 }
2985
2986 if (PsGetCurrentProcessSessionId() != pdesk->rpwinstaParent->dwSessionId)
2987 {
2988 ObDereferenceObject(pdesk);
2989 ERR("NtUserSwitchDesktop called for a desktop of a different session\n");
2990 goto Exit; // Return FALSE
2991 }
2992
2993 if (pdesk == gpdeskInputDesktop)
2994 {
2995 ObDereferenceObject(pdesk);
2996 WARN("NtUserSwitchDesktop called for active desktop\n");
2997 Ret = TRUE;
2998 goto Exit;
2999 }
3000
3001 /*
3002 * Don't allow applications switch the desktop if it's locked, unless the caller
3003 * is the logon application itself
3004 */
3005 if ((pdesk->rpwinstaParent->Flags & WSS_LOCKED) &&
3007 {
3008 ObDereferenceObject(pdesk);
3009 ERR("Switching desktop 0x%p denied because the window station is locked!\n", hdesk);
3010 goto Exit; // Return FALSE
3011 }
3012
3013 if (pdesk->rpwinstaParent != InputWindowStation)
3014 {
3015 ObDereferenceObject(pdesk);
3016 ERR("Switching desktop 0x%p denied because desktop doesn't belong to the interactive winsta!\n", hdesk);
3017 goto Exit; // Return FALSE
3018 }
3019
3020 /* FIXME: Fail if the process is associated with a secured
3021 desktop such as Winlogon or Screen-Saver */
3022 /* FIXME: Connect to input device */
3023
3024 TRACE("Switching from desktop 0x%p to 0x%p\n", gpdeskInputDesktop, pdesk);
3025
3026 bRedrawDesktop = FALSE;
3027
3028 /* The first time SwitchDesktop is called, gpdeskInputDesktop is NULL */
3029 if (gpdeskInputDesktop != NULL)
3030 {
3032 bRedrawDesktop = TRUE;
3033
3034 /* Hide the previous desktop window */
3036 }
3037
3038 /* Set the active desktop in the desktop's window station. */
3040
3041 /* Set the global state. */
3042 gpdeskInputDesktop = pdesk;
3043
3044 /* Show the new desktop window */
3046
3047 TRACE("SwitchDesktop gpdeskInputDesktop 0x%p\n", gpdeskInputDesktop);
3048 ObDereferenceObject(pdesk);
3049
3050 Ret = TRUE;
3051
3052Exit:
3053 TRACE("Leave NtUserSwitchDesktop, ret=%i\n", Ret);
3054 UserLeave();
3055 return Ret;
3056}
ULONG NTAPI PsGetCurrentProcessSessionId(VOID)
Definition: process.c:1133
#define WS_VISIBLE
Definition: pedump.c:620
struct _WINSTATION_OBJECT * rpwinstaParent
Definition: desktop.h:11
struct _DESKTOP * ActiveDesktop
Definition: winsta.h:42
NTSTATUS FASTCALL IntHideDesktop(PDESKTOP Desktop)
Definition: desktop.c:1647
NTSTATUS FASTCALL co_IntShowDesktop(PDESKTOP Desktop, ULONG Width, ULONG Height, BOOL bRedraw)
Definition: desktop.c:1629
#define SM_CYSCREEN
Definition: winuser.h:971
#define SM_CXSCREEN
Definition: winuser.h:970

Referenced by SwitchDesktop().

◆ NtUserSystemParametersInfo()

BOOL NTAPI NtUserSystemParametersInfo ( UINT  uiAction,
UINT  uiParam,
PVOID  pvParam,
UINT  fWinIni 
)

Definition at line 2186 of file sysparams.c.

2191{
2192 BOOL bResult;
2193
2194 TRACE("Enter NtUserSystemParametersInfo(%u)\n", uiAction);
2196
2197 // FIXME: Get rid of the flags and only use this from um. kernel can access data directly.
2198 /* Set UM memory protection flag */
2199 fWinIni |= SPIF_PROTECT;
2200
2201 /* Call internal function */
2202 bResult = UserSystemParametersInfo(uiAction, uiParam, pvParam, fWinIni);
2203
2204 TRACE("Leave NtUserSystemParametersInfo, returning %d\n", bResult);
2205 UserLeave();
2206
2207 return bResult;
2208}
#define SPIF_PROTECT
Definition: sysparams.h:13
BOOL FASTCALL UserSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
Definition: sysparams.c:2123

Referenced by DrawFocusRect(), RealSystemParametersInfoA(), RealSystemParametersInfoW(), SetDoubleClickTime(), START_TEST(), Test_NtUserSystemParametersInfo_fWinIni(), Test_NtUserSystemParametersInfo_Params(), Test_SPI_SETACCESSTIMEOUT(), Test_SPI_SETBEEP(), Test_SPI_SETBORDER(), Test_SPI_SETDESKWALLPAPER(), Test_SPI_SETFASTTASKSWITCH(), Test_SPI_SETICONMETRICS(), Test_SPI_SETICONTITLELOGFONT(), Test_SPI_SETMENUANIMATION(), Test_SPI_SETMINIMIZEDMETRICS(), Test_SPI_SETMOUSE(), Test_SPI_SETMOUSEBUTTONSWAP(), Test_SPI_SETNONCLIENTMETRICS(), Test_SPI_SETSTICKYKEYS(), Test_SPI_SETWORKAREA(), and Test_UserPref().

◆ NtUserTestForInteractiveUser()

DWORD NTAPI NtUserTestForInteractiveUser ( DWORD  dwUnknown1)

Definition at line 851 of file ntstubs.c.

853{
854 STUB;
855 return 0;
856}

◆ NtUserThunkedMenuInfo()

BOOL NTAPI NtUserThunkedMenuInfo ( HMENU  hMenu,
LPCMENUINFO  lpcmi 
)

Definition at line 6542 of file menu.c.

6545{
6546 PMENU Menu;
6547 BOOL Ret = FALSE;
6548
6549 TRACE("Enter NtUserThunkedMenuInfo\n");
6551
6552 Menu = UserGetMenuObject(hMenu);
6553 if (Menu)
6554 {
6555 Ret = UserMenuInfo(Menu, (PROSMENUINFO)lpcmi, TRUE);
6556 }
6557
6558 UserLeave();
6559 TRACE("Leave NtUserThunkedMenuInfo, ret=%i\n", Ret);
6560 return Ret;
6561}
BOOL FASTCALL UserMenuInfo(PMENU Menu, PROSMENUINFO UnsafeMenuInfo, BOOL SetOrGet)
Definition: menu.c:5204

Referenced by SetMenuInfo().

◆ NtUserThunkedMenuItemInfo()

BOOL NTAPI NtUserThunkedMenuItemInfo ( HMENU  hMenu,
UINT  uItem,
BOOL  fByPosition,
BOOL  bInsert,
LPMENUITEMINFOW  lpmii,
PUNICODE_STRING  lpszCaption 
)

Definition at line 6567 of file menu.c.

6574{
6575 PMENU Menu;
6577 UNICODE_STRING lstrCaption = { 0 };
6578 BOOL Ret = FALSE;
6579
6580 TRACE("Enter NtUserThunkedMenuItemInfo\n");
6581
6583
6584 if (!(Menu = UserGetMenuObject(hMenu)))
6585 {
6586 goto Cleanup; // Return FALSE
6587 }
6588
6589 /* Check if we got a Caption */
6590 if (lpszCaption && lpszCaption->Buffer)
6591 {
6592 /* Copy the string to kernel mode */
6593 Status = ProbeAndCaptureUnicodeString( &lstrCaption,
6594 UserMode,
6595 lpszCaption);
6596 if (!NT_SUCCESS(Status))
6597 {
6598 ERR("Failed to capture MenuItem Caption (status 0x%08x)\n",Status);
6600 goto Cleanup; // Return FALSE
6601 }
6602 }
6603
6604 if (bInsert)
6605 {
6606 Ret = UserInsertMenuItem(Menu, uItem, fByPosition, lpmii, &lstrCaption);
6607 }
6608 else
6609 {
6610 Ret = UserMenuItemInfo(Menu, uItem, fByPosition, (PROSMENUITEMINFO)lpmii, TRUE, &lstrCaption);
6611 }
6612
6613Cleanup:
6614 UserLeave();
6615
6616 if (lstrCaption.Buffer)
6617 {
6619 }
6620
6621 TRACE("Leave NtUserThunkedMenuItemInfo, ret=%i\n", Ret);
6622 return Ret;
6623}
static BOOL bInsert
Definition: cmdinput.c:121
DWORD FASTCALL UserInsertMenuItem(PMENU Menu, UINT uItem, BOOL fByPosition, LPCMENUITEMINFOW UnsafeItemInfo, PUNICODE_STRING lpstr)
Definition: menu.c:4961
BOOL FASTCALL UserMenuItemInfo(PMENU Menu, UINT Item, BOOL ByPosition, PROSMENUITEMINFO UnsafeItemInfo, BOOL SetOrGet, PUNICODE_STRING lpstr)
Definition: menu.c:5130

Referenced by AppendMenuA(), AppendMenuW(), CheckMenuRadioItem(), InsertMenuA(), InsertMenuItemA(), InsertMenuItemW(), InsertMenuW(), ModifyMenuA(), ModifyMenuW(), SetMenuItemInfoA(), and SetMenuItemInfoW().

◆ NtUserToUnicodeEx()

INT NTAPI NtUserToUnicodeEx ( UINT  wVirtKey,
UINT  wScanCode,
PBYTE  lpKeyState,
LPWSTR  pwszBuff,
int  cchBuff,
UINT  wFlags,
HKL  dwhkl 
)

◆ NtUserTrackMouseEvent()

BOOL NTAPI NtUserTrackMouseEvent ( LPTRACKMOUSEEVENT  lpEventTrack)

Definition at line 482 of file mouse.c.

484{
485 TRACKMOUSEEVENT SafeTME;
486 BOOL bRet = FALSE;
487
488 TRACE("Enter NtUserTrackMouseEvent\n");
489
491 {
492 ProbeForRead(lpEventTrack, sizeof(TRACKMOUSEEVENT), 1);
493 RtlCopyMemory(&SafeTME, lpEventTrack, sizeof(TRACKMOUSEEVENT));
494 }
496 {
498 _SEH2_YIELD(return FALSE);
499 }
500 _SEH2_END;
501
502 if (SafeTME.cbSize != sizeof(TRACKMOUSEEVENT))
503 {
505 return FALSE;
506 }
507
509 {
511 return FALSE;
512 }
513
515
516 if (SafeTME.dwFlags & TME_QUERY)
517 {
518 bRet = IntQueryTrackMouseEvent(&SafeTME);
520 {
521 ProbeForWrite(lpEventTrack, sizeof(TRACKMOUSEEVENT), 1);
522 RtlCopyMemory(lpEventTrack, &SafeTME, sizeof(TRACKMOUSEEVENT));
523 }
525 {
527 bRet = FALSE;
528 }
529 _SEH2_END;
530 }
531 else
532 {
533 bRet = IntTrackMouseEvent(&SafeTME);
534 }
535
536 TRACE("Leave NtUserTrackMouseEvent, ret=%i\n", bRet);
537 UserLeave();
538 return bRet;
539}
#define TME_CANCEL
Definition: commctrl.h:5001
#define TME_LEAVE
Definition: commctrl.h:4998
#define TME_NONCLIENT
Definition: commctrl.h:4999
#define TME_QUERY
Definition: commctrl.h:5000
#define TME_HOVER
Definition: commctrl.h:4997
BOOL FASTCALL IntTrackMouseEvent(LPTRACKMOUSEEVENT lpEventTrack)
Definition: mouse.c:410
BOOL FASTCALL IntQueryTrackMouseEvent(LPTRACKMOUSEEVENT lpEventTrack)
Definition: mouse.c:375

◆ NtUserTrackPopupMenuEx()

BOOL NTAPI NtUserTrackPopupMenuEx ( _In_ HMENU  hMenu,
_In_ UINT  fuFlags,
_In_ INT  x,
_In_ INT  y,
_In_ HWND  hwnd,
_In_opt_ LPTPMPARAMS  lptpm 
)

Definition at line 6634 of file menu.c.

6641{
6642 PMENU menu;
6643 PWND pWnd;
6644 TPMPARAMS tpm;
6645 BOOL Ret = FALSE;
6646 USER_REFERENCE_ENTRY WndRef, MenuRef;
6647
6648 TRACE("Enter NtUserTrackPopupMenuEx\n");
6649
6650 if (fuFlags & ~VALID_TPM_FLAGS)
6651 {
6652 ERR("TPME : Invalid flags 0x%X (valid flags are 0x%X)\n", fuFlags, VALID_TPM_FLAGS);
6654 goto Exit0;
6655 }
6656
6658
6659 /* Parameter check */
6660 if (!(menu = UserGetMenuObject( hMenu )))
6661 {
6662 ERR("TPME : Invalid Menu handle.\n");
6664 goto Exit;
6665 }
6666
6667 if (!(pWnd = UserGetWindowObject(hWnd)))
6668 {
6669 ERR("TPME : Invalid Window handle.\n");
6670 goto Exit;
6671 }
6672
6673 if (lptpm)
6674 {
6675 _SEH2_TRY
6676 {
6677 ProbeForRead(lptpm, sizeof(TPMPARAMS), sizeof(ULONG));
6678 tpm = *lptpm;
6679 }
6681 {
6682 _SEH2_YIELD(goto Exit);
6683 }
6684 _SEH2_END
6685 }
6686
6687 UserRefObjectCo(pWnd, &WndRef);
6688 UserRefObjectCo(menu, &MenuRef);
6689 Ret = IntTrackPopupMenuEx(menu, fuFlags, x, y, pWnd, (lptpm ? &tpm : NULL));
6691 UserDerefObjectCo(pWnd);
6692
6693Exit:
6694 UserLeave();
6695
6696Exit0:
6697 TRACE("Leave NtUserTrackPopupMenuEx, ret=%i\n", Ret);
6698 return Ret;
6699}
#define menu
Definition: input.c:3282
BOOL FASTCALL IntTrackPopupMenuEx(_Inout_ PMENU menu, _In_ UINT wFlags, _In_ INT x, _In_ INT y, _In_ PWND pWnd, _In_opt_ const TPMPARAMS *lpTpm)
Definition: menu.c:4575
#define VALID_TPM_FLAGS
Definition: menu.c:6625

Referenced by TrackPopupMenu().

◆ NtUserTranslateAccelerator()

int NTAPI NtUserTranslateAccelerator ( HWND  Window,
HACCEL  Table,
LPMSG  Message 
)

Definition at line 367 of file accelerator.c.

371{
372 PWND Window = NULL;
373 PACCELERATOR_TABLE Accel = NULL;
374 ULONG i;
375 MSG Message;
376 USER_REFERENCE_ENTRY AccelRef, WindowRef;
377 int Ret = 0;
378
379 TRACE("NtUserTranslateAccelerator(hWnd %p, hAccel %p, Message %p)\n",
380 hWnd, hAccel, pUnsafeMessage);
382
383 if (hWnd == NULL)
384 {
385 goto Cleanup; // Return 0
386 }
387
389 {
390 ProbeForRead(pUnsafeMessage, sizeof(MSG), 4);
391 RtlCopyMemory(&Message, pUnsafeMessage, sizeof(MSG));
392 }
394 {
396 _SEH2_YIELD(goto Cleanup); // Return 0
397 }
398 _SEH2_END;
399
400 if ((Message.message != WM_KEYDOWN) &&
401 (Message.message != WM_SYSKEYDOWN) &&
402 (Message.message != WM_SYSCHAR) &&
403 (Message.message != WM_CHAR))
404 {
405 goto Cleanup; // Return 0
406 }
407
408 Accel = UserGetAccelObject(hAccel);
409 if (!Accel)
410 {
411 goto Cleanup; // Return 0
412 }
413
414 UserRefObjectCo(Accel, &AccelRef);
415
417 if (!Window)
418 {
419 goto Cleanup; // Return 0
420 }
421
422 UserRefObjectCo(Window, &WindowRef);
423
424 /* FIXME: Associate AcceleratorTable with the current thread */
425
426 for (i = 0; i < Accel->Count; i++)
427 {
429 {
430 Ret = 1;
431 break;
432 }
433
434 /* Undocumented feature... */
435 if (Accel->Table[i].fVirt & FVIRT_TBL_END)
436 break;
437 }
438
439Cleanup:
441 if (Accel) UserDerefObjectCo(Accel);
442
443 TRACE("NtUserTranslateAccelerator returns %d\n", Ret);
444 UserLeave();
445 return Ret;
446}
#define FVIRT_TBL_END
Definition: accelerator.c:16
static BOOLEAN FASTCALL co_IntTranslateAccelerator(PWND Window, CONST MSG *pMsg, CONST ACCEL *pAccel)
Definition: accelerator.c:44
#define WM_SYSCHAR
Definition: winuser.h:1749
#define WM_CHAR
Definition: winuser.h:1745
#define WM_SYSKEYDOWN
Definition: winuser.h:1747

Referenced by TranslateAcceleratorW().

◆ NtUserTranslateMessage()

BOOL NTAPI NtUserTranslateMessage ( LPMSG  lpMsg,
UINT  flags 
)

Definition at line 2490 of file message.c.

2491{
2492 MSG SafeMsg;
2493 BOOL Ret;
2494 PWND pWnd;
2495
2496 _SEH2_TRY
2497 {
2498 ProbeForRead(lpMsg, sizeof(MSG), 1);
2499 RtlCopyMemory(&SafeMsg, lpMsg, sizeof(MSG));
2500 }
2502 {
2504 _SEH2_YIELD(return FALSE);
2505 }
2506 _SEH2_END;
2507
2509 pWnd = UserGetWindowObject(SafeMsg.hwnd);
2510 if (pWnd) // Must have a window!
2511 {
2512 Ret = IntTranslateKbdMessage(&SafeMsg, flags);
2513 }
2514 else
2515 {
2516 TRACE("No Window for Translate. hwnd 0x%p Msg %u\n", SafeMsg.hwnd, SafeMsg.message);
2517 Ret = FALSE;
2518 }
2519 UserLeave();
2520
2521 return Ret;
2522}
BOOL FASTCALL IntTranslateKbdMessage(LPMSG lpMsg, UINT flags)
Definition: keyboard.c:1499

Referenced by TranslateMessageEx().

◆ NtUserUnhookWindowsHookEx()

BOOL NTAPI NtUserUnhookWindowsHookEx ( HHOOK  Hook)

Definition at line 1691 of file hook.c.

1692{
1693 PHOOK HookObj;
1694 BOOL Ret = FALSE;
1695
1696 TRACE("Enter NtUserUnhookWindowsHookEx\n");
1698
1699 if (!(HookObj = IntGetHookObject(Hook)))
1700 {
1701 ERR("Invalid handle passed to NtUserUnhookWindowsHookEx\n");
1702 /* SetLastNtError(Status); */
1703 goto Exit; // Return FALSE
1704 }
1705
1706 ASSERT(Hook == UserHMGetHandle(HookObj));
1707
1708 IntRemoveHook(HookObj);
1709
1710 UserDereferenceObject(HookObj);
1711
1712 Ret = TRUE;
1713
1714Exit:
1715 TRACE("Leave NtUserUnhookWindowsHookEx, ret=%i\n", Ret);
1716 UserLeave();
1717 return Ret;
1718}
PHOOK FASTCALL IntGetHookObject(HHOOK hHook)
Definition: hook.c:937

◆ NtUserUnhookWinEvent()

BOOL NTAPI NtUserUnhookWinEvent ( HWINEVENTHOOK  hWinEventHook)

Definition at line 413 of file event.c.

415{
416 PEVENTHOOK pEH;
417 BOOL Ret = FALSE;
418
420
422 if (pEH)
423 {
424 Ret = IntRemoveEvent(pEH);
425 }
426
427 UserLeave();
428 return Ret;
429}
struct tagEVENTHOOK * PEVENTHOOK
BOOLEAN IntRemoveEvent(PVOID Object)
Definition: event.c:126

◆ NtUserUnloadKeyboardLayout()

BOOL NTAPI NtUserUnloadKeyboardLayout ( HKL  hKl)

Definition at line 1251 of file kbdlayout.c.

1253{
1254 BOOL ret;
1255 PWINSTATION_OBJECT pWinSta;
1256
1258
1260 ret = IntUnloadKeyboardLayout(pWinSta, hKl);
1261
1262 UserLeave();
1263 return ret;
1264}
static BOOL APIENTRY IntUnloadKeyboardLayout(_Inout_ PWINSTATION_OBJECT pWinSta, _In_ HKL hKL)
Definition: kbdlayout.c:852

Referenced by UnloadKeyboardLayout().

◆ NtUserUnlockWindowStation()

BOOL NTAPI NtUserUnlockWindowStation ( HWINSTA  hWindowStation)

Definition at line 1595 of file winsta.c.

1596{
1599 BOOL Ret;
1600
1601 TRACE("About to set process window station with handle (%p)\n",
1602 hWindowStation);
1603
1605 {
1606 ERR("Unauthorized process attempted to unlock the window station!\n");
1608 return FALSE;
1609 }
1610
1611 Status = IntValidateWindowStationHandle(hWindowStation,
1612 UserMode,
1613 0,
1614 &Object,
1615 NULL);
1616 if (!NT_SUCCESS(Status))
1617 {
1618 TRACE("Validation of window station handle (%p) failed\n",
1619 hWindowStation);
1621 return FALSE;
1622 }
1623
1624 Ret = (Object->Flags & WSS_LOCKED) == WSS_LOCKED;
1625 Object->Flags &= ~WSS_LOCKED;
1626
1628 return Ret;
1629}

Referenced by UnlockWindowStation().

◆ NtUserUnregisterClass()

BOOL NTAPI NtUserUnregisterClass ( PUNICODE_STRING  ClassNameOrAtom,
HINSTANCE  hInstance,
PCLSMENUNAME  pClassMenuName 
)

Referenced by START_TEST().

◆ NtUserUnregisterHotKey()

BOOL NTAPI NtUserUnregisterHotKey ( HWND  hWnd,
int  id 
)

Definition at line 584 of file hotkey.c.

585{
586 BOOL bRet = FALSE;
587 PWND pWnd = NULL;
588
589 TRACE("Enter NtUserUnregisterHotKey\n");
591
592 /* Fail if the given window is invalid */
593 if (hWnd && !(pWnd = UserGetWindowObject(hWnd)))
594 goto cleanup;
595
596 bRet = UserUnregisterHotKey(pWnd, id);
597
598cleanup:
599 TRACE("Leave NtUserUnregisterHotKey, ret=%i\n", bRet);
600 UserLeave();
601 return bRet;
602}
BOOL FASTCALL UserUnregisterHotKey(PWND pWnd, int id)
Definition: hotkey.c:499

◆ NtUserUnregisterUserApiHook()

BOOL NTAPI NtUserUnregisterUserApiHook ( VOID  )

Definition at line 1768 of file hook.c.

1769{
1770 BOOL ret;
1771
1774 UserLeave();
1775
1776 return ret;
1777}
BOOL FASTCALL UserUnregisterUserApiHook(VOID)
Definition: hook.c:206

Referenced by UnregisterUserApiHook().

◆ NtUserUpdateInputContext()

BOOL NTAPI NtUserUpdateInputContext ( HIMC  hIMC,
DWORD  dwType,
DWORD_PTR  dwValue 
)

Definition at line 1862 of file ime.c.

1866{
1867 PIMC pIMC;
1868 BOOL ret = FALSE;
1869
1871
1872 if (!IS_IMM_MODE())
1873 {
1874 ERR("!IS_IMM_MODE()\n");
1875 goto Quit;
1876 }
1877
1879 if (!pIMC)
1880 {
1881 ERR("Invalid HIMC %p\n", hIMC);
1882 goto Quit;
1883 }
1884
1885 ret = UserUpdateInputContext(pIMC, dwType, dwValue);
1886
1887Quit:
1888 UserLeave();
1889 return ret;
1890}
static BOOL FASTCALL UserUpdateInputContext(_In_ PIMC pIMC, _In_ DWORD dwType, _In_ DWORD_PTR dwValue)
Definition: ime.c:1828

Referenced by ImmLockClientImc(), and User32SetImeWindowOfImc().

◆ NtUserUpdateInstance()

DWORD NTAPI NtUserUpdateInstance ( DWORD  Unknown0,
DWORD  Unknown1,
DWORD  Unknown2 
)

Definition at line 335 of file ntstubs.c.

339{
340 STUB
341
342 return 0;
343}

◆ NtUserUpdateLayeredWindow()

BOOL NTAPI NtUserUpdateLayeredWindow ( HWND  hwnd,
HDC  hdcDst,
POINT pptDst,
SIZE psize,
HDC  hdcSrc,
POINT pptSrc,
COLORREF  crKey,
BLENDFUNCTION pblend,
DWORD  dwFlags,
RECT prcDirty 
)

Definition at line 341 of file layered.c.

352{
353 UPDATELAYEREDWINDOWINFO info;
354 POINT Dst, Src;
355 SIZE Size;
356 RECT Dirty;
357 BLENDFUNCTION blend = { AC_SRC_OVER, 0, 255, 0 };
358 PWND pWnd;
359 BOOL Ret = FALSE;
360
361 TRACE("Enter NtUserUpdateLayeredWindow\n");
363
364 if (!(pWnd = UserGetWindowObject(hwnd)))
365 {
366 goto Exit;
367 }
368
370 {
371 if (pptDst)
372 {
373 ProbeForRead(pptDst, sizeof(POINT), 1);
374 Dst = *pptDst;
375 }
376 if (pptSrc)
377 {
378 ProbeForRead(pptSrc, sizeof(POINT), 1);
379 Src = *pptSrc;
380 }
381 ProbeForRead(psize, sizeof(SIZE), 1);
382 Size = *psize;
383 if (pblend)
384 {
385 ProbeForRead(pblend, sizeof(BLENDFUNCTION), 1);
386 blend = *pblend;
387 }
388 if (prcDirty)
389 {
390 ProbeForRead(prcDirty, sizeof(RECT), 1);
391 Dirty = *prcDirty;
392 }
393 }
395 {
397 _SEH2_YIELD(goto Exit);
398 }
399 _SEH2_END;
400
401 if ( GetLayeredStatus(pWnd) ||
403 !(pWnd->ExStyle & WS_EX_LAYERED) )
404 {
405 ERR("Layered Window Invalid Parameters\n");
407 goto Exit;
408 }
409
410 info.cbSize = sizeof(info);
411 info.hdcDst = hdcDst;
412 info.pptDst = pptDst? &Dst : NULL;
413 info.psize = &Size;
414 info.hdcSrc = hdcSrc;
415 info.pptSrc = pptSrc ? &Src : NULL;
416 info.crKey = crKey;
417 info.pblend = &blend;
418 info.dwFlags = dwFlags;
419 info.prcDirty = prcDirty ? &Dirty : NULL;
420 Ret = IntUpdateLayeredWindowI( pWnd, &info );
421Exit:
422 TRACE("Leave NtUserUpdateLayeredWindow, ret=%i\n", Ret);
423 UserLeave();
424 return Ret;
425}
BOOL FASTCALL IntUpdateLayeredWindowI(PWND pWnd, UPDATELAYEREDWINDOWINFO *info)
Definition: layered.c:101
BOOL FASTCALL GetLayeredStatus(PWND pWnd)
Definition: layered.c:23
#define Dst
Definition: mesh.h:153
_Must_inspect_result_ _Out_ LPSIZE psize
Definition: ntgdi.h:1569
#define AC_SRC_OVER
Definition: wingdi.h:1369
#define ULW_ALPHA
Definition: winuser.h:2889
#define ULW_OPAQUE
Definition: winuser.h:2890
#define ULW_COLORKEY
Definition: winuser.h:2888
#define ULW_EX_NORESIZE
Definition: winuser.h:2891
static HDC hdcSrc
Definition: xlate.c:32
static HDC hdcDst
Definition: xlate.c:32

Referenced by UpdateLayeredWindow(), and UpdateLayeredWindowIndirect().

◆ NtUserUpdatePerUserSystemParameters()

BOOL NTAPI NtUserUpdatePerUserSystemParameters ( DWORD  dwReserved,
BOOL  bEnable 
)

Definition at line 381 of file sysparams.c.

384{
385 BOOL bResult;
386
387 TRACE("Enter NtUserUpdatePerUserSystemParameters\n");
389
391 if(bEnable)
393 else
395 bResult = TRUE;
396
397 TRACE("Leave NtUserUpdatePerUserSystemParameters, returning %d\n", bResult);
398 UserLeave();
399
400 return bResult;
401}
static const WCHAR * KEY_DESKTOP
Definition: sysparams.c:61
BOOL g_PaintDesktopVersion
Definition: sysparams.c:19
static VOID SpiUpdatePerUserSystemParameters(VOID)
Definition: sysparams.c:229
static INT SpiLoadDWord(PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
Definition: sysparams.c:118
static const WCHAR * VAL_PAINTDESKVER
Definition: sysparams.c:75
_In_ BOOL bEnable
Definition: winddi.h:3426

Referenced by START_TEST(), UpdatePerUserSystemParameters(), and UserInitialize().

◆ NtUserUserHandleGrantAccess()

BOOL NTAPI NtUserUserHandleGrantAccess ( IN HANDLE  hUserHandle,
IN HANDLE  hJob,
IN BOOL  bGrant 
)

Definition at line 347 of file ntstubs.c.

351{
352 STUB
353
354 return 0;
355}

◆ NtUserValidateHandleSecure()

BOOL NTAPI NtUserValidateHandleSecure ( HANDLE  hHdl)

Definition at line 791 of file object.c.

793{
794 UINT uType;
795 PPROCESSINFO ppi;
797 BOOL Ret = FALSE;
798
800
802 {
804 goto Exit; // Return FALSE
805 }
806 uType = entry->type;
807 switch (uType)
808 {
809 case TYPE_WINDOW:
811 ppi = ((PTHREADINFO)entry->pi)->ppi;
812 break;
813 case TYPE_MENU:
814 case TYPE_ACCELTABLE:
815 case TYPE_CURSOR:
816 case TYPE_HOOK:
817 case TYPE_CALLPROC:
819 ppi = entry->pi;
820 break;
821 default:
822 ppi = NULL;
823 break;
824 }
825
826 if (!ppi)
827 goto Exit; // Return FALSE
828
829 // Same process job returns TRUE.
830 if (gptiCurrent->ppi->pW32Job == ppi->pW32Job) Ret = TRUE;
831
832Exit:
833 UserLeave();
834 return Ret;
835}
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
uint32_t entry
Definition: isohybrid.c:63
PVOID pW32Job
Definition: win32.h:276
Definition: ntuser.h:17
PUSER_HANDLE_ENTRY handle_to_entry(PUSER_HANDLE_TABLE ht, HANDLE handle)
Definition: object.c:341

Referenced by ValidateHandleNoErr().

◆ NtUserValidateRect()

BOOL NTAPI NtUserValidateRect ( HWND  hWnd,
CONST RECT lpRect 
)

Referenced by ValidateRect().

◆ NtUserValidateTimerCallback()

BOOL APIENTRY NtUserValidateTimerCallback ( LPARAM  lParam)

Definition at line 707 of file timer.c.

709{
710 BOOL Ret = FALSE;
711
713
715
716 UserLeave();
717 return Ret;
718}
BOOL FASTCALL ValidateTimerCallback(PTHREADINFO pti, LPARAM lParam)
Definition: timer.c:155

Referenced by DispatchMessageA(), and DispatchMessageW().

◆ NtUserVkKeyScanEx()

DWORD NTAPI NtUserVkKeyScanEx ( WCHAR  wChar,
HKL  KeyboardLayout,
BOOL  bUsehHK 
)

Definition at line 1932 of file keyboard.c.

1936{
1937 PKBDTABLES pKbdTbl;
1938 PVK_TO_WCHAR_TABLE pVkToWchTbl;
1939 PVK_TO_WCHARS10 pVkToWch;
1940 PKL pKl = NULL;
1941 DWORD i, dwModBits = 0, dwModNumber = 0, Ret = (DWORD)-1;
1942
1943 TRACE("NtUserVkKeyScanEx() wch %u, KbdLayout 0x%p\n", wch, dwhkl);
1945
1946 if (bUsehKL)
1947 {
1948 // Use given keyboard layout
1949 if (dwhkl)
1950 pKl = UserHklToKbl(dwhkl);
1951 }
1952 else
1953 {
1954 // Use thread keyboard layout
1955 pKl = ((PTHREADINFO)PsGetCurrentThreadWin32Thread())->KeyboardLayout;
1956 }
1957
1958 if (!pKl)
1959 goto Exit;
1960
1961 pKbdTbl = pKl->spkf->pKbdTbl;
1962
1963 // Interate through all VkToWchar tables while pVkToWchars is not NULL
1964 for (i = 0; pKbdTbl->pVkToWcharTable[i].pVkToWchars; i++)
1965 {
1966 pVkToWchTbl = &pKbdTbl->pVkToWcharTable[i];
1967 pVkToWch = (PVK_TO_WCHARS10)(pVkToWchTbl->pVkToWchars);
1968
1969 // Interate through all virtual keys
1970 while (pVkToWch->VirtualKey)
1971 {
1972 for (dwModNumber = 0; dwModNumber < pVkToWchTbl->nModifications; dwModNumber++)
1973 {
1974 if (pVkToWch->wch[dwModNumber] == wch)
1975 {
1976 dwModBits = pKbdTbl->pCharModifiers->ModNumber[dwModNumber];
1977 TRACE("i %lu wC %04x: dwModBits %08x dwModNumber %08x MaxModBits %08x\n",
1978 i, wch, dwModBits, dwModNumber, pKbdTbl->pCharModifiers->wMaxModBits);
1979 Ret = (dwModBits << 8) | (pVkToWch->VirtualKey & 0xFF);
1980 goto Exit;
1981 }
1982 }
1983 pVkToWch = (PVK_TO_WCHARS10)(((BYTE *)pVkToWch) + pVkToWchTbl->cbSize);
1984 }
1985 }
1986Exit:
1987 UserLeave();
1988 return Ret;
1989}
PMODIFIERS pCharModifiers
Definition: kbd.h:96
PVK_TO_WCHAR_TABLE pVkToWcharTable
Definition: kbd.h:97
WORD wMaxModBits
Definition: kbd.h:28
BYTE ModNumber[]
Definition: kbd.h:29
BYTE cbSize
Definition: kbd.h:53
PVK_TO_WCHARS1 pVkToWchars
Definition: kbd.h:51
BYTE nModifications
Definition: kbd.h:52

Referenced by VkKeyScanExA(), VkKeyScanExW(), and VkKeyScanW().

◆ NtUserWaitForInputIdle()

DWORD NTAPI NtUserWaitForInputIdle ( IN HANDLE  hProcess,
IN DWORD  dwMilliseconds,
IN BOOL  bSharedWow 
)

Definition at line 3103 of file message.c.

3106{
3108 PPROCESSINFO W32Process;
3109 PTHREADINFO pti;
3111 HANDLE Handles[3];
3114
3116
3120 UserMode,
3121 (PVOID*)&Process,
3122 NULL);
3123
3124 if (!NT_SUCCESS(Status))
3125 {
3126 UserLeave();
3128 return WAIT_FAILED;
3129 }
3130
3132
3133 W32Process = (PPROCESSINFO)Process->Win32Process;
3134
3136 !W32Process ||
3137 pti->ppi == W32Process)
3138 {
3140 UserLeave();
3142 return WAIT_FAILED;
3143 }
3144
3145 Handles[0] = Process;
3146 Handles[1] = W32Process->InputIdleEvent;
3147 Handles[2] = pti->pEventQueueServer; // IntMsqSetWakeMask returns hEventQueueClient
3148
3149 if (!Handles[1])
3150 {
3152 UserLeave();
3153 return STATUS_SUCCESS; /* no event to wait on */
3154 }
3155
3156 if (dwMilliseconds != INFINITE)
3157 Timeout.QuadPart = (LONGLONG) dwMilliseconds * (LONGLONG) -10000;
3158
3160 W32Process->W32PF_flags |= W32PF_WAITFORINPUTIDLE;
3161 for (pti = W32Process->ptiList; pti; pti = pti->ptiSibling)
3162 {
3164 pti->pClientInfo->dwTIFlags = pti->TIF_flags;
3165 }
3167
3168 TRACE("WFII: ppi %p\n", W32Process);
3169 TRACE("WFII: waiting for %p\n", Handles[1] );
3170
3171 /*
3172 * We must add a refcount to our current PROCESSINFO,
3173 * because anything could happen (including process death) we're leaving win32k
3174 */
3175 IntReferenceProcessInfo(W32Process);
3176
3177 do
3178 {
3179 UserLeave();
3181 Handles,
3182 WaitAny,
3184 UserMode,
3185 FALSE,
3186 dwMilliseconds == INFINITE ? NULL : &Timeout,
3187 NULL);
3189
3190 if (!NT_SUCCESS(Status))
3191 {
3194 goto WaitExit;
3195 }
3196
3197 switch (Status)
3198 {
3199 case STATUS_WAIT_0:
3200 goto WaitExit;
3201
3202 case STATUS_WAIT_2:
3203 {
3204 MSG Msg;
3205 co_IntGetPeekMessage( &Msg, 0, 0, 0, PM_REMOVE | PM_QS_SENDMESSAGE, FALSE);
3206 ERR("WFII: WAIT 2\n");
3207 }
3208 break;
3209
3210 case STATUS_TIMEOUT:
3211 ERR("WFII: timeout\n");
3212 case WAIT_FAILED:
3213 goto WaitExit;
3214
3215 default:
3216 ERR("WFII: finished\n");
3218 goto WaitExit;
3219 }
3220 }
3221 while (TRUE);
3222
3223WaitExit:
3225 for (pti = W32Process->ptiList; pti; pti = pti->ptiSibling)
3226 {
3227 pti->TIF_flags &= ~TIF_WAITFORINPUTIDLE;
3228 pti->pClientInfo->dwTIFlags = pti->TIF_flags;
3229 }
3230 W32Process->W32PF_flags &= ~W32PF_WAITFORINPUTIDLE;
3232
3233 IntDereferenceProcessInfo(W32Process);
3235 UserLeave();
3236 return Status;
3237}
#define STATUS_TIMEOUT
Definition: d3dkmdt.h:49
#define TIF_WAITFORINPUTIDLE
Definition: ntuser.h:277
if(dx< 0)
Definition: linetemp.h:194
@ WaitAny
NTSTATUS NTAPI KeWaitForMultipleObjects(IN ULONG Count, IN PVOID Object[], IN WAIT_TYPE WaitType, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL, OUT PKWAIT_BLOCK WaitBlockArray OPTIONAL)
Definition: wait.c:586
BOOLEAN NTAPI PsGetProcessExitProcessCalled(PEPROCESS Process)
Definition: process.c:1043
#define STATUS_WAIT_0
Definition: ntstatus.h:330
#define STATUS_WAIT_2
Definition: ntstatus.h:124
static ULONG Timeout
Definition: ping.c:61
PKEVENT pEventQueueServer
Definition: win32.h:125
int64_t LONGLONG
Definition: typedefs.h:68
#define IntReferenceProcessInfo(ppi)
Definition: win32.h:182
#define W32PF_WAITFORINPUTIDLE
Definition: win32.h:22
#define IntDereferenceProcessInfo(ppi)
Definition: win32.h:187
#define INFINITE
Definition: message.c:3098
#define WAIT_FAILED
Definition: message.c:3099
@ UserRequest
Definition: ketypes.h:473

Referenced by WaitForInputIdle().

◆ NtUserWaitForMsgAndEvent()

DWORD NTAPI NtUserWaitForMsgAndEvent ( DWORD  Unknown0)

Definition at line 359 of file ntstubs.c.

361{
362 STUB
363
364 return 0;
365}

◆ NtUserWaitMessage()

BOOL NTAPI NtUserWaitMessage ( VOID  )

Definition at line 2329 of file message.c.

2330{
2331 BOOL ret;
2332
2334 TRACE("NtUserWaitMessage Enter\n");
2335 ret = co_IntWaitMessage(NULL, 0, 0);
2336 TRACE("NtUserWaitMessage Leave\n");
2337 UserLeave();
2338
2339 return ret;
2340}

Referenced by WaitMessage().

◆ NtUserWin32PoolAllocationStats()

DWORD NTAPI NtUserWin32PoolAllocationStats ( DWORD  Unknown0,
DWORD  Unknown1,
DWORD  Unknown2,
DWORD  Unknown3,
DWORD  Unknown4,
DWORD  Unknown5 
)

Definition at line 369 of file ntstubs.c.

376{
377 STUB
378
379 return 0;
380}

◆ NtUserWindowFromPoint()

HWND NTAPI NtUserWindowFromPoint ( LONG  X,
LONG  Y 
)

Definition at line 3884 of file winpos.c.

3885{
3886 POINT pt;
3887 HWND Ret = NULL;
3888 PWND DesktopWindow, Window;
3889 USHORT hittest;
3891
3892 TRACE("Enter NtUserWindowFromPoint\n");
3894
3895 if ((DesktopWindow = UserGetWindowObject(IntGetDesktopWindow())))
3896 {
3897 //PTHREADINFO pti;
3898
3899 pt.x = X;
3900 pt.y = Y;
3901
3902 // Hmm... Threads live on desktops thus we have a reference on the desktop and indirectly the desktop window.
3903 // It is possible this referencing is useless, though it should not hurt...
3904 UserRefObjectCo(DesktopWindow, &Ref);
3905
3906 //pti = PsGetCurrentThreadWin32Thread();
3907 Window = co_WinPosWindowFromPoint(DesktopWindow, &pt, &hittest, FALSE);
3908 if (Window)
3909 {
3910 Ret = UserHMGetHandle(Window);
3911 }
3912
3913 UserDerefObjectCo(DesktopWindow);
3914 }
3915
3916 TRACE("Leave NtUserWindowFromPoint, ret=%p\n", Ret);
3917 UserLeave();
3918 return Ret;
3919}
#define X(b, s)
PWND APIENTRY co_WinPosWindowFromPoint(IN PWND ScopeWin, IN POINT *WinPoint, IN OUT USHORT *HitTest, IN BOOL Ignore)
Definition: winpos.c:2992

Referenced by WindowFromPoint().

◆ NtUserYieldTask()

DWORD NTAPI NtUserYieldTask ( VOID  )

Definition at line 384 of file ntstubs.c.

385{
386 STUB
387
388 return 0;
389}

◆ RtlGetExpWinVer()

ULONG RtlGetExpWinVer ( _In_ PVOID  BaseAddress)

Definition at line 20 of file image.c.

21{
22 ULONG dwMajorVersion = 3, dwMinorVersion = 10; /* Set default to Windows 3.10 (WINVER_WIN31) */
23 PIMAGE_NT_HEADERS pNTHeader;
24 ULONG_PTR AlignedAddress = (ULONG_PTR)BaseAddress;
25
26 TRACE("(%p)\n", BaseAddress);
27
28 /* Remove the magic flag for non-mapped images */
29 if (AlignedAddress & 1)
30 AlignedAddress = (AlignedAddress & ~1);
31
32 if (AlignedAddress && !LOWORD(AlignedAddress))
33 {
34 pNTHeader = RtlImageNtHeader((PVOID)AlignedAddress);
35 if (pNTHeader)
36 {
37 dwMajorVersion = pNTHeader->OptionalHeader.MajorSubsystemVersion;
38 if (dwMajorVersion == 1)
39 dwMajorVersion = 3;
40 else
41 dwMinorVersion = pNTHeader->OptionalHeader.MinorSubsystemVersion;
42 }
43 }
44
45 return MAKEWORD(dwMinorVersion, dwMajorVersion);
46}
#define RtlImageNtHeader
Definition: compat.h:806
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184
#define MAKEWORD(a, b)
Definition: typedefs.h:248

Referenced by InitThreadCallback(), and User32CreateWindowEx().

◆ RtlInitLargeAnsiString()

VOID NTAPI RtlInitLargeAnsiString ( IN OUT  PLARGE_ANSI_STRING,
IN  PCSZ,
IN  INT 
)

Definition at line 17 of file rtlstr.c.

21{
22 USHORT DestSize;
23
24 if (SourceString)
25 {
26 DestSize = (USHORT)strlen(SourceString);
27 DestinationString->Length = DestSize;
28 DestinationString->MaximumLength = DestSize + sizeof(CHAR);
29 }
30 else
31 {
34 }
35
37 DestinationString->bAnsi = TRUE;
38}
#define CHAR(Char)
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1592
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1957
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1956
unsigned short Length
Definition: sprintf.c:451
void * Buffer
Definition: sprintf.c:453
unsigned short MaximumLength
Definition: sprintf.c:452

Referenced by DefSetText(), and RtlInitLargeString().

◆ RtlInitLargeUnicodeString()

VOID NTAPI RtlInitLargeUnicodeString ( IN OUT  PLARGE_UNICODE_STRING,
IN  PCWSTR,
IN  INT 
)

Definition at line 42 of file rtlstr.c.

46{
47 USHORT DestSize;
48
49 if (SourceString)
50 {
51 DestSize = (USHORT)wcslen(SourceString) * sizeof(WCHAR);
52 DestinationString->Length = DestSize;
53 DestinationString->MaximumLength = DestSize + sizeof(WCHAR);
54 }
55 else
56 {
59 }
60
62 DestinationString->bAnsi = FALSE;
63}
uint16_t * PWSTR
Definition: typedefs.h:56

Referenced by co_IntCreateDefaultImeWindow(), DefSetText(), and RtlInitLargeString().

◆ RtlLargeStringToUnicodeString()

BOOL NTAPI RtlLargeStringToUnicodeString ( PUNICODE_STRING  DestinationString,
PLARGE_STRING  SourceString 
)

Definition at line 67 of file rtlstr.c.

70{
72
73 /* Check parameters */
74 if (!DestinationString || !SourceString) return FALSE;
75
76 /* Check if size if ok */
77 // We can't do this atm and truncate the string instead.
78 //if (SourceString->Length > 0xffff) return FALSE;
79
81
82 if (SourceString->bAnsi)
83 {
86 }
87 else
88 {
90 }
91}
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
@ AnsiString
Definition: dnslib.h:19
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
char * LPSTR
Definition: typedefs.h:51

Referenced by NtUserDefSetText().

Variable Documentation

◆ bInternal

◆ IconInfo

◆ lpInstName

Definition at line 2311 of file ntuser.h.

◆ lpResName

Definition at line 2312 of file ntuser.h.

Referenced by _Success_().

◆ pbpp