ReactOS  0.4.14-dev-50-g13bb5e2
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)
 

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 ()
 

Macro Definition Documentation

◆ 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:320
#define HOOKID_TO_FLAG(HookId)
Definition: user_x.h:110

Definition at line 111 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))))
#define WS_THICKFRAME
Definition: pedump.c:630
#define WS_DLGFRAME
Definition: pedump.c:626
#define WS_EX_DLGMODALFRAME
Definition: pedump.c:645
const DWORD Style
Definition: appswitch.c:71
const DWORD ExStyle
Definition: appswitch.c:72

Definition at line 96 of file user_x.h.

◆ UserHasThickFrameStyle

#define UserHasThickFrameStyle (   Style,
  ExStyle 
)
Value:
(((Style) & WS_THICKFRAME) && \
#define WS_THICKFRAME
Definition: pedump.c:630
#define WS_DLGFRAME
Definition: pedump.c:626
const DWORD Style
Definition: appswitch.c:71
#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 }
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
#define GetWin32ClientInfo()
Definition: ntuser.h:320
struct _THREADINFO * GetW32ThreadInfo(VOID)
Definition: misc.c:781
uint32_t ULONG_PTR
Definition: typedefs.h:63
smooth NULL
Definition: ftsmooth.c:416
ULONG_PTR ulClientDelta
Definition: ntuser.h:294
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
PDESKTOPINFO pDeskInfo
Definition: ntuser.h:293
#define ULONG_PTR
Definition: config.h:101
EXTINLINE PVOID NtUserxGetDesktopMapping(PVOID ptr)
Definition: ntwrapper.h:806
_In_ LPWSTR _In_ ULONG _In_ ULONG _In_ ULONG _Out_ DEVINFO * pdi
Definition: winddi.h:3553

Referenced by CallNextHookEx(), GetAncestor(), GetClassLongA(), GetClassLongW(), GetClassWord(), GetLastActivePopup(), GetMenuItemInfo_common(), GetMenuState(), GetMenuStringA(), GetMenuStringW(), GetParent(), GetSubMenu(), GetThreadDesktopWnd(), GetWindow(), GetWindowInfo(), IntCallMessageProc(), IntFindChildWindowToOwner(), IntGetMenuDefaultItem(), IntGetSBData(), IntGetWndProc(), IntScrollGetScrollBarRect(), IsChild(), IsWindowVisible(), MENU_FindItem(), RealDefWindowProcA(), RealDefWindowProcW(), User32DefWindowProc(), ValidateHandle(), and ValidateHandleNoErr().

◆ GetThreadDesktopInfo()

static __inline PDESKTOPINFO GetThreadDesktopInfo ( VOID  )
static

Definition at line 43 of file user_x.h.

44 {
45  PTHREADINFO ti;
46  PDESKTOPINFO di = NULL;
47 
48  ti = GetW32ThreadInfo();
49  if (ti != NULL)
50  di = GetWin32ClientInfo()->pDeskInfo;
51 
52  return di;
53 }
#define GetWin32ClientInfo()
Definition: ntuser.h:320
struct _THREADINFO * GetW32ThreadInfo(VOID)
Definition: misc.c:781
smooth NULL
Definition: ftsmooth.c:416

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 }
uint32_t ULONG_PTR
Definition: typedefs.h:63

◆ 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:296
DWORD fsHooks
Definition: ntuser.h:137
PDESKTOPINFO pDeskInfo
Definition: ntuser.h:293

◆ LoadUserApiHook()

static __inline void LoadUserApiHook ( )
static

Definition at line 85 of file user_x.h.

86 {
87  if (!gfServerProcess &&
88  !IsInsideUserApiHook() &&
91  {
93  }
94 }
PSERVERINFO gpsi
Definition: main.c:27
BOOLEAN gfServerProcess
Definition: dllmain.c:36
DWORD dwSRVIFlags
Definition: ntuser.h:1004
BOOL FASTCALL IsInsideUserApiHook(VOID)
Definition: usrapihk.c:98
#define SRVINFO_APIHOOK
Definition: ntuser.h:911
DWORD_PTR NTAPI NtUserCallNoParam(DWORD Routine)
Definition: simplecall.c:59
BOOLEAN NTAPI RtlIsThreadWithinLoaderCallout(VOID)
Definition: libsupp.c:348

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);
8  return (PVOID)((ULONG_PTR)Ptr - g_ulSharedDelta);
9 }
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
ULONG_PTR g_ulSharedDelta
Definition: dllmain.c:34
smooth NULL
Definition: ftsmooth.c:416
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define ULONG_PTR
Definition: config.h:101

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 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
long LONG
Definition: pedump.c:60
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
GLbitfield flags
Definition: glext.h:7161
#define STATIC_UISTATE_GWL_OFFSET
Definition: user_x.h:62
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by StaticWndProc_common().