ReactOS 0.4.17-dev-1321-g5c122a9
user_x.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define STATIC_UISTATE_GWL_OFFSET   (sizeof(HFONT)+sizeof(HICON))
 
#define UserHasDlgFrameStyle(Style, ExStyle)
 
#define UserHasThickFrameStyle(Style, ExStyle)
 
#define UserHasThinFrameStyle(Style, ExStyle)    (((Style) & WS_BORDER) || (!((Style) & (WS_CHILD | WS_POPUP))))
 
#define WIN_GetFullHandle(h)   ((HWND)(h))
 
#define HOOKID_TO_FLAG(HookId)   (1 << ((HookId) + 1))
 
#define ISITHOOKED(HookId)
 
#define ARRAY_SIZE(x)   (sizeof(x) / sizeof((x)[0]))
 
#define NtUserReleaseDC(HWND, HDC)   NtUserxReleaseDC((HDC))
 
#define NtUserReleaseCapture()   NtUserxReleaseCapture()
 
#define NtUserKillSystemTimer(HWND, ID)   NtUserxKillSystemTimer((HWND), (ID))
 
#define NtUserSetSystemTimer(HWND, ID, TIMEOUT)   NtUserSetSystemTimer((HWND), (ID), (TIMEOUT), NULL)
 
#define NtUserEnableWindow(HWND, ENABLE)   NtUserxEnableWindow((HWND), (ENABLE))
 
#define NtUserArrangeIconicWindows(HWND)   NtUserxArrangeIconicWindows((HWND))
 
#define NtUserDrawMenuBar(HWND)   NtUserxDrawMenuBar((HWND))
 
#define NtUserGetWindowSysSubMenu(HWND)   GetSubMenu(GetMenu((HWND)), 0)
 
#define NtUserGetPrivateData(HWND, OFFSET, SIZE)   GetWindowLongPtrW((HWND), (OFFSET))
 
#define NtUserSetPrivateData(HWND, OFFSET, SIZE, VALUE)   SetWindowLongPtrW((HWND), (OFFSET), (VALUE))
 
#define NtUserGetMDIClientInfo(HWND)   (MDICLIENTINFO *)GetWindowLongPtr((HWND), GWLP_MDIWND)
 
#define NtUserSetMDIClientInfo(HWND, INFO)   SetWindowLongPtr((HWND), GWLP_MDIWND, (LONG_PTR)(INFO))
 
#define NTUSER_WNDPROC_BUTTON   FNID_BUTTON
 
#define NTUSER_WNDPROC_LISTBOX   FNID_LISTBOX
 
#define NTUSER_WNDPROC_STATIC   FNID_STATIC
 
#define NTUSER_WNDPROC_EDIT   FNID_EDIT
 
#define NTUSER_WNDPROC_MDICLIENT   FNID_MDICLIENT
 
#define MAKE_FNID(index)   (index)
 

Functions

static __inline PVOID SharedPtrToUser (PVOID Ptr)
 
static __inline PVOID DesktopPtrToUser (PVOID Ptr)
 
static __inline BOOL IsThreadHooked (PCLIENTINFO pci)
 
static __inline PDESKTOPINFO GetThreadDesktopInfo (VOID)
 
static __inline BOOL IsCallProcHandle (IN WNDPROC lpWndProc)
 
static __inline BOOL STATIC_update_uistate (HWND hwnd, BOOL unicode)
 
static __inline void LoadUserApiHook ()
 
DWORD FASTCALL get_input_codepage (void)
 

Macro Definition Documentation

◆ ARRAY_SIZE

#define ARRAY_SIZE (   x)    (sizeof(x) / sizeof((x)[0]))

Definition at line 116 of file user_x.h.

◆ HOOKID_TO_FLAG

#define HOOKID_TO_FLAG (   HookId)    (1 << ((HookId) + 1))

Definition at line 110 of file user_x.h.

◆ ISITHOOKED

#define ISITHOOKED (   HookId)
Value:
(GetWin32ClientInfo()->fsHooks & HOOKID_TO_FLAG(HookId) ||\
(GetWin32ClientInfo()->pDeskInfo && GetWin32ClientInfo()->pDeskInfo->fsHooks & HOOKID_TO_FLAG(HookId)))
#define GetWin32ClientInfo()
Definition: ntuser.h:356
#define HOOKID_TO_FLAG(HookId)
Definition: user_x.h:110

Definition at line 111 of file user_x.h.

◆ MAKE_FNID

#define MAKE_FNID (   index)    (index)

Definition at line 143 of file user_x.h.

◆ NTUSER_WNDPROC_BUTTON

#define NTUSER_WNDPROC_BUTTON   FNID_BUTTON

Definition at line 137 of file user_x.h.

◆ NTUSER_WNDPROC_EDIT

#define NTUSER_WNDPROC_EDIT   FNID_EDIT

Definition at line 140 of file user_x.h.

◆ NTUSER_WNDPROC_LISTBOX

#define NTUSER_WNDPROC_LISTBOX   FNID_LISTBOX

Definition at line 138 of file user_x.h.

◆ NTUSER_WNDPROC_MDICLIENT

#define NTUSER_WNDPROC_MDICLIENT   FNID_MDICLIENT

Definition at line 141 of file user_x.h.

◆ NTUSER_WNDPROC_STATIC

#define NTUSER_WNDPROC_STATIC   FNID_STATIC

Definition at line 139 of file user_x.h.

◆ NtUserArrangeIconicWindows

#define NtUserArrangeIconicWindows (   HWND)    NtUserxArrangeIconicWindows((HWND))

Definition at line 125 of file user_x.h.

◆ NtUserDrawMenuBar

#define NtUserDrawMenuBar (   HWND)    NtUserxDrawMenuBar((HWND))

Definition at line 126 of file user_x.h.

◆ NtUserEnableWindow

#define NtUserEnableWindow (   HWND,
  ENABLE 
)    NtUserxEnableWindow((HWND), (ENABLE))

Definition at line 124 of file user_x.h.

◆ NtUserGetMDIClientInfo

#define NtUserGetMDIClientInfo (   HWND)    (MDICLIENTINFO *)GetWindowLongPtr((HWND), GWLP_MDIWND)

Definition at line 133 of file user_x.h.

◆ NtUserGetPrivateData

#define NtUserGetPrivateData (   HWND,
  OFFSET,
  SIZE 
)    GetWindowLongPtrW((HWND), (OFFSET))

Definition at line 131 of file user_x.h.

◆ NtUserGetWindowSysSubMenu

#define NtUserGetWindowSysSubMenu (   HWND)    GetSubMenu(GetMenu((HWND)), 0)

Definition at line 128 of file user_x.h.

◆ NtUserKillSystemTimer

#define NtUserKillSystemTimer (   HWND,
  ID 
)    NtUserxKillSystemTimer((HWND), (ID))

Definition at line 122 of file user_x.h.

◆ NtUserReleaseCapture

#define NtUserReleaseCapture ( )    NtUserxReleaseCapture()

Definition at line 121 of file user_x.h.

◆ NtUserReleaseDC

#define NtUserReleaseDC (   HWND,
  HDC 
)    NtUserxReleaseDC((HDC))

Definition at line 120 of file user_x.h.

◆ NtUserSetMDIClientInfo

#define NtUserSetMDIClientInfo (   HWND,
  INFO 
)    SetWindowLongPtr((HWND), GWLP_MDIWND, (LONG_PTR)(INFO))

Definition at line 134 of file user_x.h.

◆ NtUserSetPrivateData

#define NtUserSetPrivateData (   HWND,
  OFFSET,
  SIZE,
  VALUE 
)    SetWindowLongPtrW((HWND), (OFFSET), (VALUE))

Definition at line 132 of file user_x.h.

◆ NtUserSetSystemTimer

#define NtUserSetSystemTimer (   HWND,
  ID,
  TIMEOUT 
)    NtUserSetSystemTimer((HWND), (ID), (TIMEOUT), NULL)

Definition at line 123 of file user_x.h.

◆ STATIC_UISTATE_GWL_OFFSET

#define STATIC_UISTATE_GWL_OFFSET   (sizeof(HFONT)+sizeof(HICON))

Definition at line 62 of file user_x.h.

◆ UserHasDlgFrameStyle

#define UserHasDlgFrameStyle (   Style,
  ExStyle 
)
Value:
(((Style) & WS_DLGFRAME) && (!((Style) & WS_THICKFRAME))))
const DWORD Style
Definition: appswitch.c:72
const DWORD ExStyle
Definition: appswitch.c:73
#define WS_EX_DLGMODALFRAME
Definition: pedump.c:645
#define WS_DLGFRAME
Definition: pedump.c:626
#define WS_THICKFRAME
Definition: pedump.c:630

Definition at line 96 of file user_x.h.

◆ UserHasThickFrameStyle

#define UserHasThickFrameStyle (   Style,
  ExStyle 
)
Value:
(((Style) & WS_THICKFRAME) && \
#define WS_BORDER
Definition: pedump.c:625

Definition at line 100 of file user_x.h.

◆ UserHasThinFrameStyle

#define UserHasThinFrameStyle (   Style,
  ExStyle 
)     (((Style) & WS_BORDER) || (!((Style) & (WS_CHILD | WS_POPUP))))

Definition at line 104 of file user_x.h.

◆ WIN_GetFullHandle

#define WIN_GetFullHandle (   h)    ((HWND)(h))

Definition at line 108 of file user_x.h.

Function Documentation

◆ DesktopPtrToUser()

static __inline PVOID DesktopPtrToUser ( PVOID  Ptr)
static

Definition at line 12 of file user_x.h.

13{
14 PCLIENTINFO pci;
17 pci = GetWin32ClientInfo();
18 pdi = pci->pDeskInfo;
19
20 ASSERT(Ptr != NULL);
21 ASSERT(pdi != NULL);
22 if ((ULONG_PTR)Ptr >= (ULONG_PTR)pdi->pvDesktopBase &&
23 (ULONG_PTR)Ptr < (ULONG_PTR)pdi->pvDesktopLimit)
24 {
25 return (PVOID)((ULONG_PTR)Ptr - pci->ulClientDelta);
26 }
27 else
28 {
29 /* NOTE: This is slow as it requires a call to win32k. This should only be
30 neccessary if a thread wants to access an object on a different
31 desktop */
33 }
34}
#define NULL
Definition: types.h:112
#define ULONG_PTR
Definition: config.h:101
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
struct _THREADINFO * GetW32ThreadInfo(VOID)
Definition: misc.c:806
#define ASSERT(a)
Definition: mode.c:44
EXTINLINE PVOID NtUserxGetDesktopMapping(PVOID ptr)
Definition: ntwrapper.h:806
ULONG_PTR ulClientDelta
Definition: ntuser.h:330
PDESKTOPINFO pDeskInfo
Definition: ntuser.h:329
uint32_t ULONG_PTR
Definition: typedefs.h:65
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO * pdi
Definition: winddi.h:3554

◆ get_input_codepage()

DWORD FASTCALL get_input_codepage ( void  )

Definition at line 253 of file message.c.

254{
255 DWORD cp;
256 int ret;
258 ret = GetLocaleInfoW( LOWORD(hkl), LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER, (WCHAR *)&cp, sizeof(cp) / sizeof(WCHAR) );
259 if (!ret) cp = CP_ACP;
260 return cp;
261}
#define CP_ACP
Definition: compat.h:109
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: locale.c:1675
return ret
Definition: mutex.c:147
unsigned long DWORD
Definition: ntddk_ex.h:95
POINT cp
Definition: magnifier.c:59
HKL hkl
Definition: msctf.idl:632
UINT_PTR HKL
Definition: msctf.idl:125
#define LOWORD(l)
Definition: pedump.c:82
short WCHAR
Definition: pedump.c:58
HKL WINAPI GetKeyboardLayout(_In_ DWORD)
#define LOCALE_IDEFAULTANSICODEPAGE
Definition: winnls.h:48

Referenced by map_wparam_char_WtoA(), and MsgiUnicodeToAnsiMessage().

◆ GetThreadDesktopInfo()

static __inline PDESKTOPINFO GetThreadDesktopInfo ( VOID  )
static

Definition at line 43 of file user_x.h.

44{
46 PDESKTOPINFO di = NULL;
47
49 if (ti != NULL)
50 di = GetWin32ClientInfo()->pDeskInfo;
51
52 return di;
53}
SYMCRYPT_MAGIC_FIELD SYMCRYPT_ASYM_ALIGN union @5444 ti

Referenced by GetShellWindow(), GetThreadDesktopWnd(), and User32DefWindowProc().

◆ IsCallProcHandle()

static __inline BOOL IsCallProcHandle ( IN WNDPROC  lpWndProc)
static

Definition at line 56 of file user_x.h.

57{
58 /* FIXME - check for 64 bit architectures... */
59 return ((ULONG_PTR)lpWndProc & 0xFFFF0000) == 0xFFFF0000;
60}

◆ IsThreadHooked()

static __inline BOOL IsThreadHooked ( PCLIENTINFO  pci)
static

Definition at line 37 of file user_x.h.

38{
39 return (pci->fsHooks|pci->pDeskInfo->fsHooks) != 0;
40}
ULONG fsHooks
Definition: ntuser.h:332
DWORD fsHooks
Definition: ntuser.h:141

◆ LoadUserApiHook()

static __inline void LoadUserApiHook ( )
static

Definition at line 85 of file user_x.h.

86{
87 if (!gfServerProcess &&
91 {
93 }
94}
BOOLEAN NTAPI RtlIsThreadWithinLoaderCallout(VOID)
Definition: libsupp.c:358
PSERVERINFO gpsi
Definition: imm.c:18
DWORD_PTR NTAPI NtUserCallNoParam(DWORD Routine)
Definition: simplecall.c:59
@ NOPARAM_ROUTINE_LOADUSERAPIHOOK
Definition: ntuser.h:1547
#define SRVINFO_APIHOOK
Definition: ntuser.h:957
DWORD dwSRVIFlags
Definition: ntuser.h:1058
BOOLEAN gfServerProcess
Definition: dllmain.c:35
BOOL FASTCALL IsInsideUserApiHook(VOID)
Definition: usrapihk.c:98

Referenced by AdjustWindowRectEx(), DefWindowProcA(), DefWindowProcW(), DrawCaption(), DrawFrameControl(), EnableScrollBar(), GetScrollInfo(), GetSystemMetrics(), MDIRedrawFrame(), SetScrollInfo(), SetWindowRgn(), SystemParametersInfoA(), and SystemParametersInfoW().

◆ SharedPtrToUser()

static __inline PVOID SharedPtrToUser ( PVOID  Ptr)
static

Definition at line 4 of file user_x.h.

5{
6 ASSERT(Ptr != NULL);
9}
SHAREDINFO gSharedInfo
Definition: imm.c:19
ULONG_PTR ulSharedDelta
Definition: ntuser.h:1140

Referenced by ClientThreadSetupHelper(), Init(), IntGetClassLongA(), IntGetClassLongW(), IntGetProp(), ValidateHandle(), and ValidateHandleNoErr().

◆ STATIC_update_uistate()

static __inline BOOL STATIC_update_uistate ( HWND  hwnd,
BOOL  unicode 
)
static

Definition at line 65 of file user_x.h.

66{
67 LONG flags, prevflags;
68
69 if (unicode)
70 flags = DefWindowProcW(hwnd, WM_QUERYUISTATE, 0, 0);
71 else
72 flags = DefWindowProcA(hwnd, WM_QUERYUISTATE, 0, 0);
73
75
76 if (prevflags != flags)
77 {
79 return TRUE;
80 }
81
82 return FALSE;
83}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
GLbitfield flags
Definition: glext.h:7161
long LONG
Definition: pedump.c:60
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define STATIC_UISTATE_GWL_OFFSET
Definition: user_x.h:62
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by StaticWndProc_common().