ReactOS 0.4.15-dev-7788-g1ad9096
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  _IMEWND
 
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_CICERO_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 IS_IMM_MODE()   (gpsi && (gpsi->dwSRVIFlags & SRVINFO_IMM32))
 
#define IS_CICERO_MODE()   (gpsi && (gpsi->dwSRVIFlags & SRVINFO_CICERO_ENABLED))
 
#define IS_16BIT_MODE()   (GetWin32ClientInfo()->dwTIFlags & TIF_16BIT)
 
#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 _IMEWND IMEWND
 
typedef struct _IMEWNDPIMEWND
 
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_ISWINLOGON2 , 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)
 
DWORD NTAPI NtUserAssociateInputContext (HWND hWnd, HIMC hIMC, DWORD dwFlags)
 
NTSTATUS NTAPI NtUserBuildHimcList (DWORD dwThreadId, DWORD dwCount, HIMC *phList, LPDWORD 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 (HMENU hmenu, UINT fuFlags, int x, int y, HWND hwnd, 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 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 (UINT uVirtualKey, 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 (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 (HIMC hIMC)
 
BOOLEAN NTAPI NtUserDestroyWindow (HWND Wnd)
 
BOOL NTAPI NtUserDisableThreadIme (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 (HWND hWnd, UINT Flags)
 
DWORD NTAPI NtUserGetAppImeLevel (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 (DWORD dwHotKeyId, LPUINT lpuModifiers, LPUINT lpuVirtualKey, LPHKL lphKL)
 
BOOL NTAPI NtUserGetImeInfoEx (PIMEINFOEX pImeInfoEx, 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 (HWND hwnd, BOOL fOpen, 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 (HWND hWnd, INT Offset, ULONG_PTR dwNewLong, 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)
 
LONG_PTR APIENTRY NtUserSetClassLongPtr (VOID)
 
DWORD NTAPI NtUserSetDbgTag (DWORD Unknown0, DWORD Unknown1)
 
DWORD APIENTRY NtUserSetDbgTagCount (DWORD Unknown0)
 
HWND NTAPI NtUserSetFocus (HWND hWnd)
 
BOOL NTAPI NtUserSetImeHotKey (DWORD dwHotKeyId, UINT uModifiers, UINT uVirtualKey, HKL hKL, DWORD dwAction)
 
BOOL NTAPI NtUserSetImeInfoEx (PIMEINFOEX pImeInfoEx)
 
BOOL NTAPI NtUserSetImeOwnerWindow (HWND hImeWnd, 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 (HKL hNewKL, 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)
 

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.

◆ 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_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 3579 of file ntuser.h.

◆ HWNDPARAM_ROUTINE_ROS_NOTIFYWINEVENT

#define HWNDPARAM_ROUTINE_ROS_NOTIFYWINEVENT   0x1005

Definition at line 3589 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 1211 of file ntuser.h.

◆ IS_CICERO_MODE

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

Definition at line 1210 of file ntuser.h.

◆ IS_IMM_MODE

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

Definition at line 1209 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 3582 of file ntuser.h.

◆ MSQ_STATE_CAPTURE

#define MSQ_STATE_CAPTURE   0x1

Definition at line 3581 of file ntuser.h.

◆ MSQ_STATE_CARET

#define MSQ_STATE_CARET   0x6

Definition at line 3586 of file ntuser.h.

◆ MSQ_STATE_FOCUS

#define MSQ_STATE_FOCUS   0x3

Definition at line 3583 of file ntuser.h.

◆ MSQ_STATE_MENUOWNER

#define MSQ_STATE_MENUOWNER   0x4

Definition at line 3584 of file ntuser.h.

◆ MSQ_STATE_MOVESIZE

#define MSQ_STATE_MOVESIZE   0x5

Definition at line 3585 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 3574 of file ntuser.h.

◆ NtUserSetWindowLongPtr

#define NtUserSetWindowLongPtr   NtUserSetWindowLong

Definition at line 3282 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 3575 of file ntuser.h.

◆ ONEPARAM_ROUTINE_GETDESKTOPMAPPING

#define ONEPARAM_ROUTINE_GETDESKTOPMAPPING   0xfffe000e

Definition at line 3576 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 2829 of file ntuser.h.

◆ QUERY_WINDOW_ACTIVE_IME

#define QUERY_WINDOW_ACTIVE_IME   0x09

Definition at line 2836 of file ntuser.h.

◆ QUERY_WINDOW_DEFAULT_ICONTEXT

#define QUERY_WINDOW_DEFAULT_ICONTEXT   0x08

Definition at line 2835 of file ntuser.h.

◆ QUERY_WINDOW_DEFAULT_IME

#define QUERY_WINDOW_DEFAULT_IME   0x07

Definition at line 2834 of file ntuser.h.

◆ QUERY_WINDOW_FOCUS

#define QUERY_WINDOW_FOCUS   0x03

Definition at line 2830 of file ntuser.h.

◆ QUERY_WINDOW_FOREGROUND

#define QUERY_WINDOW_FOREGROUND   0x06

Definition at line 2833 of file ntuser.h.

◆ QUERY_WINDOW_ISHUNG

#define QUERY_WINDOW_ISHUNG   0x04

Definition at line 2831 of file ntuser.h.

◆ QUERY_WINDOW_REAL_ID

#define QUERY_WINDOW_REAL_ID   0x05

Definition at line 2832 of file ntuser.h.

◆ QUERY_WINDOW_UNIQUE_PROCESS_ID

#define QUERY_WINDOW_UNIQUE_PROCESS_ID   0x00

Definition at line 2827 of file ntuser.h.

◆ QUERY_WINDOW_UNIQUE_THREAD_ID

#define QUERY_WINDOW_UNIQUE_THREAD_ID   0x01

Definition at line 2828 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_CICERO_ENABLED

#define SRVINFO_CICERO_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 3588 of file ntuser.h.

◆ TWOPARAM_ROUTINE_SETGUITHRDHANDLE

#define TWOPARAM_ROUTINE_SETGUITHRDHANDLE   0xfffd0051

Definition at line 3578 of file ntuser.h.

◆ TWOPARAM_ROUTINE_SETMENUBARHEIGHT

#define TWOPARAM_ROUTINE_SETMENUBARHEIGHT   0xfffd0050

Definition at line 3577 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 1494 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

typedef struct _IMEWND * 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 1796 of file ntuser.h.

1797{
enum _CONSOLECONTROL * PCONSOLECONTROL
@ ConsoleCtrlDesktopConsoleThread
Definition: ntuser.h:1798
@ ConsoleMakePalettePublic
Definition: ntuser.h:1800
@ GuiConsoleWndClassAtom
Definition: ntuser.h:1799
@ ConsoleAcquireDisplayOwnership
Definition: ntuser.h:1801
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 1496 of file ntuser.h.

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

◆ 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_ISWINLOGON2 
THREADSTATE_CHECKCONIME 
THREADSTATE_GETTHREADINFO 
THREADSTATE_PROGMANWINDOW 
THREADSTATE_TASKMANWINDOW 

Definition at line 2470 of file ntuser.h.

2471{
2491 THREADSTATE_PROGMANWINDOW, /* FIXME: Delete this HACK */
2492 THREADSTATE_TASKMANWINDOW, /* FIXME: Delete this HACK */
2493};
@ THREADSTATE_GETCURSOR
Definition: ntuser.h:2478
@ THREADSTATE_DEFAULTIMEWINDOW
Definition: ntuser.h:2475
@ THREADSTATE_DEFAULTINPUTCONTEXT
Definition: ntuser.h:2476
@ THREADSTATE_CHECKCONIME
Definition: ntuser.h:2489
@ THREADSTATE_INSENDMESSAGE
Definition: ntuser.h:2482
@ THREADSTATE_GETTHREADINFO
Definition: ntuser.h:2490
@ THREADSTATE_CAPTUREWINDOW
Definition: ntuser.h:2474
@ THREADSTATE_TASKMANWINDOW
Definition: ntuser.h:2492
@ THREADSTATE_FOREGROUNDTHREAD
Definition: ntuser.h:2484
@ THREADSTATE_OLDKEYBOARDLAYOUT
Definition: ntuser.h:2486
@ THREADSTATE_GETINPUTSTATE
Definition: ntuser.h:2477
@ THREADSTATE_ISWINLOGON2
Definition: ntuser.h:2488
@ THREADSTATE_PROGMANWINDOW
Definition: ntuser.h:2491
@ THREADSTATE_ACTIVEWINDOW
Definition: ntuser.h:2473
@ THREADSTATE_GETMESSAGETIME
Definition: ntuser.h:2483
@ THREADSTATE_FOCUSWINDOW
Definition: ntuser.h:2472
@ THREADSTATE_GETMESSAGEEXTRAINFO
Definition: ntuser.h:2481
@ THREADSTATE_ISWINLOGON
Definition: ntuser.h:2487
@ THREADSTATE_UPTIMELASTREAD
Definition: ntuser.h:2480
@ THREADSTATE_CHANGEBITS
Definition: ntuser.h:2479
@ THREADSTATE_IMECOMPATFLAGS
Definition: ntuser.h:2485

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
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:1675
#define RtlEqualMemory(a, b, c)
Definition: kdvm.h:18
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#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/7]

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

◆ C_ASSERT() [2/7]

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

◆ C_ASSERT() [3/7]

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

◆ C_ASSERT() [4/7]

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

◆ C_ASSERT() [5/7]

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

◆ C_ASSERT() [6/7]

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

◆ C_ASSERT() [7/7]

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

◆ GetW32ProcessInfo()

◆ GetW32ThreadInfo()

◆ NtUserActivateKeyboardLayout()

HKL NTAPI NtUserActivateKeyboardLayout ( HKL  hKL,
ULONG  Flags 
)

Definition at line 1263 of file kbdlayout.c.

1266{
1267 PWINSTATION_OBJECT pWinSta;
1268 HKL hOldKL;
1269
1271
1272 /* FIXME */
1273
1275 hOldKL = co_IntActivateKeyboardLayout(pWinSta, hKL, Flags, NULL);
1276 UserLeave();
1277
1278 return hOldKL;
1279}
#define NULL
Definition: types.h:112
UINT_PTR HKL
Definition: msctf.idl:143
PWINSTATION_OBJECT FASTCALL IntGetProcessWindowStation(HWINSTA *phWinSta OPTIONAL)
Definition: winsta.c:400
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:251
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:242
HKL APIENTRY co_IntActivateKeyboardLayout(_Inout_ PWINSTATION_OBJECT pWinSta, _In_ HKL hKL, _In_ ULONG uFlags, _Inout_ PWND pWnd)
Definition: kbdlayout.c:818
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by User32DefWindowProc().

◆ NtUserAlterWindowStyle()

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

Definition at line 4087 of file window.c.

4088{
4089 LONG ret;
4090
4092
4093 if (hWnd == IntGetDesktopWindow())
4094 {
4096 UserLeave();
4097 return 0;
4098 }
4099
4100 ret = co_IntSetWindowLongPtr(hWnd, Index, NewValue, FALSE, sizeof(LONG), TRUE);
4101
4102 UserLeave();
4103
4104 return ret;
4105}
HWND hWnd
Definition: settings.c:17
long LONG
Definition: pedump.c:60
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
int ret
_In_ WDFCOLLECTION _In_ ULONG Index
HWND FASTCALL IntGetDesktopWindow(VOID)
Definition: desktop.c:1374
static LONG_PTR co_IntSetWindowLongPtr(HWND hWnd, DWORD Index, LONG_PTR NewValue, BOOL Ansi, ULONG Size, BOOL bAlter)
Definition: window.c:3825
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:22

Referenced by ButtonWndProc_common().

◆ NtUserAssociateInputContext()

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

Definition at line 1702 of file ime.c.

1703{
1704 DWORD ret = 2;
1705 PWND pWnd;
1706 PIMC pIMC;
1707
1709
1710 if (!IS_IMM_MODE())
1711 {
1712 ERR("!IS_IMM_MODE()\n");
1713 goto Quit;
1714 }
1715
1716 pWnd = ValidateHwndNoErr(hWnd);
1717 if (!pWnd)
1718 goto Quit;
1719
1720 pIMC = (hIMC ? UserGetObjectNoErr(gHandleTable, hIMC, TYPE_INPUTCONTEXT) : NULL);
1721 ret = IntAssociateInputContextEx(pWnd, pIMC, dwFlags);
1722
1723Quit:
1724 UserLeave();
1725 return ret;
1726}
#define ERR(fmt,...)
Definition: debug.h:110
#define ValidateHwndNoErr(hwnd)
Definition: precomp.h:84
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IS_IMM_MODE()
Definition: ntuser.h:1209
Definition: ntuser.h:694
Definition: ntuser.h:199
DWORD FASTCALL IntAssociateInputContextEx(PWND pWnd, PIMC pIMC, DWORD dwFlags)
Definition: ime.c:1636
PUSER_HANDLE_TABLE gHandleTable
Definition: object.c:13
PVOID UserGetObjectNoErr(PUSER_HANDLE_TABLE ht, HANDLE handle, HANDLE_TYPE type)
Definition: object.c:481
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

Referenced by ImmAssociateContext(), and ImmAssociateContextEx().

◆ NtUserAttachThreadInput()

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

Definition at line 665 of file input.c.

669{
671 PTHREADINFO pti, ptiTo;
672 BOOL Ret = FALSE;
673
675 TRACE("Enter NtUserAttachThreadInput %s\n",(fAttach ? "TRUE" : "FALSE" ));
676
677 pti = IntTID2PTI(UlongToHandle(idAttach));
678 ptiTo = IntTID2PTI(UlongToHandle(idAttachTo));
679
680 if ( !pti || !ptiTo )
681 {
682 TRACE("AttachThreadInput pti or ptiTo NULL.\n");
684 goto Exit;
685 }
686
687 Status = UserAttachThreadInput( pti, ptiTo, fAttach);
688 if (!NT_SUCCESS(Status))
689 {
690 TRACE("AttachThreadInput Error Status 0x%x. \n",Status);
692 }
693 else Ret = TRUE;
694
695Exit:
696 TRACE("Leave NtUserAttachThreadInput, ret=%d\n",Ret);
697 UserLeave();
698 return Ret;
699}
LONG NTSTATUS
Definition: precomp.h:26
#define UlongToHandle(ul)
Definition: basetsd.h:97
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
unsigned int BOOL
Definition: ntddk_ex.h:94
Status
Definition: gdiplustypes.h:25
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
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:480
PTHREADINFO FASTCALL IntTID2PTI(HANDLE id)
Definition: misc.c:42

◆ NtUserBeginPaint()

HDC NTAPI NtUserBeginPaint ( HWND  hWnd,
PAINTSTRUCT lPs 
)

Definition at line 1608 of file painting.c.

1609{
1610 PWND Window;
1611 PAINTSTRUCT Ps;
1613 HDC hDC;
1615 HDC Ret = NULL;
1616
1617 TRACE("Enter NtUserBeginPaint\n");
1619
1621 {
1622 goto Cleanup; // Return NULL
1623 }
1624
1625 UserRefObjectCo(Window, &Ref);
1626
1627 hDC = IntBeginPaint(Window, &Ps);
1628
1629 Status = MmCopyToCaller(UnsafePs, &Ps, sizeof(PAINTSTRUCT));
1630 if (! NT_SUCCESS(Status))
1631 {
1633 goto Cleanup; // Return NULL
1634 }
1635
1636 Ret = hDC;
1637
1638Cleanup:
1640
1641 TRACE("Leave NtUserBeginPaint, ret=%p\n", Ret);
1642 UserLeave();
1643 return Ret;
1644}
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:92
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:40
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:1435
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:122
VOID FASTCALL SetLastNtError(_In_ NTSTATUS Status)
Definition: error.c:31

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,
39 0,
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)

◆ NtUserBlockInput()

BOOL NTAPI NtUserBlockInput ( BOOL  BlockIt)

Definition at line 419 of file input.c.

421{
422 BOOL ret;
423
424 TRACE("Enter NtUserBlockInput\n");
426
428
429 UserLeave();
430 TRACE("Leave NtUserBlockInput, ret=%i\n", ret);
431
432 return ret;
433}
BOOL FASTCALL IntBlockInput(PTHREADINFO pti, BOOL BlockIt)
Definition: input.c:375

Referenced by BlockInput().

◆ NtUserBuildHimcList()

NTSTATUS NTAPI NtUserBuildHimcList ( DWORD  dwThreadId,
DWORD  dwCount,
HIMC phList,
LPDWORD  pdwCount 
)

Definition at line 690 of file ime.c.

691{
693 DWORD dwRealCount;
694 PTHREADINFO pti;
695
697
698 if (!IS_IMM_MODE())
699 {
700 ERR("!IS_IMM_MODE()\n");
702 goto Quit;
703 }
704
705 if (dwThreadId == 0)
706 {
707 pti = gptiCurrent;
708 }
709 else if (dwThreadId == INVALID_THREAD_ID)
710 {
711 pti = NULL;
712 }
713 else
714 {
716 if (!pti || !pti->rpdesk)
717 goto Quit;
718 }
719
721 {
722 ProbeForWrite(phList, dwCount * sizeof(HIMC), 1);
723 ProbeForWrite(pdwCount, sizeof(DWORD), 1);
724 *pdwCount = dwRealCount = UserBuildHimcList(pti, dwCount, phList);
725 }
727 {
728 ERR("%p, %p\n", phList, pdwCount);
729 _SEH2_YIELD(goto Quit);
730 }
731 _SEH2_END;
732
733 if (dwCount < dwRealCount)
735 else
737
738Quit:
739 UserLeave();
740 return ret;
741}
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 _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
PTHREADINFO gptiCurrent
Definition: ntuser.c:15
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:34
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:162
#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
#define INVALID_THREAD_ID
Definition: ime.c:15
DWORD FASTCALL UserBuildHimcList(PTHREADINFO pti, DWORD dwCount, HIMC *phList)
Definition: ime.c:536

Referenced by Imm32BuildHimcList().

◆ NtUserBuildHwndList()

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

Definition at line 1518 of file window.c.

1526{
1528 ULONG dwCount = 0;
1529
1530 if (pcHwndNeeded == NULL)
1532
1534
1535 if (hwndParent || !dwThreadId)
1536 {
1539
1540 if(!hwndParent)
1541 {
1542 if(hDesktop == NULL && !(Desktop = IntGetActiveDesktop()))
1543 {
1545 goto Quit;
1546 }
1547
1548 if(hDesktop)
1549 {
1551 UserMode,
1552 0,
1553 &Desktop);
1554 if(!NT_SUCCESS(Status))
1555 {
1557 goto Quit;
1558 }
1559 }
1560 hwndParent = Desktop->DesktopWindow;
1561 }
1562 else
1563 {
1564 hDesktop = 0;
1565 }
1566
1568 (Window = Parent->spwndChild))
1569 {
1570 BOOL bGoDown = TRUE;
1571
1573 while(TRUE)
1574 {
1575 if (bGoDown)
1576 {
1577 if (dwCount++ < cHwnd && phwndList)
1578 {
1579 _SEH2_TRY
1580 {
1581 ProbeForWrite(phwndList, sizeof(HWND), 1);
1582 *phwndList = UserHMGetHandle(Window);
1583 phwndList++;
1584 }
1586 {
1588 }
1589 _SEH2_END
1590 if(!NT_SUCCESS(Status))
1591 {
1592 break;
1593 }
1594 }
1595 if (Window->spwndChild && bChildren)
1596 {
1597 Window = Window->spwndChild;
1598 continue;
1599 }
1600 bGoDown = FALSE;
1601 }
1602 if (Window->spwndNext)
1603 {
1604 Window = Window->spwndNext;
1605 bGoDown = TRUE;
1606 continue;
1607 }
1608 Window = Window->spwndParent;
1609 if (Window == Parent)
1610 {
1611 break;
1612 }
1613 }
1614 }
1615
1616 if(hDesktop)
1617 {
1619 }
1620 }
1621 else // Build EnumThreadWindows list!
1622 {
1624 PTHREADINFO W32Thread;
1625 PWND Window;
1626 HWND *List = NULL;
1627
1629 if (!NT_SUCCESS(Status))
1630 {
1631 ERR("Thread Id is not valid!\n");
1633 goto Quit;
1634 }
1635 if (!(W32Thread = (PTHREADINFO)Thread->Tcb.Win32Thread))
1636 {
1638 TRACE("Tried to enumerate windows of a non gui thread\n");
1640 goto Quit;
1641 }
1642
1643 // Do not use Thread link list due to co_UserFreeWindow!!!
1644 // Current = W32Thread->WindowListHead.Flink;
1645 // Fixes Api:CreateWindowEx tests!!!
1647 if (List)
1648 {
1649 int i;
1650 for (i = 0; List[i]; i++)
1651 {
1653 if (Window && Window->head.pti == W32Thread)
1654 {
1655 if (dwCount < cHwnd && phwndList)
1656 {
1657 _SEH2_TRY
1658 {
1659 ProbeForWrite(phwndList, sizeof(HWND), 1);
1660 *phwndList = UserHMGetHandle(Window);
1661 phwndList++;
1662 }
1664 {
1666 }
1667 _SEH2_END
1668 if (!NT_SUCCESS(Status))
1669 {
1670 ERR("Failure to build window list!\n");
1671 break;
1672 }
1673 }
1674 dwCount++;
1675 }
1676 }
1678 }
1679
1681 }
1682
1683 *pcHwndNeeded = dwCount;
1685
1686Quit:
1688 UserLeave();
1689 return Status;
1690}
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
_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:35
NTSTATUS NTAPI PsLookupThreadByThreadId(IN HANDLE ThreadId, OUT PETHREAD *Thread)
Definition: thread.c:643
#define STATUS_INVALID_HANDLE
Definition: ntstatus.h:245
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:159
KTHREAD Tcb
Definition: pstypes.h:1103
PVOID Win32Thread
Definition: ketypes.h:1866
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:1262
PWND FASTCALL UserGetDesktopWindow(VOID)
Definition: desktop.c:1386
NTSTATUS FASTCALL IntValidateDesktopHandle(HDESK Desktop, KPROCESSOR_MODE AccessMode, ACCESS_MASK DesiredAccess, PDESKTOP *Object)
Definition: desktop.c:1237
#define USERTAG_WINDOWLIST
Definition: tags.h:298
HWND *FASTCALL IntWinListChildren(PWND Window)
Definition: window.c:274
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:122
#define ObDereferenceObject
Definition: obfuncs.h:203

Referenced by User32EnumWindows(), and WIN_ListChildren().

◆ NtUserBuildNameList()

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

Definition at line 1937 of file winsta.c.

1942{
1943 /* The WindowStation name list and desktop name list are build in completely
1944 different ways. Call the appropriate function */
1945 return NULL == hWindowStation ? BuildWindowStationNameList(dwSize, lpBuffer, pRequiredSize) :
1946 BuildDesktopNameList(hWindowStation, dwSize, lpBuffer, pRequiredSize);
1947}
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:175
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
static NTSTATUS FASTCALL BuildWindowStationNameList(ULONG dwSize, PVOID lpBuffer, PULONG pRequiredSize)
Definition: winsta.c:1622
static NTSTATUS FASTCALL BuildDesktopNameList(HWINSTA hWindowStation, ULONG dwSize, PVOID lpBuffer, PULONG pRequiredSize)
Definition: winsta.c:1810

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 5526 of file menu.c.

5532{
5533 HDC hdc;
5534 PWND Window;
5535 RECT Rect;
5536 DWORD ret;
5537
5539
5541 {
5543 UserLeave();
5544 return 0;
5545 }
5546
5548 if (!hdc)
5549 {
5550 UserLeave();
5551 return 0;
5552 }
5553
5554 Rect.left = leftBorder;
5555 Rect.right = Window->rcWindow.right - Window->rcWindow.left - rightBorder;
5556 Rect.top = top;
5557 Rect.bottom = 0;
5558
5560
5561 UserReleaseDC( 0, hdc, FALSE );
5562
5563 UserLeave();
5564
5565 return ret;
5566}
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:881
#define DCX_CACHE
Definition: winuser.h:2114

◆ NtUserCallHwnd()

DWORD 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 }
759
760 STUB;
761
762 return 0;
763}
PSERVERINFO gpsi
Definition: imm.c:18
#define WNDS_MSGBOX
Definition: ntuser.h:610
#define STUB
Definition: kernel32.h:27
#define DWORD
Definition: nt_native.h:44
VOID FASTCALL UserEnterShared(VOID)
Definition: ntuser.c:235
ATOM atomContextHelpIdProp
Definition: ntuser.h:1067
uint32_t DWORD_PTR
Definition: typedefs.h:65
BOOL IntDeRegisterShellHookWindow(HWND hWnd)
Definition: desktop.c:1784
BOOL IntRegisterShellHookWindow(HWND hWnd)
Definition: desktop.c:1752
HANDLE FASTCALL UserGetProp(_In_ PWND Window, _In_ ATOM Atom, _In_ BOOLEAN SystemProp)
Definition: prop.c:46
BOOL FASTCALL IntIsWindow(HWND hWnd)
Definition: window.c:176

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

◆ 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:1549
BOOL FASTCALL co_IntSetForegroundWindowMouse(PWND Window)
Definition: focus.c:1560
#define HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOWMOUSE
Definition: ntuser.h:3579
UINT FASTCALL co_WinPosArrangeIconicWindows(PWND parent)
Definition: winpos.c:731
BOOLEAN FASTCALL co_WinPosSetWindowPos(PWND Window, HWND WndInsertAfter, INT x, INT y, INT cx, INT cy, UINT flags)
Definition: winpos.c:1786
#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:1692
VOID FASTCALL IntCheckImeShowStatusInThread(PWND pImeWnd)
Definition: ime.c:2397
PWND FASTCALL IntGetParent(PWND Wnd)
Definition: window.c:204
UINT_PTR WPARAM
Definition: windef.h:207
#define SWP_NOACTIVATE
Definition: winuser.h:1242
#define SWP_FRAMECHANGED
Definition: winuser.h:1240
#define SWP_NOMOVE
Definition: winuser.h:1244
#define SWP_NOSIZE
Definition: winuser.h:1245
#define HWND_DESKTOP
Definition: winuser.h:1209
#define RDW_ALLCHILDREN
Definition: winuser.h:1221
#define SWP_NOZORDER
Definition: winuser.h:1247

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:805

Referenced by NtUserxSetProgmanWindow(), and NtUserxSetTaskmanWindow().

◆ NtUserCallHwndParam()

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

Definition at line 767 of file simplecall.c.

771{
772
773 switch (Routine)
774 {
776 {
777 DWORD ret;
778
781 UserLeave();
782 return ret;
783 }
784
786 {
787 PWND Window;
788
791 {
792 UserLeave();
793 return FALSE;
794 }
795
796 if (Param)
797 UserSetProp(Window, gpsi->atomContextHelpIdProp, (HANDLE)Param, TRUE);
798 else
800
801 UserLeave();
802 return TRUE;
803 }
804
806 {
807 PWND pWnd;
809
811
812 if (!(pWnd = UserGetWindowObject(hWnd)))
813 {
814 UserLeave();
815 return 0;
816 }
817 UserRefObjectCo(pWnd, &Ref);
818
819 if (pWnd->head.pti->ppi == PsGetCurrentProcessWin32Process() &&
820 pWnd->cbwndExtra >= DLGWINDOWEXTRA &&
822 {
823 pWnd->DialogPointer = (PVOID)Param;
824 if (Param)
825 {
826 if (!pWnd->fnid) pWnd->fnid = FNID_DIALOG;
827 pWnd->state |= WNDS_DIALOGWINDOW;
828 }
829 else
830 {
831 pWnd->fnid |= FNID_DESTROY;
832 pWnd->state &= ~WNDS_DIALOGWINDOW;
833 }
834 }
835
836 UserDerefObjectCo(pWnd);
837 UserLeave();
838 return 0;
839 }
840
842 {
843 PWND pWnd;
844 PNOTIFYEVENT pne;
846 pne = (PNOTIFYEVENT)Param;
847 if (hWnd)
849 else
850 pWnd = NULL;
851 IntNotifyWinEvent(pne->event, pWnd, pne->idObject, pne->idChild, pne->flags);
852 UserLeave();
853 return 0;
854 }
855
857 {
858 PWND pWnd;
861 if (pWnd) IntClearWindowState(pWnd, (UINT)Param);
862 UserLeave();
863 return 0;
864 }
865
867 {
868 PWND pWnd;
871 if (pWnd) IntSetWindowState(pWnd, (UINT)Param);
872 UserLeave();
873 return 0;
874 }
875 }
876
877 STUB;
878
879 return 0;
880}
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:3589
#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:616
VOID FASTCALL IntSetWindowState(PWND pWnd, UINT Flag)
Definition: misc.c:595
BOOL FASTCALL IntKillTimer(PWND Window, UINT_PTR IDEvent, BOOL SystemTimer)
Definition: timer.c:573
#define DLGWINDOWEXTRA
Definition: winuser.h:2565

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

◆ NtUserCallHwndParamLock()

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

Definition at line 884 of file simplecall.c.

888{
889 DWORD Ret = FALSE;
890 PWND Window;
892
893 TRACE("Enter NtUserCallHwndParamLock\n");
895
897 {
898 Ret = FALSE;
899 goto Exit;
900 }
901
902 UserRefObjectCo(Window, &Ref);
903
904 switch (Routine)
905 {
908 break;
909
911 {
912 PREGION Rgn = REGION_LockRgn((HRGN)Param);
914 if (Rgn) REGION_UnlockRgn(Rgn);
915 break;
916 }
917 }
918
920
921Exit:
922
923 TRACE("Leave NtUserCallHwndParamLock, ret=%lu\n", Ret);
924 UserLeave();
925
926 return Ret;
927}
Definition: region.h:8
BOOL FASTCALL co_UserRedrawWindow(PWND Window, const RECTL *UpdateRect, PREGION UpdateRgn, ULONG Flags)
Definition: painting.c:888
PREGION FASTCALL REGION_LockRgn(_In_ HRGN hrgn)
Definition: region.c:2358
VOID FASTCALL REGION_UnlockRgn(_In_ PREGION prgn)
Definition: region.c:2373
BOOL FASTCALL IntBroadcastImeShowStatusChange(PWND pImeWnd, BOOL bShow)
Definition: ime.c:2386
#define RDW_VALIDATE
Definition: winuser.h:1218

Referenced by ImeWnd_OnImeSystem(), and NtUserxValidateRgn().

◆ NtUserCallMsgFilter()

BOOL NTAPI NtUserCallMsgFilter ( LPMSG  msg,
INT  code 
)

Definition at line 2383 of file message.c.

2384{
2385 BOOL Ret = FALSE;
2386 MSG Msg;
2387
2388 _SEH2_TRY
2389 {
2390 ProbeForRead(lpmsg, sizeof(MSG), 1);
2391 RtlCopyMemory( &Msg, lpmsg, sizeof(MSG));
2392 }
2394 {
2395 _SEH2_YIELD(return FALSE);
2396 }
2397 _SEH2_END;
2398
2400
2402 {
2403 Ret = TRUE;
2404 }
2405 else
2406 {
2408 }
2409
2410 UserLeave();
2411
2412 _SEH2_TRY
2413 {
2414 ProbeForWrite(lpmsg, sizeof(MSG), 1);
2415 RtlCopyMemory(lpmsg, &Msg, sizeof(MSG));
2416 }
2418 {
2419 Ret = FALSE;
2420 }
2421 _SEH2_END;
2422
2423 return Ret;
2424}
struct @1627 Msg[]
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
LRESULT APIENTRY co_HOOK_CallHooks(INT HookId, INT Code, WPARAM wParam, LPARAM lParam)
Definition: hook.c:1102
Definition: inflate.c:139
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
LONG_PTR LPARAM
Definition: windef.h:208
#define WH_MSGFILTER
Definition: winuser.h:29
#define WH_SYSMSGFILTER
Definition: winuser.h:36

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
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:1701
LONG_PTR LRESULT
Definition: windef.h:209

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:1529
#define NOPARAM_ROUTINE_ISCONSOLEMODE
Definition: ntuser.h:3574
#define SRVINFO_IMM32
Definition: ntuser.h:949
BOOL FASTCALL IntMsqClearWakeMask(VOID)
Definition: msgqueue.c:392
BOOL FASTCALL UserLoadApiHook(VOID)
Definition: hook.c:131
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:36
BOOL gfIMEShowStatus
Definition: ime.c:29
HMENU FASTCALL UserCreateMenu(PDESKTOP Desktop, BOOL PopupMenu)
Definition: menu.c:5020
BOOL APIENTRY IntInitMessagePumpHook(VOID)
Definition: message.c:2110
BOOL APIENTRY IntUninitMessagePumpHook(VOID)
Definition: message.c:2123
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
#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:1571
BOOL FASTCALL IntAllowSetForegroundWindow(DWORD dwProcessId)
Definition: focus.c:1602
_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:2339
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING
Definition: ntuser.h:3575
#define ONEPARAM_ROUTINE_GETDESKTOPMAPPING
Definition: ntuser.h:3576
#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:2435
BOOL FASTCALL co_MsqReplyMessage(LRESULT lResult)
Definition: msgqueue.c:2472
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:279
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:37
#define LN_MESSAGE_BEEP
Definition: undocuser.h:120
#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:281
static __inline PVOID DesktopHeapAddressToUser(PVOID lpMem)
Definition: desktop.h:308
HKL FASTCALL UserGetKeyboardLayout(DWORD dwThreadId)
Definition: kbdlayout.c:1032
DWORD FASTCALL UserGetKeyboardType(DWORD dwTypeFlag)
Definition: keyboard.c:1684
DWORD APIENTRY IntGetQueueStatus(DWORD Changes)
Definition: message.c:2089
BOOL FASTCALL UserPostMessage(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1345
BOOL FASTCALL UserDeleteObject(HANDLE h, HANDLE_TYPE type)
Definition: object.c:717
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:115
#define LAYOUT_ORIENTATIONMASK
Definition: wingdi.h:1374
struct _SMWP SMWP
struct _SMWP * PSMWP
#define SM_SWAPBUTTON
Definition: winuser.h:984
#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:1260
PUSER_MESSAGE_QUEUE gpqForeground
Definition: focus.c:13
#define TWOPARAM_ROUTINE_SETGUITHRDHANDLE
Definition: ntuser.h:3578
#define TWOPARAM_ROUTINE_ROS_UPDATEUISTATE
Definition: ntuser.h:3588
#define TWOPARAM_ROUTINE_SETMENUBARHEIGHT
Definition: ntuser.h:3577
#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:63
HWND FASTCALL MsqSetStateWindow(PTHREADINFO pti, ULONG Type, HWND hWnd)
Definition: msgqueue.c:2495
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:398
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:193
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:220
BOOL FASTCALL IntShowOwnedPopups(PWND OwnerWnd, BOOL fShow)
Definition: window.c:4649
BOOL FASTCALL UserUpdateUiState(PWND Wnd, WPARAM wParam)
Definition: window.c:38
#define MAKEWPARAM(l, h)
Definition: winuser.h:4009
LRESULT(CALLBACK * HOOKPROC)(int, WPARAM, LPARAM)
Definition: winuser.h:2899
#define WM_SYSCOMMAND
Definition: winuser.h:1741
#define SWP_ASYNCWINDOWPOS
Definition: winuser.h:1253
#define QS_POSTMESSAGE
Definition: winuser.h:877
#define SC_RESTORE
Definition: winuser.h:2598
#define HWND_BOTTOM
Definition: winuser.h:1205

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

◆ 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:1445
#define WM_CHANGECBCHAIN
Definition: winuser.h:1874

Referenced by ChangeClipboardChain().

◆ NtUserChangeDisplaySettings()

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

Definition at line 946 of file display.c.

951{
952 WCHAR awcDevice[CCHDEVICENAME];
953 UNICODE_STRING ustrDevice;
954 DEVMODEW dmLocal;
955 LONG lRet;
956
957 /* Check arguments */
958 if ((dwflags != CDS_VIDEOPARAMETERS) && (lParam != NULL))
959 {
962 }
963
964 /* Check flags */
966 {
968 }
969
970 if ((dwflags & CDS_RESET) && (dwflags & CDS_NORESET))
971 {
973 }
974
975 /* Copy the device name */
976 if (pustrDevice)
977 {
978 /* Initialize destination string */
979 RtlInitEmptyUnicodeString(&ustrDevice, awcDevice, sizeof(awcDevice));
980
982 {
983 /* Probe the UNICODE_STRING and the buffer */
984 ProbeForRead(pustrDevice, sizeof(UNICODE_STRING), 1);
985 ProbeForRead(pustrDevice->Buffer, pustrDevice->Length, 1);
986
987 /* Copy the string */
988 RtlCopyUnicodeString(&ustrDevice, pustrDevice);
989 }
991 {
992 /* Set and return error */
995 }
997
998 pustrDevice = &ustrDevice;
999 }
1000
1001 /* Copy devmode */
1002 if (lpDevMode)
1003 {
1004 _SEH2_TRY
1005 {
1006 /* Probe the size field of the structure */
1007 ProbeForRead(lpDevMode, sizeof(dmLocal.dmSize), 1);
1008
1009 /* Calculate usable size */
1010 dmLocal.dmSize = min(sizeof(dmLocal), lpDevMode->dmSize);
1011
1012 /* Probe and copy the full DEVMODE */
1013 ProbeForRead(lpDevMode, dmLocal.dmSize, 1);
1014 RtlCopyMemory(&dmLocal, lpDevMode, dmLocal.dmSize);
1015 }
1017 {
1018 /* Set and return error */
1021 }
1022 _SEH2_END
1023
1024 /* Check for extra parameters */
1025 if (dmLocal.dmDriverExtra > 0)
1026 {
1027 /* FIXME: TODO */
1028 ERR("lpDevMode->dmDriverExtra is IGNORED!\n");
1029 dmLocal.dmDriverExtra = 0;
1030 }
1031
1032 /* Use the local structure */
1033 lpDevMode = &dmLocal;
1034 }
1035
1036 // FIXME: Copy videoparameters
1037
1038 /* Acquire global USER lock */
1040
1041 /* Call internal function */
1042 lRet = UserChangeDisplaySettings(pustrDevice, lpDevMode, dwflags, NULL);
1043
1044 /* Release lock */
1045 UserLeave();
1046
1047 return lRet;
1048}
#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)
WORD dmSize
Definition: wingdi.h:1568
WORD dmDriverExtra
Definition: wingdi.h:1621
WORD dmSize
Definition: wingdi.h:1620
LONG APIENTRY UserChangeDisplaySettings(PUNICODE_STRING pustrDevice, LPDEVMODEW pdm, DWORD flags, LPVOID lParam)
Definition: display.c:716
#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
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by ChangeDisplaySettingsExA(), and ChangeDisplaySettingsExW().

◆ NtUserCheckDesktopByThreadId()

BOOL NTAPI NtUserCheckDesktopByThreadId ( DWORD  dwThreadId)

◆ NtUserCheckImeHotKey()

DWORD NTAPI NtUserCheckImeHotKey ( UINT  uVirtualKey,
LPARAM  lParam 
)

Definition at line 467 of file ime.c.

468{
469 PIMEHOTKEY pNode;
471
473
474 if (!gpqForeground || !IS_IMM_MODE())
475 goto Quit;
476
477 pNode = IntCheckImeHotKey(gpqForeground, uVirtualKey, lParam);
478 if (pNode)
479 ret = pNode->dwHotKeyId;
480
481Quit:
482 UserLeave();
483 return ret;
484}
DWORD dwHotKeyId
Definition: ime.c:34
#define INVALID_HOTKEY
Definition: ime.c:16
PIMEHOTKEY IntCheckImeHotKey(PUSER_MESSAGE_QUEUE MessageQueue, UINT uVirtualKey, LPARAM lParam)
Definition: ime.c:275

◆ NtUserCheckMenuItem()

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

Definition at line 5572 of file menu.c.

5576{
5577 PMENU Menu;
5578 DWORD Ret = (DWORD)-1;
5579
5580 TRACE("Enter NtUserCheckMenuItem\n");
5582
5583 Menu = UserGetMenuObject(hMenu);
5584 if (Menu)
5585 {
5586 Ret = IntCheckMenuItem(Menu, uIDCheckItem, uCheck);
5587 }
5588
5589 TRACE("Leave NtUserCheckMenuItem, ret=%lu\n", Ret);
5590 UserLeave();
5591 return Ret;
5592}
FORCEINLINE PMENU UserGetMenuObject(HMENU hMenu)
Definition: userfuncs.h:4
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 3224 of file winpos.c.

3228{
3229 PWND pwndParent;
3230 TRACE("Enter NtUserChildWindowFromPointEx\n");
3232 if ((pwndParent = UserGetWindowObject(hwndParent)))
3233 {
3234 pwndParent = IntChildWindowFromPointEx(pwndParent, x, y, uiFlags);
3235 }
3236 UserLeave();
3237 TRACE("Leave NtUserChildWindowFromPointEx\n");
3238 return pwndParent ? UserHMGetHandle(pwndParent) : NULL;
3239}
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:3010

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 2722 of file desktop.c.

2723{
2724 PDESKTOP pdesk;
2726 BOOL Ret = FALSE;
2727
2728 TRACE("NtUserCloseDesktop(0x%p) called\n", hDesktop);
2730
2731 if (hDesktop == gptiCurrent->hdesk || hDesktop == gptiCurrent->ppi->hdeskStartup)
2732 {
2733 ERR("Attempted to close thread desktop\n");
2735 goto Exit; // Return FALSE
2736 }
2737
2738 Status = IntValidateDesktopHandle(hDesktop, UserMode, 0, &pdesk);
2739 if (!NT_SUCCESS(Status))
2740 {
2741 ERR("Validation of desktop handle 0x%p failed\n", hDesktop);
2742 goto Exit; // Return FALSE
2743 }
2744
2745 ObDereferenceObject(pdesk);
2746
2747 Status = ObCloseHandle(hDesktop, UserMode);
2748 if (!NT_SUCCESS(Status))
2749 {
2750 ERR("Failed to close desktop handle 0x%p\n", hDesktop);
2752 goto Exit; // Return FALSE
2753 }
2754
2755 Ret = TRUE;
2756
2757Exit:
2758 TRACE("Leave NtUserCloseDesktop, ret=%i\n", Ret);
2759 UserLeave();
2760 return Ret;
2761}
#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:263
PPROCESSINFO ppi
Definition: win32.h:88
HDESK hdesk
Definition: win32.h:108

Referenced by CloseDesktop().

◆ NtUserCloseWindowStation()

BOOL NTAPI NtUserCloseWindowStation ( HWINSTA  hWinSta)

Definition at line 1019 of file winsta.c.

1021{
1024
1025 TRACE("NtUserCloseWindowStation called (%p)\n", hWinSta);
1026
1027 if (hWinSta == UserGetProcessWindowStation())
1028 {
1029 ERR("Attempted to close process window station\n");
1030 return FALSE;
1031 }
1032
1034 UserMode,
1035 0,
1036 &Object,
1037 NULL);
1038 if (!NT_SUCCESS(Status))
1039 {
1040 ERR("Validation of window station handle (%p) failed\n", hWinSta);
1041 return FALSE;
1042 }
1043
1045
1046 TRACE("Closing window station handle (%p)\n", hWinSta);
1047
1048 Status = ObCloseHandle(hWinSta, UserMode);
1049 if (!NT_SUCCESS(Status))
1050 {
1052 return FALSE;
1053 }
1054
1055 return TRUE;
1056}
HWINSTA FASTCALL UserGetProcessWindowStation(VOID)
Definition: winsta.c:1353
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}
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_NOT_IMPLEMENTED
Definition: ntstatus.h:239
#define STATUS_INVALID_INFO_CLASS
Definition: ntstatus.h:240
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:1222

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;
1193
1195
1196 /* Create Clipboard data object */
1197 pMemObj = UserCreateObject(gHandleTable, NULL, NULL, &hMem, TYPE_CLIPDATA, sizeof(CLIPBOARDDATA) + cbData);
1198 if (!pMemObj)
1199 goto cleanup;
1200
1201 pMemObj->cbData = cbData;
1202
1203 /* Copy data */
1204 _SEH2_TRY
1205 {
1206 ProbeForRead(pData, cbData, 1);
1207 memcpy(pMemObj->Data, pData, cbData);
1208 }
1210 {
1211 pMemObj = NULL;
1212 }
1213 _SEH2_END;
1214
1215 /* Release the extra reference (UserCreateObject added 2 references) */
1216 UserDereferenceObject(pMemObj);
1217
1218 /* If we failed to copy data, remove handle */
1219 if (!pMemObj)
1220 {
1222 hMem = NULL;
1223 }
1224
1225cleanup:
1226 UserLeave();
1227
1228 return hMem;
1229}
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
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:644

Referenced by GetClipboardData(), and SetClipboardData().

◆ 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}
static const ENTRY Entries[]
HACCEL hAccel
Definition: main.c:47
WORD cmd
Definition: winuser.h:2925
BYTE fVirt
Definition: winuser.h:2923
WORD key
Definition: winuser.h:2924
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 || EntriesCount <= 0)
241 {
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 TRACE("Leave NtUserCreateAcceleratorTable(Entries %p, EntriesCount %u) = %p\n",
318 Entries, EntriesCount, Ret);
319 UserLeave();
320 return Ret;
321}
_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:62
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
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
char CHAR
Definition: xmlstorage.h:175

Referenced by CreateAcceleratorTableW(), and U32LoadAccelerators().

◆ NtUserCreateCaret()

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

Definition at line 310 of file caret.c.

315{
316 PWND Window;
317 PTHREADINFO pti;
318 PUSER_MESSAGE_QUEUE ThreadQueue;
319 BOOL Ret = FALSE;
320
321 TRACE("Enter NtUserCreateCaret\n");
323
325 {
326 goto Exit; // Return FALSE
327 }
328
329 if(Window->head.pti->pEThread != PsGetCurrentThread())
330 {
332 goto Exit; // Return FALSE
333 }
334
336 ThreadQueue = pti->MessageQueue;
337
338 if (ThreadQueue->CaretInfo.Visible)
339 {
341 co_IntHideCaret(&ThreadQueue->CaretInfo);
342 }
343
344 ThreadQueue->CaretInfo.hWnd = hWnd;
345 if(hBitmap)
346 {
347 ThreadQueue->CaretInfo.Bitmap = hBitmap;
348 ThreadQueue->CaretInfo.Size.cx = ThreadQueue->CaretInfo.Size.cy = 0;
349 }
350 else
351 {
352 if (nWidth == 0)
353 {
355 }
356 if (nHeight == 0)
357 {
359 }
360 ThreadQueue->CaretInfo.Bitmap = (HBITMAP)0;
361 ThreadQueue->CaretInfo.Size.cx = nWidth;
362 ThreadQueue->CaretInfo.Size.cy = nHeight;
363 }
364 ThreadQueue->CaretInfo.Visible = 0;
365 ThreadQueue->CaretInfo.Showing = 0;
366
368
369 IntNotifyWinEvent(EVENT_OBJECT_CREATE, Window, OBJID_CARET, CHILDID_SELF, 0);
370
371 Ret = TRUE;
372
373Exit:
374 TRACE("Leave NtUserCreateCaret, ret=%i\n", Ret);
375 UserLeave();
376 return Ret;
377}
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:80
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:213
UINT_PTR FASTCALL IntSetTimer(PWND Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type)
Definition: timer.c:177
#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:965
#define SM_CXBORDER
Definition: winuser.h:964

Referenced by CreateCaret().

◆ NtUserCreateDesktop()

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

Definition at line 2529 of file desktop.c.

2535{
2537 HDESK hDesk;
2538 HDESK Ret = NULL;
2539
2540 TRACE("Enter NtUserCreateDesktop\n");
2542
2543 Status = IntCreateDesktop(&hDesk,
2545 UserMode,
2546 lpszDesktopDevice,
2547 lpdmw,
2548 dwFlags,
2549 dwDesiredAccess);
2550 if (!NT_SUCCESS(Status))
2551 {
2552 ERR("IntCreateDesktop failed, Status 0x%08lx\n", Status);
2553 // SetLastNtError(Status);
2554 goto Exit; // Return NULL
2555 }
2556
2557 Ret = hDesk;
2558
2559Exit:
2560 TRACE("Leave NtUserCreateDesktop, ret=0x%p\n", Ret);
2561 UserLeave();
2562 return Ret;
2563}
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:2352

Referenced by CreateDesktopW().

◆ NtUserCreateInputContext()

HIMC NTAPI NtUserCreateInputContext ( ULONG_PTR  dwClientImcData)

Definition at line 1606 of file ime.c.

1607{
1608 PIMC pIMC;
1609 HIMC ret = NULL;
1610
1612
1613 if (!IS_IMM_MODE())
1614 {
1615 ERR("!IS_IMM_MODE()\n");
1617 goto Quit;
1618 }
1619
1620 if (!dwClientImcData)
1621 {
1623 goto Quit;
1624 }
1625
1626 pIMC = UserCreateInputContext(dwClientImcData);
1627 if (pIMC)
1628 ret = UserHMGetHandle(pIMC);
1629
1630Quit:
1631 UserLeave();
1632 return ret;
1633}
PIMC FASTCALL UserCreateInputContext(ULONG_PTR dwClientImcData)
Definition: ime.c:1558

Referenced by ImmCreateContext().

◆ NtUserCreateLocalMemHandle()

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

Definition at line 1232 of file clipboard.c.

1237{
1238 PCLIPBOARDDATA pMemObj;
1240
1242
1243 /* Get Clipboard data object */
1245 if (!pMemObj)
1246 {
1248 goto cleanup;
1249 }
1250
1251 /* Don't overrun */
1252 if (cbData > pMemObj->cbData)
1253 cbData = pMemObj->cbData;
1254
1255 /* Copy data to usermode */
1256 _SEH2_TRY
1257 {
1258 if (pcbData)
1259 {
1260 ProbeForWrite(pcbData, sizeof(*pcbData), 1);
1261 *pcbData = pMemObj->cbData;
1262 }
1263
1264 ProbeForWrite(pData, cbData, 1);
1265 memcpy(pData, pMemObj->Data, cbData);
1266 }
1268 {
1270 }
1271 _SEH2_END;
1272
1273cleanup:
1274 UserLeave();
1275
1276 return Status;
1277}
struct tagCLIPBOARDDATA * PCLIPBOARDDATA
PVOID UserGetObject(PUSER_HANDLE_TABLE ht, HANDLE handle, HANDLE_TYPE type)
Definition: object.c:495
_In_ DWORD _Out_writes_bytes_to_opt_ pcbData void _Inout_ DWORD * pcbData
Definition: wincrypt.h:4950

Referenced by 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 2666 of file window.c.

2682{
2684 LARGE_STRING lstrWindowName;
2685 LARGE_STRING lstrClassName;
2686 LARGE_STRING lstrClsVersion;
2687 UNICODE_STRING ustrClassName;
2688 UNICODE_STRING ustrClsVersion;
2689 CREATESTRUCTW Cs;
2690 HWND hwnd = NULL;
2691 PWND pwnd;
2692
2693 lstrWindowName.Buffer = NULL;
2694 lstrClassName.Buffer = NULL;
2695 lstrClsVersion.Buffer = NULL;
2696
2697 if ( (dwStyle & (WS_POPUP|WS_CHILD)) != WS_CHILD)
2698 {
2699 /* check hMenu is valid handle */
2700 if (hMenu && !UserGetMenuObject(hMenu))
2701 {
2702 ERR("NtUserCreateWindowEx: Got an invalid menu handle!\n");
2704 return NULL;
2705 }
2706 }
2707
2708 /* Copy the window name to kernel mode */
2709 Status = ProbeAndCaptureLargeString(&lstrWindowName, plstrWindowName);
2710 if (!NT_SUCCESS(Status))
2711 {
2712 ERR("NtUserCreateWindowEx: failed to capture plstrWindowName\n");
2714 return NULL;
2715 }
2716
2717 plstrWindowName = &lstrWindowName;
2718
2719 /* Check if the class is an atom */
2720 if (IS_ATOM(plstrClassName))
2721 {
2722 /* It is, pass the atom in the UNICODE_STRING */
2723 ustrClassName.Buffer = (PVOID)plstrClassName;
2724 ustrClassName.Length = 0;
2725 ustrClassName.MaximumLength = 0;
2726 }
2727 else
2728 {
2729 /* It's not, capture the class name */
2730 Status = ProbeAndCaptureLargeString(&lstrClassName, plstrClassName);
2731 if (!NT_SUCCESS(Status))
2732 {
2733 ERR("NtUserCreateWindowEx: failed to capture plstrClassName\n");
2734 /* Set last error, cleanup and return */
2736 goto cleanup;
2737 }
2738
2739 /* We pass it on as a UNICODE_STRING */
2740 ustrClassName.Buffer = lstrClassName.Buffer;
2741 ustrClassName.Length = (USHORT)min(lstrClassName.Length, MAXUSHORT); // FIXME: LARGE_STRING truncated
2742 ustrClassName.MaximumLength = (USHORT)min(lstrClassName.MaximumLength, MAXUSHORT);
2743 }
2744
2745 /* Check if the class version is an atom */
2746 if (IS_ATOM(plstrClsVersion))
2747 {
2748 /* It is, pass the atom in the UNICODE_STRING */
2749 ustrClsVersion.Buffer = (PVOID)plstrClsVersion;
2750 ustrClsVersion.Length = 0;
2751 ustrClsVersion.MaximumLength = 0;
2752 }
2753 else
2754 {
2755 /* It's not, capture the class name */
2756 Status = ProbeAndCaptureLargeString(&lstrClsVersion, plstrClsVersion);
2757 if (!NT_SUCCESS(Status))
2758 {
2759 ERR("NtUserCreateWindowEx: failed to capture plstrClsVersion\n");
2760 /* Set last error, cleanup and return */
2762 goto cleanup;
2763 }
2764
2765 /* We pass it on as a UNICODE_STRING */
2766 ustrClsVersion.Buffer = lstrClsVersion.Buffer;
2767 ustrClsVersion.Length = (USHORT)min(lstrClsVersion.Length, MAXUSHORT); // FIXME: LARGE_STRING truncated
2768 ustrClsVersion.MaximumLength = (USHORT)min(lstrClsVersion.MaximumLength, MAXUSHORT);
2769 }
2770
2771 /* Fill the CREATESTRUCTW */
2772 /* we will keep here the original parameters */
2773 Cs.style = dwStyle;
2774 Cs.lpCreateParams = lpParam;
2775 Cs.hInstance = hInstance;
2776 Cs.hMenu = hMenu;
2778 Cs.cx = nWidth;
2779 Cs.cy = nHeight;
2780 Cs.x = x;
2781 Cs.y = y;
2782 Cs.lpszName = (LPCWSTR) plstrWindowName->Buffer;
2783 Cs.lpszClass = ustrClassName.Buffer;
2784 Cs.dwExStyle = dwExStyle;
2785
2787
2788 /* Call the internal function */
2789 pwnd = co_UserCreateWindowEx(&Cs, &ustrClsVersion, plstrWindowName, acbiBuffer, dwFlags);
2790
2791 if(!pwnd)
2792 {
2793 ERR("co_UserCreateWindowEx failed!\n");
2794 }
2795 hwnd = pwnd ? UserHMGetHandle(pwnd) : NULL;
2796
2797 UserLeave();
2798
2799cleanup:
2800 if (lstrWindowName.Buffer)
2801 {
2802 ExFreePoolWithTag(lstrWindowName.Buffer, TAG_STRING);
2803 }
2804 if (lstrClassName.Buffer)
2805 {
2806 ExFreePoolWithTag(lstrClassName.Buffer, TAG_STRING);
2807 }
2808 if (lstrClsVersion.Buffer)
2809 {
2810 ExFreePoolWithTag(lstrClsVersion.Buffer, TAG_STRING);
2811 }
2812
2813 return hwnd;
2814}
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:2965
LPCWSTR lpszName
Definition: winuser.h:2964
LPVOID lpCreateParams
Definition: winuser.h:2955
HINSTANCE hInstance
Definition: winuser.h:2956
#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:2173
NTSTATUS NTAPI ProbeAndCaptureLargeString(OUT PLARGE_STRING plstrSafe, IN PLARGE_STRING plstrUnsafe)
Definition: window.c:2609
#define ERROR_INVALID_MENU_HANDLE
Definition: winerror.h:882
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by CreateWnd(), and User32CreateWindowEx().

◆ 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 3261 of file winpos.c.

3269{
3270 PWND pWnd, pWndIA;
3271 HDWP Ret = NULL;
3275
3276 TRACE("Enter NtUserDeferWindowPos\n");
3278
3279 if ( Flags & Tmp )
3280 {
3282 goto Exit;
3283 }
3284
3285 pWnd = UserGetWindowObject(Wnd);
3286 if (!pWnd || UserIsDesktopWindow(pWnd) || UserIsMessageWindow(pWnd))
3287 {
3288 goto Exit;
3289 }
3290
3291 if ( WndInsertAfter &&
3292 WndInsertAfter != HWND_BOTTOM &&
3293 WndInsertAfter != HWND_TOPMOST &&
3294 WndInsertAfter != HWND_NOTOPMOST )
3295 {
3296 pWndIA = UserGetWindowObject(WndInsertAfter);
3297 if (!pWndIA || UserIsDesktopWindow(pWndIA) || UserIsMessageWindow(pWndIA))
3298 {
3299 goto Exit;
3300 }
3301 }
3302
3303 Ret = IntDeferWindowPos(WinPosInfo, Wnd, WndInsertAfter, x, y, cx, cy, Flags);
3304
3305Exit:
3306 TRACE("Leave NtUserDeferWindowPos, ret=%p\n", Ret);
3307 UserLeave();
3308 return Ret;
3309}
HDWP FASTCALL IntDeferWindowPos(HDWP hdwp, HWND hwnd, HWND hwndAfter, INT x, INT y, INT cx, INT cy, UINT flags)
Definition: winpos.c:3063
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
#define UserIsMessageWindow(pWnd)
Definition: desktop.h:197
#define UserIsDesktopWindow(pWnd)
Definition: desktop.h:194
#define ERROR_INVALID_FLAGS
Definition: winerror.h:583
#define SWP_NOREDRAW
Definition: winuser.h:1246
#define SWP_NOREPOSITION
Definition: winuser.h:1250
#define HWND_TOPMOST
Definition: winuser.h:1208
#define SWP_DEFERERASE
Definition: winuser.h:1252
#define SWP_NOCOPYBITS
Definition: winuser.h:1243
#define SWP_SHOWWINDOW
Definition: winuser.h:1248
#define SWP_HIDEWINDOW
Definition: winuser.h:1241
#define SWP_NOSENDCHANGING
Definition: winuser.h:1251
#define HWND_NOTOPMOST
Definition: winuser.h:1206

Referenced by DeferWindowPos().

◆ NtUserDefSetText()

BOOL NTAPI NtUserDefSetText ( HWND  WindowHandle,
PLARGE_STRING  WindowText 
)

Definition at line 4453 of file window.c.

4454{
4455 PWND Wnd;
4456 LARGE_STRING SafeText;
4458 BOOL Ret = TRUE;
4459
4460 TRACE("Enter NtUserDefSetText\n");
4461
4462 if (WindowText != NULL)
4463 {
4464 _SEH2_TRY
4465 {
4466 SafeText = ProbeForReadLargeString(WindowText);
4467 }
4469 {
4470 Ret = FALSE;
4472 }
4473 _SEH2_END;
4474
4475 if (!Ret)
4476 return FALSE;
4477 }
4478 else
4479 return TRUE;
4480
4482
4483 if(!(Wnd = UserGetWindowObject(hWnd)))
4484 {
4485 UserLeave();
4486 return FALSE;
4487 }
4488
4489 // ReactOS uses Unicode and not mixed. Up/Down converting will take time.
4490 // Brought to you by: The Wine Project! Dysfunctional Thought Processes!
4491 // Now we know what the bAnsi is for.
4493 if (SafeText.Buffer)
4494 {
4495 _SEH2_TRY
4496 {
4497 if (SafeText.bAnsi)
4498 ProbeForRead(SafeText.Buffer, SafeText.Length, sizeof(CHAR));
4499 else
4500 ProbeForRead(SafeText.Buffer, SafeText.Length, sizeof(WCHAR));
4502 }
4504 {
4505 Ret = FALSE;
4507 }
4508 _SEH2_END;
4509 if (!Ret) goto Exit;
4510 }
4511
4512 if (UnicodeString.Length != 0)
4513 {
4514 if (Wnd->strName.MaximumLength > 0 &&
4515 UnicodeString.Length <= Wnd->strName.MaximumLength - sizeof(UNICODE_NULL))
4516 {
4517 ASSERT(Wnd->strName.Buffer != NULL);
4518
4519 Wnd->strName.Length = UnicodeString.Length;
4520 Wnd->strName.Buffer[UnicodeString.Length / sizeof(WCHAR)] = L'\0';
4522 UnicodeString.Buffer,
4523 UnicodeString.Length);
4524 }
4525 else
4526 {
4527 PWCHAR buf;
4528 Wnd->strName.MaximumLength = Wnd->strName.Length = 0;
4529 buf = Wnd->strName.Buffer;
4530 Wnd->strName.Buffer = NULL;
4531 if (buf != NULL)
4532 {
4534 }
4535
4537 UnicodeString.Length + sizeof(UNICODE_NULL));
4538 if (Wnd->strName.Buffer != NULL)
4539 {
4540 Wnd->strName.Buffer[UnicodeString.Length / sizeof(WCHAR)] = L'\0';
4542 UnicodeString.Buffer,
4543 UnicodeString.Length);
4544 Wnd->strName.MaximumLength = UnicodeString.Length + sizeof(UNICODE_NULL);
4545 Wnd->strName.Length = UnicodeString.Length;
4546 }
4547 else
4548 {
4550 Ret = FALSE;
4551 goto Exit;
4552 }
4553 }
4554 }
4555 else
4556 {
4557 Wnd->strName.Length = 0;
4558 if (Wnd->strName.Buffer != NULL)
4559 Wnd->strName.Buffer[0] = L'\0';
4560 }
4561
4562 // FIXME: HAX! Windows does not do this in here!
4563 // In User32, these are called after: NotifyWinEvent EVENT_OBJECT_NAMECHANGE than
4564 // RepaintButton, StaticRepaint, NtUserCallHwndLock HWNDLOCK_ROUTINE_REDRAWFRAMEANDHOOK, etc.
4565 /* Send shell notifications */
4566 if (!Wnd->spwndOwner && !IntGetParent(Wnd))
4567 {
4568 co_IntShellHookNotify(HSHELL_REDRAW, (WPARAM) hWnd, FALSE); // FIXME Flashing?
4569 }
4570
4571 Ret = TRUE;
4572Exit:
4574 TRACE("Leave NtUserDefSetText, ret=%i\n", Ret);
4575 UserLeave();
4576 return Ret;
4577}
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
#define L(x)
Definition: ntvdm.h:50
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
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

Referenced by DefSetText().

◆ NtUserDeleteMenu()

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

Definition at line 5598 of file menu.c.

5602{
5603 PMENU Menu;
5604 BOOL Ret = FALSE;
5605
5606 TRACE("Enter NtUserDeleteMenu\n");
5608
5609 Menu = UserGetMenuObject(hMenu);
5610 if (Menu)
5611 {
5612 Ret = IntRemoveMenuItem(Menu, uPosition, uFlags, TRUE);
5613 }
5614
5615 TRACE("Leave NtUserDeleteMenu, ret=%i\n", Ret);
5616 UserLeave();
5617 return Ret;
5618}
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 789 of file cursoricon.c.

792{
793 BOOL ret;
794 PCURICON_OBJECT CurIcon = NULL;
795
796 TRACE("Enter NtUserDestroyCursorIcon (%p, %i)\n", hCurIcon, bForce);
798
799 CurIcon = UserGetCurIconObject(hCurIcon);
800 if (!CurIcon)
801 {
802 ret = FALSE;
803 goto leave;
804 }
805
806 if (!bForce)
807 {
808 /* Can not destroy global objects */
809 if (CurIcon->head.ppi == NULL)
810 {
811 ERR("Trying to delete global cursor!\n");
812 ret = TRUE;
813 goto leave;
814 }
815
816 /* Maybe we have good reasons not to destroy this object */
817 if (CurIcon->head.ppi != PsGetCurrentProcessWin32Process())
818 {
819 /* No way, you're not touching my cursor */
820 ret = FALSE;
821 goto leave;
822 }
823
824 if (CurIcon->CURSORF_flags & CURSORF_CURRENT)
825 {
826 WARN("Trying to delete current cursor!\n");
827 ret = FALSE;
828 goto leave;
829 }
830
831 if (CurIcon->CURSORF_flags & CURSORF_LRSHARED)
832 {
833 WARN("Trying to delete shared cursor.\n");
834 /* This one is not an error */
835 ret = TRUE;
836 goto leave;
837 }
838 }
839
840 /* Destroy the handle */
841 ret = IntDestroyCurIconObject(CurIcon);
842
843leave:
844 if (CurIcon)
845 UserDereferenceObject(CurIcon);
846 TRACE("Leave NtUserDestroyCursorIcon, ret=%i\n", ret);
847 UserLeave();
848 return ret;
849}
#define WARN(fmt,...)
Definition: debug.h:112
#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:313

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

◆ NtUserDestroyInputContext()

BOOL NTAPI NtUserDestroyInputContext ( HIMC  hIMC)

Definition at line 1535 of file ime.c.

1536{
1537 BOOL ret = FALSE;
1538 PIMC pIMC;
1539
1541
1542 if (!IS_IMM_MODE())
1543 {
1545 goto Quit;
1546 }
1547
1549 if (pIMC)
1551
1552Quit:
1553 UserLeave();
1554 return ret;
1555}
BOOL IntDestroyInputContext(PIMC pIMC)
Definition: ime.c:1496

Referenced by Imm32DestroyInputContext().

◆ NtUserDestroyMenu()

BOOL NTAPI NtUserDestroyMenu ( HMENU  hMenu)

Definition at line 5806 of file menu.c.

5808{
5809 PMENU Menu;
5810 BOOL Ret = FALSE;
5811
5812 TRACE("Enter NtUserDestroyMenu\n");
5814
5815 if(!(Menu = UserGetMenuObject(hMenu)))
5816 {
5817 goto Exit; // Return FALSE
5818 }
5819 if (Menu->head.rpdesk != gptiCurrent->rpdesk)
5820 {
5822 goto Exit; // Return FALSE
5823 }
5824 Ret = IntDestroyMenuObject(Menu, TRUE);
5825
5826Exit:
5827 TRACE("Leave NtUserDestroyMenu, ret=%i\n", Ret);
5828 UserLeave();
5829 return Ret;
5830}
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().

◆ NtUserDestroyWindow()

BOOLEAN NTAPI NtUserDestroyWindow ( HWND  Wnd)

Definition at line 3037 of file window.c.

3038{
3039 PWND Window;
3040 BOOLEAN ret = FALSE;
3042
3043 TRACE("Enter NtUserDestroyWindow\n");
3045
3047 if (Window)
3048 {
3049 UserRefObjectCo(Window, &Ref); // FIXME: Dunno if win should be reffed during destroy...
3051 UserDerefObjectCo(Window); // FIXME: Dunno if win should be reffed during destroy...
3052 }
3053
3054 TRACE("Leave NtUserDestroyWindow, ret=%u\n", ret);
3055 UserLeave();
3056 return ret;
3057}
BOOLEAN co_UserDestroyWindow(PVOID Object)
Definition: window.c:2853

Referenced by DestroyWindow(), and User32DestroyImeUIWindow().

◆ NtUserDisableThreadIme()

BOOL NTAPI NtUserDisableThreadIme ( DWORD  dwThreadID)

Definition at line 852 of file ime.c.

854{
855 PTHREADINFO pti, ptiCurrent;
856 PPROCESSINFO ppi;
857 BOOL ret = FALSE;
858
860
861 if (!IS_IMM_MODE())
862 {
863 ERR("!IS_IMM_MODE()\n");
865 goto Quit;
866 }
867
868 ptiCurrent = GetW32ThreadInfo();
869
870 if (dwThreadID == INVALID_THREAD_ID)
871 {
872 ppi = ptiCurrent->ppi;
873 ppi->W32PF_flags |= W32PF_DISABLEIME;
874
875Retry:
876 for (pti = ppi->ptiList; pti; pti = pti->ptiSibling)
877 {
879
880 if (pti->spwndDefaultIme)
881 {
883 pti->spwndDefaultIme = NULL;
884 goto Retry; /* The contents of ppi->ptiList may be changed. */
885 }
886 }
887 }
888 else
889 {
890 if (dwThreadID == 0)
891 {
892 pti = ptiCurrent;
893 }
894 else
895 {
896 pti = IntTID2PTI(UlongToHandle(dwThreadID));
897
898 /* The thread needs to reside in the current process. */
899 if (!pti || pti->ppi != ptiCurrent->ppi)
900 goto Quit;
901 }
902
904
905 if (pti->spwndDefaultIme)
906 {
908 pti->spwndDefaultIme = NULL;
909 }
910 }
911
912 ret = TRUE;
913
914Quit:
915 UserLeave();
916 return ret;
917}
_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:256
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:2853
#define W32PF_DISABLEIME
Definition: win32.h:28

Referenced by ImmDisableIME().

◆ NtUserDispatchMessage()

LRESULT NTAPI NtUserDispatchMessage ( PMSG  pMsg)

Definition at line 2427 of file message.c.

2428{
2429 LRESULT Res = 0;
2430 MSG SafeMsg;
2431
2432 _SEH2_TRY
2433 {
2434 ProbeForRead(UnsafeMsgInfo, sizeof(MSG), 1);
2435 RtlCopyMemory(&SafeMsg, UnsafeMsgInfo, sizeof(MSG));
2436 }
2438 {
2440 _SEH2_YIELD(return FALSE);
2441 }
2442 _SEH2_END;
2443
2445
2446 Res = IntDispatchMessage(&SafeMsg);
2447
2448 UserLeave();
2449 return Res;
2450}
LRESULT FASTCALL IntDispatchMessage(PMSG pMsg)
Definition: message.c:840

Referenced by DispatchMessageA(), and DispatchMessageW().

◆ NtUserDragDetect()

BOOL NTAPI NtUserDragDetect ( HWND  hWnd,
POINT  pt 
)

Functions

Definition at line 2159 of file message.c.

2162{
2163 MSG msg;
2164 RECT rect;
2165 ULONG wDragWidth, wDragHeight;
2166 BOOL Ret = FALSE;
2167
2168 TRACE("Enter NtUserDragDetect(%p)\n", hWnd);
2170
2171 wDragWidth = UserGetSystemMetrics(SM_CXDRAG);
2172 wDragHeight= UserGetSystemMetrics(SM_CYDRAG);
2173
2174 rect.left = pt.x - wDragWidth;
2175 rect.right = pt.x + wDragWidth;
2176
2177 rect.top = pt.y - wDragHeight;
2178 rect.bottom = pt.y + wDragHeight;
2179
2181
2182 for (;;)
2183 {
2187 {
2188 if ( msg.message == WM_LBUTTONUP )
2189 {
2191 goto Exit; // Return FALSE
2192 }
2193 if ( msg.message == WM_MOUSEMOVE )
2194 {
2195 POINT tmp;
2196 tmp.x = (short)LOWORD(msg.lParam);
2197 tmp.y = (short)HIWORD(msg.lParam);
2198 if( !RECTL_bPointInRect( &rect, tmp.x, tmp.y ) )
2199 {
2201 Ret = TRUE;
2202 goto Exit;
2203 }
2204 }
2205 if ( msg.message == WM_KEYDOWN )
2206 {
2207 if ( msg.wParam == VK_ESCAPE )
2208 {
2210 Ret = TRUE;
2211 goto Exit;
2212 }
2213 }
2214 if ( msg.message == WM_QUEUESYNC )
2215 {
2217 }
2218 }
2219 co_IntWaitMessage(NULL, 0, 0);
2220 }
2221
2222Exit:
2223 TRACE("Leave NtUserDragDetect, ret=%i\n", Ret);
2224 UserLeave();
2225 return Ret;
2226}
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:1457
#define LOWORD(l)
Definition: pedump.c:82
& rect
Definition: startmenu.cpp:1413
#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:1130
BOOL APIENTRY co_IntGetPeekMessage(PMSG pMsg, HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax, UINT RemoveMsg, BOOL bGMSG)
Definition: message.c:1176
#define WM_MOUSEFIRST
Definition: winuser.h:1774
#define SM_CXDRAG
Definition: winuser.h:1028
#define WM_MOUSELAST
Definition: winuser.h:1801
#define WM_KEYFIRST
Definition: winuser.h:1714
#define WM_MOUSEMOVE
Definition: winuser.h:1775
#define WH_CBT
Definition: winuser.h:35
#define WM_QUEUESYNC
Definition: winuser.h:1639
#define PM_REMOVE
Definition: winuser.h:1196
#define HCBT_QS
Definition: winuser.h:57
#define WM_LBUTTONUP
Definition: winuser.h:1777
#define WM_KEYDOWN
Definition: winuser.h:1715
#define SM_CYDRAG
Definition: winuser.h:1029
#define WM_KEYLAST
Definition: winuser.h:1728
#define VK_ESCAPE
Definition: winuser.h:2214

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 2450 of file painting.c.

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

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 2367 of file painting.c.

2375{
2376 PWND pWnd = NULL;
2377 UNICODE_STRING SafeStr = {0};
2379 RECTL SafeRect;
2380 BOOL Ret;
2381
2383
2384 if (hWnd != NULL)
2385 {
2386 if(!(pWnd = UserGetWindowObject(hWnd)))
2387 {
2388 UserLeave();
2389 return FALSE;
2390 }
2391 }
2392
2393 _SEH2_TRY
2394 {
2395 ProbeForRead(lpRc, sizeof(RECTL), sizeof(ULONG));
2396 RtlCopyMemory(&SafeRect, lpRc, sizeof(RECTL));
2397 if (str != NULL)
2398 {
2399 SafeStr = ProbeForReadUnicodeString(str);
2400 if (SafeStr.Length != 0)
2401 {
2402 ProbeForRead( SafeStr.Buffer,
2403 SafeStr.Length,
2404 sizeof(WCHAR));
2405 }
2406 }
2407 }
2409 {
2411 }
2412 _SEH2_END;
2413
2414 if (Status != STATUS_SUCCESS)
2415 {
2417 UserLeave();
2418 return FALSE;
2419 }
2420
2421 if (str != NULL)
2422 Ret = UserDrawCaption(pWnd, hDC, &SafeRect, hFont, hIcon, &SafeStr, uFlags);
2423 else
2424 {
2425 if ( RECTL_bIsEmptyRect(&SafeRect) && hFont == 0 && hIcon == 0 )
2426 {
2427 Ret = TRUE;
2429 {
2430 ERR("NC Caption Mode\n");
2432 goto Exit;
2433 }
2434 else if (uFlags & DC_DRAWFRAMEMD)
2435 {
2436 ERR("NC Paint Mode\n");
2437 NC_DoNCPaint(pWnd, hDC, uFlags); // Update Menus too!
2438 goto Exit;
2439 }
2440 }
2441 Ret = UserDrawCaption(pWnd, hDC, &SafeRect, hFont, hIcon, NULL, uFlags);
2442 }
2443Exit:
2444 UserLeave();
2445 return Ret;
2446}
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:151
#define DC_DRAWFRAMEMD
Definition: undocuser.h:153
BOOL UserDrawCaption(PWND pWnd, HDC hDc, RECTL *lpRc, HFONT hFont, HICON hIcon, const PUNICODE_STRING Str, UINT uFlags)
Definition: painting.c:2185
FORCEINLINE BOOL RECTL_bIsEmptyRect(_In_ const RECTL *prcl)
Definition: rect.h:44
VOID UserDrawCaptionBar(PWND pWnd, HDC hDC, INT Flags)
Definition: nonclient.c:924
LRESULT NC_DoNCPaint(PWND pWnd, HDC hDC, INT Flags)
Definition: nonclient.c:1066

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 2080 of file cursoricon.c.

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

Referenced by DrawIconEx().

◆ NtUserDrawMenuBarTemp()

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

Definition at line 6212 of file menu.c.

6218{
6219 PMENU Menu;
6220 PWND Window;
6221 RECT Rect;
6223 DWORD Ret = 0;
6224
6225 ERR("Enter NtUserDrawMenuBarTemp\n");
6227
6229 {
6231 goto Exit; // Return 0
6232 }
6233
6234 if(!(Menu = UserGetMenuObject(hMenu)))
6235 {
6237 goto Exit; // Return 0
6238 }
6239
6240 _SEH2_TRY
6241 {
6242 ProbeForRead(pRect, sizeof(RECT), sizeof(ULONG));
6243 RtlCopyMemory(&Rect, pRect, sizeof(RECT));
6244 }
6246 {
6248 }
6249 _SEH2_END;
6250
6251 if (Status != STATUS_SUCCESS)
6252 {
6254 goto Exit; // Return 0
6255 }
6256
6257 Ret = IntDrawMenuBarTemp(Window, hDC, &Rect, Menu, hFont);
6258
6259Exit:
6260 ERR("Leave NtUserDrawMenuBarTemp, ret=%lu\n", Ret);
6261 UserLeave();
6262 return Ret;
6263}
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 5836 of file menu.c.

5840{
5841 PMENU Menu;
5842 UINT Ret = (UINT)-1;
5843
5844 TRACE("Enter NtUserEnableMenuItem\n");
5846
5847 Menu = UserGetMenuObject(hMenu);
5848 if (Menu)
5849 {
5850 Ret = IntEnableMenuItem(Menu, uIDEnableItem, uEnable);
5851 }
5852
5853 TRACE("Leave NtUserEnableMenuItem, ret=%u\n", Ret);
5854 UserLeave();
5855 return Ret;
5856}
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 1242 of file scrollbar.c.

1246{
1247 UINT OrigArrows;
1248 PWND Window = NULL;
1249 PSCROLLBARINFO InfoV = NULL, InfoH = NULL;
1250 BOOL Chg = FALSE;
1251 BOOL Ret = FALSE;
1253
1254 TRACE("Enter NtUserEnableScrollBar\n");
1256
1258 goto Cleanup; // Return FALSE
1259
1260 UserRefObjectCo(Window, &Ref);
1261
1263 goto Cleanup; // Return FALSE
1264
1265 OrigArrows = Window->pSBInfo->WSBflags;
1266 Window->pSBInfo->WSBflags = wArrows;
1267
1268 if (wSBflags == SB_CTL)
1269 {
1270 if ((wArrows == ESB_DISABLE_BOTH || wArrows == ESB_ENABLE_BOTH))
1271 IntEnableWindow(hWnd, (wArrows == ESB_ENABLE_BOTH));
1272
1273 Ret = TRUE;
1274 goto Cleanup;
1275 }
1276
1277 if(wSBflags != SB_BOTH && !SBID_IS_VALID(wSBflags))
1278 {
1280 ERR("Trying to set scrollinfo for unknown scrollbar type %u\n", wSBflags);
1281 goto Cleanup; // Return FALSE
1282 }
1283
1284 switch(wSBflags)
1285 {
1286 case SB_BOTH:
1288 // Fall through
1289 case SB_HORZ:
1291 break;
1292 case SB_VERT:
1294 break;
1295 default:
1296 goto Cleanup; // Return FALSE
1297 }
1298
1299 if(InfoV)
1300 Chg = IntEnableScrollBar(FALSE, InfoV, wArrows);
1301
1302 if(InfoH)
1303 Chg = (IntEnableScrollBar(TRUE, InfoH, wArrows) || Chg);
1304
1305 ERR("FIXME: EnableScrollBar wSBflags %u wArrows %u Chg %d\n", wSBflags, wArrows, Chg);
1306// Done in user32:
1307// SCROLL_RefreshScrollBar(hwnd, nBar, TRUE, TRUE);
1308
1309 Ret = Chg;
1310 goto Cleanup; // FIXME
1311
1312 if (OrigArrows == wArrows)
1313 {
1314 Ret = FALSE;
1315 goto Cleanup;
1316 }
1317
1318 Ret = TRUE;
1319
1320Cleanup:
1321 if (Window)
1323
1324 TRACE("Leave NtUserEnableScrollBar, ret=%i\n", Ret);
1325 UserLeave();
1326 return Ret;
1327}
BOOL FASTCALL co_IntCreateScrollBars(PWND Window)
Definition: scrollbar.c:748
BOOL APIENTRY IntEnableScrollBar(BOOL Horz, PSCROLLBARINFO Info, UINT wArrows)
Definition: scrollbar.c:813
#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 3245 of file winpos.c.

3247{
3248 BOOL Ret;
3249 TRACE("Enter NtUserEndDeferWindowPosEx\n");
3251 Ret = IntEndDeferWindowPosEx(WinPosInfo, bAsync);
3252 TRACE("Leave NtUserEndDeferWindowPosEx, ret=%i\n", Ret);
3253 UserLeave();
3254 return Ret;
3255}
BOOL FASTCALL IntEndDeferWindowPosEx(HDWP hdwp, BOOL bAsync)
Definition: winpos.c:3152

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

◆ NtUserEndMenu()

BOOL NTAPI NtUserEndMenu ( VOID  )

Definition at line 5862 of file menu.c.

5863{
5864 //PWND pWnd;
5865 TRACE("Enter NtUserEndMenu\n");
5867 /* if ( gptiCurrent->pMenuState &&
5868 gptiCurrent->pMenuState->pGlobalPopupMenu )
5869 {
5870 pWnd = IntGetMSWND(gptiCurrent->pMenuState);
5871 if (pWnd)
5872 {
5873 UserPostMessage( UserHMGetHandle(pWnd), WM_CANCELMODE, 0, 0);
5874 }
5875 else
5876 gptiCurrent->pMenuState->fInsideMenuLoop = FALSE;
5877 }*/
5879 {
5882 }
5883 UserLeave();
5884 TRACE("Leave NtUserEndMenu\n");
5885 return TRUE;
5886}
static HWND top_popup
Definition: menu.c:22
BOOL fInsideMenuLoop
Definition: menu.c:25
#define WM_CANCELMODE
Definition: winuser.h:1635

◆ NtUserEndPaint()

BOOL NTAPI NtUserEndPaint ( HWND  hWnd,
CONST PAINTSTRUCT lPs 
)

Definition at line 1654 of file painting.c.

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

Referenced by EndPaint().

◆ NtUserEnumDisplayDevices()

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

Definition at line 366 of file display.c.

371{
372 UNICODE_STRING ustrDevice;
373 WCHAR awcDevice[CCHDEVICENAME];
374 DISPLAY_DEVICEW dispdev;
376
377 TRACE("Enter NtUserEnumDisplayDevices(%wZ, %lu)\n",
378 pustrDevice, iDevNum);
379
380 dispdev.cb = sizeof(dispdev);
381
382 if (pustrDevice)
383 {
384 /* Initialize destination string */
385 RtlInitEmptyUnicodeString(&ustrDevice, awcDevice, sizeof(awcDevice));
386
388 {
389 /* Probe the UNICODE_STRING and the buffer */
390 ProbeForRead(pustrDevice, sizeof(UNICODE_STRING), 1);
391 ProbeForRead(pustrDevice->Buffer, pustrDevice->Length, 1);
392
393 /* Copy the string */
394 RtlCopyUnicodeString(&ustrDevice, pustrDevice);
395 }
397 {
398// _SEH2_YIELD(return _SEH2_GetExceptionCode());
400 }
402
403 if (ustrDevice.Length > 0)
404 pustrDevice = &ustrDevice;
405 else
406 pustrDevice = NULL;
407 }
408
409 /* If name is given only iDevNum==0 gives results */
410 if (pustrDevice && iDevNum != 0)
411 return FALSE;
412
413 /* Acquire global USER lock */
415
416 /* Call the internal function */
417 Status = UserEnumDisplayDevices(pustrDevice, iDevNum, &dispdev, dwFlags);
418
419 /* Release lock */
420 UserLeave();
421
422 /* On success copy data to caller */
423 if (NT_SUCCESS(Status))
424 {
425 /* Enter SEH */
427 {
428 /* First probe the cb field */
429 ProbeForWrite(&pDisplayDevice->cb, sizeof(DWORD), 1);
430
431 /* Check the buffer size */
432 if (pDisplayDevice->cb)
433 {
434 /* Probe the output buffer */
435 pDisplayDevice->cb = min(pDisplayDevice->cb, sizeof(dispdev));
436 ProbeForWrite(pDisplayDevice, pDisplayDevice->cb, 1);
437
438 /* Copy as much as the given buffer allows */
439 RtlCopyMemory(pDisplayDevice, &dispdev, pDisplayDevice->cb);
440 }
441 }
443 {
445 }
447 }
448
449 TRACE("Leave NtUserEnumDisplayDevices, Status = 0x%lx\n", Status);
450 /* Return the result */
451// return Status;
452 return NT_SUCCESS(Status); // FIXME
453}
NTSTATUS NTAPI UserEnumDisplayDevices(PUNICODE_STRING pustrDevice, DWORD iDevNum, PDISPLAY_DEVICEW pdispdev, DWORD dwFlags)
Definition: display.c:233

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 2512 of file painting.c.

2515{
2516 INT ret = ERROR;
2517 PWND pWnd;
2518
2519 TRACE("Enter NtUserExcludeUpdateRgn\n");
2521
2522 pWnd = UserGetWindowObject(hWnd);
2523
2524 if (hDC && pWnd)
2526
2527 TRACE("Leave NtUserExcludeUpdateRgn, ret=%i\n", ret);
2528
2529 UserLeave();
2530 return ret;
2531}
#define ERROR(name)
Definition: error_private.h:53
INT FASTCALL co_UserExcludeUpdateRgn(HDC hDC, PWND Window)
Definition: painting.c:2459

Referenced by ExcludeUpdateRgn().

◆ NtUserFillWindow()

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

Definition at line 1704 of file painting.c.

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

◆ NtUserFindExistingCursorIcon()

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

Definition at line 857 of file cursoricon.c.

861{
862 PCURICON_OBJECT CurIcon;
863 HICON Ret = NULL;
864 UNICODE_STRING ustrModuleSafe, ustrRsrcSafe;
865 FINDEXISTINGCURICONPARAM paramSafe;
868 RTL_ATOM atomModName;
869
870 TRACE("Enter NtUserFindExistingCursorIcon\n");
871
873 {
874 ProbeForRead(param, sizeof(*param), 1);
875 RtlCopyMemory(&paramSafe, param, sizeof(paramSafe));
876 }
878 {
880 }
882
883 /* Capture resource name (it can be an INTRESOURCE == ATOM) */
884 Status = ProbeAndCaptureUnicodeStringOrAtom(&ustrRsrcSafe, pustrRsrc);
885 if (!NT_SUCCESS(Status))
886 return NULL;
887 Status = ProbeAndCaptureUnicodeString(&ustrModuleSafe, UserMode, pustrModule);
888 if (!NT_SUCCESS(Status))
889 goto done;
890 Status = RtlLookupAtomInAtomTable(gAtomTable, ustrModuleSafe.Buffer, &atomModName);
891 ReleaseCapturedUnicodeString(&ustrModuleSafe, UserMode);
892 if (!NT_SUCCESS(Status))
893 {
894 /* The module is not in the atom table. No chance to find the cursor */
895 goto done;
896 }
897
899 CurIcon = pProcInfo->pCursorCache;
900 while (CurIcon)
901 {
902 /* Icon/cursor */
903 if (paramSafe.bIcon != is_icon(CurIcon))
904 {
905 CurIcon = CurIcon->pcurNext;
906 continue;
907 }
908 /* See if module names match */
909 if (atomModName == CurIcon->atomModName)
910 {
911 /* They do. Now see if this is the same resource */
912 if (IS_INTRESOURCE(CurIcon->strName.Buffer) != IS_INTRESOURCE(ustrRsrcSafe.Buffer))
913 {
914 /* One is an INT resource and the other is not -> no match */
915 CurIcon = CurIcon->pcurNext;
916 continue;
917 }
918
919 if (IS_INTRESOURCE(CurIcon->strName.Buffer))
920 {
921 if (CurIcon->strName.Buffer == ustrRsrcSafe.Buffer)
922 {
923 /* INT resources match */
924 break;
925 }
926 }
927 else if (RtlCompareUnicodeString(&ustrRsrcSafe, &CurIcon->strName, TRUE) == 0)
928 {
929 /* Resource name strings match */
930 break;
931 }
932 }
933 CurIcon = CurIcon->pcurNext;
934 }
935
936 /* Now search Global Cursors or Icons. */
937 if (CurIcon == NULL)
938 {
939 CurIcon = gcurFirst;
940 while (CurIcon)
941 {
942 /* Icon/cursor */
943 if (paramSafe.bIcon != is_icon(CurIcon))
944 {
945 CurIcon = CurIcon->pcurNext;
946 continue;
947 }
948 /* See if module names match */
949 if (atomModName == CurIcon->atomModName)
950 {
951 /* They do. Now see if this is the same resource */
952 if (IS_INTRESOURCE(CurIcon->strName.Buffer) != IS_INTRESOURCE(ustrRsrcSafe.Buffer))
953 {
954 /* One is an INT resource and the other is not -> no match */
955 CurIcon = CurIcon->pcurNext;
956 continue;
957 }
958 if (IS_INTRESOURCE(CurIcon->strName.Buffer))
959 {
960 if (CurIcon->strName.Buffer == ustrRsrcSafe.Buffer)
961 {
962 /* INT resources match */
963 break;
964 }
965 }
966 else if (RtlCompareUnicodeString(&ustrRsrcSafe, &CurIcon->strName, TRUE) == 0)
967 {
968 /* Resource name strings match */
969 break;
970 }
971 }
972 CurIcon = CurIcon->pcurNext;
973 }
974 }
975 if (CurIcon)
976 Ret = UserHMGetHandle(CurIcon);
977 UserLeave();
978
979done:
980 if (!IS_INTRESOURCE(ustrRsrcSafe.Buffer))
981 ExFreePoolWithTag(ustrRsrcSafe.Buffer, TAG_STRING);
982
983 return Ret;
984}
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:84
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:272
_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:150
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
#define IS_INTRESOURCE(i)
Definition: winuser.h:580

Referenced by CURSORICON_LoadImageW().

◆ NtUserFindWindowEx()

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

Definition at line 3143 of file window.c.

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

Referenced by FindWindowExW(), and START_TEST().

◆ NtUserFlashWindowEx()

BOOL NTAPI NtUserFlashWindowEx ( IN PFLASHWINFO  pfwi)

Definition at line 1745 of file painting.c.

1746{
1747 PWND pWnd;
1748 FLASHWINFO finfo = {0};
1749 BOOL Ret = FALSE;
1750
1752
1753 _SEH2_TRY
1754 {
1755 ProbeForRead(pfwi, sizeof(FLASHWINFO), 1);
1756 RtlCopyMemory(&finfo, pfwi, sizeof(FLASHWINFO));
1757 }
1759 {
1761 _SEH2_YIELD(goto Exit);
1762 }
1763 _SEH2_END
1764
1765 if (!( pWnd = ValidateHwndNoErr(finfo.hwnd)) ||
1766 finfo.cbSize != sizeof(FLASHWINFO) ||
1767 finfo.dwFlags & ~(FLASHW_ALL|FLASHW_TIMER|FLASHW_TIMERNOFG) )
1768 {
1770 goto Exit;
1771 }
1772
1773 Ret = IntFlashWindowEx(pWnd, &finfo);
1774
1775Exit:
1776 UserLeave();
1777 return Ret;
1778}
BOOL FASTCALL IntFlashWindowEx(PWND pWnd, PFLASHWINFO pfwi)
Definition: painting.c:1304

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 ( HWND  hWnd,
UINT  Flags 
)

Definition at line 3410 of file window.c.

3411{
3412 PWND Window, Ancestor;
3413 HWND Ret = NULL;
3414
3415 TRACE("Enter NtUserGetAncestor\n");
3417
3419 if (Window)
3420 {
3421 Ancestor = UserGetAncestor(Window, Type);
3422 /* fixme: can UserGetAncestor ever return NULL for a valid window? */
3423
3424 Ret = (Ancestor ? UserHMGetHandle(Ancestor) : NULL);
3425 }
3426
3427 TRACE("Leave NtUserGetAncestor, ret=%p\n", Ret);
3428 UserLeave();
3429 return Ret;
3430}
Type
Definition: Type.h:7
PWND FASTCALL UserGetAncestor(PWND Wnd, UINT Type)
Definition: window.c:3341

Referenced by GetAncestor().

◆ NtUserGetAppImeLevel()

DWORD NTAPI NtUserGetAppImeLevel ( HWND  hWnd)

Definition at line 921 of file ime.c.

922{
923 DWORD ret = 0;
924 PWND pWnd;
925 PTHREADINFO pti;
926
928
929 pWnd = ValidateHwndNoErr(hWnd);
930 if (!pWnd)
931 goto Quit;
932
933 if (!IS_IMM_MODE())
934 {
935 ERR("!IS_IMM_MODE()\n");
937 goto Quit;
938 }
939
941 if (pWnd->head.pti->ppi == pti->ppi)
943
944Quit:
945 UserLeave();
946 return ret;
947}
ATOM AtomImeLevel
Definition: ntuser.c:28

Referenced by ImmGenerateMessage(), and ImmPostMessages().

◆ NtUserGetAsyncKeyState()

SHORT NTAPI NtUserGetAsyncKeyState ( INT  Key)

Definition at line 634 of file keyboard.c.

635{
636 WORD wRet = 0;
637
638 TRACE("Enter NtUserGetAsyncKeyState\n");
639
640 if (Key >= 0x100 || Key < 0)
641 {
643 ERR("Invalid parameter Key\n");
644 return 0;
645 }
646
648
650 wRet |= 0x8000; // If down, windows returns 0x8000.
651 if (gafAsyncKeyStateRecentDown[Key / 8] & (1 << (Key % 8)))
652 wRet |= 0x1;
653 gafAsyncKeyStateRecentDown[Key / 8] &= ~(1 << (Key % 8));
654
655 UserLeave();
656
657 TRACE("Leave NtUserGetAsyncKeyState, ret=%u\n", wRet);
658 return wRet;
659}
unsigned short WORD
Definition: ntddk_ex.h:93
#define IS_KEY_DOWN(ks, vk)
Definition: input.h:101
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 381 of file caret.c.

382{
383 UINT ret;
384
386
387 ret = gpsi->dtCaretBlink;
388
389 UserLeave();
390
391 return ret;
392}

Referenced by GetCaretBlinkTime().

◆ NtUserGetCaretPos()

BOOL NTAPI NtUserGetCaretPos ( LPPOINT  lpPoint)

Definition at line 396 of file caret.c.

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

Referenced by GetCaretPos().

◆ NtUserGetClassInfo()

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

Definition at line 2731 of file class.c.

2737{
2738 UNICODE_STRING SafeClassName;
2739 WNDCLASSEXW Safewcexw;
2740 PCLS Class;
2741 RTL_ATOM ClassAtom = 0;
2742 PPROCESSINFO ppi;
2743 BOOL Ret = TRUE;
2745
2746 _SEH2_TRY
2747 {
2748 ProbeForWrite( lpWndClassEx, sizeof(WNDCLASSEXW), sizeof(ULONG));
2749 RtlCopyMemory( &Safewcexw, lpWndClassEx, sizeof(WNDCLASSEXW));
2750 if (ppszMenuName)
2751 {
2752 ProbeForWrite(ppszMenuName, sizeof(*ppszMenuName), sizeof(PVOID));
2753 }
2754 }
2756 {
2758 _SEH2_YIELD(return FALSE);
2759 }
2760 _SEH2_END;
2761
2762 Status = ProbeAndCaptureUnicodeStringOrAtom(&SafeClassName, ClassName);
2763 if (!NT_SUCCESS(Status))
2764 {
2765 ERR("Error capturing the class name\n");
2767 return FALSE;
2768 }
2769
2770 // If null instance use client.
2772
2773 TRACE("GetClassInfo(%wZ, %p)\n", &SafeClassName, hInstance);
2774
2775 /* NOTE: Need exclusive lock because getting the wndproc might require the
2776 creation of a call procedure handle */
2778
2779 ppi = GetW32ProcessInfo();
2780 if (!(ppi->W32PF_flags & W32PF_CLASSESREGISTERED))
2781 {
2783 }
2784
2785 ClassAtom = IntGetClassAtom(&SafeClassName,
2786 hInstance,
2787 ppi,
2788 &Class,
2789 NULL);
2790 if (ClassAtom != (RTL_ATOM)0)
2791 {
2792 ClassAtom = Class->atomNVClassName;
2793 Ret = UserGetClassInfo(Class, &Safewcexw, bAnsi, hInstance);
2794 }
2795 else
2796 {
2798 Ret = FALSE;
2799 }
2800
2801 UserLeave();
2802
2803 if (Ret)
2804 {
2805 _SEH2_TRY
2806 {
2807 /* Emulate Function. */
2808 if (ppszMenuName) *ppszMenuName = (LPWSTR)Safewcexw.lpszMenuName;
2809
2810 RtlCopyMemory(lpWndClassEx, &Safewcexw, sizeof(WNDCLASSEXW));
2811
2812 // From Wine:
2813 /* We must return the atom of the class here instead of just TRUE. */
2814 /* Undocumented behavior! Return the class atom as a BOOL! */
2815 Ret = (BOOL)ClassAtom;
2816 }
2818 {
2820 Ret = FALSE;
2821 }
2822 _SEH2_END;
2823 }
2824
2825 if (!IS_ATOM(SafeClassName.Buffer))
2826 ExFreePoolWithTag(SafeClassName.Buffer, TAG_STRING);
2827
2828 return Ret;
2829}
struct _PROCESSINFO * GetW32ProcessInfo(VOID)
Definition: misc.c:799
HINSTANCE hModClient
Definition: ntuser.c:25
Definition: ntuser.h:566
LPCWSTR lpszMenuName
Definition: winuser.h:3225
#define W32PF_CLASSESREGISTERED
Definition: win32.h:17
static BOOL UserGetClassInfo(IN PCLS Class, OUT PWNDCLASSEXW lpwcx, IN BOOL Ansi, HINSTANCE hInstance)
Definition: class.c:2260
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:1375
BOOL FASTCALL UserRegisterSystemClasses(VOID)
Definition: class.c:2317
#define ERROR_CLASS_DOES_NOT_EXIST
Definition: winerror.h:892
WCHAR * LPWSTR
Definition: xmlstorage.h:184

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:899
#define WM_RENDERFORMAT
Definition: winuser.h:1866

Referenced by 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 3468 of file window.c.

3471{
3472 PWND Wnd;
3473 PPROCESSINFO ppi;
3474 BOOL NotSameppi = FALSE;
3475 BOOL Ret = TRUE;
3476
3477 TRACE("Enter NtUserGetComboBoxInfo\n");
3479
3480 if (!(Wnd = UserGetWindowObject(hWnd)))
3481 {
3482 Ret = FALSE;
3483 goto Exit;
3484 }
3485 _SEH2_TRY
3486 {
3487 ProbeForWrite(pcbi, sizeof(COMBOBOXINFO), 1);
3488 }
3490 {
3492 Ret = FALSE;
3493 _SEH2_YIELD(goto Exit);
3494 }
3495 _SEH2_END;
3496
3497 if (pcbi->cbSize < sizeof(COMBOBOXINFO))
3498 {
3500 Ret = FALSE;
3501 goto Exit;
3502 }
3503
3504 // Pass the user pointer, it was already probed.
3506 {
3508 goto Exit;
3509 }
3510
3512 NotSameppi = ppi != Wnd->head.pti->ppi;
3513 if (NotSameppi)
3514 {
3515 KeAttachProcess(&Wnd->head.pti->ppi->peProcess->Pcb);
3516 }
3517
3518 _SEH2_TRY
3519 {
3520 LPHEADCOMBO lphc = ((PWND2CBOX)Wnd)->pCBox;
3521 pcbi->rcItem = lphc->textRect;
3522 pcbi->rcButton = lphc->buttonRect;
3523 pcbi->stateButton = 0;
3524 if (lphc->wState & CBF_BUTTONDOWN)
3526 if (RECTL_bIsEmptyRect(&lphc->buttonRect))
3528 pcbi->hwndCombo = lphc->self;
3529 pcbi->hwndItem = lphc->hWndEdit;
3530 pcbi->hwndList = lphc->hWndLBox;
3531 }
3533 {
3534 Ret = FALSE;
3536 }
3537 _SEH2_END;
3538
3539Exit:
3540 if (NotSameppi) KeDetachProcess();
3541 TRACE("Leave NtUserGetComboBoxInfo, ret=%i\n", Ret);
3542 UserLeave();
3543 return Ret;
3544}
#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:152
RECT textRect
Definition: comctl32.h:151
UINT wState
Definition: comctl32.h:149
HWND hWndLBox
Definition: comctl32.h:148
HWND hWndEdit
Definition: comctl32.h:147
HWND self
Definition: comctl32.h:144
RTL_ATOM atomClassName
Definition: ntuser.h:568
DWORD stateButton
Definition: winuser.h:3712
ATOM atomSysClass[ICLS_NOTUSED+1]
Definition: ntuser.h:1060
struct _WND2CBOX * PWND2CBOX
#define CBF_BUTTONDOWN
Definition: window.c:3462
#define STATE_SYSTEM_PRESSED
Definition: winuser.h:2865
#define CB_GETCOMBOBOXINFO
Definition: winuser.h:1941
#define STATE_SYSTEM_INVISIBLE
Definition: winuser.h:2877

Referenced by GetComboBoxInfo().

◆ NtUserGetControlBrush()

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

Definition at line 191 of file misc.c.

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

Referenced by GetControlBrush().

◆ NtUserGetControlColor()

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

Definition at line 215 of file misc.c.

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

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 2127 of file cursoricon.c.

2132{
2133 PCURICON_OBJECT CurIcon;
2134 HCURSOR ret;
2135 INT jiffies = 0;
2136 DWORD steps = 1;
2138
2139 TRACE("Enter NtUserGetCursorFrameInfo\n");
2141
2142 if (!(CurIcon = UserGetCurIconObject(hCursor)))
2143 {
2144 UserLeave();
2145 return NULL;
2146 }
2147
2148 ret = UserHMGetHandle(CurIcon);
2149
2150 if (CurIcon->CURSORF_flags & CURSORF_ACON)
2151 {
2152 PACON AniCurIcon = (PACON)CurIcon;
2153 if (istep >= AniCurIcon->cicur)
2154 {
2155 UserDereferenceObject(CurIcon);
2156 UserLeave();
2157 return NULL;
2158 }
2159 jiffies = AniCurIcon->ajifRate[istep];
2160 steps = AniCurIcon->cicur;
2161 ret = UserHMGetHandle(AniCurIcon->aspcur[AniCurIcon->aicur[istep]]);
2162 }
2163
2164 _SEH2_TRY
2165 {
2166 ProbeForWrite(rate_jiffies, sizeof(INT), 1);
2167 ProbeForWrite(num_steps, sizeof(DWORD), 1);
2168 *rate_jiffies = jiffies;
2169 *num_steps = steps;
2170 }
2172 {
2174 }
2175 _SEH2_END
2176
2177 if (!NT_SUCCESS(Status))
2178 {
2179 WARN("Status: 0x%08lx\n", Status);
2181 ret = NULL;
2182 }
2183
2184 UserDereferenceObject(CurIcon);
2185 UserLeave();
2186
2187 TRACE("Leaving NtUserGetCursorFrameInfo, ret = 0x%p\n", ret);
2188
2189 return ret;
2190}
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:1638
static DWORD DWORD istep
Definition: cursoricon.c:1638
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:299

Referenced by GetCursorFrameInfo().

◆ NtUserGetCursorInfo()

BOOL NTAPI NtUserGetCursorInfo ( PCURSORINFO  pci)

Definition at line 645 of file cursoricon.c.

647{
648 CURSORINFO SafeCi;
649 PSYSTEM_CURSORINFO CurInfo;
651 PCURICON_OBJECT CurIcon;
652 BOOL Ret = FALSE;
653
654 TRACE("Enter NtUserGetCursorInfo\n");
656
657 CurInfo = IntGetSysCursorInfo();
658 CurIcon = (PCURICON_OBJECT)CurInfo->CurrentCursorObject;
659
660 SafeCi.cbSize = sizeof(CURSORINFO);
661 SafeCi.flags = ((CurIcon && CurInfo->ShowingCursor >= 0) ? CURSOR_SHOWING : 0);
662 SafeCi.hCursor = (CurIcon ? UserHMGetHandle(CurIcon) : NULL);
663
664 SafeCi.ptScreenPos = gpsi->ptCursor;
665
667 {
668 if (pci->cbSize == sizeof(CURSORINFO))
669 {
670 ProbeForWrite(pci, sizeof(CURSORINFO), 1);
671 RtlCopyMemory(pci, &SafeCi, sizeof(CURSORINFO));
672 Ret = TRUE;
673 }
674 else
675 {
677 }
678 }
680 {
682 }
683 _SEH2_END;
684 if (!NT_SUCCESS(Status))
685 {
687 }
688
689 TRACE("Leave NtUserGetCursorInfo, ret=%i\n", Ret);
690 UserLeave();
691 return Ret;
692}
struct _CURICON_OBJECT * PCURICON_OBJECT
PCURICON_OBJECT CurrentCursorObject
Definition: cursoricon.h:74
DWORD flags
Definition: winuser.h:3720
DWORD cbSize
Definition: winuser.h:3719
HCURSOR hCursor
Definition: winuser.h:3721
POINT ptScreenPos
Definition: winuser.h:3722
PSYSTEM_CURSORINFO IntGetSysCursorInfo(VOID)
Definition: cursoricon.c:187
#define CURSOR_SHOWING
Definition: winuser.h:2658

Referenced by GetCursorInfo().

◆ 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:2113

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 386 of file misc.c.

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

Referenced by GetDoubleClickTime().

◆ NtUserGetForegroundWindow()

HWND NTAPI NtUserGetForegroundWindow ( VOID  )

Definition at line 1647 of file focus.c.

1648{
1649 HWND Ret;
1650
1651 TRACE("Enter NtUserGetForegroundWindow\n");
1653
1655
1656 TRACE("Leave NtUserGetForegroundWindow, ret=%p\n", Ret);
1657 UserLeave();
1658 return Ret;
1659}
HWND FASTCALL UserGetForegroundWindow(VOID)
Definition: focus.c:1421

Referenced by GetForegroundWindow().

◆ NtUserGetGuiResources()

DWORD NTAPI NtUserGetGuiResources ( HANDLE  hProcess,
DWORD  uiFlags 
)

Definition at line 534 of file misc.c.

537{
539 PPROCESSINFO W32Process;
541 DWORD Ret = 0;
542
543 TRACE("Enter NtUserGetGuiResources\n");
545
550 (PVOID*)&Process,
551 NULL);
552
553 if(!NT_SUCCESS(Status))
554 {
556 goto Exit; // Return 0
557 }
558
559 W32Process = (PPROCESSINFO)Process->Win32Process;
560 if(!W32Process)
561 {
564 goto Exit; // Return 0
565 }
566
567 switch(uiFlags)
568 {
569 case GR_GDIOBJECTS:
570 {
571 Ret = (DWORD)W32Process->GDIHandleCount;
572 break;
573 }
574 case GR_USEROBJECTS:
575 {
576 Ret = (DWORD)W32Process->UserHandleCount;
577 break;
578 }
579 default:
580 {
582 break;
583 }
584 }
585
587
588Exit:
589 TRACE("Leave NtUserGetGuiResources, ret=%lu\n", Ret);
590 UserLeave();
591 return Ret;
592}
#define ExGetPreviousMode
Definition: ex.h:140
#define PROCESS_QUERY_INFORMATION
Definition: pstypes.h:166
_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 403 of file misc.c.

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

Referenced by GetGUIThreadInfo().

◆ NtUserGetIconSize()

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

◆ NtUserGetImeHotKey()

BOOL NTAPI NtUserGetImeHotKey ( DWORD  dwHotKeyId,
LPUINT  lpuModifiers,
LPUINT  lpuVirtualKey,
LPHKL  lphKL 
)

Definition at line 406 of file ime.c.

407{
408 PIMEHOTKEY pNode = NULL;
409
411
413 {
414 ProbeForWrite(lpuModifiers, sizeof(UINT), 1);
415 ProbeForWrite(lpuVirtualKey, sizeof(UINT), 1);
416 if (lphKL)
417 ProbeForWrite(lphKL, sizeof(HKL), 1);
418 }
420 {
421 ERR("%p, %p, %p\n", lpuModifiers, lpuVirtualKey, lphKL);
422 _SEH2_YIELD(goto Quit);
423 }
424 _SEH2_END;
425
426 pNode = IntGetImeHotKeyById(gpImeHotKeyList, dwHotKeyId);
427 if (!pNode)
428 goto Quit;
429
431 {
432 *lpuModifiers = pNode->uModifiers;
433 *lpuVirtualKey = pNode->uVirtualKey;
434 if (lphKL)
435 *lphKL = pNode->hKL;
436 }
438 {
439 ERR("%p, %p, %p, %p\n", pNode, lpuModifiers, lpuVirtualKey, lphKL);
440 pNode = NULL;
441 }
442 _SEH2_END;
443
444Quit:
445 UserLeave();
446 return !!pNode;
447}
UINT uModifiers
Definition: ime.c:36
HKL hKL
Definition: ime.c:37
UINT uVirtualKey
Definition: ime.c:35
static PIMEHOTKEY FASTCALL IntGetImeHotKeyById(PIMEHOTKEY pList, DWORD dwHotKeyId)
Definition: ime.c:146
PIMEHOTKEY gpImeHotKeyList
Definition: ime.c:40

Referenced by CliSetDefaultImeHotKeys(), and ImmGetHotKey().

◆ NtUserGetImeInfoEx()

BOOL NTAPI NtUserGetImeInfoEx ( PIMEINFOEX  pImeInfoEx,
IMEINFOEXCLASS  SearchType 
)

Definition at line 1008 of file ime.c.

1011{
1012 IMEINFOEX ImeInfoEx;
1013 BOOL ret = FALSE;
1014 PWINSTATION_OBJECT pWinSta;
1015
1017
1018 if (!IS_IMM_MODE())
1019 {
1020 ERR("!IS_IMM_MODE()\n");
1021 goto Quit;
1022 }
1023
1024 _SEH2_TRY
1025 {
1026 ProbeForRead(pImeInfoEx, sizeof(*pImeInfoEx), 1);
1027 ImeInfoEx = *pImeInfoEx;
1028 }
1030 {
1031 ERR("%p\n", pImeInfoEx);
1032 _SEH2_YIELD(goto Quit);
1033 }
1034 _SEH2_END;
1035
1037 ret = UserGetImeInfoEx(pWinSta, &ImeInfoEx, SearchType);
1038 if (!ret)
1039 goto Quit;
1040
1041 _SEH2_TRY
1042 {
1043 ProbeForWrite(pImeInfoEx, sizeof(*pImeInfoEx), 1);
1044 *pImeInfoEx = ImeInfoEx;
1045 }
1047 {
1048 ERR("%p\n", pImeInfoEx);
1049 ret = FALSE;
1050 }
1051 _SEH2_END;
1052
1053Quit:
1054 UserLeave();
1055 return ret;
1056}
BOOL FASTCALL UserGetImeInfoEx(_Inout_ PWINSTATION_OBJECT pWinSta, _Inout_ PIMEINFOEX pInfoEx, _In_ IMEINFOEXCLASS SearchType)
Definition: ime.c:951

Referenced by ImmGetImeInfoEx().

◆ NtUserGetInternalWindowPos()

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

Definition at line 3315 of file winpos.c.

3318{
3319 PWND Window;
3320 DWORD Ret = 0;
3321 BOOL Hit = FALSE;
3322 WINDOWPLACEMENT wndpl;
3323
3325
3327 {
3328 Hit = FALSE;
3329 goto Exit;
3330 }
3331
3332 _SEH2_TRY
3333 {
3334 if(rectWnd)
3335 {
3336 ProbeForWrite(rectWnd,
3337 sizeof(RECT),
3338 1);
3339 }
3340 if(ptIcon)
3341 {
3342 ProbeForWrite(ptIcon,
3343 sizeof(POINT),
3344 1);
3345 }
3346
3347 }
3349 {
3351 Hit = TRUE;
3352 }
3353 _SEH2_END;
3354
3355 wndpl.length = sizeof(WINDOWPLACEMENT);
3356
3357 if (IntGetWindowPlacement(Window, &wndpl) && !Hit)
3358 {
3359 _SEH2_TRY
3360 {
3361 if (rectWnd)
3362 {
3363 RtlCopyMemory(rectWnd, &wndpl.rcNormalPosition , sizeof(RECT));
3364 }
3365 if (ptIcon)
3366 {
3367 RtlCopyMemory(ptIcon, &wndpl.ptMinPosition, sizeof(POINT));
3368 }
3369
3370 }
3372 {
3374 Hit = TRUE;
3375 }
3376 _SEH2_END;
3377
3378 if (!Hit) Ret = wndpl.showCmd;
3379 }
3380Exit:
3381 UserLeave();
3382 return Ret;
3383}
BOOL FASTCALL IntGetWindowPlacement(PWND Wnd, WINDOWPLACEMENT *lpwndpl)
Definition: winpos.c:559
RECT rcNormalPosition
Definition: winuser.h:3295
POINT ptMinPosition
Definition: winuser.h:3293
struct _WINDOWPLACEMENT WINDOWPLACEMENT

◆ NtUserGetKeyboardLayout()

HKL NTAPI NtUserGetKeyboardLayout ( DWORD  dwThreadid)

◆ NtUserGetKeyboardLayoutList()

UINT NTAPI NtUserGetKeyboardLayoutList ( ULONG  nItems,
HKL pHklBuff 
)

Definition at line 1075 of file kbdlayout.c.

1078{
1079 UINT ret = 0;
1080 PWINSTATION_OBJECT pWinSta;
1081
1082 if (!pHklBuff)
1083 nBuff = 0;
1084
1086
1087 if (nBuff > MAXULONG / sizeof(HKL))
1088 {
1090 goto Quit;
1091 }
1092
1093 _SEH2_TRY
1094 {
1095 ProbeForWrite(pHklBuff, nBuff * sizeof(HKL), 1);
1096 }
1098 {
1100 goto Quit;
1101 }
1102 _SEH2_END;
1103
1105
1106 _SEH2_TRY
1107 {
1108 ret = IntGetKeyboardLayoutList(pWinSta, nBuff, pHklBuff);
1109 }
1111 {
1113 goto Quit;
1114 }
1115 _SEH2_END;
1116
1117Quit:
1118 UserLeave();
1119 return ret;
1120}
#define MAXULONG
Definition: typedefs.h:251
static UINT APIENTRY IntGetKeyboardLayoutList(_Inout_ PWINSTATION_OBJECT pWinSta, _In_ ULONG nBuff, _Out_ HKL *pHklBuff)
Definition: kbdlayout.c:98

Referenced by CliImmInitializeHotKeys().

◆ NtUserGetKeyboardLayoutName()

BOOL NTAPI NtUserGetKeyboardLayoutName ( _Inout_ PUNICODE_STRING  pustrName)

Definition at line 1129 of file kbdlayout.c.

1131{
1132 BOOL bRet = FALSE;
1133 PKL pKl;
1134 PTHREADINFO pti;
1135 UNICODE_STRING ustrNameSafe;
1137
1139
1141 pKl = pti->KeyboardLayout;
1142
1143 if (!pKl)
1144 goto cleanup;
1145
1146 _SEH2_TRY
1147 {
1148 ProbeForWriteUnicodeString(pustrName);
1149 ustrNameSafe = *pustrName;
1150
1151 ProbeForWrite(ustrNameSafe.Buffer, ustrNameSafe.MaximumLength, 1);
1152
1153 if (IS_IME_HKL(pKl->hkl))
1154 {
1155 Status = RtlIntegerToUnicodeString((ULONG)(ULONG_PTR)pKl->hkl, 16, &ustrNameSafe);
1156 }
1157 else
1158 {
1159 if (ustrNameSafe.MaximumLength < KL_NAMELENGTH * sizeof(WCHAR))
1160 {
1162 goto cleanup;
1163 }
1164
1165 /* FIXME: Do not use awchKF */
1166 ustrNameSafe.Length = 0;
1167 Status = RtlAppendUnicodeToString(&ustrNameSafe, pKl->spkf->awchKF);
1168 }
1169
1170 if (NT_SUCCESS(Status))
1171 {
1172 *pustrName = ustrNameSafe;
1173 bRet = TRUE;
1174 }
1175 }
1177 {
1179 }
1180 _SEH2_END;
1181
1182cleanup:
1183 UserLeave();
1184 return bRet;
1185}
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
Definition: string_lib.cpp:62
#define IS_IME_HKL(hKL)
Definition: imm32_undoc.h:20
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 GetKeyboardLayoutNameW(), and START_TEST().

◆ NtUserGetKeyboardState()

DWORD NTAPI NtUserGetKeyboardState ( LPBYTE  Unknown0)

Definition at line 2551 of file msgqueue.c.

2552{
2553 DWORD i, ret = TRUE;
2554 PTHREADINFO pti;
2555 PUSER_MESSAGE_QUEUE MessageQueue;
2556
2558
2560 MessageQueue = pti->MessageQueue;
2561
2562 _SEH2_TRY
2563 {
2564 /* Probe and copy key state to an array */
2565 ProbeForWrite(lpKeyState, 256 * sizeof(BYTE), 1);
2566 for (i = 0; i < 256; ++i)
2567 {
2568 lpKeyState[i] = 0;
2569 if (IS_KEY_DOWN(MessageQueue->afKeyState, i))
2570 lpKeyState[i] |= KS_DOWN_BIT;
2571 if (IS_KEY_LOCKED(MessageQueue->afKeyState, i))
2572 lpKeyState[i] |= KS_LOCK_BIT;
2573 }
2574 }
2576 {
2578 ret = FALSE;
2579 }
2580 _SEH2_END;
2581
2582 UserLeave();
2583
2584 return ret;
2585}
BYTE afKeyState[256 *2/8]
Definition: msgqueue.h:84
#define KS_DOWN_BIT
Definition: input.h:54
#define KS_LOCK_BIT
Definition: input.h:55
#define IS_KEY_LOCKED(ks, vk)
Definition: input.h:102
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 1584 of file keyboard.c.

1585{
1586 PTHREADINFO pti;
1587 DWORD i, dwRet = 0;
1588 SIZE_T cchKeyName;
1589 WORD wScanCode = (lParam >> 16) & 0xFF;
1590 BOOL bExtKey = (HIWORD(lParam) & KF_EXTENDED) ? TRUE : FALSE;
1591 PKBDTABLES pKbdTbl;
1592 VSC_LPWSTR *pKeyNames = NULL;
1593 CONST WCHAR *pKeyName = NULL;
1594 WCHAR KeyNameBuf[2];
1595
1596 TRACE("Enter NtUserGetKeyNameText\n");
1597
1599
1600 /* Get current keyboard layout */
1602 pKbdTbl = pti ? pti->KeyboardLayout->spkf->pKbdTbl : 0;
1603
1604 if (!pKbdTbl || cchSize < 1)
1605 {
1606 ERR("Invalid parameter\n");
1607 goto cleanup;
1608 }
1609
1610 /* "Do not care" flag */
1612 {
1613 /* Note: We could do vsc -> vk -> vsc conversion, instead of using
1614 hardcoded scan codes, but it's not what Windows does */
1615 if (wScanCode == SCANCODE_RSHIFT && !bExtKey)
1616 wScanCode = SCANCODE_LSHIFT;
1617 else if (wScanCode == SCANCODE_CTRL || wScanCode == SCANCODE_ALT)
1618 bExtKey = FALSE;
1619 }
1620
1621 if (bExtKey)
1622 pKeyNames = pKbdTbl->pKeyNamesExt;
1623 else
1624 pKeyNames = pKbdTbl->pKeyNames;
1625
1626 for (i = 0; pKeyNames[i].pwsz; i++)
1627 {
1628 if (pKeyNames[i].vsc == wScanCode)
1629 {
1630 pKeyName = pKeyNames[i].pwsz;
1631 break;
1632 }
1633 }
1634
1635 if (!pKeyName)
1636 {
1637 WORD wVk = IntVscToVk(wScanCode, pKbdTbl);
1638
1639 if (wVk)
1640 {
1641 KeyNameBuf[0] = IntVkToChar(wVk, pKbdTbl);
1642 KeyNameBuf[1] = 0;
1643 if (KeyNameBuf[0])
1644 pKeyName = KeyNameBuf;
1645 }
1646 }
1647
1648 if (pKeyName)
1649 {
1650 cchKeyName = wcslen(pKeyName);
1651 if (cchKeyName > (cchSize - 1UL))
1652 cchKeyName = cchSize - 1UL; // Don't count '\0'
1653
1654 _SEH2_TRY
1655 {
1656 ProbeForWrite(lpString, (cchKeyName + 1) * sizeof(WCHAR), 1);
1657 RtlCopyMemory(lpString, pKeyName, cchKeyName * sizeof(WCHAR));
1658 lpString[cchKeyName] = UNICODE_NULL;
1659 dwRet = cchKeyName;
1660 }
1662 {
1664 }
1665 _SEH2_END;
1666 }
1667 else
1668 {
1670 }
1671
1672cleanup:
1673 UserLeave();
1674 TRACE("Leave NtUserGetKeyNameText, ret=%lu\n", dwRet);
1675 return dwRet;
1676}
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#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:59
static WCHAR FASTCALL IntVkToChar(WORD wVk, PKBDTABLES pKbdTbl)
Definition: keyboard.c:607
static WORD FASTCALL IntVscToVk(WORD wScanCode, PKBDTABLES pKbdTbl)
Definition: keyboard.c:564
#define KF_EXTENDED
Definition: winuser.h:2446

Referenced by GetKeyNameTextA(), and GetKeyNameTextW().

◆ NtUserGetKeyState()

SHORT NTAPI NtUserGetKeyState ( INT  VirtKey)

Definition at line 2535 of file msgqueue.c.

2536{
2537 DWORD Ret;
2538
2540
2541 Ret = UserGetKeyState(key);
2542
2543 UserLeave();
2544
2545 return (SHORT)Ret;
2546}
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 3579 of file window.c.

3581{
3582 PWND Wnd;
3583 PPROCESSINFO ppi;
3584 BOOL NotSameppi = FALSE;
3585 DWORD Ret = 0;
3586
3587 TRACE("Enter NtUserGetListBoxInfo\n");
3589
3590 if (!(Wnd = UserGetWindowObject(hWnd)))
3591 {
3592 goto Exit; // Return 0
3593 }
3594
3595 if ((Wnd->pcls->atomClassName != gpsi->atomSysClass[ICLS_LISTBOX]) && Wnd->fnid != FNID_LISTBOX)
3596 {
3598 goto Exit;
3599 }
3600
3601 // wine lisbox:test_GetListBoxInfo lb_getlistboxinfo = 0, should not send a message!
3603 NotSameppi = ppi != Wnd->head.pti->ppi;
3604 if (NotSameppi)
3605 {
3606 KeAttachProcess(&Wnd->head.pti->ppi->peProcess->Pcb);
3607 }
3608
3609 _SEH2_TRY
3610 {
3611 LB_DESCR *descr = ((PWND2LB)Wnd)->pLBiv;
3612 // See Controls ListBox.c:LB_GETLISTBOXINFO must match...
3613 Ret = descr->page_size;
3614 }
3616 {
3617 Ret = 0;
3619 }
3620 _SEH2_END;
3621
3622Exit:
3623 if (NotSameppi) KeDetachProcess();
3624 TRACE("Leave NtUserGetListBoxInfo, ret=%lu\n", Ret);
3625 UserLeave();
3626 return Ret;
3627}
#define ICLS_LISTBOX
Definition: ntuser.h:915
#define FNID_LISTBOX
Definition: ntuser.h:871
const char * descr
Definition: boot.c:45
struct _WND2LB * PWND2LB
#define LB_GETLISTBOXINFO
Definition: winuser.h:2044

Referenced by GetListBoxInfo().

◆ NtUserGetMenuBarInfo()

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

Definition at line 5892 of file menu.c.

5897{
5898 PWND pWnd;
5899 HMENU hMenu;
5900 MENUBARINFO kmbi;
5901 BOOL Ret = FALSE;
5902 PPOPUPMENU pPopupMenu;
5905 PMENU Menu = NULL;
5906
5907 TRACE("Enter NtUserGetMenuBarInfo\n");
5909
5910 if (!(pWnd = UserGetWindowObject(hwnd)))
5911 {
5913 goto Cleanup; // Return FALSE
5914 }
5915
5916 UserRefObjectCo(pWnd, &Ref);
5917
5919 kmbi.hMenu = NULL;
5920 kmbi.hwndMenu = NULL;
5921 kmbi.fBarFocused = FALSE;
5922 kmbi.fFocused = FALSE;
5923
5924 switch (idObject)
5925 {
5926 case OBJID_CLIENT:
5927 if (!pWnd->pcls->fnid)
5928 goto Cleanup; // Return FALSE
5929 if (pWnd->pcls->fnid != FNID_MENU)
5930 {
5931 WARN("called on invalid window: %u\n", pWnd->pcls->fnid);
5933 goto Cleanup; // Return FALSE
5934 }
5935 // Windows does this! Wine checks for Atom and uses GetWindowLongPtrW.
5936 hMenu = (HMENU)co_IntSendMessage(hwnd, MN_GETHMENU, 0, 0);
5937 pPopupMenu = ((PMENUWND)pWnd)->ppopupmenu;
5938 if (pPopupMenu && pPopupMenu->spmenu)
5939 {
5940 if (UserHMGetHandle(pPopupMenu->spmenu) != hMenu)
5941 {
5942 ERR("Window Pop Up hMenu %p not the same as Get hMenu %p!\n", UserHMGetHandle(pPopupMenu->spmenu), hMenu);
5943 }
5944 }
5945 break;
5946 case OBJID_MENU:
5947 if (pWnd->style & WS_CHILD)
5948 goto Cleanup; // Return FALSE
5949 hMenu = UlongToHandle(pWnd->IDMenu);
5950 TRACE("GMBI: OBJID_MENU hMenu %p\n",hMenu);
5951 break;
5952 case OBJID_SYSMENU:
5953 if (!(pWnd->style & WS_SYSMENU))
5954 goto Cleanup; // Return FALSE
5955 Menu = IntGetSystemMenu(pWnd, FALSE);
5956 hMenu = UserHMGetHandle(Menu);
5957 break;
5958 default:
5959 goto Cleanup; // Return FALSE
5960 }
5961
5962 if (!hMenu)
5963 goto Cleanup; // Return FALSE
5964
5965 _SEH2_TRY
5966 {
5967 ProbeForRead(pmbi, sizeof(MENUBARINFO), 1);
5968 kmbi.cbSize = pmbi->cbSize;
5969 }
5971 {
5972 kmbi.cbSize = 0;
5973 }
5974 _SEH2_END
5975
5976 if (kmbi.cbSize != sizeof(MENUBARINFO))
5977 {
5979 goto Cleanup; // Return FALSE
5980 }
5981
5982 if (!Menu)
5983 {
5984 Menu = UserGetMenuObject(hMenu);
5985 if (!Menu)
5986 goto Cleanup; // Return FALSE
5987 }
5988
5989 if ((idItem < 0) || ((ULONG)idItem > Menu->cItems))
5990 goto Cleanup; // Return FALSE
5991
5992 if (idItem == 0)
5993 {
5994 Ret = IntGetMenuItemRect(pWnd, Menu, 0, &kmbi.rcBar);
5995 kmbi.rcBar.right = kmbi.rcBar.left + Menu->cxMenu;
5996 kmbi.rcBar.bottom = kmbi.rcBar.top + Menu->cyMenu;
5997 TRACE("idItem a 0 %d\n",Ret);
5998 }
5999 else
6000 {
6001 Ret = IntGetMenuItemRect(pWnd, Menu, idItem-1, &kmbi.rcBar);
6002 TRACE("idItem b %d %d\n", idItem-1, Ret);
6003 }
6004
6005 kmbi.hMenu = hMenu;
6006 kmbi.fBarFocused = top_popup_hmenu == hMenu;
6007 TRACE("GMBI: top p hm %p hMenu %p\n",top_popup_hmenu, hMenu);
6008 if (idItem)
6009 {
6010 kmbi.fFocused = Menu->iItem == idItem-1;
6011 if (kmbi.fFocused && (Menu->rgItems[idItem - 1].spSubMenu))
6012 {
6013 kmbi.hwndMenu = Menu->rgItems[idItem - 1].spSubMenu->hWnd;
6014 }
6015 }
6016 else
6017 {
6018 kmbi.fFocused = kmbi.fBarFocused;
6019 }
6020
6021 _SEH2_TRY
6022 {
6023 ProbeForWrite(pmbi, sizeof(MENUBARINFO), 1);
6024 RtlCopyMemory(pmbi, &kmbi, sizeof(MENUBARINFO));
6025 }
6027 {
6029 }
6030 _SEH2_END
6031
6032 if (!NT_SUCCESS(Status))
6033 {
6035 Ret = FALSE;
6036 goto Cleanup;
6037 }
6038
6039 Ret = TRUE;
6040
6041Cleanup:
6042 if (pWnd) UserDerefObjectCo(pWnd);
6043 TRACE("Leave NtUserGetMenuBarInfo, ret=%i\n", Ret);
6044 UserLeave();
6045 return Ret;
6046}
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:3730
DWORD cbSize
Definition: winuser.h:3726
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:5371
static HMENU top_popup_hmenu
Definition: menu.c:23
BOOL FASTCALL IntGetMenuItemRect(PWND pWnd, PMENU Menu, UINT uItem, PRECTL Rect)
Definition: menu.c:5218
#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:1773

◆ NtUserGetMenuIndex()

UINT NTAPI NtUserGetMenuIndex ( HMENU  hMenu,
HMENU  hSubMenu 
)

Definition at line 6052 of file menu.c.

6055{
6056 PMENU Menu, SubMenu;
6057 PITEM MenuItem;
6058 UINT i;
6059 UINT Ret = 0xFFFFFFFF;
6060
6061 TRACE("Enter NtUserGetMenuIndex\n");
6063
6064 if ( !(Menu = UserGetMenuObject(hMenu)) ||
6065 !(SubMenu = UserGetMenuObject(hSubMenu)) )
6066 goto Exit; // Return 0xFFFFFFFF
6067
6068 MenuItem = Menu->rgItems;
6069 for (i = 0; i < Menu->cItems; i++, MenuItem++)
6070 {
6071 if (MenuItem->spSubMenu == SubMenu)
6072 {
6073 Ret = MenuItem->wID;
6074 break;
6075 }
6076 }
6077
6078Exit:
6079 TRACE("Leave NtUserGetMenuIndex, ret=%u\n", Ret);
6080 UserLeave();
6081 return Ret;
6082}
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 2297 of file message.c.

2301{
2302 MSG Msg;
2303 BOOL Ret;
2304
2305 if ( (MsgFilterMin|MsgFilterMax) & ~WM_MAXIMUM )
2306 {
2308 return FALSE;
2309 }
2310
2312
2313 RtlZeroMemory(&Msg, sizeof(MSG));
2314
2315 Ret = co_IntGetPeekMessage(&Msg, hWnd, MsgFilterMin, MsgFilterMax, PM_REMOVE, TRUE);
2316
2317 UserLeave();
2318
2319 if (Ret)
2320 {
2321 _SEH2_TRY
2322 {
2323 ProbeForWrite(pMsg, sizeof(MSG), 1);
2324 RtlCopyMemory(pMsg, &Msg, sizeof(MSG));
2325 }
2327 {
2329 Ret = FALSE;
2330 }
2331 _SEH2_END;
2332 }
2333
2334 if ((INT)Ret != -1)
2335 Ret = Ret ? (WM_QUIT != pMsg->message) : FALSE;
2336
2337 return Ret;
2338}
UINT message
Definition: winuser.h:3115
#define WM_MAXIMUM
Definition: undocuser.h:64
#define WM_QUIT
Definition: winuser.h:1623

Referenced by GetMessageA(), and GetMessageW().

◆ NtUserGetMonitorInfo()

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

Definition at line 728 of file monitor.c.

731{
732 PMONITOR pMonitor;
733 MONITORINFOEXW MonitorInfo;
735 BOOL bRet = FALSE;
736 PWCHAR pwstrDeviceName;
737
738 TRACE("Enter NtUserGetMonitorInfo\n");
740
741 /* Get monitor object */
742 pMonitor = UserGetMonitorObject(hMonitor);
743 if (!pMonitor)
744 {
745 TRACE("Couldnt find monitor %p\n", hMonitor);
746 goto cleanup;
747 }
748
749 /* Check if pMonitorInfoUnsafe is valid */
750 if(pMonitorInfoUnsafe == NULL)
751 {
753 goto cleanup;
754 }
755
756 pwstrDeviceName = ((PPDEVOBJ)(pMonitor->hDev))->pGraphicsDevice->szWinDeviceName;
757
758 /* Get size of pMonitorInfoUnsafe */
759 Status = MmCopyFromCaller(&MonitorInfo.cbSize, &pMonitorInfoUnsafe->cbSize, sizeof(MonitorInfo.cbSize));
760 if (!NT_SUCCESS(Status))
761 {
763 goto cleanup;
764 }
765
766 /* Check if size of struct is valid */
767 if (MonitorInfo.cbSize != sizeof(MONITORINFO) &&
768 MonitorInfo.cbSize != sizeof(MONITORINFOEXW))
769 {
771 goto cleanup;
772 }
773
774 /* Fill monitor info */
775 MonitorInfo.rcMonitor = pMonitor->rcMonitor;
776 MonitorInfo.rcWork = pMonitor->rcWork;
777 MonitorInfo.dwFlags = 0;
778 if (pMonitor->IsPrimary)
779 MonitorInfo.dwFlags |= MONITORINFOF_PRIMARY;
780
781 /* Fill device name */
782 if (MonitorInfo.cbSize == sizeof(MONITORINFOEXW))
783 {
784 RtlStringCbCopyNExW(MonitorInfo.szDevice,
785 sizeof(MonitorInfo.szDevice),
786 pwstrDeviceName,
787 (wcslen(pwstrDeviceName)+1) * sizeof(WCHAR),
789 }
790
791 /* Output data */
792 Status = MmCopyToCaller(pMonitorInfoUnsafe, &MonitorInfo, MonitorInfo.cbSize);
793 if (!NT_SUCCESS(Status))
794 {
795 TRACE("GetMonitorInfo: MmCopyToCaller failed\n");
797 goto cleanup;
798 }
799
800 TRACE("GetMonitorInfo: success\n");
801 bRet = TRUE;
802
803cleanup:
804 TRACE("Leave NtUserGetMonitorInfo, ret=%i\n", bRet);
805 UserLeave();
806 return bRet;
807}
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:3804
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 // http://msdn.microsoft.com/en-us/library/ms646259(v=vs.85).aspx
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:693
#define ERROR_NOACCESS
Definition: winerror.h:578

◆ NtUserGetObjectInformation()

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

Definition at line 1099 of file winsta.c.

1105{
1107 PWINSTATION_OBJECT WinStaObject = NULL;
1108 PDESKTOP DesktopObject = NULL;
1109 POBJECT_HEADER ObjectHeader;
1110 POBJECT_HEADER_NAME_INFO NameInfo;
1111 OBJECT_HANDLE_INFORMATION HandleInfo;
1112 USEROBJECTFLAGS ObjectFlags;
1113 PUNICODE_STRING pStrNameU = NULL;
1114 PVOID pvData = NULL;
1115 SIZE_T nDataSize = 0;
1116
1117 _SEH2_TRY
1118 {
1119 if (nLengthNeeded)
1120 ProbeForWrite(nLengthNeeded, sizeof(*nLengthNeeded), 1);
1121 ProbeForWrite(pvInformation, nLength, 1);
1122 }
1124 {
1126 return FALSE;
1127 }
1128 _SEH2_END;
1129
1130 /* Try window station */
1131 TRACE("Trying to open window station 0x%p\n", hObject);
1133 0,
1135 UserMode,
1136 (PVOID*)&WinStaObject,
1137 &HandleInfo);
1138
1140 {
1141 /* Try desktop */
1142 TRACE("Trying to open desktop %p\n", hObject);
1143 WinStaObject = NULL;
1145 UserMode,
1146 0,
1147 &DesktopObject);
1148 }
1149
1150 if (!NT_SUCCESS(Status))
1151 {
1152 ERR("Failed: 0x%x\n", Status);
1153 goto Exit;
1154 }
1155
1156 TRACE("WinSta or Desktop opened!\n");
1157
1158 /* Get data */
1159 switch (nIndex)
1160 {
1161 case UOI_FLAGS:
1162 {
1163 ObjectFlags.fReserved = FALSE;
1164 ObjectFlags.fInherit = !!(HandleInfo.HandleAttributes & OBJ_INHERIT);
1165
1166 ObjectFlags.dwFlags = 0;
1167 if (WinStaObject != NULL)
1168 {
1169 if (!(WinStaObject->Flags & WSS_NOIO))
1170 ObjectFlags.dwFlags |= WSF_VISIBLE;
1171 }
1172 else if (DesktopObject != NULL)
1173 {
1174 FIXME("Setting DF_ALLOWOTHERACCOUNTHOOK is unimplemented.\n");
1175 }
1176 else
1177 {
1178 ERR("No associated WinStaObject nor DesktopObject!\n");
1179 }
1180
1181 pvData = &ObjectFlags;
1182 nDataSize = sizeof(ObjectFlags);
1184 break;
1185 }
1186
1187 case UOI_NAME:
1188 {
1189 if (WinStaObject != NULL)
1190 {
1191 ObjectHeader = OBJECT_TO_OBJECT_HEADER(WinStaObject);
1192 NameInfo = OBJECT_HEADER_TO_NAME_INFO(ObjectHeader);
1193
1194 if (NameInfo && (NameInfo->Name.Length > 0))
1195 {
1196 /* Named window station */
1197 pStrNameU = &NameInfo->Name;
1198 nDataSize = pStrNameU->Length + sizeof(UNICODE_NULL);
1199 }
1200 else
1201 {
1202 /* Unnamed window station (should never happen!) */
1203 ASSERT(FALSE);
1204 pStrNameU = NULL;
1205 nDataSize = sizeof(UNICODE_NULL);
1206 }
1208 }
1209 else if (DesktopObject != NULL)
1210 {
1211 pvData = DesktopObject->pDeskInfo->szDesktopName;
1212 nDataSize = (wcslen(DesktopObject->pDeskInfo->szDesktopName) + 1) * sizeof(WCHAR);
1214 }
1215 else
1216 {
1218 }
1219 break;
1220 }
1221
1222 case UOI_TYPE:
1223 {
1224 if (WinStaObject != NULL)
1225 {
1226 ObjectHeader = OBJECT_TO_OBJECT_HEADER(WinStaObject);
1227 pStrNameU = &ObjectHeader->Type->Name;
1228 nDataSize = pStrNameU->Length + sizeof(UNICODE_NULL);
1230 }
1231 else if (DesktopObject != NULL)
1232 {
1233 ObjectHeader = OBJECT_TO_OBJECT_HEADER(DesktopObject);
1234 pStrNameU = &ObjectHeader->Type->Name;
1235 nDataSize = pStrNameU->Length + sizeof(UNICODE_NULL);
1237 }
1238 else
1239 {
1241 }
1242 break;
1243 }
1244
1245 case UOI_USER_SID:
1247 ERR("UOI_USER_SID unimplemented!\n");
1248 break;
1249
1250 default:
1252 break;
1253 }
1254
1255Exit:
1256 if ((Status == STATUS_SUCCESS) && (nLength < nDataSize))
1258
1259 _SEH2_TRY
1260 {
1261 if (nLengthNeeded)
1262 *nLengthNeeded = nDataSize;
1263
1264 /* Try to copy data to caller */
1265 if (Status == STATUS_SUCCESS && (nDataSize > 0))
1266 {
1267 TRACE("Trying to copy data to caller (len = %lu, len needed = %lu)\n", nLength, nDataSize);
1268 if (pvData)
1269 {
1270 /* Copy the data */
1271 RtlCopyMemory(pvInformation, pvData, nDataSize);
1272 }
1273 else if (pStrNameU)
1274 {
1275 /* Copy and NULL-terminate the string */
1276 RtlCopyMemory(pvInformation, pStrNameU->Buffer, pStrNameU->Length);
1277 ((PWCHAR)pvInformation)[pStrNameU->Length / sizeof(WCHAR)] = UNICODE_NULL;
1278 }
1279 else
1280 {
1281 /* Zero the memory */
1282 RtlZeroMemory(pvInformation, nDataSize);
1283 }
1284 }
1285 }
1287 {
1289 }
1290 _SEH2_END;
1291
1292 /* Release objects */
1293 if (DesktopObject != NULL)
1294 ObDereferenceObject(DesktopObject);
1295 if (WinStaObject != NULL)
1296 ObDereferenceObject(WinStaObject);
1297
1298 if (!NT_SUCCESS(Status))
1299 {
1301 return FALSE;
1302 }
1303
1304 return TRUE;
1305}
#define FIXME(fmt,...)
Definition: debug.h:111
#define OBJ_INHERIT
Definition: winternl.h:225
#define OBJECT_HEADER_TO_NAME_INFO(h)
Definition: obtypes.h:114
#define OBJECT_TO_OBJECT_HEADER(o)
Definition: obtypes.h:111
#define STATUS_OBJECT_TYPE_MISMATCH
Definition: ntstatus.h:273
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
_In_ DWORD nLength
Definition: wincon.h:473
_In_ ULONG _In_opt_ PVOID pvData
Definition: winddi.h:3749
#define UOI_NAME
Definition: winuser.h:1084
#define UOI_TYPE
Definition: winuser.h:1085
#define UOI_USER_SID
Definition: winuser.h:1086
#define WSF_VISIBLE
Definition: winuser.h:2452
#define UOI_FLAGS
Definition: winuser.h:1083

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 1376 of file winsta.c.

1377{
1379}

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}

◆ 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 1142 of file scrollbar.c.

1143{
1145 SCROLLBARINFO sbi;
1146 PWND Window;
1147 BOOL Ret = FALSE;
1149
1150 TRACE("Enter NtUserGetScrollBarInfo\n");
1152
1153 Status = MmCopyFromCaller(&sbi, psbi, sizeof(SCROLLBARINFO));
1154 if(!NT_SUCCESS(Status) || (sbi.cbSize != sizeof(SCROLLBARINFO)))
1155 {
1157 goto Exit; // Return FALSE
1158 }
1159
1161 goto Exit; // Return FALSE
1162
1163 UserRefObjectCo(Window, &Ref);
1164 Ret = co_IntGetScrollBarInfo(Window, idObject, &sbi);
1166
1167 Status = MmCopyToCaller(psbi, &sbi, sizeof(SCROLLBARINFO));
1168 if(!NT_SUCCESS(Status))
1169 {
1171 Ret = FALSE;
1172 }
1173
1174Exit:
1175 TRACE("Leave NtUserGetScrollBarInfo, ret=%i\n", Ret);
1176 UserLeave();
1177 return Ret;
1178}
BOOL FASTCALL co_IntGetScrollBarInfo(PWND Window, LONG idObject, PSCROLLBARINFO psbi)
Definition: scrollbar.c:666

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

◆ NtUserGetSystemMenu()

HMENU NTAPI NtUserGetSystemMenu ( HWND  hWnd,
BOOL  bRevert 
)

Definition at line 5648 of file menu.c.

5649{
5650 PWND Window;
5651 PMENU Menu;
5652 HMENU Ret = NULL;
5653
5654 TRACE("Enter NtUserGetSystemMenu\n");
5656
5658 {
5659 goto Exit; // Return NULL
5660 }
5661
5662 if (!(Menu = IntGetSystemMenu(Window, bRevert)))
5663 {
5664 goto Exit; // Return NULL
5665 }
5666
5667 Ret = UserHMGetHandle(Menu);
5668
5669Exit:
5670 TRACE("Leave NtUserGetSystemMenu, ret=%p\n", Ret);
5671 UserLeave();
5672 return Ret;
5673}

Referenced by GetSystemMenu().

◆ NtUserGetThreadDesktop()

HDESK NTAPI NtUserGetThreadDesktop ( DWORD  dwThreadId,
HDESK  hConsoleDesktop 
)

Definition at line 3033 of file desktop.c.

3034{
3035 HDESK hDesk;
3037 PTHREADINFO pti;
3039 PDESKTOP DesktopObject;
3041
3043 TRACE("Enter NtUserGetThreadDesktop\n");
3044
3045 if (!dwThreadId)
3046 {
3048 hDesk = NULL;
3049 goto Quit;
3050 }
3051
3052 /* Validate the Win32 thread and retrieve its information */
3054 if (pti)
3055 {
3056 /* Get the desktop handle of the thread */
3057 hDesk = pti->hdesk;
3058 Process = pti->ppi->peProcess;
3059 }
3060 else if (hConsoleDesktop)
3061 {
3062 /*
3063 * The thread may belong to a console, so attempt to use the provided
3064 * console desktop handle as a fallback. Otherwise this means that the
3065 * thread is either not Win32 or invalid.
3066 */
3067 hDesk = hConsoleDesktop;
3069 }
3070 else
3071 {
3073 hDesk = NULL;
3074 goto Quit;
3075 }
3076
3077 if (!hDesk)
3078 {
3079 ERR("Desktop information of thread 0x%x broken!?\n", dwThreadId);
3080 goto Quit;
3081 }
3082
3084 {
3085 /*
3086 * Just return the handle, since we queried the desktop handle
3087 * of a thread running in the same context.
3088 */
3089 goto Quit;
3090 }
3091
3092 /*
3093 * We could just use the cached rpdesk instead of looking up the handle,
3094 * but it may actually be safer to validate the desktop and get a temporary
3095 * reference to it so that it does not disappear under us (e.g. when the
3096 * desktop is being destroyed) during the operation.
3097 */
3098 /*
3099 * Switch into the context of the thread we are trying to get
3100 * the desktop from, so we can use the handle.
3101 */
3102 KeAttachProcess(&Process->Pcb);
3104 0,
3106 UserMode,
3107 (PVOID*)&DesktopObject,
3110
3111 if (NT_SUCCESS(Status))
3112 {
3113 /*
3114 * Lookup our handle table if we can find a handle to the desktop object.
3115 * If not, create one.
3116 * QUESTION: Do we really need to create a handle in case it doesn't exist??
3117 */
3118 hDesk = IntGetDesktopObjectHandle(DesktopObject);
3119
3120 /* All done, we got a valid handle to the desktop */
3121 ObDereferenceObject(DesktopObject);
3122 }
3123 else
3124 {
3125 /* The handle could not be found, there is nothing to get... */
3126 hDesk = NULL;
3127 }
3128
3129 if (!hDesk)
3130 {
3131 ERR("Could not retrieve or access desktop for thread 0x%x\n", dwThreadId);
3133 }
3134
3135Quit:
3136 TRACE("Leave NtUserGetThreadDesktop, hDesk = 0x%p\n", hDesk);
3137 UserLeave();
3138 return hDesk;
3139}
HDESK FASTCALL IntGetDesktopObjectHandle(PDESKTOP DesktopObject)
Definition: desktop.c:1271
_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 240 of file misc.c.

242{
243 DWORD_PTR ret = 0;
244 PTHREADINFO pti;
245
246 TRACE("Enter NtUserGetThreadState\n");
247 if (Routine != THREADSTATE_GETTHREADINFO)
248 {
250 }
251 else
252 {
254 }
255
257
258 switch (Routine)
259 {
261 ret = TRUE;
262 break;
265 break;
267 /* FIXME: Should use UserEnterShared */
269 break;
270 case THREADSTATE_PROGMANWINDOW: /* FIXME: Delete this HACK */
271 ret = (DWORD_PTR)GetW32ThreadInfo()->pDeskInfo->hProgmanWindow;
272 break;
273 case THREADSTATE_TASKMANWINDOW: /* FIXME: Delete this HACK */
274 ret = (DWORD_PTR)GetW32ThreadInfo()->pDeskInfo->hTaskManWindow;
275 break;
278 break;
280 {
283 TRACE("THREADSTATE_INSENDMESSAGE\n");
284
285 ret = ISMEX_NOSEND;
286 if (Message)
287 {
288 if (Message->ptiSender)
289 ret = ISMEX_SEND;
290 else
291 {
292 if (Message->CompletionCallback)
293 ret = ISMEX_CALLBACK;
294 else
295 ret = ISMEX_NOTIFY;
296 }
297 /* If ReplyMessage */
298 if (Message->QS_Flags & QS_SMRESULT) ret |= ISMEX_REPLIED;
299 }
300
301 break;
302 }
305 break;
306
308 pti->pcti->timeLastRead = EngGetTickCount32();
309 break;
310
313 break;
314
317 break;
319 ret = (DWORD_PTR) (GetW32ThreadInfo()->MessageQueue->CursorObject ?
320 UserHMGetHandle(GetW32ThreadInfo()->MessageQueue->CursorObject) : 0);
321 break;
324 break;
326 if (pti->spwndDefaultIme)
328 break;
330 if (pti->spDefaultImc)
332 break;
334 ret = pti->pcti->fsChangeBits;
335 break;
337 ret = pti->ppi->dwImeCompatFlags;
338 break;
340 ret = (ULONG_PTR)pti->hklPrev;
341 break;
345 break;
347 ret = (IntTID2PTI(UlongToHandle(pti->rpdesk->dwConsoleThreadId)) == pti);
348 break;
349 }
350
351 TRACE("Leave NtUserGetThreadState, ret=%lu\n", ret);
352 UserLeave();
353
354 return ret;
355}
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:41
HWND APIENTRY IntGetCapture(VOID)
Definition: focus.c:1440
HWND FASTCALL UserGetActiveWindow(VOID)
Definition: focus.c:1429
LPARAM FASTCALL MsqGetMessageExtraInfo(VOID)
Definition: msgqueue.c:2455
HANDLE NTAPI PsGetCurrentProcessId(VOID)
Definition: process.c:1123
HANDLE gpidLogon
Definition: simplecall.c:15
DWORD dwImeCompatFlags
Definition: win32.h:276
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:95
PTHREADINFO GetW32ThreadInfo(VOID)
Definition: misc.c:805
#define QS_KEY
Definition: winuser.h:874
#define QS_SENDMESSAGE
Definition: winuser.h:880
#define QS_TIMER
Definition: winuser.h:878
#define QS_MOUSEBUTTON
Definition: winuser.h:876
#define QS_INPUT
Definition: winuser.h:899
#define QS_PAINT
Definition: winuser.h:879

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 5722 of file menu.c.

5725{
5726 PWND WindowObject;
5727 TITLEBARINFO bartitleinfo;
5728 BOOLEAN retValue = TRUE;
5729
5730 TRACE("Enter NtUserGetTitleBarInfo\n");
5732
5733 /* Vaildate the windows handle */
5734 if (!(WindowObject = UserGetWindowObject(hwnd)))
5735 {
5737 retValue = FALSE;
5738 }
5739
5740 _SEH2_TRY
5741 {
5742 /* Copy our usermode buffer bti to local buffer bartitleinfo */
5743 ProbeForRead(bti, sizeof(TITLEBARINFO), 1);
5744 RtlCopyMemory(&bartitleinfo, bti, sizeof(TITLEBARINFO));
5745 }
5747 {
5748 /* Fail copy the data */
5750 retValue = FALSE;
5751 }
5752 _SEH2_END
5753
5754 /* Get the tile bar info */
5755 if (retValue)
5756 {
5757 retValue = intGetTitleBarInfo(WindowObject, &bartitleinfo);
5758 if (retValue)
5759 {
5760 _SEH2_TRY
5761 {
5762 /* Copy our buffer to user mode buffer bti */
5763 ProbeForWrite(bti, sizeof(TITLEBARINFO), 1);
5764 RtlCopyMemory(bti, &bartitleinfo, sizeof(TITLEBARINFO));
5765 }
5767 {
5768 /* Fail copy the data */
5770 retValue = FALSE;
5771 }
5772 _SEH2_END
5773 }
5774 }
5775
5776 TRACE("Leave NtUserGetTitleBarInfo, ret=%u\n", retValue);
5777 UserLeave();
5778 return retValue;
5779}
BOOLEAN APIENTRY intGetTitleBarInfo(PWND pWindowObject, PTITLEBARINFO bti)
Definition: menu.c:4792

Referenced by GetTitleBarInfo(), and START_TEST().

◆ NtUserGetUpdateRect()

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

Definition at line 1955 of file painting.c.

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

Referenced by GetUpdateRect().

◆ NtUserGetUpdateRgn()

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

Definition at line 1928 of file painting.c.

1929{
1930 PWND Window;
1931 INT ret = ERROR;
1932
1933 TRACE("Enter NtUserGetUpdateRgn\n");
1935
1937 if (Window)
1938 {
1939 ret = co_UserGetUpdateRgn(Window, hRgn, bErase);
1940 }
1941
1942 TRACE("Leave NtUserGetUpdateRgn, ret=%i\n", ret);
1943 UserLeave();
1944 return ret;
1945}
static HRGN hRgn
Definition: mapping.c:33
INT FASTCALL co_UserGetUpdateRgn(PWND Window, HRGN hRgn, BOOL bErase)
Definition: painting.c:1784

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 3389 of file winpos.c.

3391{
3392 PWND Wnd;
3393 WINDOWPLACEMENT Safepl;
3395 BOOL Ret = FALSE;
3396
3397 TRACE("Enter NtUserGetWindowPlacement\n");
3399
3400 if (!(Wnd = UserGetWindowObject(hWnd)))
3401 {
3402 goto Exit; // Return FALSE
3403 }
3404
3405 Status = MmCopyFromCaller(&Safepl, lpwndpl, sizeof(WINDOWPLACEMENT));
3406 if (!NT_SUCCESS(Status))
3407 {
3409 goto Exit; // Return FALSE
3410 }
3411
3412 Safepl.length = sizeof(WINDOWPLACEMENT);
3413
3414 IntGetWindowPlacement(Wnd, &Safepl);
3415
3416 Status = MmCopyToCaller(lpwndpl, &Safepl, sizeof(WINDOWPLACEMENT));
3417 if (!NT_SUCCESS(Status))
3418 {
3420 goto Exit; // Return FALSE
3421 }
3422
3423 Ret = TRUE;
3424
3425Exit:
3426 TRACE("Leave NtUserGetWindowPlacement, ret=%i\n", Ret);
3427 UserLeave();
3428 return Ret;
3429}

Referenced by GetWindowPlacement().

◆ NtUserGetWOWClass()

PCLS NTAPI NtUserGetWOWClass ( HINSTANCE  hInstance,
PUNICODE_STRING  ClassName 
)

Definition at line 2893 of file class.c.

2896{
2897 UNICODE_STRING SafeClassName;
2899 PCLS Class = NULL;
2900 RTL_ATOM ClassAtom = 0;
2902
2903 Status = ProbeAndCaptureUnicodeStringOrAtom(&SafeClassName, ClassName);
2904 if (!NT_SUCCESS(Status))
2905 {
2906 ERR("Error capturing the class name\n");
2908 return FALSE;
2909 }
2910
2912
2914
2915 ClassAtom = IntGetClassAtom(&SafeClassName,
2916 hInstance,
2917 pi,
2918 &Class,
2919 NULL);
2920 if (!ClassAtom)
2921 {
2923 }
2924
2925
2926 if (SafeClassName.Buffer && !IS_ATOM(SafeClassName.Buffer))
2927 ExFreePoolWithTag(SafeClassName.Buffer, TAG_STRING);
2928
2929 UserLeave();
2930//
2931// Don't forget to use DesktopPtrToUser( ? ) with return pointer in user space.
2932//
2933 return Class;
2934}
static refpint_t pi[]
Definition: server.c:96

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 452 of file caret.c.

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

Referenced by HideCaret().

◆ NtUserHiliteMenuItem()

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

Definition at line 6174 of file menu.c.

6179{
6180 PMENU Menu;
6181 PWND Window;
6182 BOOL Ret = FALSE;
6183
6184 TRACE("Enter NtUserHiliteMenuItem\n");
6186
6188 {
6190 goto Exit; // Return FALSE
6191 }
6192
6193 if(!(Menu = UserGetMenuObject(hMenu)))
6194 {
6196 goto Exit; // Return FALSE
6197 }
6198
6199 Ret = IntHiliteMenuItem(Window, Menu, uItemHilite, uHilite);
6200
6201Exit:
6202 TRACE("Leave NtUserHiliteMenuItem, ret=%i\n", Ret);
6203 UserLeave();
6204 return Ret;
6205}
BOOL FASTCALL IntHiliteMenuItem(PWND WindowObject, PMENU MenuObject, UINT uItemHilite, UINT uHilite)
Definition: menu.c:4766

◆ 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 (use hPowerRequestEvent).
199// Initialize Media Change (use hMediaRequestEvent).
200
201 /* Initialize various GDI stuff (DirectX, fonts, language ID etc.) */
202 if (!InitializeGreCSRSS())
203 return STATUS_UNSUCCESSFUL;
204
205 /* Initialize USER */
207
208 /* Return */
209 UserLeave();
210 return Status;
211}
VOID InitCsrProcess(VOID)
Definition: csr.c:20
#define USER_VERSION
Definition: ntuser.h:1149
NTSTATUS NTAPI UserInitialize(VOID)
Definition: ntuser.c:116
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
Definition: rtlcompat.c:108
BOOL InitializeGreCSRSS(VOID)
Definition: init.c:80

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 4587 of file window.c.

4588{
4589 PWND Wnd;
4591 INT Result = 0;
4592
4593 TRACE("Enter NtUserInternalGetWindowText\n");
4595
4596 if(lpString && (nMaxCount <= 1))
4597 {
4599 goto Exit; // Return 0
4600 }
4601
4602 if(!(Wnd = UserGetWindowObject(hWnd)))
4603 {
4604 goto Exit; // Return 0
4605 }
4606
4607 Result = Wnd->strName.Length / sizeof(WCHAR);
4608 if(lpString)
4609 {
4610 const WCHAR Terminator = L'\0';
4611 INT Copy;
4612 WCHAR *Buffer = (WCHAR*)lpString;
4613
4614 Copy = min(nMaxCount - 1, Result);
4615 if(Copy > 0)
4616 {
4617 Status = MmCopyToCaller(Buffer, Wnd->strName.Buffer, Copy * sizeof(WCHAR));
4618 if(!NT_SUCCESS(Status))
4619 {
4621 Result = 0;
4622 goto Exit;
4623 }
4624 Buffer += Copy;
4625 }
4626
4627 Status = MmCopyToCaller(Buffer, &Terminator, sizeof(WCHAR));
4628 if(!NT_SUCCESS(Status))
4629 {
4631 Result = 0;
4632 goto Exit;
4633 }
4634
4635 Result = Copy;
4636 }
4637
4638Exit:
4639 TRACE("Leave NtUserInternalGetWindowText, ret=%i\n", Result);
4640 UserLeave();
4641 return Result;
4642}
Definition: bufpool.h:45
VOID Copy(PVOID Src, PVOID Dst, ULONG NumBytes)
Definition: mmixer.c:126
_In_ int nMaxCount
Definition: winuser.h:4877

Referenced by InternalGetWindowText().

◆ NtUserInvalidateRect()

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

Definition at line 2535 of file painting.c.

2539{
2540 UINT flags = RDW_INVALIDATE | (bErase ? RDW_ERASE : 0);
2541 if (!hWnd)
2542 {
2544 lpUnsafeRect = NULL;
2545 }
2546 return NtUserRedrawWindow(hWnd, lpUnsafeRect, NULL, flags);
2547}
GLbitfield flags
Definition: glext.h:7161
BOOL APIENTRY NtUserRedrawWindow(HWND hWnd, CONST RECT *lprcUpdate, HRGN hrgnUpdate, UINT flags)
Definition: painting.c:1996
#define RDW_ERASE
Definition: winuser.h:1211
#define RDW_ERASENOW
Definition: winuser.h:1219
#define RDW_FRAME
Definition: winuser.h:1212
#define RDW_INVALIDATE
Definition: winuser.h:1214

Referenced by ComboWndProc_common(), and InvalidateRect().

◆ NtUserInvalidateRgn()

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

Definition at line 2551 of file painting.c.

2555{
2556 if (!hWnd)
2557 {
2559 return FALSE;
2560 }
2561 return NtUserRedrawWindow(hWnd, NULL, hRgn, RDW_INVALIDATE | (bErase? RDW_ERASE : 0));
2562}

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 655 of file timer.c.

660{
661 PWND Window = NULL;
662 BOOL ret;
663
664 TRACE("Enter NtUserKillTimer\n");
667
668 ret = IntKillTimer(Window, uIDEvent, FALSE);
669
670 UserLeave();
671
672 TRACE("Leave NtUserKillTimer, ret=%i\n", ret);
673 return ret;
674}

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 1198 of file kbdlayout.c.

1206{
1207 HKL hRetKL;
1209 UNICODE_STRING uszSafeKLID;
1210 PWINSTATION_OBJECT pWinSta;
1211 HANDLE hSafeFile;
1212
1213 UNREFERENCED_PARAMETER(offTable);
1214 UNREFERENCED_PARAMETER(pTables);
1215
1218 KLF_RESET|KLF_SHIFTLOCK))
1219 {
1220 ERR("Invalid flags: %x\n", Flags);
1222 return NULL;
1223 }
1224
1225 RtlInitEmptyUnicodeString(&uszSafeKLID, Buffer, sizeof(Buffer));
1226 _SEH2_TRY
1227 {
1228 ProbeForRead(puszKLID, sizeof(*puszKLID), 1);
1229 ProbeForRead(puszKLID->Buffer, sizeof(puszKLID->Length), 1);
1230 RtlCopyUnicodeString(&uszSafeKLID, puszKLID);
1231 }
1233 {
1235 _SEH2_YIELD(return NULL);
1236 }
1237 _SEH2_END;
1238
1240
1241 hSafeFile = (hFile ? IntVerifyKeyboardFileHandle(hFile) : NULL);
1243 hRetKL = co_IntLoadKeyboardLayoutEx(pWinSta,
1244 hSafeFile,
1245 hOldKL,
1246 &uszSafeKLID,
1247 (HKL)(DWORD_PTR)dwNewKL,
1248 Flags);
1249 if (hSafeFile)
1250 ZwClose(hSafeFile);
1251
1252 UserLeave();
1253 return hRetKL;
1254}
_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:922
HANDLE FASTCALL IntVerifyKeyboardFileHandle(HANDLE hFile)
Definition: kbdlayout.c:1000
#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 1541 of file winsta.c.

1542{
1545
1546 TRACE("About to set process window station with handle (%p)\n",
1547 hWindowStation);
1548
1550 {
1551 ERR("Unauthorized process attempted to lock the window station!\n");
1553 return FALSE;
1554 }
1555
1556 Status = IntValidateWindowStationHandle(hWindowStation,
1557 UserMode,
1558 0,
1559 &Object,
1560 NULL);
1561 if (!NT_SUCCESS(Status))
1562 {
1563 TRACE("Validation of window station handle (%p) failed\n",
1564 hWindowStation);
1566 return FALSE;
1567 }
1568
1569 Object->Flags |= WSS_LOCKED;
1570
1572 return TRUE;
1573}
#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 1972 of file winsta.c.

1973{
1974 BOOL ret;
1976
1978
1979 if (pti->rpdesk == IntGetActiveDesktop())
1980 {
1982 }
1983 else
1984 {
1985 ret = FALSE;
1986 }
1987
1988 UserLeave();
1989
1990 return ret;
1991}
#define LN_LOCK_WORKSTATION
Definition: undocuser.h:118

Referenced by LockWorkStation().

◆ NtUserMapVirtualKeyEx()

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

Definition at line 1439 of file keyboard.c.

1440{
1441 PKBDTABLES pKbdTbl = NULL;
1442 UINT ret = 0;
1443
1444 TRACE("Enter NtUserMapVirtualKeyEx\n");
1446
1447 if (!dwhkl)
1448 {
1449 PTHREADINFO pti;
1450
1452 if (pti && pti->KeyboardLayout)
1453 pKbdTbl = pti->KeyboardLayout->spkf->pKbdTbl;
1454 }
1455 else
1456 {
1457 PKL pKl;
1458
1459 pKl = UserHklToKbl(dwhkl);
1460 if (pKl)
1461 pKbdTbl = pKl->spkf->pKbdTbl;
1462 }
1463
1464 if (pKbdTbl)
1465 ret = IntMapVirtualKeyEx(uCode, uType, pKbdTbl);
1466
1467 UserLeave();
1468 TRACE("Leave NtUserMapVirtualKeyEx, ret=%u\n", ret);
1469 return ret;
1470}
struct _KBDTABLES * pKbdTbl
Definition: input.h:21
PKL NTAPI UserHklToKbl(HKL hKl)
Definition: kbdlayout.c:541
static UINT IntMapVirtualKeyEx(UINT uCode, UINT Type, PKBDTABLES pKbdTbl)
Definition: keyboard.c:1393

Referenced by MapVirtualKeyExW().

◆ NtUserMenuItemFromPoint()

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

Definition at line 6269 of file menu.c.

6274{
6275 PMENU Menu;
6276 PWND Window = NULL;
6277 PITEM mi;
6278 ULONG i;
6279 int Ret = -1;
6280
6281 TRACE("Enter NtUserMenuItemFromPoint\n");
6283
6284 if (!(Menu = UserGetMenuObject(hMenu)))
6285 {
6286 goto Exit; // Return -1
6287 }
6288
6289 if (!(Window = UserGetWindowObject(Menu->hWnd)))
6290 {
6291 goto Exit; // Return -1
6292 }
6293
6294 X -= Window->rcWindow.left;
6295 Y -= Window->rcWindow.top;
6296
6297 mi = Menu->rgItems;
6298 for (i = 0; i < Menu->cItems; i++, mi++)
6299 {
6300 RECTL Rect;
6301
6302 Rect.left = mi->xItem;
6303 Rect.top = mi->yItem;
6304 Rect.right = mi->cxItem;
6305 Rect.bottom = mi->cyItem;
6306
6308
6309 if (RECTL_bPointInRect(&Rect, X, Y))
6310 {
6311 break;
6312 }
6313 }
6314
6315 Ret = (mi ? i : NO_SELECTED_ITEM);
6316
6317Exit:
6318 TRACE("Leave NtUserMenuItemFromPoint, ret=%i\n", Ret);
6319 UserLeave();
6320 return Ret;
6321}
#define Y(I)
#define NO_SELECTED_ITEM
Definition: ntuser.h:413
HWND hWnd
Definition: ntuser.h:437
VOID FASTCALL MENU_AdjustMenuItemRect(PMENU menu, PRECTL rect)
Definition: menu.c:1462
static MONITORINFO mi
Definition: win.c:7338

◆ NtUserMessageCall()

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

Definition at line 2490 of file message.c.

2497{
2498 LRESULT lResult = 0;
2499 BOOL Ret = FALSE;
2500 PWND Window = NULL;
2502
2504
2505 switch(dwType)
2506 {
2507 case FNID_SCROLLBAR:
2508 {
2509 lResult = ScrollBarWndProc(hWnd, Msg, wParam, lParam);
2510 break;
2511 }
2512 case FNID_DESKTOP:
2513 {
2515 if (Window)
2516 {
2517 //ERR("FNID_DESKTOP IN\n");
2518 Ret = DesktopWindowProc(Window, Msg, wParam, lParam, &lResult);
2519 //ERR("FNID_DESKTOP OUT\n");
2520 }
2521 break;
2522 }
2523 case FNID_MENU:
2524 {
2526 if (Window)
2527 {
2528 Ret = PopupMenuWndProc( Window, Msg, wParam, lParam, &lResult);
2529 }
2530 break;
2531 }
2532 case FNID_MESSAGEWND:
2533 {
2535 if (Window)
2536 {
2537 Ret = !UserMessageWindowProc(Window, Msg, wParam, lParam, &lResult);
2538 }
2539 break;
2540 }
2541 case FNID_DEFWINDOWPROC:
2542 /* Validate input */
2543 if (hWnd)
2544 {
2546 if (!Window)
2547 {
2548 UserLeave();
2549 return FALSE;
2550 }
2551 UserRefObjectCo(Window, &Ref);
2552 }
2553 lResult = IntDefWindowProc(Window, Msg, wParam, lParam, Ansi);
2554 Ret = TRUE;
2555 if (hWnd)
2557 break;
2560 break;
2562 {
2563 BROADCASTPARM parm, *retparam;
2564 DWORD_PTR RetVal = 0;
2565
2566 if (ResultInfo)
2567 {
2568 _SEH2_TRY
2569 {
2570 ProbeForWrite((PVOID)ResultInfo, sizeof(BROADCASTPARM), 1);
2571 RtlCopyMemory(&parm, (PVOID)ResultInfo, sizeof(BROADCASTPARM));
2572 }
2574 {
2575 _SEH2_YIELD(break);
2576 }
2577 _SEH2_END;
2578 }
2579 else
2580 break;
2581
2582 if ( parm.recipients & BSM_ALLDESKTOPS ||
2584 {
2585 PLIST_ENTRY DesktopEntry;
2586 PDESKTOP rpdesk;
2587 HWND *List, hwndDenied = NULL;
2588 HDESK hDesk = NULL;
2589 PWND pwnd, pwndDesk;
2590 ULONG i;
2591 UINT fuFlags;
2592
2593 for (DesktopEntry = InputWindowStation->DesktopListHead.Flink;
2594 DesktopEntry != &InputWindowStation->DesktopListHead;
2595 DesktopEntry = DesktopEntry->Flink)
2596 {
2597 rpdesk = CONTAINING_RECORD(DesktopEntry, DESKTOP, ListEntry);
2598 pwndDesk = rpdesk->pDeskInfo->spwnd;
2599 List = IntWinListChildren(pwndDesk);
2600
2601 if (parm.flags & BSF_QUERY)
2602 {
2603 if (List != NULL)
2604 {
2605 if (parm.flags & BSF_FORCEIFHUNG || parm.flags & BSF_NOHANG)
2606 {
2607 fuFlags = SMTO_ABORTIFHUNG;
2608 }
2609 else if (parm.flags & BSF_NOTIMEOUTIFNOTHUNG)
2610 {
2611 fuFlags = SMTO_NOTIMEOUTIFNOTHUNG;
2612 }
2613 else
2614 {
2615 fuFlags = SMTO_NORMAL;
2616 }
2618 Msg,
2619 wParam,
2620 lParam,
2621 fuFlags,
2622 2000,
2623 &RetVal);
2624 Ret = TRUE;
2625 for (i = 0; List[i]; i++)
2626 {
2627 pwnd = UserGetWindowObject(List[i]);
2628 if (!pwnd) continue;
2629
2630 if ( pwnd->fnid == FNID_MENU ||
2632 continue;
2633
2634 if ( parm.flags & BSF_IGNORECURRENTTASK )
2635 {
2636 if ( pwnd->head.pti == gptiCurrent )
2637 continue;
2638 }
2640 Msg,
2641 wParam,
2642 lParam,
2643 fuFlags,
2644 2000,
2645 &RetVal);
2646
2647 if (!RetVal && EngGetLastError() == ERROR_TIMEOUT)
2648 {
2649 if (!(parm.flags & BSF_FORCEIFHUNG))
2650 Ret = FALSE;
2651 }
2652 if (RetVal == BROADCAST_QUERY_DENY)
2653 {
2654 hwndDenied = List[i];
2655 hDesk = UserHMGetHandle(pwndDesk);
2656 Ret = FALSE;
2657 }
2658 }
2660 _SEH2_TRY
2661 {
2662 retparam = (PBROADCASTPARM) ResultInfo;
2663 retparam->hDesk = hDesk;
2664 retparam->hWnd = hwndDenied;
2665 }
2667 {
2668 _SEH2_YIELD(break);
2669 }
2670 _SEH2_END;
2671 if (!Ret) break; // Have a hit! Let everyone know!
2672 }
2673 }
2674 else if (parm.flags & BSF_POSTMESSAGE)
2675 {
2676 if (List != NULL)
2677 {
2679
2680 for (i = 0; List[i]; i++)
2681 {
2682 pwnd = UserGetWindowObject(List[i]);
2683 if (!pwnd) continue;
2684
2685 if ( pwnd->fnid == FNID_MENU ||
2687 continue;
2688
2689 if ( parm.flags & BSF_IGNORECURRENTTASK )
2690 {
2691 if ( pwnd->head.pti == gptiCurrent )
2692 continue;
2693 }
2695 }
2697 }
2698 Ret = TRUE;
2699 }
2700 else
2701 {
2702 if (List != NULL)
2703 {
2705
2706 for (i = 0; List[i]; i++)
2707 {
2708 pwnd = UserGetWindowObject(List[i]);
2709 if (!pwnd) continue;
2710
2711 if ( pwnd->fnid == FNID_MENU ||
2713 continue;
2714
2715 if ( parm.flags & BSF_IGNORECURRENTTASK )
2716 {
2717 if ( pwnd->head.pti == gptiCurrent )
2718 continue;
2719 }
2721 }
2723 }
2724 Ret = TRUE;
2725 }
2726 }
2727 }
2728 else if (parm.recipients & BSM_APPLICATIONS)
2729 {
2730 HWND *List, hwndDenied = NULL;
2731 HDESK hDesk = NULL;
2732 PWND pwnd, pwndDesk;
2733 ULONG i;
2734 UINT fuFlags;
2735
2736 pwndDesk = UserGetDesktopWindow();
2737 List = IntWinListChildren(pwndDesk);
2738
2739 if (parm.flags & BSF_QUERY)
2740 {
2741 if (List != NULL)
2742 {
2743 if (parm.flags & BSF_FORCEIFHUNG || parm.flags & BSF_NOHANG)
2744 {
2745 fuFlags = SMTO_ABORTIFHUNG;
2746 }
2747 else if (parm.flags & BSF_NOTIMEOUTIFNOTHUNG)
2748 {
2749 fuFlags = SMTO_NOTIMEOUTIFNOTHUNG;
2750 }
2751 else
2752 {
2753 fuFlags = SMTO_NORMAL;
2754 }
2756 Msg,
2757 wParam,
2758 lParam,
2759 fuFlags,
2760 2000,
2761 &RetVal);
2762 Ret = TRUE;
2763 for (i = 0; List[i]; i++)
2764 {
2765 pwnd = UserGetWindowObject(List[i]);
2766 if (!pwnd) continue;
2767
2768 if ( pwnd->fnid == FNID_MENU ||
2770 continue;
2771
2772 if ( parm.flags & BSF_IGNORECURRENTTASK )
2773 {
2774 if ( pwnd->head.pti == gptiCurrent )
2775 continue;
2776 }
2778 Msg,
2779 wParam,
2780 lParam,
2781 fuFlags,
2782 2000,
2783 &RetVal);
2784
2785 if (!RetVal && EngGetLastError() == ERROR_TIMEOUT)
2786 {
2787 if (!(parm.flags & BSF_FORCEIFHUNG))
2788 Ret = FALSE;
2789 }
2790 if (RetVal == BROADCAST_QUERY_DENY)
2791 {
2792 hwndDenied = List[i];
2793 hDesk = UserHMGetHandle(pwndDesk);
2794 Ret = FALSE;
2795 }
2796 }
2798 _SEH2_TRY
2799 {
2800 retparam = (PBROADCASTPARM) ResultInfo;
2801 retparam->hDesk = hDesk;
2802 retparam->hWnd = hwndDenied;
2803 }
2805 {
2806 _SEH2_YIELD(break);
2807 }
2808 _SEH2_END;
2809 }
2810 }
2811 else if (parm.flags & BSF_POSTMESSAGE)
2812 {
2813 if (List != NULL)
2814 {
2816
2817 for (i = 0; List[i]; i++)
2818 {
2819 pwnd = UserGetWindowObject(List[i]);
2820 if (!pwnd) continue;
2821
2822 if ( pwnd->fnid == FNID_MENU ||
2824 continue;
2825
2826 if ( parm.flags & BSF_IGNORECURRENTTASK )
2827 {
2828 if ( pwnd->head.pti == gptiCurrent )
2829 continue;
2830 }
2832 }
2834 }
2835 Ret = TRUE;
2836 }
2837 else
2838 {
2839 if (List != NULL)
2840 {
2842
2843 for (i = 0; List[i]; i++)
2844 {
2845 pwnd = UserGetWindowObject(List[i]);
2846 if (!pwnd) continue;
2847
2848 if ( pwnd->fnid == FNID_MENU ||
2850 continue;
2851
2852 if ( parm.flags & BSF_IGNORECURRENTTASK )
2853 {
2854 if ( pwnd->head.pti == gptiCurrent )
2855 continue;
2856 }
2858 }
2860 }
2861 Ret = TRUE;
2862 }
2863 }
2864 }
2865 break;
2867 {
2868 CALL_BACK_INFO CallBackInfo;
2869 ULONG_PTR uResult;
2870
2871 _SEH2_TRY
2872 {
2873 ProbeForRead((PVOID)ResultInfo, sizeof(CALL_BACK_INFO), 1);
2874 RtlCopyMemory(&CallBackInfo, (PVOID)ResultInfo, sizeof(CALL_BACK_INFO));
2875 }
2877 {
2878 _SEH2_YIELD(break);
2879 }
2880 _SEH2_END;
2881
2883 {
2885 break;
2886 }
2887
2889 CallBackInfo.CallBack, CallBackInfo.Context, &uResult)))
2890 {
2891 ERR("Callback failure!\n");
2892 }
2893 }
2894 break;
2895 case FNID_SENDMESSAGE:
2896 {
2897 lResult = co_IntDoSendMessage(hWnd, Msg, wParam, lParam, 0);
2898 Ret = TRUE;
2899
2900 if (ResultInfo)
2901 {
2902 _SEH2_TRY
2903 {
2904 ProbeForWrite((PVOID)ResultInfo, sizeof(ULONG_PTR), 1);
2905 RtlCopyMemory((PVOID)ResultInfo, &lResult, sizeof(ULONG_PTR));
2906 }
2908 {
2909 Ret = FALSE;
2910 _SEH2_YIELD(break);
2911 }
2912 _SEH2_END;
2913 }
2914 break;
2915 }
2916 case FNID_SENDMESSAGEFF:
2918 {
2919 DOSENDMESSAGE dsm, *pdsm = (PDOSENDMESSAGE)ResultInfo;
2920 if (ResultInfo)
2921 {
2922 _SEH2_TRY
2923 {
2924 ProbeForRead(pdsm, sizeof(DOSENDMESSAGE), 1);
2925 RtlCopyMemory(&dsm, pdsm, sizeof(DOSENDMESSAGE));
2926 }
2928 {
2929 _SEH2_YIELD(break);
2930 }
2931 _SEH2_END;
2932 }
2933
2934 Ret = co_IntDoSendMessage( hWnd, Msg, wParam, lParam, pdsm ? &dsm : NULL );
2935
2936 if (pdsm)
2937 {
2938 _SEH2_TRY
2939 {
2940 ProbeForWrite(pdsm, sizeof(DOSENDMESSAGE), 1);
2941 RtlCopyMemory(pdsm, &dsm, sizeof(DOSENDMESSAGE));
2942 }
2944 {
2945 Ret = FALSE;
2946 _SEH2_YIELD(break);
2947 }
2948 _SEH2_END;
2949 }
2950 break;
2951 }
2952 // CallNextHook bypass.
2953 case FNID_CALLWNDPROC:
2955 {
2956 PTHREADINFO pti;
2958 PHOOK NextObj, Hook;
2959
2960 pti = GetW32ThreadInfo();
2961
2962 Hook = pti->sphkCurrent;
2963
2964 if (!Hook) break;
2965
2966 NextObj = Hook->phkNext;
2967 ClientInfo = pti->pClientInfo;
2968 _SEH2_TRY
2969 {
2970 ClientInfo->phkCurrent = NextObj;
2971 }
2973 {
2974 ClientInfo = NULL;
2975 }
2976 _SEH2_END;
2977
2978 if (!ClientInfo || !NextObj) break;
2979
2980 NextObj->phkNext = IntGetNextHook(NextObj);
2981
2982 if ( Hook->HookId == WH_CALLWNDPROC)
2983 {
2984 CWPSTRUCT CWP;
2985 CWP.hwnd = hWnd;
2986 CWP.message = Msg;
2987 CWP.wParam = wParam;
2988 CWP.lParam = lParam;
2989 TRACE("WH_CALLWNDPROC: Hook %p NextHook %p\n", Hook, NextObj);
2990
2991 lResult = co_IntCallHookProc( Hook->HookId,
2992 HC_ACTION,
2993 ((ClientInfo->CI_flags & CI_CURTHPRHOOK) ? 1 : 0),
2994 (LPARAM)&CWP,
2995 Hook->Proc,
2996 Hook->ihmod,
2997 Hook->offPfn,
2998 Hook->Ansi,
2999 &Hook->ModuleName);
3000 }
3001 else
3002 {
3003 CWPRETSTRUCT CWPR;
3004 CWPR.hwnd = hWnd;
3005 CWPR.message = Msg;
3006 CWPR.wParam = wParam;
3007 CWPR.lParam = lParam;
3008 CWPR.lResult = ClientInfo->dwHookData;
3009
3010 lResult = co_IntCallHookProc( Hook->HookId,
3011 HC_ACTION,
3012 ((ClientInfo->CI_flags & CI_CURTHPRHOOK) ? 1 : 0),
3013 (LPARAM)&CWPR,
3014 Hook->Proc,
3015 Hook->ihmod,
3016 Hook->offPfn,
3017 Hook->Ansi,
3018 &Hook->ModuleName);
3019 }
3020 }
3021 break;
3022 }
3023
3024 switch(dwType)
3025 {
3026 case FNID_DEFWINDOWPROC:
3027 case FNID_CALLWNDPROC:
3029 case FNID_SCROLLBAR:
3030 case FNID_DESKTOP:
3031 case FNID_MENU:
3032 if (ResultInfo)
3033 {
3034 _SEH2_TRY
3035 {
3036 ProbeForWrite((PVOID)ResultInfo, sizeof(LRESULT), 1);
3037 RtlCopyMemory((PVOID)ResultInfo, &lResult, sizeof(LRESULT));
3038 }
3040 {
3041 Ret = FALSE;
3042 }
3043 _SEH2_END;
3044 }
3045 break;
3046 default:
3047 break;
3048 }
3049
3050 UserLeave();
3051
3052 return Ret;
3053}
#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
#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:535
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:50
ULONG_PTR Context
Definition: callback.h:51
struct _WND * spwnd
Definition: ntuser.h:137
LIST_ENTRY DesktopListHead
Definition: winsta.h:19
WPARAM wParam
Definition: winuser.h:3019
LRESULT lResult
Definition: winuser.h:3017
LPARAM lParam
Definition: winuser.h:3018
LPARAM lParam
Definition: winuser.h:3025
WPARAM wParam
Definition: winuser.h:3026
UINT message
Definition: winuser.h:3027
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:1439
BOOL FASTCALL UserMessageWindowProc(PWND pwnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *lResult)
Definition: desktop.c:1525
BOOL WINAPI PopupMenuWndProc(PWND Wnd, UINT Message, WPARAM wParam, LPARAM lParam, LRESULT *lResult)
Definition: menu.c:4619
static int is_pointer_message(UINT message, WPARAM wparam)
Definition: message.c:98
static LRESULT FASTCALL co_IntDoSendMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, PDOSENDMESSAGE dsm)
Definition: message.c:1954
LRESULT FASTCALL co_IntSendMessageWithCallBack(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, SENDASYNCPROC CompletionCallback, ULONG_PTR CompletionCallbackContext, ULONG_PTR *uResult)
Definition: message.c:1735
BOOL FASTCALL UserSendNotifyMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2040
LRESULT FASTCALL co_IntSendMessageTimeout(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, UINT uFlags, UINT uTimeout, ULONG_PTR *uResult)
Definition: message.c:1657
LRESULT APIENTRY ScrollBarWndProc(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: scrollbar.c:1123
ENGAPI ULONG APIENTRY EngGetLastError(VOID)
Definition: error.c:9
#define ERROR_MESSAGE_SYNC_ONLY
Definition: winerror.h:681
#define ERROR_TIMEOUT
Definition: winerror.h:941
#define HC_ACTION
Definition: winuser.h:48
#define SMTO_ABORTIFHUNG
Definition: winuser.h:1223
#define BROADCAST_QUERY_DENY
Definition: winuser.h:178
#define SMTO_NORMAL
Definition: winuser.h:1225
#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 3433 of file winpos.c.

3437{
3438 PWND pWnd;
3439
3440 TRACE("Enter NtUserMinMaximize\n");
3442
3443 pWnd = UserGetWindowObject(hWnd);
3444 if (!pWnd || UserIsDesktopWindow(pWnd) || UserIsMessageWindow(pWnd))
3445 {
3446 goto Exit;
3447 }
3448
3449 if ( cmd > SW_MAX || pWnd->state2 & WNDS2_INDESTROY)
3450 {
3452 goto Exit;
3453 }
3454
3455 cmd |= Hide ? SW_HIDE : 0;
3456
3457 co_WinPosShowWindow(pWnd, cmd);
3458
3459Exit:
3460 TRACE("Leave NtUserMinMaximize\n");
3461 UserLeave();
3462 return 0; // Always NULL?
3463}
#define WNDS2_INDESTROY
Definition: ntuser.h:648
BOOLEAN FASTCALL co_WinPosShowWindow(PWND Wnd, INT Cmd)
Definition: winpos.c:2566
DWORD state2
Definition: ntuser.h:702
Definition: ftp_var.h:139
#define SW_HIDE
Definition: winuser.h:768
#define SW_MAX
Definition: winuser.h:782

◆ 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 827 of file monitor.c.

830{
831 RECTL rc;
832 HMONITOR hMonitor = NULL;
833
834 /* Check if flags are valid */
835 if (dwFlags != MONITOR_DEFAULTTONULL &&
836 dwFlags != MONITOR_DEFAULTTOPRIMARY &&
837 dwFlags != MONITOR_DEFAULTTONEAREST)
838 {
840 return NULL;
841 }
842
843 /* Fill rect (bottom-right exclusive) */
844 rc.left = pt.x;
845 rc.right = pt.x + 1;
846 rc.top = pt.y;
847 rc.bottom = pt.y + 1;
848
850
851 /* Find intersecting monitor */
852 IntGetMonitorsFromRect(&rc, &hMonitor, NULL, 1, dwFlags);
853
854 UserLeave();
855 return hMonitor;
856}
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 967 of file monitor.c.

970{
971 PWND pWnd;
972 HMONITOR hMonitor = NULL;
973 RECTL Rect = {0, 0, 0, 0};
974
975 TRACE("Enter NtUserMonitorFromWindow\n");
976
977 /* Check if flags are valid */
978 if (dwFlags != MONITOR_DEFAULTTONULL &&
979 dwFlags != MONITOR_DEFAULTTOPRIMARY &&
980 dwFlags != MONITOR_DEFAULTTONEAREST)
981 {
983 return NULL;
984 }
985
987
988 /* If window is given, use it first */
989 if (hWnd)
990 {
991 /* Get window object */
993 if (!pWnd)
994 goto cleanup;
995
996 /* Find only monitors which have intersection with given window */
997 Rect.left = Rect.right = pWnd->rcWindow.left;
998 Rect.top = Rect.bottom = pWnd->rcWindow.bottom;
999 }
1000
1001 /* Find monitors now */
1002 IntGetMonitorsFromRect(&Rect, &hMonitor, NULL, 1, dwFlags);
1003
1004cleanup:
1005 TRACE("Leave NtUserMonitorFromWindow, ret=%p\n", hMonitor);
1006 UserLeave();
1007 return hMonitor;
1008}
RECT rcWindow
Definition: ntuser.h:716

Referenced by MonitorFromWindow().

◆ NtUserMoveWindow()

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

Definition at line 3469 of file winpos.c.

3476{
3477 return NtUserSetWindowPos(hWnd, 0, X, Y, nWidth, nHeight,
3478 (bRepaint ? SWP_NOZORDER | SWP_NOACTIVATE :
3480}
BOOL APIENTRY NtUserSetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags)
Definition: winpos.c:3506

Referenced by MoveWindow().

◆ NtUserNotifyIMEStatus()

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

Definition at line 803 of file ime.c.

804{
805 PWND pwnd;
806 PTHREADINFO pti;
807 HKL hKL;
808
810
811 if (!IS_IMM_MODE())
812 {
813 ERR("!IS_IMM_MODE()\n");
814 goto Quit;
815 }
816
817 pwnd = ValidateHwndNoErr(hwnd);
818 if (!pwnd)
819 goto Quit;
820
821 pti = pwnd->head.pti;
822 if (!pti || !gptiForeground)
823 goto Quit;
825 goto Quit;
826 if (ghIMC == pwnd->hImc && gfImeOpen == !!fOpen && gdwImeConversion == dwConversion)
827 goto Quit;
828
829 ghIMC = pwnd->hImc;
830 if (ghIMC)
831 {
832 gfImeOpen = !!fOpen;
833 gdwImeConversion = dwConversion;
834 UserSetImeConversionKeyState(pti, (fOpen ? dwConversion : IME_CMODE_ALPHANUMERIC));
835 }
836
837 if (ISITHOOKED(WH_SHELL))
838 {
839 hKL = (pti->KeyboardLayout ? pti->KeyboardLayout->hkl : NULL);
840 co_HOOK_CallHooks(WH_SHELL, HSHELL_LANGUAGE, (WPARAM)hwnd, (LPARAM)hKL);
841 }
842
843 // TODO:
844
845Quit:
846 UserLeave();
847 return 0;
848}
#define ISITHOOKED(HookId)
Definition: hook.h:6
#define IME_CMODE_ALPHANUMERIC
Definition: imm.h:336
HIMC hImc
Definition: ntuser.h:740
PTHREADINFO gptiForeground
Definition: focus.c:15
HIMC ghIMC
Definition: ime.c:26
DWORD gdwImeConversion
Definition: ime.c:28
static VOID FASTCALL UserSetImeConversionKeyState(PTHREADINFO pti, DWORD dwConversion)
Definition: ime.c:744
BOOL gfImeOpen
Definition: ime.c:27
#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 2588 of file desktop.c.

2592{
2594 HDESK Desktop;
2595
2599 UserMode,
2600 NULL,
2601 dwDesiredAccess,
2602 NULL,
2603 (HANDLE*)&Desktop);
2604
2605 if (!NT_SUCCESS(Status))
2606 {
2607 ERR("Failed to open desktop\n");
2609 return NULL;
2610 }
2611
2612 TRACE("Opened desktop %S with handle 0x%p\n", ObjectAttributes->ObjectName->Buffer, Desktop);
2613
2614 return Desktop;
2615}
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 2682 of file desktop.c.

2686{
2687 HDESK hdesk;
2688
2690 TRACE("Enter NtUserOpenInputDesktop gpdeskInputDesktop 0x%p\n", gpdeskInputDesktop);
2691
2692 hdesk = UserOpenInputDesktop(dwFlags, fInherit, dwDesiredAccess);
2693
2694 TRACE("NtUserOpenInputDesktop returning 0x%p\n", hdesk);
2695 UserLeave();
2696 return hdesk;
2697}
HDESK UserOpenInputDesktop(DWORD dwFlags, BOOL fInherit, ACCESS_MASK dwDesiredAccess)
Definition: desktop.c:2617
PDESKTOP gpdeskInputDesktop
Definition: desktop.c:35

Referenced by OpenInputDesktop().

◆ NtUserOpenWindowStation()

HWINSTA NTAPI NtUserOpenWindowStation ( POBJECT_ATTRIBUTES  ObjectAttributes,
ACCESS_MASK  dwDesiredAccess 
)

◆ NtUserPaintDesktop()

BOOL NTAPI NtUserPaintDesktop ( HDC  hDC)

Definition at line 2779 of file desktop.c.

2780{
2781 BOOL Ret;
2782
2784 TRACE("Enter NtUserPaintDesktop\n");
2785
2786 Ret = IntPaintDesktop(hDC);
2787
2788 TRACE("Leave NtUserPaintDesktop, ret=%i\n", Ret);
2789 UserLeave();
2790 return Ret;
2791}
BOOL FASTCALL IntPaintDesktop(HDC hDC)
Definition: desktop.c:1835

Referenced by PaintDesktop().

◆ NtUserPaintMenuBar()

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

Definition at line 6326 of file menu.c.

6333{
6334 PWND Window;
6335 RECT Rect;
6336 DWORD ret;
6337
6339
6341 {
6343 UserLeave();
6344 return 0;
6345 }
6346
6347 Rect.left = leftBorder;
6348 Rect.right = Window->rcWindow.right - Window->rcWindow.left - rightBorder;
6349 Rect.top = top;
6350 Rect.bottom = 0;
6351
6353
6354 UserLeave();
6355
6356 return ret;
6357}

◆ NtUserPeekMessage()

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

Definition at line 2341 of file message.c.

2346{
2347 MSG Msg;
2348 BOOL Ret;
2349
2350 if ( RemoveMsg & PM_BADMSGFLAGS )
2351 {
2353 return FALSE;
2354 }
2355
2357
2358 RtlZeroMemory(&Msg, sizeof(MSG));
2359
2360 Ret = co_IntGetPeekMessage(&Msg, hWnd, MsgFilterMin, MsgFilterMax, RemoveMsg, FALSE);
2361
2362 UserLeave();
2363
2364 if (Ret)
2365 {
2366 _SEH2_TRY
2367 {
2368 ProbeForWrite(pMsg, sizeof(MSG), 1);
2369 RtlCopyMemory(pMsg, &Msg, sizeof(MSG));
2370 }
2372 {
2374 Ret = FALSE;
2375 }
2376 _SEH2_END;
2377 }
2378
2379 return Ret;
2380}
#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 2229 of file message.c.

2233{
2234 BOOL ret;
2235
2237
2239
2240 UserLeave();
2241
2242 return ret;
2243}

Referenced by PostMessageA(), and PostMessageW().

◆ NtUserPostThreadMessage()

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

Definition at line 2246 of file message.c.

2250{
2251 BOOL ret = FALSE;
2252 PETHREAD peThread;
2253 PTHREADINFO pThread;
2255
2257
2258 Status = PsLookupThreadByThreadId(UlongToHandle(idThread), &peThread);
2259
2260 if ( Status == STATUS_SUCCESS )
2261 {
2262 pThread = (PTHREADINFO)peThread->Tcb.Win32Thread;
2263 if( !pThread ||
2264 !pThread->MessageQueue ||
2265 (pThread->TIF_flags & TIF_INCLEANUP))
2266 {
2267 ObDereferenceObject( peThread );
2268 goto exit;
2269 }
2270 ret = UserPostThreadMessage( pThread, Msg, wParam, lParam);
2271 ObDereferenceObject( peThread );
2272 }
2273 else
2274 {
2276 }
2277exit:
2278 UserLeave();
2279 return ret;
2280}
#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:1308

Referenced by PostThreadMessageA(), and PostThreadMessageW().

◆ NtUserPrintWindow()

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

Definition at line 2566 of file painting.c.

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

◆ 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:160
_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:290
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533

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:149
_In_ THREADINFOCLASS ThreadInformationClass
Definition: psfuncs.h:840
POBJECT_TYPE PsThreadType
Definition: thread.c:20

◆ NtUserQueryInputContext()

DWORD_PTR NTAPI NtUserQueryInputContext ( HIMC  hIMC,
DWORD  dwType 
)

Definition at line 1791 of file ime.c.

1792{
1793 PIMC pIMC;
1794 PTHREADINFO ptiIMC;
1795 DWORD_PTR ret = 0;
1796
1798
1799 if (!IS_IMM_MODE())
1800 {
1801 ERR("!IS_IMM_MODE()\n");
1802 goto Quit;
1803 }
1804
1806 if (!pIMC)
1807 goto Quit;
1808
1809 ptiIMC = pIMC->head.pti;
1810
1811 switch (dwType)
1812 {
1813 case QIC_INPUTPROCESSID:
1814 ret = (DWORD_PTR)PsGetThreadProcessId(ptiIMC->pEThread);
1815 break;
1816
1817 case QIC_INPUTTHREADID:
1818 ret = (DWORD_PTR)PsGetThreadId(ptiIMC->pEThread);
1819 break;
1820
1822 if (ptiIMC->spwndDefaultIme)
1824 break;
1825
1826 case QIC_DEFAULTIMC:
1827 if (ptiIMC->spDefaultImc)
1829 break;
1830 }
1831
1832Quit:
1833 UserLeave();
1834 return ret;
1835}
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:394
@ QIC_DEFAULTIMC
Definition: undocuser.h:395
@ QIC_INPUTTHREADID
Definition: undocuser.h:393
@ QIC_INPUTPROCESSID
Definition: undocuser.h:392

Referenced by CtfImmGenerateMessage(), CtfImmGetGuidAtom(), CtfImmIsGuidMapEnable(), CtfImmTIMCreateInputContext(), Imm32CheckImcProcess(), Imm32GetImeMenuItemWInterProcess(), Imm32InternalLockIMC(), Imm32IsCrossThreadAccess(), Imm32MakeIMENotify(), ImmGetImeMenuItemsAW(), 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 4189 of file window.c.

4190{
4191/* Console Leader Process CID Window offsets */
4192#define GWLP_CONSOLE_LEADER_PID 0
4193#define GWLP_CONSOLE_LEADER_TID 4
4194
4195 DWORD_PTR Result = 0;
4196 PWND pWnd, pwndActive;
4197 PTHREADINFO pti, ptiActive;
4198
4199 TRACE("Enter NtUserQueryWindow\n");
4201
4202 if (!(pWnd = UserGetWindowObject(hWnd)))
4203 {
4204 goto Exit; // Return 0
4205 }
4206
4207 switch(Index)
4208 {
4210 {
4211 if ( (pWnd->head.pti->TIF_flags & TIF_CSRSSTHREAD) &&
4213 {
4214 // IntGetWindowLong(offset == GWLP_CONSOLE_LEADER_PID)
4215 Result = (DWORD_PTR)(*((LONG_PTR*)((PCHAR)(pWnd + 1) + GWLP_CONSOLE_LEADER_PID)));
4216 }
4217 else
4218 {
4220 }
4221 break;
4222 }
4223
4225 {
4226 if ( (pWnd->head.pti->TIF_flags & TIF_CSRSSTHREAD) &&
4228 {
4229 // IntGetWindowLong(offset == GWLP_CONSOLE_LEADER_TID)
4230 Result = (DWORD_PTR)(*((LONG_PTR*)((PCHAR)(pWnd + 1) + GWLP_CONSOLE_LEADER_TID)));
4231 }
4232 else
4233 {
4235 }
4236 break;
4237 }
4238
4240 Result = (DWORD_PTR)(pWnd->head.pti->MessageQueue->spwndActive ? UserHMGetHandle(pWnd->head.pti->MessageQueue->spwndActive) : 0);
4241 break;
4242
4243 case QUERY_WINDOW_FOCUS:
4244 Result = (DWORD_PTR)(pWnd->head.pti->MessageQueue->spwndFocus ? UserHMGetHandle(pWnd->head.pti->MessageQueue->spwndFocus) : 0);
4245 break;
4246
4248 Result = (pWnd->fnid == FNID_GHOST) || MsqIsHung(pWnd->head.pti, MSQ_HUNG);
4249 break;
4250
4252 Result = (DWORD_PTR)pWnd->head.pti->pEThread->Cid.UniqueProcess;
4253 break;
4254
4256 Result = (pWnd->head.pti->MessageQueue == gpqForeground);
4257 break;
4258
4259 case QUERY_WINDOW_DEFAULT_IME: /* default IME window */
4260 if (pWnd->head.pti->spwndDefaultIme)
4261 Result = (DWORD_PTR)UserHMGetHandle(pWnd->head.pti->spwndDefaultIme);
4262 break;
4263
4264 case QUERY_WINDOW_DEFAULT_ICONTEXT: /* default input context handle */
4265 if (pWnd->head.pti->spDefaultImc)
4266 Result = (DWORD_PTR)UserHMGetHandle(pWnd->head.pti->spDefaultImc);
4267 break;
4268
4271 {
4272 pwndActive = gpqForeground->spwndActive;
4274 if (pti->rpdesk == pwndActive->head.rpdesk)
4275 {
4276 ptiActive = pwndActive->head.pti;
4277 if (ptiActive->spwndDefaultIme)
4279 }
4280 }
4281 break;
4282 }
4283
4284Exit:
4285 TRACE("Leave NtUserQueryWindow, ret=%u\n", Result);
4286 UserLeave();
4287 return Result;
4288}
#define QUERY_WINDOW_DEFAULT_ICONTEXT
Definition: ntuser.h:2835
#define QUERY_WINDOW_UNIQUE_THREAD_ID
Definition: ntuser.h:2828
#define QUERY_WINDOW_ACTIVE_IME
Definition: ntuser.h:2836
#define TIF_CSRSSTHREAD
Definition: ntuser.h:266
#define QUERY_WINDOW_FOCUS
Definition: ntuser.h:2830
#define QUERY_WINDOW_ACTIVE
Definition: ntuser.h:2829
#define QUERY_WINDOW_REAL_ID
Definition: ntuser.h:2832
#define QUERY_WINDOW_FOREGROUND
Definition: ntuser.h:2833
#define FNID_GHOST
Definition: ntuser.h:875
#define QUERY_WINDOW_UNIQUE_PROCESS_ID
Definition: ntuser.h:2827
#define QUERY_WINDOW_ISHUNG
Definition: ntuser.h:2831
#define QUERY_WINDOW_DEFAULT_IME
Definition: ntuser.h:2834
#define PCHAR
Definition: match.c:90
BOOL FASTCALL MsqIsHung(PTHREADINFO pti, DWORD TimeOut)
Definition: msgqueue.c:2137
#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 3486 of file winpos.c.

3489{
3490 PWND pwndParent;
3491 TRACE("Enter NtUserRealChildWindowFromPoint\n");
3493 if ((pwndParent = UserGetWindowObject(Parent)))
3494 {
3495 pwndParent = IntRealChildWindowFromPoint(pwndParent, x, y);
3496 }
3497 UserLeave();
3498 TRACE("Leave NtUserRealChildWindowFromPoint\n");
3499 return pwndParent ? UserHMGetHandle(pwndParent) : NULL;
3500}
PWND FASTCALL IntRealChildWindowFromPoint(PWND Parent, LONG x, LONG y)
Definition: winpos.c:2967

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 1996 of file painting.c.

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

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

◆ NtUserRegisterClassExWOW()

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

Definition at line 2424 of file class.c.

2442{
2443 WNDCLASSEXW CapturedClassInfo = {0};
2444 UNICODE_STRING CapturedName = {0}, CapturedMenuName = {0}, CapturedVersion = {0};
2445 RTL_ATOM Ret = (RTL_ATOM)0;
2447 BOOL Exception = FALSE;
2448
2449 if (Flags & ~(CSF_ANSIPROC))
2450 {
2451 ERR("NtUserRegisterClassExWOW Bad Flags!\n");
2453 return Ret;
2454 }
2455
2457
2458 TRACE("NtUserRegisterClassExWOW ClsN %wZ\n",ClassName);
2459
2460 if ( !(ppi->W32PF_flags & W32PF_CLASSESREGISTERED ))
2461 {
2463 }
2464
2465 _SEH2_TRY
2466 {
2467 /* Probe the parameters and basic parameter checks */
2468 if (ProbeForReadUint(&lpwcx->cbSize) != sizeof(WNDCLASSEXW))
2469 {
2470 ERR("NtUserRegisterClassExWOW Wrong cbSize!\n");
2471 goto InvalidParameter;
2472 }
2473
2474 ProbeForRead(lpwcx,
2475 sizeof(WNDCLASSEXW),
2476 sizeof(ULONG));
2477 RtlCopyMemory(&CapturedClassInfo,
2478 lpwcx,
2479 sizeof(WNDCLASSEXW));
2480
2481 CapturedName = ProbeForReadUnicodeString(ClassName);
2482 CapturedVersion = ProbeForReadUnicodeString(ClsVersion);
2483
2484 ProbeForRead(pClassMenuName,
2485 sizeof(CLSMENUNAME),
2486 1);
2487
2488 CapturedMenuName = ProbeForReadUnicodeString(pClassMenuName->pusMenuName);
2489
2490 if ( (CapturedName.Length & 1) ||
2491 (CapturedMenuName.Length & 1) ||
2492 (CapturedClassInfo.cbClsExtra < 0) ||
2493 ((CapturedClassInfo.cbClsExtra + CapturedName.Length +
2494 CapturedMenuName.Length + sizeof(CLS))
2495 < (ULONG)CapturedClassInfo.cbClsExtra) ||
2496 (CapturedClassInfo.cbWndExtra < 0) ||
2497 (CapturedClassInfo.hInstance == NULL) )
2498 {
2499 ERR("NtUserRegisterClassExWOW Invalid Parameter Error!\n");
2500 goto InvalidParameter;
2501 }
2502
2503 if (CapturedName.Length != 0)
2504 {
2505 ProbeForRead(CapturedName.Buffer,
2506 CapturedName.Length,
2507 sizeof(WCHAR));
2508 }
2509 else
2510 {
2511 if (!IS_ATOM(CapturedName.Buffer))
2512 {
2513 ERR("NtUserRegisterClassExWOW ClassName Error!\n");
2514 goto InvalidParameter;
2515 }
2516 }
2517
2518 if (CapturedVersion.Length != 0)
2519 {
2520 ProbeForRead(CapturedVersion.Buffer,
2521 CapturedVersion.Length,
2522 sizeof(WCHAR));
2523 }
2524 else
2525 {
2526 if (!IS_ATOM(CapturedVersion.Buffer))
2527 {
2528 ERR("NtUserRegisterClassExWOW ClassName Error!\n");
2529 goto InvalidParameter;
2530 }
2531 }
2532
2533 if (CapturedMenuName.Length != 0)
2534 {
2535 ProbeForRead(CapturedMenuName.Buffer,
2536 CapturedMenuName.Length,
2537 sizeof(WCHAR));
2538 }
2539 else if (CapturedMenuName.Buffer != NULL &&
2540 !IS_INTRESOURCE(CapturedMenuName.Buffer))
2541 {
2542 ERR("NtUserRegisterClassExWOW MenuName Error!\n");
2546 }
2547
2548 if (IsCallProcHandle(lpwcx->lpfnWndProc))
2549 { // Never seen this yet, but I'm sure it's a little haxxy trick!
2550 // If this pops up we know what todo!
2551 ERR("NtUserRegisterClassExWOW WndProc is CallProc!!\n");
2552 }
2553
2554 TRACE("NtUserRegisterClassExWOW MnuN %wZ\n",&CapturedMenuName);
2555 }
2557 {
2558 ERR("NtUserRegisterClassExWOW Exception Error!\n");
2560 Exception = TRUE;
2561 }
2562 _SEH2_END;
2563
2564 if (!Exception)
2565 {
2566 /* Register the class */
2567 Ret = UserRegisterClass(&CapturedClassInfo,
2568 &CapturedName,
2569 &CapturedVersion,
2570 &CapturedMenuName,
2571 fnID,
2572 Flags);
2573 }
2574
2575 if (!Ret)
2576 {
2577 TRACE("NtUserRegisterClassExWOW Null Return!\n");
2578 }
2579
2580 UserLeave();
2581
2582 return Ret;
2583}
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:3218
UINT cbSize
Definition: winuser.h:3216
int cbWndExtra
Definition: winuser.h:3220
HINSTANCE hInstance
Definition: winuser.h:3221
int cbClsExtra
Definition: winuser.h:3219
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:1502

Referenced by RegisterClassExWOWW(), and START_TEST().

◆ NtUserRegisterHotKey()

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

Definition at line 512 of file hotkey.c.

516{
517 PHOT_KEY pHotKey;
518 PWND pWnd = NULL;
519 PTHREADINFO pHotKeyThread;
520 BOOL bRet = FALSE;
521
522 TRACE("Enter NtUserRegisterHotKey\n");
523
524 if (fsModifiers & ~(MOD_ALT|MOD_CONTROL|MOD_SHIFT|MOD_WIN)) // FIXME: Does Win2k3 support MOD_NOREPEAT?
525 {
526 WARN("Invalid modifiers: %x\n", fsModifiers);
528 return 0;
529 }
530
532
533 /* Find hotkey thread */
534 if (hWnd == NULL)
535 {
536 pHotKeyThread = gptiCurrent;
537 }
538 else
539 {
541 if (!pWnd)
542 goto cleanup;
543
544 pHotKeyThread = pWnd->head.pti;
545
546 /* Fix wine msg "Window on another thread" test_hotkey */
547 if (pWnd->head.pti != gptiCurrent)
548 {
550 WARN("Must be from the same Thread.\n");
551 goto cleanup;
552 }
553 }
554
555 /* Check for existing hotkey */
556 if (IsHotKey(fsModifiers, vk))
557 {
559 WARN("Hotkey already exists\n");
560 goto cleanup;
561 }
562
563 /* Create new hotkey */
565 if (pHotKey == NULL)
566 {
568 goto cleanup;
569 }
570
571 pHotKey->pti = pHotKeyThread;
572 pHotKey->pWnd = pWnd;
573 pHotKey->fsModifiers = fsModifiers;
574 pHotKey->vk = vk;
575 pHotKey->id = id;
576
577 /* Insert hotkey to the global list */
578 pHotKey->pNext = gphkFirst;
579 gphkFirst = pHotKey;
580
581 bRet = TRUE;
582
583cleanup:
584 TRACE("Leave NtUserRegisterHotKey, ret=%i\n", bRet);
585 UserLeave();
586 return bRet;
587}
GLuint id
Definition: glext.h:5910
#define MOD_ALT
Definition: imm.h:184
#define MOD_SHIFT
Definition: imm.h:186
#define MOD_CONTROL
Definition: imm.h:185
WORD vk
Definition: input.c:77
Definition: hotkey.h:4
UINT fsModifiers
Definition: hotkey.h:7
PTHREADINFO pti
Definition: hotkey.h:5
struct _HOT_KEY * pNext
Definition: hotkey.h:10
INT id
Definition: hotkey.h:9
UINT vk
Definition: hotkey.h:8
PWND pWnd
Definition: hotkey.h:6
static PHOT_KEY FASTCALL IsHotKey(UINT fsModifiers, WORD wVk)
Definition: hotkey.c:151
PHOT_KEY gphkFirst
Definition: hotkey.c:38
#define USERTAG_HOTKEY
Definition: tags.h:238
#define ERROR_WINDOW_OF_OTHER_THREAD
Definition: winerror.h:889
#define ERROR_HOTKEY_ALREADY_REGISTERED
Definition: winerror.h:890
#define MOD_WIN
Definition: winuser.h:2644

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 4294 of file window.c.

4295{
4296 UNICODE_STRING SafeMessageName;
4298 UINT Ret = 0;
4299
4300 TRACE("Enter NtUserRegisterWindowMessage\n");
4302
4303 if(MessageNameUnsafe == NULL)
4304 {
4306 goto Exit; // Return 0
4307 }
4308
4309 Status = IntSafeCopyUnicodeStringTerminateNULL(&SafeMessageName, MessageNameUnsafe);
4310 if(!NT_SUCCESS(Status))
4311 {
4313 goto Exit; // Return 0
4314 }
4315
4316 Ret = (UINT)IntAddAtom(SafeMessageName.Buffer);
4317 if (SafeMessageName.Buffer)
4318 ExFreePoolWithTag(SafeMessageName.Buffer, TAG_STRING);
4319
4320Exit:
4321 TRACE("Leave NtUserRegisterWindowMessage, ret=%u\n", Ret);
4322 UserLeave();
4323 return Ret;
4324}
RTL_ATOM FASTCALL IntAddAtom(LPWSTR AtomName)
Definition: useratom.c:13
NTSTATUS FASTCALL IntSafeCopyUnicodeStringTerminateNULL(PUNICODE_STRING Dest, PUNICODE_STRING Source)
Definition: misc.c:683

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 6363 of file menu.c.

6367{
6368 PMENU Menu;
6369 BOOL Ret = FALSE;
6370
6371 TRACE("Enter NtUserRemoveMenu\n");
6373
6374 Menu = UserGetMenuObject(hMenu);
6375 if (Menu)
6376 {
6377 Ret = IntRemoveMenuItem(Menu, uPosition, uFlags, FALSE);
6378 }
6379
6380 TRACE("Leave NtUserRemoveMenu, ret=%i\n", Ret);
6381 UserLeave();
6382 return Ret;
6383}

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 2829 of file desktop.c.

2834{
2837 HWINSTA hWinSta = NULL;
2838 HDESK hDesktop = NULL;
2839 UNICODE_STRING CapturedDesktopPath;
2840
2841 /* Allow only the Console Server to perform this operation (via CSRSS) */
2843 return NULL;
2844
2845 /* Get the process object the user handle was referencing */
2849 UserMode,
2850 (PVOID*)&Process,
2851 NULL);
2852 if (!NT_SUCCESS(Status))
2853 return NULL;
2854
2856
2857 _SEH2_TRY
2858 {
2859 /* Probe the handle pointer */
2860 // ProbeForWriteHandle
2861 ProbeForWrite(phWinSta, sizeof(HWINSTA), sizeof(HWINSTA));
2862 }
2864 {
2866 _SEH2_YIELD(goto Quit);
2867 }
2868 _SEH2_END;
2869
2870 /* Capture the user desktop path string */
2871 Status = ProbeAndCaptureUnicodeString(&CapturedDesktopPath,
2872 UserMode,
2873 DesktopPath);
2874 if (!NT_SUCCESS(Status))
2875 goto Quit;
2876
2877 /* Call the internal function */
2879 &CapturedDesktopPath,
2880 bInherit,
2881 &hWinSta,
2882 &hDesktop);
2883 if (!NT_SUCCESS(Status))
2884 {
2885 ERR("IntResolveDesktop failed, Status 0x%08lx\n", Status);
2886 hWinSta = NULL;
2887 hDesktop = NULL;
2888 }
2889
2890 _SEH2_TRY
2891 {
2892 /* Return the window station handle */
2893 *phWinSta = hWinSta;
2894 }
2896 {
2898
2899 /* We failed, close the opened desktop and window station */
2900 if (hDesktop) ObCloseHandle(hDesktop, UserMode);
2901 hDesktop = NULL;
2902 if (hWinSta) ObCloseHandle(hWinSta, UserMode);
2903 }
2904 _SEH2_END;
2905
2906 /* Free the captured string */
2907 ReleaseCapturedUnicodeString(&CapturedDesktopPath, UserMode);
2908
2909Quit:
2910 UserLeave();
2911
2912 /* Dereference the process object */
2914
2915 /* Return the desktop handle */
2916 return hDesktop;
2917}
NTSTATUS FASTCALL IntResolveDesktop(IN PEPROCESS Process, IN PUNICODE_STRING DesktopPath, IN BOOL bInherit, OUT HWINSTA *phWinSta, OUT HDESK *phDesktop)
Definition: desktop.c:551

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 1182 of file scrollbar.c.

1187{
1188 PWND Window;
1189 SCROLLINFO psi;
1190 BOOL Ret = FALSE;
1191 SBDATA SBDataSafe;
1193
1194 TRACE("Enter NtUserGetScrollInfo\n");
1196
1197 _SEH2_TRY
1198 {
1199 RtlCopyMemory(&psi, lpsi, sizeof(SCROLLINFO));
1200 if (pSBData)
1201 RtlCopyMemory(&SBDataSafe, pSBData, sizeof(SBDATA));
1202 }
1204 {
1205 ERR("NtUserGetScrollInfo Failed size\n");
1207 _SEH2_YIELD(goto Exit); // Return FALSE
1208 }
1209 _SEH2_END
1210
1212 {
1213 ERR("NtUserGetScrollInfo Bad window\n");
1214 goto Exit; // Return FALSE
1215 }
1216
1217 UserRefObjectCo(Window, &Ref);
1218 Ret = co_IntGetScrollInfo(Window, fnBar, &SBDataSafe, &psi);
1220
1221 _SEH2_TRY
1222 {
1223 RtlCopyMemory(lpsi, &psi, sizeof(SCROLLINFO));
1224 }
1226 {
1227 ERR("NtUserGetScrollInfo Failed copy to user\n");
1229 Ret = FALSE;
1230 _SEH2_YIELD(goto Exit);
1231 }
1232 _SEH2_END
1233
1234Exit:
1235 TRACE("Leave NtUserGetScrollInfo, ret=%i\n", Ret);
1236 UserLeave();
1237 return Ret;
1238}
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:861

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 708 of file input.c.

712{
713 PTHREADINFO pti;
714 UINT uRet = 0;
715
716 TRACE("Enter NtUserSendInput\n");
718
720 ASSERT(pti);
721
722 if (!pti->rpdesk)
723 {
724 goto cleanup;
725 }
726
727 if (!nInputs || !pInput || cbSize != sizeof(INPUT))
728 {
730 goto cleanup;
731 }
732
733 /*
734 * FIXME: Check access rights of the window station
735 * e.g. services running in the service window station cannot block input
736 */
737 if (!ThreadHasInputAccess(pti) ||
739 {
741 goto cleanup;
742 }
743
744 while (nInputs--)
745 {
746 INPUT SafeInput;
748
749 Status = MmCopyFromCaller(&SafeInput, pInput++, sizeof(INPUT));
750 if (!NT_SUCCESS(Status))
751 {
753 goto cleanup;
754 }
755
756 switch (SafeInput.type)
757 {
758 case INPUT_MOUSE:
759 if (UserSendMouseInput(&SafeInput.mi, TRUE))
760 uRet++;
761 break;
762 case INPUT_KEYBOARD:
763 if (UserSendKeyboardInput(&SafeInput.ki, TRUE))
764 uRet++;
765 break;
766 case INPUT_HARDWARE:
767 FIXME("INPUT_HARDWARE not supported!\n");
768 break;
769 default:
770 ERR("SendInput(): Invalid input type: 0x%x\n", SafeInput.type);
771 break;
772 }
773 }
774
775cleanup:
776 TRACE("Leave NtUserSendInput, ret=%u\n", uRet);
777 UserLeave();
778 return uRet;
779}
KEYBDINPUT ki
Definition: winable.h:62
DWORD type
Definition: winable.h:59
MOUSEINPUT mi
Definition: winable.h:61
#define IntIsActiveDesktop(Desktop)
Definition: desktop.h:172
BOOL NTAPI UserSendKeyboardInput(KEYBDINPUT *pKbdInput, BOOL bInjected)
Definition: keyboard.c:1110
#define ThreadHasInputAccess(W32Thread)
Definition: input.h:68
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 1662 of file focus.c.

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

Referenced by SetActiveWindow().

◆ NtUserSetAppImeLevel()

BOOL NTAPI NtUserSetAppImeLevel ( HWND  hWnd,
DWORD  dwLevel 
)

Definition at line 1060 of file ime.c.

1061{
1062 BOOL ret = FALSE;
1063 PWND pWnd;
1064 PTHREADINFO pti;
1065
1067
1068 if (!IS_IMM_MODE())
1069 {
1070 ERR("!IS_IMM_MODE()\n");
1072 goto Quit;
1073 }
1074
1075 pWnd = ValidateHwndNoErr(hWnd);
1076 if (!pWnd)
1077 goto Quit;
1078
1080 if (pWnd->head.pti->ppi == pti->ppi)
1081 ret = UserSetProp(pWnd, AtomImeLevel, (HANDLE)(ULONG_PTR)dwLevel, TRUE);
1082
1083Quit:
1084 UserLeave();
1085 return ret;
1086}

◆ NtUserSetCapture()

HWND NTAPI NtUserSetCapture ( HWND  Wnd)

Definition at line 1703 of file focus.c.

1704{
1705 HWND Ret;
1706
1707 TRACE("Enter NtUserSetCapture(%p)\n", hWnd);
1709
1710 Ret = co_UserSetCapture(hWnd);
1711
1712 TRACE("Leave NtUserSetCapture, ret=%p\n", Ret);
1713 UserLeave();
1714 return Ret;
1715}

Referenced by SetCapture().

◆ NtUserSetClassLong()

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

Definition at line 2586 of file class.c.

2590{
2592 PWND Window;
2593 ULONG_PTR Ret = 0;
2594
2596
2598
2600 if (Window != NULL)
2601 {
2602 if (Window->head.pti->ppi != pi)
2603 {
2605 goto Cleanup;
2606 }
2607
2608 _SEH2_TRY
2609 {
2611
2612 /* Probe the parameters */
2613 if (Offset == GCW_ATOM || Offset == GCLP_MENUNAME)
2614 {
2615 /* FIXME: Resource ID can be passed directly without UNICODE_STRING ? */
2616 if (IS_ATOM(dwNewLong))
2617 {
2618 Value.MaximumLength = 0;
2619 Value.Length = 0;
2620 Value.Buffer = (PWSTR)dwNewLong;
2621 }
2622 else
2623 {
2625 }
2626
2627 if (Value.Length & 1)
2628 {
2629 goto InvalidParameter;
2630 }
2631
2632 if (Value.Length != 0)
2633 {
2634 ProbeForRead(Value.Buffer,
2635 Value.Length,
2636 sizeof(WCHAR));
2637 }
2638 else
2639 {
2640 if (Offset == GCW_ATOM && !IS_ATOM(Value.Buffer))
2641 {
2642 goto InvalidParameter;
2643 }
2644 else if (Offset == GCLP_MENUNAME && !IS_INTRESOURCE(Value.Buffer))
2645 {
2649 }
2650 }
2651
2652 dwNewLong = (ULONG_PTR)&Value;
2653 }
2654
2655 Ret = UserSetClassLongPtr(Window->pcls,
2656 Offset,
2657 dwNewLong,
2658 Ansi);
2659 switch(Offset)
2660 {
2661 case GCLP_HICONSM:
2662 case GCLP_HICON:
2663 {
2664 if (Ret && Ret != dwNewLong)
2666 }
2667 }
2668 }
2670 {
2672 }
2673 _SEH2_END;
2674 }
2675
2676Cleanup:
2677 UserLeave();
2678
2679 return Ret;
2680}
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
uint16_t * PWSTR
Definition: typedefs.h:56
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
ULONG_PTR UserSetClassLongPtr(IN PCLS Class, IN INT Index, IN ULONG_PTR NewLong, IN BOOL Ansi)
Definition: class.c:1869
#define GCLP_MENUNAME
Definition: winuser.h:677
#define GCLP_HICONSM
Definition: winuser.h:675
#define GCLP_HICON
Definition: winuser.h:674
#define DC_ICON
Definition: winuser.h:429
#define GCW_ATOM
Definition: winuser.h:661

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

◆ NtUserSetClassLongPtr()

LONG_PTR APIENTRY NtUserSetClassLongPtr ( VOID  )

Definition at line 954 of file ntstubs.c.

956{
957 STUB;
958 return 0;
959}

◆ NtUserSetClassWord()

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

Definition at line 2684 of file class.c.

2688{
2689/*
2690 * NOTE: Obsoleted in 32-bit windows
2691 */
2692 return(0);
2693}

◆ 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(), 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:1713
#define WM_DRAWCLIPBOARD
Definition: winuser.h:1869

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 1045 of file cursoricon.c.

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

Referenced by SetCursor().

◆ NtUserSetCursorContents()

BOOL NTAPI NtUserSetCursorContents ( HANDLE  Handle,
PICONINFO  IconInfo 
)

Definition at line 1115 of file cursoricon.c.

1118{
1119 FIXME(" is UNIMPLEMENTED.\n");
1120 return FALSE;
1121}

◆ NtUserSetCursorIconData()

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

Definition at line 1506 of file cursoricon.c.

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

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 1721 of file focus.c.

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

Referenced by SetFocus().

◆ NtUserSetImeHotKey()

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

Definition at line 451 of file ime.c.

457{
458 BOOL ret;
460 ret = IntSetImeHotKey(dwHotKeyId, uModifiers, uVirtualKey, hKL, dwAction);
461 UserLeave();
462 return ret;
463}
static BOOL APIENTRY IntSetImeHotKey(DWORD dwHotKeyId, UINT uModifiers, UINT uVirtualKey, HKL hKL, DWORD dwAction)
Definition: ime.c:339

Referenced by CliImmInitializeHotKeys(), and CliImmSetHotKeyWorker().

◆ NtUserSetImeInfoEx()

BOOL NTAPI NtUserSetImeInfoEx ( PIMEINFOEX  pImeInfoEx)

Definition at line 1126 of file ime.c.

1127{
1128 BOOL ret = FALSE;
1129 IMEINFOEX ImeInfoEx;
1130 PWINSTATION_OBJECT pWinSta;
1131
1133
1134 if (!IS_IMM_MODE())
1135 {
1136 ERR("!IS_IMM_MODE()\n");
1137 goto Quit;
1138 }
1139
1140 _SEH2_TRY
1141 {
1142 ProbeForRead(pImeInfoEx, sizeof(*pImeInfoEx), 1);
1143 ImeInfoEx = *pImeInfoEx;
1144 }
1146 {
1147 ERR("%p\n", pImeInfoEx);
1148 _SEH2_YIELD(goto Quit);
1149 }
1150 _SEH2_END;
1151
1153 ret = UserSetImeInfoEx(pWinSta, &ImeInfoEx);
1154
1155Quit:
1156 UserLeave();
1157 return ret;
1158}
BOOL FASTCALL UserSetImeInfoEx(_Inout_ PWINSTATION_OBJECT pWinSta, _Inout_ PIMEINFOEX pImeInfoEx)
Definition: ime.c:1090

Referenced by Imm32LoadIME().

◆ NtUserSetImeOwnerWindow()

BOOL NTAPI NtUserSetImeOwnerWindow ( HWND  hImeWnd,
HWND  hwndFocus 
)

Definition at line 1362 of file ime.c.

1363{
1364 BOOL ret = FALSE;
1365 PWND pImeWnd, pwndFocus, pwndTopLevel, pwndNode, pwndActive;
1366 PTHREADINFO ptiIme;
1367
1369
1370 if (!IS_IMM_MODE())
1371 {
1372 ERR("!IS_IMM_MODE()\n");
1373 goto Quit;
1374 }
1375
1376 pImeWnd = ValidateHwndNoErr(hImeWnd);
1377 if (!pImeWnd || pImeWnd->fnid != FNID_IME)
1378 goto Quit;
1379
1380 pwndFocus = ValidateHwndNoErr(hwndFocus);
1381 if (pwndFocus)
1382 {
1383 if (IS_WND_IMELIKE(pwndFocus))
1384 goto Quit;
1385
1386 pwndTopLevel = IntGetTopLevelWindow(pwndFocus);
1387
1388 for (pwndNode = pwndTopLevel; pwndNode; pwndNode = pwndNode->spwndOwner)
1389 {
1390 if (pwndNode->pcls->atomClassName == gpsi->atomSysClass[ICLS_IME])
1391 {
1392 pwndTopLevel = NULL;
1393 break;
1394 }
1395 }
1396
1397 WndSetOwner(pImeWnd, pwndTopLevel);
1398 IntImeCheckTopmost(pImeWnd);
1399 }
1400 else
1401 {
1402 ptiIme = pImeWnd->head.pti;
1403 pwndActive = ptiIme->MessageQueue->spwndActive;
1404
1405 if (!pwndActive || pwndActive != pImeWnd->spwndOwner)
1406 {
1407 if (pwndActive && ptiIme == pwndActive->head.pti && !IS_WND_IMELIKE(pwndActive))
1408 {
1409 WndSetOwner(pImeWnd, pwndActive);
1410 }
1411 else
1412 {
1413 IntImeSetFutureOwner(pImeWnd, pImeWnd->spwndOwner);
1414 }
1415
1416 IntImeCheckTopmost(pImeWnd);
1417 }
1418 }
1419
1420 ret = TRUE;
1421
1422Quit:
1423 UserLeave();
1424 return ret;
1425}
#define ICLS_IME
Definition: ntuser.h:927
#define FNID_IME
Definition: ntuser.h:874
PWND FASTCALL IntGetTopLevelWindow(PWND pwnd)
Definition: ime.c:487
VOID FASTCALL IntImeSetFutureOwner(PWND pImeWnd, PWND pwndOwner)
Definition: ime.c:1162
VOID FASTCALL IntImeCheckTopmost(PWND pImeWnd)
Definition: ime.c:1346
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:843
#define THREAD_SET_INFORMATION
Definition: nt_native.h:1337
HDESK FASTCALL IntGetDesktopObjectHandle(PDESKTOP DesktopObject)
Definition: desktop.c:1271
uint32_t * PULONG
Definition: typedefs.h:59
BOOL IntSetThreadDesktop(IN HDESK hDesktop, IN BOOL FreeOnFailure)
Definition: desktop.c:3260
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 3626 of file winpos.c.

3631{
3632 WINDOWPLACEMENT wndpl;
3633 UINT flags;
3634 PWND Wnd;
3635 RECT rect;
3636 POINT pt = {0};
3637 BOOL Ret = FALSE;
3639
3640 TRACE("Enter NtUserSetWindowPlacement\n");
3642
3643 if (!(Wnd = UserGetWindowObject(hwnd)) || // FIXME:
3645 {
3646 goto Exit; // Return FALSE
3647 }
3648
3649 _SEH2_TRY
3650 {
3651 if (lppt)
3652 {
3653 ProbeForRead(lppt, sizeof(POINT), 1);
3654 RtlCopyMemory(&pt, lppt, sizeof(POINT));
3655 }
3656 if (lprect)
3657 {
3658 ProbeForRead(lprect, sizeof(RECT), 1);
3659 RtlCopyMemory(&rect, lprect, sizeof(RECT));
3660 }
3661 }
3663 {
3665 _SEH2_YIELD(goto Exit); // Return FALSE
3666 }
3667 _SEH2_END
3668
3669 wndpl.length = sizeof(wndpl);
3670 wndpl.showCmd = showCmd;
3671 wndpl.flags = flags = 0;
3672
3673 if ( lppt )
3674 {
3675 flags |= PLACE_MIN;
3676 wndpl.flags |= WPF_SETMINPOSITION;
3677 wndpl.ptMinPosition = pt;
3678 }
3679 if ( lprect )
3680 {
3681 flags |= PLACE_RECT;
3682 wndpl.rcNormalPosition = rect;
3683 }
3684
3685 UserRefObjectCo(Wnd, &Ref);
3686 IntSetWindowPlacement(Wnd, &wndpl, flags);
3687 UserDerefObjectCo(Wnd);
3688 Ret = TRUE;
3689
3690Exit:
3691 TRACE("Leave NtUserSetWindowPlacement, ret=%i\n", Ret);
3692 UserLeave();
3693 return Ret;
3694}
BOOL FASTCALL IntSetWindowPlacement(PWND Wnd, WINDOWPLACEMENT *wpl, UINT Flags)
Definition: winpos.c:665
#define PLACE_RECT
Definition: winpos.c:32
#define PLACE_MIN
Definition: winpos.c:30
#define WPF_SETMINPOSITION
Definition: winuser.h:2533

◆ NtUserSetKeyboardState()

BOOL NTAPI NtUserSetKeyboardState ( LPBYTE  lpKeyState)

Definition at line 2589 of file msgqueue.c.

2590{
2591 UINT i;
2592 BOOL bRet = TRUE;
2593 PTHREADINFO pti;
2594 PUSER_MESSAGE_QUEUE MessageQueue;
2595
2597
2599 MessageQueue = pti->MessageQueue;
2600
2601 _SEH2_TRY
2602 {
2603 ProbeForRead(pKeyState, 256 * sizeof(BYTE), 1);
2604 for (i = 0; i < 256; ++i)
2605 {
2606 SET_KEY_DOWN(MessageQueue->afKeyState, i, pKeyState[i] & KS_DOWN_BIT);
2607 SET_KEY_LOCKED(MessageQueue->afKeyState, i, pKeyState[i] & KS_LOCK_BIT);
2608 }
2609 }
2611 {
2613 bRet = FALSE;
2614 }
2615 _SEH2_END;
2616
2617 UserLeave();
2618
2619 return bRet;
2620}
#define SET_KEY_DOWN(ks, vk, down)
Definition: input.h:103
#define SET_KEY_LOCKED(ks, vk, down)
Definition: input.h:106

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 1953 of file winsta.c.

1954{
1956 {
1957 return FALSE;
1958 }
1959
1960 if (!IntIsWindow(hWnd))
1961 {
1962 return FALSE;
1963 }
1964
1965 hwndSAS = hWnd;
1966
1967 return TRUE;
1968}

Referenced by SetLogonNotifyWindow().

◆ NtUserSetMenu()

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

Definition at line 6389 of file menu.c.

6393{
6394 PWND Window;
6395 BOOL Changed;
6396 BOOL Ret = FALSE;
6397
6398 TRACE("Enter NtUserSetMenu\n");
6400
6402 {
6403 goto Exit; // Return FALSE
6404 }
6405
6406 if (!IntSetMenu(Window, Menu, &Changed))
6407 {
6408 goto Exit; // Return FALSE
6409 }
6410
6411 // Not minimized and please repaint!!!
6412 if (!(Window->style & WS_MINIMIZE) && (Repaint || Changed))
6413 {
6415 UserRefObjectCo(Window, &Ref);
6418 }
6419
6420 Ret = TRUE;
6421
6422Exit:
6423 TRACE("Leave NtUserSetMenu, ret=%i\n", Ret);
6424 UserLeave();
6425 return Ret;
6426}
BOOL FASTCALL IntSetMenu(PWND Wnd, HMENU Menu, BOOL *Changed)
Definition: menu.c:5447

Referenced by SetMenu().

◆ NtUserSetMenuContextHelpId()

BOOL NTAPI NtUserSetMenuContextHelpId ( HMENU  hmenu,
DWORD  dwContextHelpId 
)

Definition at line 6432 of file menu.c.

6435{
6436 PMENU Menu;
6437 BOOL Ret = FALSE;
6438
6439 TRACE("Enter NtUserSetMenuContextHelpId\n");
6441
6442 Menu = UserGetMenuObject(hMenu);
6443 if (Menu)
6444 {
6445 Ret = IntSetMenuContextHelpId(Menu, dwContextHelpId);
6446 }
6447
6448 TRACE("Leave NtUserSetMenuContextHelpId, ret=%i\n", Ret);
6449 UserLeave();
6450 return Ret;
6451}
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 6457 of file menu.c.

6461{
6462 PMENU Menu;
6463 BOOL Ret = FALSE;
6464
6465 TRACE("Enter NtUserSetMenuDefaultItem\n");
6467
6468 Menu = UserGetMenuObject(hMenu);
6469 if (Menu)
6470 {
6471 Ret = UserSetMenuDefaultItem(Menu, uItem, fByPos);
6472 }
6473
6474 TRACE("Leave NtUserSetMenuDefaultItem, ret=%i\n", Ret);
6475 UserLeave();
6476 return Ret;
6477}
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 6483 of file menu.c.

6485{
6486 PMENU Menu;
6487 BOOL Ret = FALSE;
6488
6489 TRACE("Enter NtUserSetMenuFlagRtoL\n");
6491
6492 Menu = UserGetMenuObject(hMenu);
6493 if (Menu)
6494 {
6495 Ret = IntSetMenuFlagRtoL(Menu);
6496 }
6497
6498 TRACE("Leave NtUserSetMenuFlagRtoL, ret=%i\n", Ret);
6499 UserLeave();
6500 return Ret;
6501}
BOOL FASTCALL IntSetMenuFlagRtoL(PMENU Menu)
Definition: menu.c:864

◆ NtUserSetObjectInformation()

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

Definition at line 1339 of file winsta.c.

1344{
1345 /* FIXME: ZwQueryObject */
1346 /* FIXME: ZwSetInformationObject */
1348 return FALSE;
1349}

◆ NtUserSetParent()

HWND NTAPI NtUserSetParent ( HWND  hWndChild,
HWND  hWndNewParent 
)

Definition at line 3647 of file window.c.

3648{
3649 HWND Ret;
3650
3651 TRACE("Enter NtUserSetParent\n");
3653
3654 /*
3655 Check Parent first from user space, set it here.
3656 */
3657 if (!hWndNewParent)
3658 {
3659 hWndNewParent = IntGetDesktopWindow();
3660 }
3661 else if (hWndNewParent == HWND_MESSAGE)
3662 {
3663 hWndNewParent = IntGetMessageWindow();
3664 }
3665
3666 Ret = co_UserSetParent(hWndChild, hWndNewParent);
3667
3668 TRACE("Leave NtUserSetParent, ret=%p\n", Ret);
3669 UserLeave();
3670 return Ret;
3671}
HWND hWndChild[NUM_TABS]
Definition: main.h:74
HWND FASTCALL co_UserSetParent(HWND hWndChild, HWND hWndNewParent)
Definition: window.c:1294

Referenced by SetParent().

◆ NtUserSetProcessWindowStation()

BOOL NTAPI NtUserSetProcessWindowStation ( HWINSTA  hWindowStation)

Definition at line 1518 of file winsta.c.

1519{
1520 BOOL ret;
1521
1523
1524 ret = UserSetProcessWindowStation(hWindowStation);
1525
1526 UserLeave();
1527
1528 return ret;
1529}
BOOL FASTCALL UserSetProcessWindowStation(HWINSTA hWindowStation)
Definition: winsta.c:1382

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 1397 of file scrollbar.c.

1401{
1402 PWND Window = NULL;
1403 SETSCROLLBARINFO Safeinfo;
1404 PSCROLLBARINFO sbi;
1405 LPSCROLLINFO psi;
1407 LONG Obj;
1408 BOOL Ret = FALSE;
1410
1411 TRACE("Enter NtUserSetScrollBarInfo\n");
1413
1415 goto Cleanup; // Return FALSE
1416
1417 UserRefObjectCo(Window, &Ref);
1418
1419 Obj = SBOBJ_TO_SBID(idObject);
1420 if(!SBID_IS_VALID(Obj))
1421 {
1423 ERR("Trying to set scrollinfo for unknown scrollbar type %d\n", Obj);
1424 goto Cleanup; // Return FALSE
1425 }
1426
1428 goto Cleanup; // Return FALSE
1429
1430 Status = MmCopyFromCaller(&Safeinfo, info, sizeof(SETSCROLLBARINFO));
1431 if(!NT_SUCCESS(Status))
1432 {
1434 goto Cleanup; // Return FALSE
1435 }
1436
1439
1440 psi->nTrackPos = Safeinfo.nTrackPos;
1441 sbi->reserved = Safeinfo.reserved;
1442 RtlCopyMemory(&sbi->rgstate, &Safeinfo.rgstate, sizeof(Safeinfo.rgstate));
1443
1444 Ret = TRUE;
1445
1446Cleanup:
1447 if (Window)
1449
1450 TRACE("Leave NtUserSetScrollBarInfo, ret=%i\n", Ret);
1451 UserLeave();
1452 return Ret;
1453}
#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:3621
DWORD rgstate[CCHILDREN_SCROLLBAR+1]
Definition: winuser.h:3754

Referenced by IntScrollHandleScrollEvent(), and IntUpdateScrollArrows().

◆ NtUserSetScrollInfo()

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

Definition at line 1331 of file scrollbar.c.

1336{
1337 PWND Window = NULL;
1339 SCROLLINFO ScrollInfo;
1340 DWORD Ret = 0;
1342
1343 TRACE("Enter NtUserSetScrollInfo\n");
1345
1347 goto Cleanup; // Return 0
1348
1349 UserRefObjectCo(Window, &Ref);
1350
1351 Status = MmCopyFromCaller(&ScrollInfo, lpsi, sizeof(SCROLLINFO) - sizeof(ScrollInfo.nTrackPos));
1352 if(!NT_SUCCESS(Status))
1353 {
1355 goto Cleanup; // Return 0
1356 }
1357
1358 Ret = co_IntSetScrollInfo(Window, fnBar, &ScrollInfo, bRedraw);
1359
1360Cleanup:
1361 if (Window)
1363
1364 TRACE("Leave NtUserSetScrollInfo, ret=%lu\n", Ret);
1365 UserLeave();
1366 return Ret;
1367}
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 3714 of file window.c.

3715{
3716 PWINSTATION_OBJECT WinStaObject;
3717 PWND WndShell, WndListView;
3718 BOOL Ret = FALSE;
3721 PTHREADINFO ti;
3722
3723 TRACE("Enter NtUserSetShellWindowEx\n");
3725
3726 if (!(WndShell = UserGetWindowObject(hwndShell)))
3727 {
3728 goto Exit; // Return FALSE
3729 }
3730
3731 if (!(WndListView = UserGetWindowObject(hwndListView)))
3732 {
3733 goto Exit; // Return FALSE
3734 }
3735
3737 UserMode,
3738 0,
3739 &WinStaObject,
3740 0);
3741
3742 if (!NT_SUCCESS(Status))
3743 {
3745 goto Exit; // Return FALSE
3746 }
3747
3748 /*
3749 * Test if we are permitted to change the shell window.
3750 */
3751 if (WinStaObject->ShellWindow)
3752 {
3753 ObDereferenceObject(WinStaObject);
3754 goto Exit; // Return FALSE
3755 }
3756
3757 /*
3758 * Move shell window into background.
3759 */
3760 if (hwndListView && hwndListView != hwndShell)
3761 {
3762 /*
3763 * Disabled for now to get Explorer working.
3764 * -- Filip, 01/nov/2003
3765 */
3766#if 0
3768#endif
3769
3770 if (WndListView->ExStyle & WS_EX_TOPMOST)
3771 {
3772 ObDereferenceObject(WinStaObject);
3773 goto Exit; // Return FALSE
3774 }
3775 }
3776
3777 if (WndShell->ExStyle & WS_EX_TOPMOST)
3778 {
3779 ObDereferenceObject(WinStaObject);
3780 goto Exit; // Return FALSE
3781 }
3782
3783 UserRefObjectCo(WndShell, &Ref);
3784 WndShell->state2 |= WNDS2_BOTTOMMOST;
3786
3787 WinStaObject->ShellWindow = hwndShell;
3788 WinStaObject->ShellListView = hwndListView;
3789
3790 ti = GetW32ThreadInfo();
3791 if (ti->pDeskInfo)
3792 {
3793 ti->pDeskInfo->hShellWindow = hwndShell;
3794 ti->pDeskInfo->spwndShell = WndShell;
3795 ti->pDeskInfo->spwndBkGnd = WndListView;
3796 ti->pDeskInfo->ppiShellProcess = ti->ppi;
3797 }
3798
3800
3801 UserDerefObjectCo(WndShell);
3802
3803 ObDereferenceObject(WinStaObject);
3804 Ret = TRUE;
3805
3806Exit:
3807 TRACE("Leave NtUserSetShellWindowEx, ret=%i\n", Ret);
3808 UserLeave();
3809 return Ret;
3810}
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
BOOL FASTCALL UserRegisterHotKey(PWND pWnd, int id, UINT fsModifiers, UINT vk)
Definition: hotkey.c:431
#define SC_TASKLIST
Definition: winuser.h:2599

Referenced by 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:1599
DWORD COLORREF
Definition: windef.h:300
#define HWND_BROADCAST
Definition: winuser.h:1204
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1626

Referenced by SetSysColors().

◆ NtUserSetSystemCursor()

BOOL NTAPI NtUserSetSystemCursor ( HCURSOR  hcur,
DWORD  id 
)

Definition at line 2197 of file cursoricon.c.

2200{
2201 PCURICON_OBJECT pcur, pcurOrig = NULL;
2202 int i;
2203 PPROCESSINFO ppi;
2204 BOOL Ret = FALSE;
2206
2208 {
2209 goto Exit;
2210 }
2211
2212 if (hcur)
2213 {
2214 pcur = UserGetCurIconObject(hcur);
2215 if (!pcur)
2216 {
2218 goto Exit;
2219 }
2220
2222
2223 for (i = 0 ; i < 16; i++)
2224 {
2225 if (gasyscur[i].type == id)
2226 {
2227 pcurOrig = gasyscur[i].handle;
2228
2229 if (pcurOrig) break;
2230
2231 if (ppi->W32PF_flags & W32PF_CREATEDWINORDC)
2232 {
2233 gasyscur[i].handle = pcur;
2235 pcur->head.ppi = NULL;
2237 Ret = TRUE;
2238 }
2239 break;
2240 }
2241 }
2242 if (pcurOrig)
2243 {
2244 FIXME("Need to copy cursor data or do something! pcurOrig %p new pcur %p\n",pcurOrig,pcur);
2245 }
2246 }
2247Exit:
2248 UserLeave();
2249 return Ret;
2250}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
BOOL FASTCALL CheckWinstaAttributeAccess(ACCESS_MASK DesiredAccess)
Definition: winsta.c:377
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 5683 of file menu.c.

5684{
5685 BOOL Result = FALSE;
5686 PWND Window;
5687 PMENU Menu;
5688
5689 TRACE("Enter NtUserSetSystemMenu\n");
5691
5693 {
5694 goto Exit; // Return FALSE
5695 }
5696
5697 if (hMenu)
5698 {
5699 /*
5700 * Assign new menu handle and Up the Lock Count.
5701 */
5702 if (!(Menu = IntGetMenuObject(hMenu)))
5703 {
5704 goto Exit; // Return FALSE
5705 }
5706
5708 }
5709 else
5711
5712Exit:
5713 TRACE("Leave NtUserSetSystemMenu, ret=%i\n", Result);
5714 UserLeave();
5715 return Result;
5716}
BOOL FASTCALL IntSetSystemMenu(PWND Window, PMENU Menu)
Definition: menu.c:5414

Referenced by SetSystemMenu().

◆ NtUserSetSystemTimer()

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

Definition at line 679 of file timer.c.

685{
687
689 TRACE("Enter NtUserSetSystemTimer\n");
690
691 ret = IntSetTimer(UserGetWindowObject(hWnd), nIDEvent, uElapse, NULL, TMRF_SYSTEM);
692
693 UserLeave();
694
695 TRACE("Leave NtUserSetSystemTimer, ret=%u\n", ret);
696 return ret;
697}

Referenced by SetSystemTimer().

◆ NtUserSetThreadDesktop()

BOOL NTAPI NtUserSetThreadDesktop ( HDESK  hDesktop)

Definition at line 3452 of file desktop.c.

3453{
3454 BOOL ret = FALSE;
3455
3457
3458 // FIXME: IntSetThreadDesktop validates the desktop handle, it should happen
3459 // here too and set the NT error level. Q. Is it necessary to have the validation
3460 // in IntSetThreadDesktop? Is it needed there too?
3461 if (hDesktop || (!hDesktop && PsGetCurrentProcess() == gpepCSRSS))
3462 ret = IntSetThreadDesktop(hDesktop, FALSE);
3463
3464 UserLeave();
3465
3466 return ret;
3467}

Referenced by SetThreadDesktop().

◆ NtUserSetThreadLayoutHandles()

DWORD NTAPI NtUserSetThreadLayoutHandles ( HKL  hNewKL,
HKL  hOldKL 
)

Definition at line 508 of file ime.c.

509{
510 PTHREADINFO pti;
511 PKL pOldKL, pNewKL;
512
514
515 pti = GetW32ThreadInfo();
516 pOldKL = pti->KeyboardLayout;
517 if (pOldKL && pOldKL->hkl != hOldKL)
518 goto Quit;
519
520 pNewKL = UserHklToKbl(hNewKL);
521 if (!pNewKL)
522 goto Quit;
523
524 if (IS_IME_HKL(hNewKL) != IS_IME_HKL(hOldKL))
525 pti->hklPrev = hOldKL;
526
527 UserAssignmentLock((PVOID*)&pti->KeyboardLayout, pNewKL);
528 pti->pClientInfo->hKL = pNewKL->hkl;
529
530Quit:
531 UserLeave();
532 return 0;
533}
PVOID FASTCALL UserAssignmentLock(PVOID *ppvObj, PVOID pvNew)
Definition: object.c:839

Referenced by ImmActivateLayout().

◆ NtUserSetThreadState()

DWORD NTAPI NtUserSetThreadState ( DWORD  Unknown0,
DWORD  Unknown1 
)

Definition at line 359 of file misc.c.

362{
363 PTHREADINFO pti;
364 DWORD Ret = 0;
365 // Test the only flags user can change.
370 if (pti->MessageQueue)
371 {
372 Ret = pti->MessageQueue->QF_flags; // Get the queue flags.
373 if (Set)
374 pti->MessageQueue->QF_flags |= (Set&Flags); // Set the queue flags.
375 else
376 {
377 if (Flags) pti->MessageQueue->QF_flags &= ~Flags; // Clr the queue flags.
378 }
379 }
380 UserLeave();
381 return Ret;
382}
#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 629 of file timer.c.

636{
637 PWND Window = NULL;
639
640 TRACE("Enter NtUserSetTimer\n");
643
644 ret = IntSetTimer(Window, nIDEvent, uElapse, lpTimerFunc, TMRF_TIFROMWND);
645
646 UserLeave();
647 TRACE("Leave NtUserSetTimer, ret=%u\n", ret);
648
649 return ret;
650}
#define TMRF_TIFROMWND
Definition: timer.h:25

Referenced by SetTimer().

◆ NtUserSetWindowFNID()

BOOL NTAPI NtUserSetWindowFNID ( HWND  hWnd,
WORD  fnID 
)

Definition at line 4330 of file window.c.

4332{
4333 PWND Wnd;
4334 BOOL Ret = FALSE;
4335
4336 TRACE("Enter NtUserSetWindowFNID\n");
4338
4339 if (!(Wnd = UserGetWindowObject(hWnd)))
4340 {
4341 goto Exit; // Return FALSE
4342 }
4343
4344 if (Wnd->head.pti->ppi != PsGetCurrentProcessWin32Process())
4345 {
4347 goto Exit; // Return FALSE
4348 }
4349
4350 // From user land we only set these.
4351 if (fnID != FNID_DESTROY)
4352 {
4353 /* HACK: The minimum should be FNID_BUTTON, but menu code relies on this */
4354 if (fnID < FNID_FIRST || fnID > FNID_GHOST ||
4355 Wnd->fnid != 0)
4356 {
4358 goto Exit; // Return FALSE
4359 }
4360 }
4361
4362 Wnd->fnid |= fnID;
4363 Ret = TRUE;
4364
4365Exit:
4366 TRACE("Leave NtUserSetWindowFNID\n");
4367 UserLeave();
4368 return Ret;
4369}

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 4043 of file window.c.

4044{
4045 LONG ret;
4046
4048
4049 if (hWnd == IntGetDesktopWindow())
4050 {
4052 UserLeave();
4053 return 0;
4054 }
4055
4056 ret = (LONG)co_IntSetWindowLongPtr(hWnd, Index, NewValue, Ansi, sizeof(LONG), FALSE);
4057
4058 UserLeave();
4059
4060 return ret;
4061}

Referenced by SetWindowLongA(), and SetWindowLongW().

◆ NtUserSetWindowPlacement()

BOOL NTAPI NtUserSetWindowPlacement ( HWND  hWnd,
WINDOWPLACEMENT lpwndpl 
)

Definition at line 3700 of file winpos.c.

3702{
3703 PWND Wnd;
3704 WINDOWPLACEMENT Safepl;
3705 UINT Flags;
3706 BOOL Ret = FALSE;
3708
3709 TRACE("Enter NtUserSetWindowPlacement\n");
3711
3712 if (!(Wnd = UserGetWindowObject(hWnd)) ||
3714 {
3715 goto Exit; // Return FALSE
3716 }
3717
3718 _SEH2_TRY
3719 {
3720 ProbeForRead(lpwndpl, sizeof(WINDOWPLACEMENT), 1);
3721 RtlCopyMemory(&Safepl, lpwndpl, sizeof(WINDOWPLACEMENT));
3722 }
3724 {
3726 _SEH2_YIELD(goto Exit); // Return FALSE
3727 }
3728 _SEH2_END
3729
3730 if(Safepl.length != sizeof(WINDOWPLACEMENT))
3731 {
3732 goto Exit; // Return FALSE
3733 }
3734
3736 if (Safepl.flags & WPF_SETMINPOSITION) Flags |= PLACE_MIN;
3737 UserRefObjectCo(Wnd, &Ref);
3738 IntSetWindowPlacement(Wnd, &Safepl, Flags);
3739 UserDerefObjectCo(Wnd);
3740 Ret = TRUE;
3741
3742Exit:
3743 TRACE("Leave NtUserSetWindowPlacement, ret=%i\n", Ret);
3744 UserLeave();
3745 return Ret;
3746}
#define PLACE_MAX
Definition: winpos.c:31

Referenced by SetWindowPlacement().

◆ NtUserSetWindowPos()

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

Definition at line 3506 of file winpos.c.

3514{
3515 PWND Window, pWndIA;
3516 BOOL ret = FALSE;
3518
3519 TRACE("Enter NtUserSetWindowPos\n");
3521
3522 if (!(Window = UserGetWindowObject(hWnd)) ||
3524 {
3525 ERR("NtUserSetWindowPos bad window handle!\n");
3526 goto Exit; // Return FALSE
3527 }
3528
3529 if ( hWndInsertAfter != HWND_TOP &&
3530 hWndInsertAfter != HWND_BOTTOM &&
3531 hWndInsertAfter != HWND_TOPMOST &&
3532 hWndInsertAfter != HWND_NOTOPMOST )
3533 {
3534 if (!(pWndIA = UserGetWindowObject(hWndInsertAfter)) ||
3535 UserIsDesktopWindow(pWndIA) || UserIsMessageWindow(pWndIA))
3536 {
3537 ERR("NtUserSetWindowPos bad insert window handle!\n");
3538 goto Exit; // Return FALSE
3539 }
3540 }
3541
3542 /* First make sure that coordinates are valid for WM_WINDOWPOSCHANGING */
3543 if (!(uFlags & SWP_NOMOVE))
3544 {
3545 if (X < -32768) X = -32768;
3546 else if (X > 32767) X = 32767;
3547 if (Y < -32768) Y = -32768;
3548 else if (Y > 32767) Y = 32767;
3549 }
3550 if (!(uFlags & SWP_NOSIZE))
3551 {
3552 if (cx < 0) cx = 0;
3553 else if (cx > 32767) cx = 32767;
3554 if (cy < 0) cy = 0;
3555 else if (cy > 32767) cy = 32767;
3556 }
3557
3558 UserRefObjectCo(Window, &Ref);
3559 ret = co_WinPosSetWindowPos(Window, hWndInsertAfter, X, Y, cx, cy, uFlags);
3561
3562Exit:
3563 TRACE("Leave NtUserSetWindowPos, ret=%i\n", ret);
3564 UserLeave();
3565 return ret;
3566}
#define HWND_TOP
Definition: winuser.h:1207

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

◆ NtUserSetWindowRgn()

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

Definition at line 3572 of file winpos.c.

3576{
3577 HRGN hrgnCopy = NULL;
3578 PWND Window;
3580 INT Ret = 0;
3581
3582 TRACE("Enter NtUserSetWindowRgn\n");
3584
3585 if (!(Window = UserGetWindowObject(hWnd)) ||
3587 {
3588 goto Exit; // Return 0
3589 }
3590
3591 if (hRgn) // The region will be deleted in user32.
3592 {
3594 {
3595 hrgnCopy = NtGdiCreateRectRgn(0, 0, 0, 0);
3596 /* The coordinates of a window's window region are relative to the
3597 upper-left corner of the window, not the client area of the window. */
3598 NtGdiCombineRgn( hrgnCopy, hRgn, 0, RGN_COPY);
3599 }
3600 else
3601 goto Exit; // Return 0
3602 }
3603
3605 if (hrgnCopy)
3606 {
3607 Window->hrgnNewFrame = hrgnCopy; // Should be PSMWP->acvr->hrgnClip
3608 }
3609 else
3610 {
3611 Window->hrgnNewFrame = HRGN_WINDOW;
3612 }
3614 Ret = (INT)co_WinPosSetWindowPos(Window, HWND_TOP, 0, 0, 0, 0, bRedraw ? flags : (flags | SWP_NOREDRAW));
3615
3616Exit:
3617 TRACE("Leave NtUserSetWindowRgn, ret=%i\n", Ret);
3618 UserLeave();
3619 return Ret;
3620}
#define SWP_NOCLIENTSIZE
Definition: msg.h:29
#define SWP_NOCLIENTMOVE
Definition: msg.h:30
__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:1146
#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:85
#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:1765
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:939
#define ERROR_INVALID_FILTER_PROC
Definition: winerror.h:908
#define ERROR_HOOK_NEEDS_HMOD
Definition: winerror.h:909
#define ERROR_INVALID_HOOK_FILTER
Definition: winerror.h:907
#define ERROR_GLOBAL_ONLY_HOOK
Definition: winerror.h:910
#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_FOREGROUNDIDLE
Definition: winuser.h:41
#define WH_JOURNALRECORD
Definition: winuser.h:30
KAPC_STATE
Definition: ketypes.h:1409

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 1995 of file winsta.c.

2000{
2001 BOOL Ret = FALSE;
2003 PWINSTATION_OBJECT WindowStation = NULL;
2004 LUID luidUser;
2005
2007
2009 {
2011 goto Leave;
2012 }
2013
2014 /* Validate the window station */
2015 Status = IntValidateWindowStationHandle(hWindowStation,
2016 UserMode,
2017 0,
2018 &WindowStation,
2019 NULL);
2020 if (!NT_SUCCESS(Status))
2021 {
2022 goto Leave;
2023 }
2024
2025 /* Capture the user LUID */
2026 _SEH2_TRY
2027 {
2028 ProbeForRead(pluid, sizeof(LUID), 1);
2029 luidUser = *pluid;
2030 }
2032 {
2034 _SEH2_YIELD(goto Leave);
2035 }
2036 _SEH2_END;
2037
2038 /* Reset the window station user LUID */
2039 RtlZeroMemory(&WindowStation->luidUser, sizeof(LUID));
2040
2041 /* Reset the window station user SID */
2042 if (WindowStation->psidUser)
2043 {
2045 WindowStation->psidUser = NULL;
2046 }
2047
2048 /* Copy the new user SID if one has been provided */
2049 if (psid)
2050 {
2052 if (WindowStation->psidUser == NULL)
2053 {
2055 goto Leave;
2056 }
2057
2059 _SEH2_TRY
2060 {
2061 ProbeForRead(psid, size, 1);
2062 RtlCopyMemory(WindowStation->psidUser, psid, size);
2063 }
2065 {
2067 }
2068 _SEH2_END;
2069
2070 if (!NT_SUCCESS(Status))
2071 {
2073 WindowStation->psidUser = NULL;
2074 goto Leave;
2075 }
2076 }
2077
2078 /* Copy the new user LUID */
2079 WindowStation->luidUser = luidUser;
2080
2081 Ret = TRUE;
2082
2083Leave:
2084 if (WindowStation)
2085 ObDereferenceObject(WindowStation);
2086
2087 UserLeave();
2088 return Ret;
2089}
#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 4118 of file window.c.

4119{
4120 PWND Window;
4121 WORD OldValue;
4122 WORD Ret = 0;
4123
4124 TRACE("Enter NtUserSetWindowWord\n");
4126
4127 if (hWnd == IntGetDesktopWindow())
4128 {
4130 goto Exit; // Return 0
4131 }
4132
4134 {
4135 goto Exit; // Return 0
4136 }
4137
4138 switch (Index)
4139 {
4140 case GWL_ID:
4141 case GWL_HINSTANCE:
4142 case GWL_HWNDPARENT:
4144 goto Exit;
4145
4146 default:
4147 if (Index < 0)
4148 {
4150 goto Exit; // Return 0
4151 }
4152 }
4153
4154 if ((ULONG)Index > (Window->cbwndExtra - sizeof(WORD)))
4155 {
4157 goto Exit; // Return 0
4158 }
4159
4160 OldValue = *((WORD *)((PCHAR)(Window + 1) + Index));
4161 *((WORD *)((PCHAR)(Window + 1) + Index)) = NewValue;
4162
4163 Ret = OldValue;
4164
4165Exit:
4166 TRACE("Leave NtUserSetWindowWord, ret=%u\n", Ret);
4167 UserLeave();
4168 return Ret;
4169}
LONG FASTCALL co_UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
Definition: window.c:4020
#define ERROR_INVALID_INDEX
Definition: winerror.h:894
#define GWL_HINSTANCE
Definition: winuser.h:855
#define GWL_ID
Definition: winuser.h:859
#define GWL_HWNDPARENT
Definition: winuser.h:857

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:925
#define ERROR_DLL_NOT_FOUND
Definition: winerror.h:679

Referenced by SetWinEventHook().

◆ NtUserShowCaret()

BOOL NTAPI NtUserShowCaret ( HWND  hWnd)

Definition at line 424 of file caret.c.

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

Referenced by ShowCaret().

◆ NtUserShowScrollBar()

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

Definition at line 1370 of file scrollbar.c.

1371{
1372 PWND Window;
1373 DWORD ret = 0;
1375
1376 TRACE("Enter NtUserShowScrollBar\n");
1378
1380 if (Window)
1381 {
1382 UserRefObjectCo(Window, &Ref);
1383 ret = co_UserShowScrollBar(Window, nBar, (nBar == SB_VERT) ? 0 : bShow,
1384 (nBar == SB_HORZ) ? 0 : bShow);
1386 }
1387
1388 TRACE("Leave NtUserShowScrollBar, ret=%lu\n", ret);
1389 UserLeave();
1390 return ret;
1391}
DWORD FASTCALL co_UserShowScrollBar(PWND Wnd, int nBar, BOOL fShowH, BOOL fShowV)
Definition: scrollbar.c:852

Referenced by ShowScrollBar().

◆ NtUserShowWindow()

BOOL NTAPI NtUserShowWindow ( HWND  hWnd,
LONG  nCmdShow 
)

Definition at line 3789 of file winpos.c.

3790{
3791 PWND Window;
3792 BOOL ret = FALSE;
3794
3795 TRACE("Enter NtUserShowWindow hWnd %p SW_ %d\n",hWnd, nCmdShow);
3797
3798 if (!(Window = UserGetWindowObject(hWnd)) ||
3800 {
3801 goto Exit; // Return FALSE
3802 }
3803
3804 if ( nCmdShow > SW_MAX || Window->state2 & WNDS2_INDESTROY)
3805 {
3807 goto Exit; // Return FALSE
3808 }
3809
3810 UserRefObjectCo(Window, &Ref);
3811 ret = co_WinPosShowWindow(Window, nCmdShow);
3813
3814Exit:
3815 TRACE("Leave NtUserShowWindow, ret=%i\n", ret);
3816 UserLeave();
3817 return ret;
3818}

Referenced by ShowWindow().

◆ NtUserShowWindowAsync()

BOOL NTAPI NtUserShowWindowAsync ( HWND  hWnd,
LONG  nCmdShow 
)

Definition at line 3752 of file winpos.c.

3753{
3754 PWND Window;
3756 BOOL ret = FALSE;
3758
3759 TRACE("Enter NtUserShowWindowAsync\n");
3761
3762 if (!(Window = UserGetWindowObject(hWnd)) ||
3764 {
3765 goto Exit; // Return FALSE
3766 }
3767
3768 if ( nCmdShow > SW_MAX )
3769 {
3771 goto Exit; // Return FALSE
3772 }
3773
3774 UserRefObjectCo(Window, &Ref);
3777 if (Result != -1 && Result != 0) ret = TRUE;
3778
3779Exit:
3780 TRACE("Leave NtUserShowWindowAsync, ret=%i\n", ret);
3781 UserLeave();
3782 return ret;
3783}
@ 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 2936 of file desktop.c.

2937{
2938 PDESKTOP pdesk;
2940 BOOL bRedrawDesktop;
2941 BOOL Ret = FALSE;
2942
2944 TRACE("Enter NtUserSwitchDesktop(0x%p)\n", hdesk);
2945
2946 Status = IntValidateDesktopHandle(hdesk, UserMode, 0, &pdesk);
2947 if (!NT_SUCCESS(Status))
2948 {
2949 ERR("Validation of desktop handle 0x%p failed\n", hdesk);
2950 goto Exit; // Return FALSE
2951 }
2952
2953 if (PsGetCurrentProcessSessionId() != pdesk->rpwinstaParent->dwSessionId)
2954 {
2955 ObDereferenceObject(pdesk);
2956 ERR("NtUserSwitchDesktop called for a desktop of a different session\n");
2957 goto Exit; // Return FALSE
2958 }
2959
2960 if (pdesk == gpdeskInputDesktop)
2961 {
2962 ObDereferenceObject(pdesk);
2963 WARN("NtUserSwitchDesktop called for active desktop\n");
2964 Ret = TRUE;
2965 goto Exit;
2966 }
2967
2968 /*
2969 * Don't allow applications switch the desktop if it's locked, unless the caller
2970 * is the logon application itself
2971 */
2972 if ((pdesk->rpwinstaParent->Flags & WSS_LOCKED) &&
2974 {
2975 ObDereferenceObject(pdesk);
2976 ERR("Switching desktop 0x%p denied because the window station is locked!\n", hdesk);
2977 goto Exit; // Return FALSE
2978 }
2979
2980 if (pdesk->rpwinstaParent != InputWindowStation)
2981 {
2982 ObDereferenceObject(pdesk);
2983 ERR("Switching desktop 0x%p denied because desktop doesn't belong to the interactive winsta!\n", hdesk);
2984 goto Exit; // Return FALSE
2985 }
2986
2987 /* FIXME: Fail if the process is associated with a secured
2988 desktop such as Winlogon or Screen-Saver */
2989 /* FIXME: Connect to input device */
2990
2991 TRACE("Switching from desktop 0x%p to 0x%p\n", gpdeskInputDesktop, pdesk);
2992
2993 bRedrawDesktop = FALSE;
2994
2995 /* The first time SwitchDesktop is called, gpdeskInputDesktop is NULL */
2996 if (gpdeskInputDesktop != NULL)
2997 {
2999 bRedrawDesktop = TRUE;
3000
3001 /* Hide the previous desktop window */
3003 }
3004
3005 /* Set the active desktop in the desktop's window station. */
3007
3008 /* Set the global state. */
3009 gpdeskInputDesktop = pdesk;
3010
3011 /* Show the new desktop window */
3013
3014 TRACE("SwitchDesktop gpdeskInputDesktop 0x%p\n", gpdeskInputDesktop);
3015 ObDereferenceObject(pdesk);
3016
3017 Ret = TRUE;
3018
3019Exit:
3020 TRACE("Leave NtUserSwitchDesktop, ret=%i\n", Ret);
3021 UserLeave();
3022 return Ret;
3023}
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:1635
NTSTATUS FASTCALL co_IntShowDesktop(PDESKTOP Desktop, ULONG Width, ULONG Height, BOOL bRedraw)
Definition: desktop.c:1617
#define SM_CYSCREEN
Definition: winuser.h:960
#define SM_CXSCREEN
Definition: winuser.h:959

Referenced by SwitchDesktop().

◆ NtUserSystemParametersInfo()

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

Definition at line 2168 of file sysparams.c.

2173{
2174 BOOL bResult;
2175
2176 TRACE("Enter NtUserSystemParametersInfo(%u)\n", uiAction);
2178
2179 // FIXME: Get rid of the flags and only use this from um. kernel can access data directly.
2180 /* Set UM memory protection flag */
2181 fWinIni |= SPIF_PROTECT;
2182
2183 /* Call internal function */
2184 bResult = UserSystemParametersInfo(uiAction, uiParam, pvParam, fWinIni);
2185
2186 TRACE("Leave NtUserSystemParametersInfo, returning %d\n", bResult);
2187 UserLeave();
2188
2189 return bResult;
2190}
#define SPIF_PROTECT
Definition: sysparams.h:13
BOOL FASTCALL UserSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
Definition: sysparams.c:2105

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 6507 of file menu.c.

6510{
6511 PMENU Menu;
6512 BOOL Ret = FALSE;
6513
6514 TRACE("Enter NtUserThunkedMenuInfo\n");
6516
6517 Menu = UserGetMenuObject(hMenu);
6518 if (Menu)
6519 {
6520 Ret = UserMenuInfo(Menu, (PROSMENUINFO)lpcmi, TRUE);
6521 }
6522
6523 TRACE("Leave NtUserThunkedMenuInfo, ret=%i\n", Ret);
6524 UserLeave();
6525 return Ret;
6526}
BOOL FASTCALL UserMenuInfo(PMENU Menu, PROSMENUINFO UnsafeMenuInfo, BOOL SetOrGet)
Definition: menu.c:5166

Referenced by SetMenuInfo().

◆ NtUserThunkedMenuItemInfo()

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

Definition at line 6532 of file menu.c.

6539{
6540 PMENU Menu;
6542 UNICODE_STRING lstrCaption;
6543 BOOL Ret = FALSE;
6544
6545 TRACE("Enter NtUserThunkedMenuItemInfo\n");
6547
6548 /* lpszCaption may be NULL, check for it and call RtlInitUnicodeString()
6549 if bInsert == TRUE call UserInsertMenuItem() else UserSetMenuItemInfo() */
6550
6551 RtlInitEmptyUnicodeString(&lstrCaption, NULL, 0);
6552
6553 if (!(Menu = UserGetMenuObject(hMenu)))
6554 {
6555 goto Cleanup; // Return FALSE
6556 }
6557
6558 /* Check if we got a Caption */
6559 if (lpszCaption && lpszCaption->Buffer)
6560 {
6561 /* Copy the string to kernel mode */
6562 Status = ProbeAndCaptureUnicodeString( &lstrCaption,
6563 UserMode,
6564 lpszCaption);
6565 if (!NT_SUCCESS(Status))
6566 {
6567 ERR("Failed to capture MenuItem Caption (status 0x%08x)\n",Status);
6569 goto Cleanup; // Return FALSE
6570 }
6571 }
6572
6573 if (bInsert)
6574 {
6575 Ret = UserInsertMenuItem(Menu, uItem, fByPosition, lpmii, &lstrCaption);
6576 goto Cleanup;
6577 }
6578
6579 Ret = UserMenuItemInfo(Menu, uItem, fByPosition, (PROSMENUITEMINFO)lpmii, TRUE, &lstrCaption);
6580
6581Cleanup:
6582 if (lstrCaption.Buffer)
6583 {
6585 }
6586
6587 TRACE("Leave NtUserThunkedMenuItemInfo, ret=%i\n", Ret);
6588 UserLeave();
6589 return Ret;
6590}
static BOOL bInsert
Definition: cmdinput.c:121
DWORD FASTCALL UserInsertMenuItem(PMENU Menu, UINT uItem, BOOL fByPosition, LPCMENUITEMINFOW UnsafeItemInfo, PUNICODE_STRING lpstr)
Definition: menu.c:4923
BOOL FASTCALL UserMenuItemInfo(PMENU Menu, UINT Item, BOOL ByPosition, PROSMENUITEMINFO UnsafeItemInfo, BOOL SetOrGet, PUNICODE_STRING lpstr)
Definition: menu.c:5092

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 
)

Referenced by START_TEST(), and ToUnicodeEx().

◆ 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:4984
#define TME_LEAVE
Definition: commctrl.h:4981
#define TME_NONCLIENT
Definition: commctrl.h:4982
#define TME_QUERY
Definition: commctrl.h:4983
#define TME_HOVER
Definition: commctrl.h:4980
BOOL FASTCALL IntTrackMouseEvent(LPTRACKMOUSEEVENT lpEventTrack)
Definition: mouse.c:410
BOOL FASTCALL IntQueryTrackMouseEvent(LPTRACKMOUSEEVENT lpEventTrack)
Definition: mouse.c:375

◆ NtUserTrackPopupMenuEx()

BOOL NTAPI NtUserTrackPopupMenuEx ( HMENU  hmenu,
UINT  fuFlags,
int  x,
int  y,
HWND  hwnd,
LPTPMPARAMS  lptpm 
)

Definition at line 6596 of file menu.c.

6603{
6604 PMENU menu;
6605 PWND pWnd;
6606 TPMPARAMS tpm;
6607 BOOL Ret = FALSE;
6609
6610 TRACE("Enter NtUserTrackPopupMenuEx\n");
6612 /* Parameter check */
6613 if (!(menu = UserGetMenuObject( hMenu )))
6614 {
6615 ERR("TPME : Invalid Menu handle.\n");
6617 goto Exit;
6618 }
6619
6620 if (!(pWnd = UserGetWindowObject(hWnd)))
6621 {
6622 ERR("TPME : Invalid Window handle.\n");
6623 goto Exit;
6624 }
6625
6626 if (lptpm)
6627 {
6628 _SEH2_TRY
6629 {
6630 ProbeForRead(lptpm, sizeof(TPMPARAMS), sizeof(ULONG));
6631 tpm = *lptpm;
6632 }
6634 {
6635 _SEH2_YIELD(goto Exit);
6636 }
6637 _SEH2_END
6638 }
6639 UserRefObjectCo(pWnd, &Ref);
6640 Ret = IntTrackPopupMenuEx(menu, fuFlags, x, y, pWnd, lptpm ? &tpm : NULL);
6641 UserDerefObjectCo(pWnd);
6642
6643Exit:
6644 TRACE("Leave NtUserTrackPopupMenuEx, ret=%i\n",Ret);
6645 UserLeave();
6646 return Ret;
6647}
BOOL WINAPI IntTrackPopupMenuEx(PMENU menu, UINT wFlags, int x, int y, PWND pWnd, LPTPMPARAMS lpTpm)
Definition: menu.c:4549

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:1721
#define WM_CHAR
Definition: winuser.h:1717
#define WM_SYSKEYDOWN
Definition: winuser.h:1719

Referenced by TranslateAcceleratorW().

◆ NtUserTranslateMessage()

BOOL NTAPI NtUserTranslateMessage ( LPMSG  lpMsg,
UINT  flags 
)

Definition at line 2453 of file message.c.

2454{
2455 MSG SafeMsg;
2456 BOOL Ret;
2457 PWND pWnd;
2458
2459 _SEH2_TRY
2460 {
2461 ProbeForRead(lpMsg, sizeof(MSG), 1);
2462 RtlCopyMemory(&SafeMsg, lpMsg, sizeof(MSG));
2463 }
2465 {
2467 _SEH2_YIELD(return FALSE);
2468 }
2469 _SEH2_END;
2470
2472 pWnd = UserGetWindowObject(SafeMsg.hwnd);
2473 if (pWnd) // Must have a window!
2474 {
2475 Ret = IntTranslateKbdMessage(&SafeMsg, flags);
2476 }
2477 else
2478 {
2479 TRACE("No Window for Translate. hwnd 0x%p Msg %u\n", SafeMsg.hwnd, SafeMsg.message);
2480 Ret = FALSE;
2481 }
2482 UserLeave();
2483
2484 return Ret;
2485}
BOOL FASTCALL IntTranslateKbdMessage(LPMSG lpMsg, UINT flags)
Definition: keyboard.c:1276

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 1288 of file kbdlayout.c.

1290{
1291 BOOL ret;
1292 PWINSTATION_OBJECT pWinSta;
1293
1295
1297 ret = IntUnloadKeyboardLayout(pWinSta, hKl);
1298
1299 UserLeave();
1300 return ret;
1301}
static BOOL APIENTRY IntUnloadKeyboardLayout(_Inout_ PWINSTATION_OBJECT pWinSta, _In_ HKL hKL)
Definition: kbdlayout.c:890

Referenced by UnloadKeyboardLayout().

◆ NtUserUnlockWindowStation()

BOOL NTAPI NtUserUnlockWindowStation ( HWINSTA  hWindowStation)

Definition at line 1585 of file winsta.c.

1586{
1589 BOOL Ret;
1590
1591 TRACE("About to set process window station with handle (%p)\n",
1592 hWindowStation);
1593
1595 {
1596 ERR("Unauthorized process attempted to unlock the window station!\n");
1598 return FALSE;
1599 }
1600
1601 Status = IntValidateWindowStationHandle(hWindowStation,
1602 UserMode,
1603 0,
1604 &Object,
1605 NULL);
1606 if (!NT_SUCCESS(Status))
1607 {
1608 TRACE("Validation of window station handle (%p) failed\n",
1609 hWindowStation);
1611 return FALSE;
1612 }
1613
1614 Ret = (Object->Flags & WSS_LOCKED) == WSS_LOCKED;
1615 Object->Flags &= ~WSS_LOCKED;
1616
1618 return Ret;
1619}

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 591 of file hotkey.c.

592{
593 PHOT_KEY pHotKey = gphkFirst, phkNext, *pLink = &gphkFirst;
594 BOOL bRet = FALSE;
595 PWND pWnd = NULL;
596
597 TRACE("Enter NtUserUnregisterHotKey\n");
599
600 /* Fail if given window is invalid */
601 if (hWnd && !(pWnd = UserGetWindowObject(hWnd)))
602 goto cleanup;
603
604 while (pHotKey)
605 {
606 /* Save next ptr for later use */
607 phkNext = pHotKey->pNext;
608
609 /* Should we delete this hotkey? */
610 if (pHotKey->pWnd == pWnd && pHotKey->id == id)
611 {
612 /* Update next ptr for previous hotkey and free memory */
613 *pLink = phkNext;
615
616 bRet = TRUE;
617 }
618 else /* This hotkey will stay, use its next ptr */
619 pLink = &pHotKey->pNext;
620
621 /* Move to the next entry */
622 pHotKey = phkNext;
623 }
624
625cleanup:
626 TRACE("Leave NtUserUnregisterHotKey, ret=%i\n", bRet);
627 UserLeave();
628 return bRet;
629}

◆ 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 1762 of file ime.c.

1766{
1767 PIMC pIMC;
1768 BOOL ret = FALSE;
1769
1771
1772 if (!IS_IMM_MODE())
1773 {
1774 ERR("!IS_IMM_MODE()\n");
1775 goto Quit;
1776 }
1777
1779 if (!pIMC)
1780 goto Quit;
1781
1782 ret = UserUpdateInputContext(pIMC, dwType, dwValue);
1783
1784Quit:
1785 UserLeave();
1786 return ret;
1787}
BOOL FASTCALL UserUpdateInputContext(PIMC pIMC, DWORD dwType, DWORD_PTR dwValue)
Definition: ime.c:1729

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:2785
#define ULW_OPAQUE
Definition: winuser.h:2786
#define ULW_COLORKEY
Definition: winuser.h:2784
#define ULW_EX_NORESIZE
Definition: winuser.h:2787
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 375 of file sysparams.c.

378{
379 BOOL bResult;
380
381 TRACE("Enter NtUserUpdatePerUserSystemParameters\n");
383
385 if(bEnable)
387 else
389 bResult = TRUE;
390
391 TRACE("Leave NtUserUpdatePerUserSystemParameters, returning %d\n", bResult);
392 UserLeave();
393
394 return bResult;
395}
static const WCHAR * KEY_DESKTOP
Definition: sysparams.c:61
BOOL g_PaintDesktopVersion
Definition: sysparams.c:19
static VOID SpiUpdatePerUserSystemParameters(VOID)
Definition: sysparams.c:232
static INT SpiLoadDWord(PCWSTR pwszKey, PCWSTR pwszValue, INT iValue)
Definition: sysparams.c:108
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 792 of file object.c.

794{
795 UINT uType;
796 PPROCESSINFO ppi;
798 BOOL Ret = FALSE;
799
801
803 {
805 goto Exit; // Return FALSE
806 }
807 uType = entry->type;
808 switch (uType)
809 {
810 case TYPE_WINDOW:
812 ppi = ((PTHREADINFO)entry->pi)->ppi;
813 break;
814 case TYPE_MENU:
815 case TYPE_ACCELTABLE:
816 case TYPE_CURSOR:
817 case TYPE_HOOK:
818 case TYPE_CALLPROC:
820 ppi = entry->pi;
821 break;
822 default:
823 ppi = NULL;
824 break;
825 }
826
827 if (!ppi)
828 goto Exit; // Return FALSE
829
830 // Same process job returns TRUE.
831 if (gptiCurrent->ppi->pW32Job == ppi->pW32Job) Ret = TRUE;
832
833Exit:
834 UserLeave();
835 return Ret;
836}
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
uint32_t entry
Definition: isohybrid.c:63
PVOID pW32Job
Definition: win32.h:275
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 701 of file timer.c.

703{
704 BOOL Ret = FALSE;
705
707
709
710 UserLeave();
711 return Ret;
712}
BOOL FASTCALL ValidateTimerCallback(PTHREADINFO pti, LPARAM lParam)
Definition: timer.c:150

Referenced by DispatchMessageA(), and DispatchMessageW().

◆ NtUserVkKeyScanEx()

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

Definition at line 1709 of file keyboard.c.

1713{
1714 PKBDTABLES pKbdTbl;
1715 PVK_TO_WCHAR_TABLE pVkToWchTbl;
1716 PVK_TO_WCHARS10 pVkToWch;
1717 PKL pKl = NULL;
1718 DWORD i, dwModBits = 0, dwModNumber = 0, Ret = (DWORD)-1;
1719
1720 TRACE("NtUserVkKeyScanEx() wch %u, KbdLayout 0x%p\n", wch, dwhkl);
1722
1723 if (bUsehKL)
1724 {
1725 // Use given keyboard layout
1726 if (dwhkl)
1727 pKl = UserHklToKbl(dwhkl);
1728 }
1729 else
1730 {
1731 // Use thread keyboard layout
1732 pKl = ((PTHREADINFO)PsGetCurrentThreadWin32Thread())->KeyboardLayout;
1733 }
1734
1735 if (!pKl)
1736 goto Exit;
1737
1738 pKbdTbl = pKl->spkf->pKbdTbl;
1739
1740 // Interate through all VkToWchar tables while pVkToWchars is not NULL
1741 for (i = 0; pKbdTbl->pVkToWcharTable[i].pVkToWchars; i++)
1742 {
1743 pVkToWchTbl = &pKbdTbl->pVkToWcharTable[i];
1744 pVkToWch = (PVK_TO_WCHARS10)(pVkToWchTbl->pVkToWchars);
1745
1746 // Interate through all virtual keys
1747 while (pVkToWch->VirtualKey)
1748 {
1749 for (dwModNumber = 0; dwModNumber < pVkToWchTbl->nModifications; dwModNumber++)
1750 {
1751 if (pVkToWch->wch[dwModNumber] == wch)
1752 {
1753 dwModBits = pKbdTbl->pCharModifiers->ModNumber[dwModNumber];
1754 TRACE("i %lu wC %04x: dwModBits %08x dwModNumber %08x MaxModBits %08x\n",
1755 i, wch, dwModBits, dwModNumber, pKbdTbl->pCharModifiers->wMaxModBits);
1756 Ret = (dwModBits << 8) | (pVkToWch->VirtualKey & 0xFF);
1757 goto Exit;
1758 }
1759 }
1760 pVkToWch = (PVK_TO_WCHARS10)(((BYTE *)pVkToWch) + pVkToWchTbl->cbSize);
1761 }
1762 }
1763Exit:
1764 UserLeave();
1765 return Ret;
1766}
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 VkKeyScanExW(), and VkKeyScanW().

◆ NtUserWaitForInputIdle()

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

Definition at line 3060 of file message.c.

3063{
3065 PPROCESSINFO W32Process;
3066 PTHREADINFO pti;
3068 HANDLE Handles[3];
3071
3073
3077 UserMode,
3078 (PVOID*)&Process,
3079 NULL);
3080
3081 if (!NT_SUCCESS(Status))
3082 {
3083 UserLeave();
3085 return WAIT_FAILED;
3086 }
3087
3089
3090 W32Process = (PPROCESSINFO)Process->Win32Process;
3091
3093 !W32Process ||
3094 pti->ppi == W32Process)
3095 {
3097 UserLeave();
3099 return WAIT_FAILED;
3100 }
3101
3102 Handles[0] = Process;
3103 Handles[1] = W32Process->InputIdleEvent;
3104 Handles[2] = pti->pEventQueueServer; // IntMsqSetWakeMask returns hEventQueueClient
3105
3106 if (!Handles[1])
3107 {
3109 UserLeave();
3110 return STATUS_SUCCESS; /* no event to wait on */
3111 }
3112
3113 if (dwMilliseconds != INFINITE)
3114 Timeout.QuadPart = (LONGLONG) dwMilliseconds * (LONGLONG) -10000;
3115
3117 W32Process->W32PF_flags |= W32PF_WAITFORINPUTIDLE;
3118 for (pti = W32Process->ptiList; pti; pti = pti->ptiSibling)
3119 {
3121 pti->pClientInfo->dwTIFlags = pti->TIF_flags;
3122 }
3124
3125 TRACE("WFII: ppi %p\n", W32Process);
3126 TRACE("WFII: waiting for %p\n", Handles[1] );
3127
3128 /*
3129 * We must add a refcount to our current PROCESSINFO,
3130 * because anything could happen (including process death) we're leaving win32k
3131 */
3132 IntReferenceProcessInfo(W32Process);
3133
3134 do
3135 {
3136 UserLeave();
3138 Handles,
3139 WaitAny,
3141 UserMode,
3142 FALSE,
3143 dwMilliseconds == INFINITE ? NULL : &Timeout,
3144 NULL);
3146
3147 if (!NT_SUCCESS(Status))
3148 {
3151 goto WaitExit;
3152 }
3153
3154 switch (Status)
3155 {
3156 case STATUS_WAIT_0:
3157 goto WaitExit;
3158
3159 case STATUS_WAIT_2:
3160 {
3161 MSG Msg;
3162 co_IntGetPeekMessage( &Msg, 0, 0, 0, PM_REMOVE | PM_QS_SENDMESSAGE, FALSE);
3163 ERR("WFII: WAIT 2\n");
3164 }
3165 break;
3166
3167 case STATUS_TIMEOUT:
3168 ERR("WFII: timeout\n");
3169 case WAIT_FAILED:
3170 goto WaitExit;
3171
3172 default:
3173 ERR("WFII: finished\n");
3175 goto WaitExit;
3176 }
3177 }
3178 while (TRUE);
3179
3180WaitExit:
3182 for (pti = W32Process->ptiList; pti; pti = pti->ptiSibling)
3183 {
3184 pti->TIF_flags &= ~TIF_WAITFORINPUTIDLE;
3185 pti->pClientInfo->dwTIFlags = pti->TIF_flags;
3186 }
3187 W32Process->W32PF_flags &= ~W32PF_WAITFORINPUTIDLE;
3189
3190 IntDereferenceProcessInfo(W32Process);
3192 UserLeave();
3193 return Status;
3194}
#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_TIMEOUT
Definition: ntstatus.h:81
#define STATUS_WAIT_0
Definition: ntstatus.h:237
#define STATUS_WAIT_2
Definition: ntstatus.h:72
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:181
#define W32PF_WAITFORINPUTIDLE
Definition: win32.h:22
#define IntDereferenceProcessInfo(ppi)
Definition: win32.h:186
#define INFINITE
Definition: message.c:3055
#define WAIT_FAILED
Definition: message.c:3056
@ UserRequest
Definition: ketypes.h:421

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 2283 of file message.c.

2284{
2285 BOOL ret;
2286
2288 TRACE("NtUserWaitMessage Enter\n");
2289 ret = co_IntWaitMessage(NULL, 0, 0);
2290 TRACE("NtUserWaitMessage Leave\n");
2291 UserLeave();
2292
2293 return ret;
2294}

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 3825 of file winpos.c.

3826{
3827 POINT pt;
3828 HWND Ret = NULL;
3830 USHORT hittest;
3832
3833 TRACE("Enter NtUserWindowFromPoint\n");
3835
3837 {
3838 //PTHREADINFO pti;
3839
3840 pt.x = X;
3841 pt.y = Y;
3842
3843 // Hmm... Threads live on desktops thus we have a reference on the desktop and indirectly the desktop window.
3844 // It is possible this referencing is useless, though it should not hurt...
3846
3847 //pti = PsGetCurrentThreadWin32Thread();
3849 if (Window)
3850 {
3851 Ret = UserHMGetHandle(Window);
3852 }
3853
3855 }
3856
3857 TRACE("Leave NtUserWindowFromPoint, ret=%p\n", Ret);
3858 UserLeave();
3859 return Ret;
3860}
#define X(b, s)
PWND APIENTRY co_WinPosWindowFromPoint(IN PWND ScopeWin, IN POINT *WinPoint, IN OUT USHORT *HitTest, IN BOOL Ignore)
Definition: winpos.c:2933
Implementation of the Explorer desktop window.
Definition: desktop.h:52

Referenced by WindowFromPoint().

◆ NtUserYieldTask()

DWORD NTAPI NtUserYieldTask ( VOID  )

Definition at line 384 of file ntstubs.c.

385{
386 STUB
387
388 return 0;
389}

◆ 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}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define CHAR(Char)
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1910
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1909
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}

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: xmlstorage.h:182

Referenced by NtUserDefSetText().

Variable Documentation

◆ bInternal

◆ IconInfo

◆ lpInstName

Definition at line 2295 of file ntuser.h.

◆ lpResName

Definition at line 2296 of file ntuser.h.

Referenced by _Success_().

◆ pbpp