ReactOS  0.4.12-dev-934-g9a4676f
user32p.h File Reference
#include "controls.h"
#include "dde_private.h"
#include "regcontrol.h"
#include "resource.h"
#include "ntwrapper.h"
Include dependency graph for user32p.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Imm32ApiTable
 

Macros

#define user32_module   User32Instance
 
#define IS_ATOM(x)   (((ULONG_PTR)(x) > 0x0) && ((ULONG_PTR)(x) < 0x10000))
 
#define SPY_DISPATCHMESSAGE   0x0101
 
#define SPY_SENDMESSAGE   0x0103
 
#define SPY_DEFWNDPROC   0x0105
 
#define SPY_RESULT_OK   0x0001
 
#define SPY_RESULT_INVALIDHWND   0x0003
 
#define SPY_RESULT_DEFWND   0x0005
 

Functions

BOOL WINAPI GdiDllInitialize (HANDLE, DWORD, LPVOID)
 
LONG WINAPI GdiGetCharDimensions (HDC, LPTEXTMETRICW, LONG *)
 
const charSPY_GetMsgName (UINT msg, HWND hWnd)
 
const charSPY_GetVKeyName (WPARAM wParam)
 
void SPY_EnterMessage (INT iFlag, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
void SPY_ExitMessage (INT iFlag, HWND hwnd, UINT msg, LRESULT lReturn, WPARAM wParam, LPARAM lParam)
 
BOOL FASTCALL BeginIfHookedUserApiHook (VOID)
 
BOOL FASTCALL EndUserApiHook (VOID)
 
BOOL FASTCALL IsInsideUserApiHook (VOID)
 
VOID FASTCALL ResetUserApiHook (PUSERAPIHOOK)
 
BOOL FASTCALL IsMsgOverride (UINT, PUAHOWP)
 
BOOL WINAPI InitUserApiHook (HINSTANCE hInstance, USERAPIHOOKPROC pfn)
 
BOOL WINAPI ClearUserApiHook (HINSTANCE hInstance)
 
BOOL FASTCALL MessageInit (VOID)
 
VOID FASTCALL MessageCleanup (VOID)
 
VOID WINAPI UserSetLastError (IN DWORD dwErrCode)
 
VOID WINAPI UserSetLastNTError (IN NTSTATUS Status)
 
PCALLPROCDATA FASTCALL ValidateCallProc (HANDLE hCallProc)
 
PWND FASTCALL ValidateHwnd (HWND hwnd)
 
PWND FASTCALL ValidateHwndOrDesk (HWND hwnd)
 
PWND FASTCALL GetThreadDesktopWnd (VOID)
 
PVOID FASTCALL ValidateHandleNoErr (HANDLE handle, UINT uType)
 
PWND FASTCALL ValidateHwndNoErr (HWND hwnd)
 
BOOL FASTCALL TestWindowProcess (PWND)
 
PVOID FASTCALL ValidateHandle (HANDLE, UINT)
 
BOOL MenuInit (VOID)
 
VOID MenuCleanup (VOID)
 
UINT MenuDrawMenuBar (HDC hDC, LPRECT Rect, HWND hWnd, BOOL Draw)
 
VOID MenuTrackMouseMenuBar (HWND hWnd, ULONG Ht, POINT Pt)
 
VOID MenuTrackKbdMenuBar (HWND hWnd, UINT wParam, WCHAR wChar)
 
VOID FASTCALL Logon (BOOL IsLogon)
 
void mirror_rect (const RECT *window_rect, RECT *rect)
 
BOOL FASTCALL DefSetText (HWND hWnd, PCWSTR String, BOOL Ansi)
 
VOID FASTCALL ScrollTrackScrollBar (HWND Wnd, INT SBType, POINT Pt)
 
HCURSOR CursorIconToCursor (HICON hIcon, BOOL SemiTransparent)
 
BOOL get_icon_size (HICON hIcon, SIZE *size)
 
VOID FASTCALL IntNotifyWinEvent (DWORD, HWND, LONG, LONG, DWORD)
 
UINT WINAPI WinPosGetMinMaxInfo (HWND hWnd, POINT *MaxSize, POINT *MaxPos, POINT *MinTrack, POINT *MaxTrack)
 
VOID UserGetWindowBorders (DWORD, DWORD, SIZE *, BOOL)
 
VOID FASTCALL GetConnected (VOID)
 
BOOL FASTCALL EnumNamesA (HWINSTA WindowStation, NAMEENUMPROCA EnumFunc, LPARAM Context, BOOL Desktops)
 
BOOL FASTCALL EnumNamesW (HWINSTA WindowStation, NAMEENUMPROCW EnumFunc, LPARAM Context, BOOL Desktops)
 
BOOL UserDrawSysMenuButton (HWND hWnd, HDC hDC, LPRECT, BOOL down)
 
HWNDWIN_ListChildren (HWND hWndparent)
 
VOID DeleteFrameBrushes (VOID)
 
BOOL WINAPI GdiValidateHandle (HGDIOBJ)
 
HANDLE FASTCALL UserGetProp (HWND hWnd, ATOM Atom, BOOLEAN SystemProp)
 
BOOL WINAPI InitializeImmEntryTable (VOID)
 
BOOL WINAPI UpdatePerUserImmEnabling (VOID)
 

Variables

HINSTANCE User32Instance
 
PPROCESSINFO g_ppi
 
ULONG_PTR g_ulSharedDelta
 
PSERVERINFO gpsi
 
SHAREDINFO gSharedInfo
 
BOOLEAN gfLogonProcess
 
BOOLEAN gfServerProcess
 
PUSER_HANDLE_TABLE gHandleTable
 
PUSER_HANDLE_ENTRY gHandleEntries
 
CRITICAL_SECTION U32AccelCacheLock
 
HINSTANCE ghImm32
 
RTL_CRITICAL_SECTION gcsUserApiHook
 
USERAPIHOOK guah
 
HINSTANCE ghmodUserApiHook
 
HICON hIconSmWindows
 
HICON hIconWindows
 
Imm32ApiTable gImmApiEntries
 

Macro Definition Documentation

◆ IS_ATOM

#define IS_ATOM (   x)    (((ULONG_PTR)(x) > 0x0) && ((ULONG_PTR)(x) < 0x10000))

Definition at line 64 of file user32p.h.

◆ SPY_DEFWNDPROC

#define SPY_DEFWNDPROC   0x0105

Definition at line 75 of file user32p.h.

◆ SPY_DISPATCHMESSAGE

#define SPY_DISPATCHMESSAGE   0x0101

Definition at line 73 of file user32p.h.

◆ SPY_RESULT_DEFWND

#define SPY_RESULT_DEFWND   0x0005

Definition at line 78 of file user32p.h.

◆ SPY_RESULT_INVALIDHWND

#define SPY_RESULT_INVALIDHWND   0x0003

Definition at line 77 of file user32p.h.

◆ SPY_RESULT_OK

#define SPY_RESULT_OK   0x0001

Definition at line 76 of file user32p.h.

◆ SPY_SENDMESSAGE

#define SPY_SENDMESSAGE   0x0103

Definition at line 74 of file user32p.h.

◆ user32_module

#define user32_module   User32Instance

Definition at line 47 of file user32p.h.

Function Documentation

◆ BeginIfHookedUserApiHook()

BOOL FASTCALL BeginIfHookedUserApiHook ( VOID  )

Definition at line 106 of file usrapihk.c.

107 {
109  if (IsInsideUserApiHook()) return TRUE;
110 
112  return FALSE;
113 }
#define TRUE
Definition: types.h:120
LONG gcCallUserApiHook
Definition: usrapihk.c:35
BOOL FASTCALL IsInsideUserApiHook(VOID)
Definition: usrapihk.c:98
#define InterlockedDecrement
Definition: armddk.h:52
#define InterlockedIncrement
Definition: armddk.h:53

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

◆ ClearUserApiHook()

BOOL WINAPI ClearUserApiHook ( HINSTANCE  hInstance)

Definition at line 193 of file usrapihk.c.

194 {
196  USERAPIHOOKPROC pfn = NULL, pfn1 = NULL;
197 
200  if ( ghmodUserApiHook == hInstance )
201  {
202  pfn1 = gpfnInitUserApi;
203  if ( --gcLoadUserApiHook == 0 )
204  {
205  gfUserApiHook = 0;
207  if ( gcCallUserApiHook )
208  {
209  hInstance = NULL;
210  pfn1 = NULL;
211  pfn = gpfnInitUserApi;
212  gcLoadUserApiHook = 1;
213  }
214  else
215  {
216  hInstance = hModule;
219  }
220  }
221  }
223 
224  if ( pfn )
225  {
226  pfn(uahShutdown, 0); // Shutdown.
227 
229  pfn1 = gpfnInitUserApi;
230 
231  if ( --gcLoadUserApiHook == 0 )
232  {
233  if ( gcCallUserApiHook )
234  {
235  hInstance = NULL;
236  pfn1 = NULL;
237  }
238  else
239  {
243  }
244  }
246  }
247 
248  if ( pfn1 ) pfn1(uahStop, 0);
249 
250  return hInstance != 0;
251 }
VOID FASTCALL ResetUserApiHook(PUSERAPIHOOK puah)
Definition: usrapihk.c:131
HINSTANCE ghmodUserApiHook
Definition: usrapihk.c:37
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
LONG gcCallUserApiHook
Definition: usrapihk.c:35
BOOL(CALLBACK * USERAPIHOOKPROC)(UAPIHK State, PUSERAPIHOOK puah)
Definition: undocuser.h:362
HINSTANCE hInstance
Definition: charmap.c:20
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
smooth NULL
Definition: ftsmooth.c:416
DWORD gcLoadUserApiHook
Definition: usrapihk.c:34
USERAPIHOOK guah
Definition: usrapihk.c:344
RTL_CRITICAL_SECTION gcsUserApiHook
Definition: usrapihk.c:39
USERAPIHOOKPROC gpfnInitUserApi
Definition: usrapihk.c:38
DWORD gfUserApiHook
Definition: usrapihk.c:36
HMODULE hModule
Definition: animate.c:44

Referenced by ClientLoadLibrary().

◆ CursorIconToCursor()

HCURSOR CursorIconToCursor ( HICON  hIcon,
BOOL  SemiTransparent 
)

Definition at line 79 of file cursoricon.c.

80 {
82  return NULL;
83 }
smooth NULL
Definition: ftsmooth.c:416
#define UNIMPLEMENTED
Definition: debug.h:114

◆ DefSetText()

BOOL FASTCALL DefSetText ( HWND  hWnd,
PCWSTR  String,
BOOL  Ansi 
)

Definition at line 64 of file defwnd.c.

65 {
66  BOOL Ret;
67  LARGE_STRING lsString;
68 
69  if ( String )
70  {
71  if ( Ansi )
73  else
75  }
76  Ret = NtUserDefSetText(hWnd, (String ? &lsString : NULL));
77 
78  return Ret;
79 }
VOID NTAPI RtlInitLargeUnicodeString(IN OUT PLARGE_UNICODE_STRING, IN PCWSTR, IN INT)
Definition: rtlstr.c:42
CONST char * PCSZ
Definition: umtypes.h:125
HWND hWnd
Definition: settings.c:17
static WCHAR String[]
Definition: stringtable.c:55
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
VOID NTAPI RtlInitLargeAnsiString(IN OUT PLARGE_ANSI_STRING, IN PCSZ, IN INT)
Definition: rtlstr.c:17
BOOL NTAPI NtUserDefSetText(HWND WindowHandle, PLARGE_STRING WindowText)
Definition: window.c:4230

Referenced by IntDefWindowProc(), RealDefWindowProcA(), and RealDefWindowProcW().

◆ DeleteFrameBrushes()

VOID DeleteFrameBrushes ( VOID  )

Definition at line 71 of file paint.c.

72 {
73  unsigned Brush;
74 
75  for (Brush = 0; Brush < sizeof(FrameBrushes) / sizeof(HBRUSH); Brush++)
76  {
77  if (NULL != FrameBrushes[Brush])
78  {
81  }
82  }
83  if (NULL != hHatch)
84  {
86  hHatch = NULL;
87  }
88 }
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
void Brush(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, LONG style)
Definition: drawing.cpp:160
smooth NULL
Definition: ftsmooth.c:416
static HBRUSH FrameBrushes[13]
Definition: paint.c:32
static HBITMAP hHatch
Definition: paint.c:33

Referenced by Cleanup().

◆ EndUserApiHook()

BOOL FASTCALL EndUserApiHook ( VOID  )

Definition at line 164 of file usrapihk.c.

165 {
167  USERAPIHOOKPROC pfn;
168  BOOL Ret = FALSE;
169 
171  {
172  if ( !gcLoadUserApiHook )
173  {
175 
176  pfn = gpfnInitUserApi;
180 
182 
183  if ( pfn ) Ret = pfn(uahStop, 0);
184 
185  if ( hModule ) Ret = FreeLibrary(hModule);
186  }
187  }
188  return Ret;
189 }
HINSTANCE ghmodUserApiHook
Definition: usrapihk.c:37
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
LONG gcCallUserApiHook
Definition: usrapihk.c:35
BOOL(CALLBACK * USERAPIHOOKPROC)(UAPIHK State, PUSERAPIHOOK puah)
Definition: undocuser.h:362
unsigned int BOOL
Definition: ntddk_ex.h:94
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
smooth NULL
Definition: ftsmooth.c:416
#define FreeLibrary(x)
Definition: compat.h:405
#define InterlockedDecrement
Definition: armddk.h:52
DWORD gcLoadUserApiHook
Definition: usrapihk.c:34
RTL_CRITICAL_SECTION gcsUserApiHook
Definition: usrapihk.c:39
USERAPIHOOKPROC gpfnInitUserApi
Definition: usrapihk.c:38
HMODULE hModule
Definition: animate.c:44

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

◆ EnumNamesA()

BOOL FASTCALL EnumNamesA ( HWINSTA  WindowStation,
NAMEENUMPROCA  EnumFunc,
LPARAM  Context,
BOOL  Desktops 
)

Definition at line 273 of file winsta.c.

277 {
278  ENUMNAMESASCIICONTEXT PrivateContext;
279 
280  PrivateContext.UserEnumFunc = EnumFunc;
281  PrivateContext.UserContext = Context;
282 
283  return EnumNamesW(WindowStation, EnumNamesCallback, (LPARAM) &PrivateContext, Desktops);
284 }
BOOL CALLBACK EnumNamesCallback(LPWSTR Name, LPARAM Param)
Definition: winsta.c:211
LONG_PTR LPARAM
Definition: windef.h:208
static BOOL CALLBACK EnumFunc(_In_ HWND hWnd, _In_ PCWSTR lpszString, _In_ HANDLE hData)
Definition: SetProp.c:15
BOOL FASTCALL EnumNamesW(HWINSTA WindowStation, NAMEENUMPROCW EnumFunc, LPARAM Context, BOOL Desktops)
Definition: winsta.c:130
struct tagContext Context
Definition: acpixf.h:1012
NAMEENUMPROCA UserEnumFunc
Definition: winsta.c:201

Referenced by EnumDesktopsA(), and EnumWindowStationsA().

◆ EnumNamesW()

BOOL FASTCALL EnumNamesW ( HWINSTA  WindowStation,
NAMEENUMPROCW  EnumFunc,
LPARAM  Context,
BOOL  Desktops 
)

Definition at line 130 of file winsta.c.

134 {
135  CHAR Buffer[256];
136  PVOID NameList;
137  PWCHAR Name;
140  ULONG CurrentEntry, EntryCount;
141  BOOL Ret;
142 
143  /* Check parameters */
144  if (WindowStation == NULL && Desktops)
145  {
146  WindowStation = GetProcessWindowStation();
147  }
148 
149  /* Try with fixed-size buffer */
150  Status = NtUserBuildNameList(WindowStation, sizeof(Buffer), Buffer, &RequiredSize);
151  if (NT_SUCCESS(Status))
152  {
153  /* Fixed-size buffer is large enough */
154  NameList = (PWCHAR) Buffer;
155  }
156  else if (Status == STATUS_BUFFER_TOO_SMALL)
157  {
158  /* Allocate a larger buffer */
159  NameList = HeapAlloc(GetProcessHeap(), 0, RequiredSize);
160  if (NameList == NULL)
161  return FALSE;
162 
163  /* Try again */
164  Status = NtUserBuildNameList(WindowStation, RequiredSize, NameList, NULL);
165  if (!NT_SUCCESS(Status))
166  {
167  HeapFree(GetProcessHeap(), 0, NameList);
169  return FALSE;
170  }
171  }
172  else
173  {
174  /* Some unrecognized error occured */
176  return FALSE;
177  }
178 
179  /* Enum the names one by one */
180  EntryCount = *((DWORD *) NameList);
181  Name = (PWCHAR) ((PCHAR) NameList + sizeof(DWORD));
182  Ret = TRUE;
183  for (CurrentEntry = 0; CurrentEntry < EntryCount && Ret; ++CurrentEntry)
184  {
185  Ret = (*EnumFunc)(Name, Context);
186  Name += wcslen(Name) + 1;
187  }
188 
189  /* Cleanup */
190  if (NameList != Buffer)
191  {
192  HeapFree(GetProcessHeap(), 0, NameList);
193  }
194 
195  return Ret;
196 }
signed char * PCHAR
Definition: retypes.h:7
#define TRUE
Definition: types.h:120
NTSTATUS APIENTRY NtUserBuildNameList(HWINSTA hWindowStation, ULONG dwSize, PVOID lpBuffer, PULONG pRequiredSize)
Definition: winsta.c:1901
char CHAR
Definition: xmlstorage.h:175
LONG NTSTATUS
Definition: precomp.h:26
uint16_t * PWCHAR
Definition: typedefs.h:54
#define DWORD
Definition: nt_native.h:44
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:64
unsigned int BOOL
Definition: ntddk_ex.h:94
struct NameRec_ * Name
Definition: cdprocs.h:464
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
_Inout_ PRTL_BUFFER _In_ SIZE_T RequiredSize
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:409
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
HWINSTA WINAPI GetProcessWindowStation(void)
Definition: ntwrapper.h:124
struct tagContext Context
Definition: acpixf.h:1012
unsigned int ULONG
Definition: retypes.h:1
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by EnumDesktopsW(), EnumNamesA(), and EnumWindowStationsW().

◆ GdiDllInitialize()

BOOL WINAPI GdiDllInitialize ( HANDLE  ,
DWORD  ,
LPVOID   
)

Definition at line 71 of file dllmain.c.

75 {
76  switch (dwReason)
77  {
78  case DLL_PROCESS_ATTACH:
79  {
80  /* Don't bother us for each thread */
81  // DisableThreadLibraryCalls(hDll);
82 
83  /* Initialize the kernel part of GDI first */
84  if (!NtGdiInit()) return FALSE;
85 
86  /* Now initialize ourselves */
88  break;
89  }
90 
91  case DLL_THREAD_ATTACH:
92  {
93  NtCurrentTeb()->GdiTebBatch.Offset = 0;
94  NtCurrentTeb()->GdiBatchCount = 0;
95  break;
96  }
97 
98  case DLL_PROCESS_DETACH:
99  {
100  /* Cleanup */
102  return TRUE;
103  }
104 
105  default:
106  return FALSE;
107  }
108 
109  /* Very simple, the list will fill itself as it is needed */
110  if (!SetStockObjects)
111  {
112  RtlZeroMemory(&stock_objects, NB_STOCK_OBJECTS); // Assume ROS is dirty
114  }
115 
116  return TRUE;
117 }
#define TRUE
Definition: types.h:120
__kernel_entry W32KAPI BOOL APIENTRY NtGdiInit(VOID)
Definition: init.c:85
#define NB_STOCK_OBJECTS
Definition: ntgdityp.h:189
VOID WINAPI GdiProcessShutdown(VOID)
Definition: dllmain.c:59
#define DLL_THREAD_ATTACH
Definition: compat.h:121
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
DWORD dwReason
Definition: misc.cpp:154
VOID WINAPI GdiProcessSetup(VOID)
Definition: dllmain.c:41
#define DLL_PROCESS_DETACH
Definition: compat.h:119
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
BOOL SetStockObjects
Definition: dllmain.c:8
HGDIOBJ stock_objects[]
Definition: gdiobj.c:6

Referenced by DllMain().

◆ GdiGetCharDimensions()

LONG WINAPI GdiGetCharDimensions ( HDC  ,
LPTEXTMETRICW  ,
LONG  
)

Definition at line 2008 of file font.c.

2009 {
2010  SIZE sz;
2011  TEXTMETRICW tm;
2012  static const WCHAR alphabet[] =
2013  {
2014  'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q',
2015  'r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H',
2016  'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',0
2017  };
2018 
2019  if(!GetTextMetricsW(hdc, &tm)) return 0;
2020 
2021  if(!GetTextExtentPointW(hdc, alphabet, 52, &sz)) return 0;
2022 
2023  if (lptm) *lptm = tm;
2024  if (height) *height = tm.tmHeight;
2025 
2026  return (sz.cx / 26 + 1) / 2;
2027 }
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
LONG cx
Definition: windef.h:319
__wchar_t WCHAR
Definition: xmlstorage.h:180
HDC hdc
Definition: main.c:9
Definition: time.h:76
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
static LPTEXTMETRICW lptm
Definition: font.c:42
BOOL WINAPI GetTextExtentPointW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE lpsz)

◆ GdiValidateHandle()

BOOL WINAPI GdiValidateHandle ( HGDIOBJ  )

Definition at line 712 of file misc.c.

713 {
715  if ( (Entry->Type & GDI_ENTRY_BASETYPE_MASK) != 0 &&
717  GDI_HANDLE_GET_TYPE(hobj) )
718  {
719  HANDLE pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1);
720  if(pid == NULL || pid == CurrentProcessId)
721  {
722  return TRUE;
723  }
724  }
725  return FALSE;
726 
727 }
#define GDI_HANDLE_GET_INDEX(h)
Definition: gdi.h:28
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3835
#define TRUE
Definition: types.h:120
uint32_t ULONG_PTR
Definition: typedefs.h:63
#define GDI_ENTRY_BASETYPE_MASK
Definition: ntgdihdl.h:34
PGDI_TABLE_ENTRY GdiHandleTable
Definition: misc.c:33
smooth NULL
Definition: ftsmooth.c:416
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
HANDLE CurrentProcessId
Definition: misc.c:35
PVOID HANDLE
Definition: typedefs.h:71
Definition: gdi.h:1
#define GDI_ENTRY_UPPER_SHIFT
Definition: ntgdihdl.h:35
#define GDI_HANDLE_TYPE_MASK
Definition: gdi.h:17
base of all file and directory entries
Definition: entries.h:82

◆ get_icon_size()

BOOL get_icon_size ( HICON  hIcon,
SIZE size 
)

Definition at line 74 of file cursoricon.c.

75 {
76  return NtUserGetIconSize(hIcon, 0, &size->cx, &size->cy);
77 }
GLsizeiptr size
Definition: glext.h:5919
BOOL APIENTRY NtUserGetIconSize(HANDLE hCurIcon, UINT istepIfAniCur, PLONG plcx, PLONG plcy)
Definition: cursoricon.c:586
HICON hIcon
Definition: msconfig.c:44

◆ GetConnected()

VOID FASTCALL GetConnected ( VOID  )

◆ GetThreadDesktopWnd()

PWND FASTCALL GetThreadDesktopWnd ( VOID  )

Definition at line 407 of file misc.c.

408 {
410  if (Wnd != NULL)
411  Wnd = DesktopPtrToUser(Wnd);
412  return Wnd;
413 }
static __inline PVOID DesktopPtrToUser(PVOID Ptr)
Definition: user_x.h:12
smooth NULL
Definition: ftsmooth.c:416
struct _WND * spwnd
Definition: ntuser.h:136
Definition: ntuser.h:657
static __inline PDESKTOPINFO GetThreadDesktopInfo(VOID)
Definition: user_x.h:43

Referenced by GetDesktopWindow(), IsChild(), and ValidateHwndOrDesk().

◆ InitializeImmEntryTable()

BOOL WINAPI InitializeImmEntryTable ( VOID  )

Definition at line 183 of file imm.c.

184 {
187 }
#define TRUE
Definition: types.h:120
BOOL WINAPI IntInitializeImmEntryTable(VOID)
Definition: imm.c:64
BOOL bImmInitializing
Definition: imm.c:23

Referenced by DllMain().

◆ InitUserApiHook()

BOOL WINAPI InitUserApiHook ( HINSTANCE  hInstance,
USERAPIHOOKPROC  pfn 
)

Definition at line 255 of file usrapihk.c.

256 {
257  USERAPIHOOK uah;
258 
259  ResetUserApiHook(&uah);
260 
262 
263  if (!pfn(uahLoadInit,&uah) || // Swap data, User32 to and Uxtheme from!
265  uah.size <= 0 )
266  {
268  return FALSE;
269  }
270 
271  if ( ghmodUserApiHook )
272  {
273  if ( ghmodUserApiHook != hInstance )
274  {
276  pfn(uahStop, 0);
277  return FALSE;
278  }
280  }
281  else
282  {
284  // Do not over write GetRealWindowOwner.
285  RtlCopyMemory(&guah, &uah, sizeof(USERAPIHOOK) - sizeof(LONG));
286  gpfnInitUserApi = pfn;
287  gcLoadUserApiHook = 1;
288  gfUserApiHook = 1;
289  // Copy Message Masks
291  &uah.DefWndProcArray,
293  sizeof(grgbDwpLiteHookMsg));
294 
296  &uah.WndProcArray,
298  sizeof(grgbWndLiteHookMsg));
299 
301  &uah.DlgProcArray,
303  sizeof(grgbDlgLiteHookMsg));
304  }
306  return TRUE;
307 }
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
VOID FASTCALL ResetUserApiHook(PUSERAPIHOOK puah)
Definition: usrapihk.c:131
UAHOWP DlgProcArray
Definition: undocuser.h:344
HINSTANCE ghmodUserApiHook
Definition: usrapihk.c:37
VOID FASTCALL CopyMsgMask(PUAHOWP Dest, PUAHOWP Src, PVOID hkmsg, DWORD Size)
Definition: usrapihk.c:76
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
HINSTANCE hInstance
Definition: charmap.c:20
long LONG
Definition: pedump.c:60
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
UAHOWP DefWndProcArray
Definition: undocuser.h:333
FORCERESETUSERAPIHOOK ForceResetUserApiHook
Definition: undocuser.h:348
DWORD gcLoadUserApiHook
Definition: usrapihk.c:34
BYTE grgbDlgLiteHookMsg[128]
Definition: usrapihk.c:43
UAHOWP WndProcArray
Definition: undocuser.h:341
USERAPIHOOK guah
Definition: usrapihk.c:344
BOOL WINAPI ForceResetUserApiHook(HINSTANCE hInstance)
Definition: usrapihk.c:117
BYTE grgbWndLiteHookMsg[128]
Definition: usrapihk.c:42
BYTE grgbDwpLiteHookMsg[128]
Definition: usrapihk.c:41
RTL_CRITICAL_SECTION gcsUserApiHook
Definition: usrapihk.c:39
USERAPIHOOKPROC gpfnInitUserApi
Definition: usrapihk.c:38
DWORD gfUserApiHook
Definition: usrapihk.c:36

Referenced by ClientLoadLibrary().

◆ IntNotifyWinEvent()

VOID FASTCALL IntNotifyWinEvent ( DWORD  ,
HWND  ,
LONG  ,
LONG  ,
DWORD   
)

Definition at line 113 of file hook.c.

120 {
121  NOTIFYEVENT ne;
122  ne.event = event;
123  ne.idObject = idObject;
124  ne.idChild = idChild;
125  ne.flags = flags;
128 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
PSERVERINFO gpsi
Definition: main.c:27
EXTINLINE VOID NtUserxNotifyWinEvent(HWND hWnd, PVOID ne)
Definition: ntwrapper.h:721
GLbitfield flags
Definition: glext.h:7161
static DWORD FASTCALL GetMaskFromEvent(DWORD Event)
Definition: hook.c:46
struct _cl_event * event
Definition: glext.h:7739
DWORD dwInstalledEventHooks
Definition: ntuser.h:1024

◆ IsInsideUserApiHook()

BOOL FASTCALL IsInsideUserApiHook ( VOID  )

Definition at line 98 of file usrapihk.c.

99 {
100  if ( ghmodUserApiHook && gfUserApiHook ) return TRUE;
101  return FALSE;
102 }
#define TRUE
Definition: types.h:120
HINSTANCE ghmodUserApiHook
Definition: usrapihk.c:37
DWORD gfUserApiHook
Definition: usrapihk.c:36

Referenced by BeginIfHookedUserApiHook(), and LoadUserApiHook().

◆ IsMsgOverride()

BOOL FASTCALL IsMsgOverride ( UINT  ,
PUAHOWP   
)

Definition at line 63 of file usrapihk.c.

64 {
65  UINT nMsg = Msg / 8; // Group Indexed, (Msg 1024) / 8 = (0 -> 127) bytes Max
66 
67  if ( puaowpOverride && nMsg < puaowpOverride->Size )
68  {
69  return (puaowpOverride->MsgBitArray[nMsg] & (1 << (Msg & WM_SETFOCUS)));
70  }
71  return FALSE;
72 }
struct @1567 Msg[]
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
unsigned int UINT
Definition: ndis.h:50
#define WM_SETFOCUS
Definition: winuser.h:1595

Referenced by DefWindowProcA(), DefWindowProcW(), IntCallWindowProcA(), and IntCallWindowProcW().

◆ Logon()

VOID FASTCALL Logon ( BOOL  IsLogon)

Definition at line 74 of file logon.c.

75 {
76  USER_API_MESSAGE ApiMessage;
77  PUSER_LOGON LogonRequest = &ApiMessage.Data.LogonRequest;
78 
79  LogonRequest->IsLogon = IsLogon;
81  NULL,
83  sizeof(*LogonRequest));
84 }
#define USERSRV_SERVERDLL_INDEX
Definition: winmsg.h:15
BOOL IsLogon
Definition: winmsg.h:65
NTSTATUS NTAPI CsrClientCallServer(IN OUT PCSR_API_MESSAGE ApiMessage, IN OUT PCSR_CAPTURE_BUFFER CaptureBuffer OPTIONAL, IN CSR_API_NUMBER ApiNumber, IN ULONG DataLength)
Definition: connect.c:360
USER_LOGON LogonRequest
Definition: winmsg.h:102
smooth NULL
Definition: ftsmooth.c:416
#define CSR_CREATE_API_NUMBER(ServerId, ApiId)
Definition: csrmsg.h:37
union _USER_API_MESSAGE::@3382 Data

Referenced by SetWindowStationUser().

◆ MenuCleanup()

VOID MenuCleanup ( VOID  )

Definition at line 649 of file menu.c.

650 {
651 }

Referenced by Cleanup().

◆ MenuDrawMenuBar()

UINT MenuDrawMenuBar ( HDC  hDC,
LPRECT  Rect,
HWND  hWnd,
BOOL  Draw 
)

◆ MenuInit()

BOOL MenuInit ( VOID  )

Definition at line 363 of file menu.c.

364 {
365  NONCLIENTMETRICSW ncm;
366 
367  /* get the menu font */
368  if (!ghMenuFont || !ghMenuFontBold)
369  {
370  ncm.cbSize = sizeof(ncm);
371  if(!UserSystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, 0))
372  {
373  ERR("MenuInit(): SystemParametersInfo(SPI_GETNONCLIENTMETRICS) failed!\n");
374  return FALSE;
375  }
376 
377  ghMenuFont = GreCreateFontIndirectW(&ncm.lfMenuFont);
378  if (ghMenuFont == NULL)
379  {
380  ERR("MenuInit(): CreateFontIndirectW(hMenuFont) failed!\n");
381  return FALSE;
382  }
383  ncm.lfMenuFont.lfWeight = max(ncm.lfMenuFont.lfWeight + 300, 1000);
384  ghMenuFontBold = GreCreateFontIndirectW(&ncm.lfMenuFont);
385  if (ghMenuFontBold == NULL)
386  {
387  ERR("MenuInit(): CreateFontIndirectW(hMenuFontBold) failed!\n");
389  ghMenuFont = NULL;
390  return FALSE;
391  }
392 
395 
396  co_IntSetupOBM();
397  }
398 
399  return TRUE;
400 }
BOOL NTAPI GreSetObjectOwner(HGDIOBJ hobj, ULONG ulOwner)
Definition: gdiobj.c:1250
#define max(a, b)
Definition: svc.c:63
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
Definition: gdiobj.c:1153
#define TRUE
Definition: types.h:120
HFONT ghMenuFont
Definition: menu.c:14
VOID FASTCALL co_IntSetupOBM(VOID)
Definition: callback.c:1169
smooth NULL
Definition: ftsmooth.c:416
HFONT FASTCALL GreCreateFontIndirectW(LOGFONTW *lplf)
Definition: font.c:23
#define ERR(fmt,...)
Definition: debug.h:109
#define GDI_OBJ_HMGR_PUBLIC
Definition: ntgdihdl.h:116
HFONT ghMenuFontBold
Definition: menu.c:15
BOOL FASTCALL UserSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
Definition: sysparams.c:2059

Referenced by ClientThreadSetupHelper(), and co_IntInitializeDesktopGraphics().

◆ MenuTrackKbdMenuBar()

VOID MenuTrackKbdMenuBar ( HWND  hWnd,
UINT  wParam,
WCHAR  wChar 
)

◆ MenuTrackMouseMenuBar()

VOID MenuTrackMouseMenuBar ( HWND  hWnd,
ULONG  Ht,
POINT  Pt 
)

◆ MessageCleanup()

VOID FASTCALL MessageCleanup ( VOID  )

Definition at line 3281 of file message.c.

3282 {
3285 }
CRITICAL_SECTION gcsMPH
Definition: message.c:3065
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
static CRITICAL_SECTION DdeCrst
Definition: message.c:177

Referenced by Cleanup(), and ClientThreadSetupHelper().

◆ MessageInit()

BOOL FASTCALL MessageInit ( VOID  )

Definition at line 3273 of file message.c.

3274 {
3277 
3278  return TRUE;
3279 }
CRITICAL_SECTION gcsMPH
Definition: message.c:3065
#define TRUE
Definition: types.h:120
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:697
static CRITICAL_SECTION DdeCrst
Definition: message.c:177

Referenced by ClientThreadSetupHelper().

◆ mirror_rect()

void mirror_rect ( const RECT window_rect,
RECT rect 
)

Definition at line 15 of file winpos.c.

16 {
17  int width = window_rect->right - window_rect->left;
18  int tmp = rect->left;
19  rect->left = width - rect->right;
20  rect->right = width - tmp;
21 }
GLint GLint GLsizei width
Definition: gl.h:1546
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
& rect
Definition: startmenu.cpp:1413

◆ ResetUserApiHook()

VOID FASTCALL ResetUserApiHook ( PUSERAPIHOOK  )

Definition at line 131 of file usrapihk.c.

132 {
133  // Setup Structure.....
134  puah->size = sizeof(USERAPIHOOK);
135  puah->DefWindowProcA = RealDefWindowProcA;
136  puah->DefWindowProcW = RealDefWindowProcW;
137  puah->DefWndProcArray.MsgBitArray = NULL;
138  puah->DefWndProcArray.Size = 0;
139  puah->GetScrollInfo = RealGetScrollInfo;
140  puah->SetScrollInfo = RealSetScrollInfo;
141  puah->EnableScrollBar = NtUserEnableScrollBar;
142  puah->AdjustWindowRectEx = RealAdjustWindowRectEx;
143  puah->SetWindowRgn = NtUserSetWindowRgn;
144  puah->PreWndProc = DefaultOWP;
145  puah->PostWndProc = DefaultOWP;
146  puah->WndProcArray.MsgBitArray = NULL;
147  puah->WndProcArray.Size = 0;
148  puah->PreDefDlgProc = DefaultOWP;
149  puah->PostDefDlgProc = DefaultOWP;
150  puah->DlgProcArray.MsgBitArray = NULL;
151  puah->DlgProcArray.Size = 0;
152  puah->GetSystemMetrics = RealGetSystemMetrics;
153  puah->SystemParametersInfoA = RealSystemParametersInfoA;
154  puah->SystemParametersInfoW = RealSystemParametersInfoW;
155  puah->ForceResetUserApiHook = ForceResetUserApiHook;
156  puah->DrawFrameControl = RealDrawFrameControl;
157  puah->DrawCaption = RealUserDrawCaption;
158  puah->MDIRedrawFrame = RealMDIRedrawFrame;
159  puah->GetRealWindowOwner = GetRealWindowOwner;
160 }
struct tagUSERAPIHOOK USERAPIHOOK
BOOL WINAPI RealMDIRedrawFrame(HWND, DWORD)
Definition: usrapihk.c:311
BOOL WINAPI RealSystemParametersInfoW(UINT, UINT, PVOID, UINT)
Definition: desktop.c:341
BOOL WINAPI RealUserDrawCaption(HWND hWnd, HDC hDC, LPCRECT lpRc, UINT uFlags)
Definition: nonclient.c:80
BOOL NTAPI NtUserEnableScrollBar(HWND hWnd, UINT wSBflags, UINT wArrows)
Definition: scrollbar.c:1282
INT WINAPI RealSetScrollInfo(HWND, int, LPCSCROLLINFO, BOOL)
Definition: scrollbar.c:1625
smooth NULL
Definition: ftsmooth.c:416
LRESULT WINAPI DefaultOWP(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR lResult, PDWORD pData)
Definition: usrapihk.c:52
BOOL WINAPI RealGetScrollInfo(HWND, INT, LPSCROLLINFO)
Definition: scrollbar.c:1472
BOOL WINAPI RealAdjustWindowRectEx(LPRECT, DWORD, BOOL, DWORD)
Definition: nonclient.c:90
BOOL WINAPI RealDrawFrameControl(HDC, LPRECT, UINT, UINT)
Definition: draw.c:1415
int WINAPI RealGetSystemMetrics(int)
Definition: desktop.c:128
BOOL WINAPI ForceResetUserApiHook(HINSTANCE hInstance)
Definition: usrapihk.c:117
BOOL WINAPI RealSystemParametersInfoA(UINT, UINT, PVOID, UINT)
Definition: desktop.c:180
DWORD WINAPI GetRealWindowOwner(HWND)
Definition: window.c:1881
LRESULT WINAPI RealDefWindowProcA(HWND, UINT, WPARAM, LPARAM)
Definition: defwnd.c:806
LRESULT WINAPI RealDefWindowProcW(HWND, UINT, WPARAM, LPARAM)
Definition: defwnd.c:1014
INT NTAPI NtUserSetWindowRgn(HWND hWnd, HRGN hRgn, BOOL bRedraw)
Definition: winpos.c:3398

Referenced by ClearUserApiHook(), ForceResetUserApiHook(), and InitUserApiHook().

◆ ScrollTrackScrollBar()

VOID FASTCALL ScrollTrackScrollBar ( HWND  Wnd,
INT  SBType,
POINT  Pt 
)

Definition at line 1115 of file scrollbar.c.

1116 {
1117  MSG Msg;
1118  UINT XOffset = 0, YOffset = 0;
1119 
1120  if (SBType != SB_CTL)
1121  { // Used with CMD mouse tracking.
1122  PWND pwnd = ValidateHwnd(Wnd);
1123  if (!pwnd) return;
1124  XOffset = pwnd->rcClient.left - pwnd->rcWindow.left;
1125  YOffset = pwnd->rcClient.top - pwnd->rcWindow.top;
1126 // RECT rect;
1127 // WIN_GetRectangles( Wnd, COORDS_CLIENT, &rect, NULL );
1128  ScreenToClient(Wnd, &Pt);
1129 // Pt.x -= rect.left;
1130 // Pt.y -= rect.top;
1131  Pt.x += XOffset;
1132  Pt.y += YOffset;
1133  }
1134 
1135  IntScrollHandleScrollEvent(Wnd, SBType, WM_LBUTTONDOWN, Pt);
1136 
1137  do
1138  {
1139  if (!GetMessageW(&Msg, 0, 0, 0)) break;
1140  if (CallMsgFilterW(&Msg, MSGF_SCROLLBAR)) continue;
1141  if ( Msg.message == WM_LBUTTONUP ||
1142  Msg.message == WM_MOUSEMOVE ||
1143  (Msg.message == WM_SYSTIMER && Msg.wParam == SCROLL_TIMER))
1144  {
1145  Pt.x = LOWORD(Msg.lParam) + XOffset;
1146  Pt.y = HIWORD(Msg.lParam) + YOffset;
1147  IntScrollHandleScrollEvent(Wnd, SBType, Msg.message, Pt);
1148  }
1149  else
1150  {
1153  }
1154  if (!IsWindow(Wnd))
1155  {
1156  ReleaseCapture();
1157  break;
1158  }
1159  } while (Msg.message != WM_LBUTTONUP && GetCapture() == Wnd);
1160 }
BOOL WINAPI TranslateMessage(_In_ const MSG *)
long y
Definition: polytest.cpp:48
#define WM_LBUTTONDOWN
Definition: winuser.h:1752
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define WM_SYSTIMER
Definition: comctl32.h:111
#define SB_CTL
Definition: winuser.h:554
long x
Definition: polytest.cpp:48
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
LONG top
Definition: windef.h:292
struct @1567 Msg[]
RECT rcClient
Definition: ntuser.h:681
LONG left
Definition: windef.h:291
BOOL WINAPI CallMsgFilterW(_In_ LPMSG, _In_ INT)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
HWND WINAPI GetCapture(void)
Definition: message.c:2879
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
RECT rcWindow
Definition: ntuser.h:680
Definition: ntuser.h:657
#define MSGF_SCROLLBAR
Definition: winuser.h:1164
#define WM_LBUTTONUP
Definition: winuser.h:1753
unsigned int UINT
Definition: ndis.h:50
#define WM_MOUSEMOVE
Definition: winuser.h:1751
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2888
static VOID FASTCALL IntScrollHandleScrollEvent(HWND Wnd, INT SBType, UINT Msg, POINT Pt)
Definition: scrollbar.c:744
#define HIWORD(l)
Definition: typedefs.h:246
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
#define LOWORD(l)
Definition: pedump.c:82
#define SCROLL_TIMER
Definition: scrollbar.c:45

Referenced by DefWndTrackScrollBar(), and ScrollBarWndProc_common().

◆ SPY_EnterMessage()

void SPY_EnterMessage ( INT  iFlag,
HWND  hwnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 2593 of file spy.c.

2595 {
2596  SPY_INSTANCE sp_e;
2597  int indent;
2598  DWORD save_error = GetLastError();
2599 
2600  if (!spy_init() || exclude_msg(msg)) return;
2601 
2602  sp_e.msgnum = msg;
2603  sp_e.msg_hwnd = hWnd;
2604  sp_e.lParam = lParam;
2605  sp_e.wParam = wParam;
2606  SPY_GetWndName(&sp_e);
2607  SPY_GetMsgStuff(&sp_e);
2609 
2610  /* each SPY_SENDMESSAGE must be complemented by call to SPY_ExitMessage */
2611  switch(iFlag)
2612  {
2613  case SPY_DISPATCHMESSAGE:
2614  TRACE("%*s(%p) %-16s [%04x] %s dispatched wp=%08lx lp=%08lx\n",
2615  indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg,
2616  sp_e.msg_name, wParam, lParam);
2617  break;
2618 
2619  case SPY_SENDMESSAGE:
2620  {
2621  char taskName[20];
2623 
2624  if (tid == GetCurrentThreadId()) strcpy( taskName, "self" );
2625  else sprintf( taskName, "tid %04ld", GetCurrentThreadId() );
2626 
2627  TRACE("%*s(%p) %-16s [%04x] %s sent from %s wp=%08lx lp=%08lx\n",
2628  indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg,
2629  sp_e.msg_name, taskName, wParam, lParam );
2630  SPY_DumpStructure(&sp_e, TRUE);
2631  }
2632  break;
2633 
2634  case SPY_DEFWNDPROC:
2635  if (exclude_dwp()) return;
2636  TRACE("%*s(%p) DefWindowProc:[%04x] %s wp=%08lx lp=%08lx\n",
2637  indent, "", hWnd, msg, sp_e.msg_name, wParam, lParam );
2638  break;
2639  }
2641  SetLastError( save_error );
2642 }
LPARAM lParam
Definition: spy.c:2015
#define TRUE
Definition: types.h:120
UINT msgnum
Definition: spy.c:2012
static const WCHAR indent[]
Definition: object.c:1156
char msg_name[60]
Definition: spy.c:2017
HWND hWnd
Definition: settings.c:17
#define SPY_SENDMESSAGE
Definition: user32p.h:74
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static void SPY_DumpStructure(const SPY_INSTANCE *sp_e, BOOL enter)
Definition: spy.c:2304
WPARAM wParam
Definition: combotst.c:138
#define SPY_DEFWNDPROC
Definition: user32p.h:75
#define sprintf(buf, format,...)
Definition: sprintf.c:55
#define SPY_DISPATCHMESSAGE
Definition: user32p.h:73
WPARAM wParam
Definition: spy.c:2014
#define debugstr_w
Definition: kernel32.h:32
DWORD WINAPI GetWindowThreadProcessId(HWND, PDWORD)
smooth NULL
Definition: ftsmooth.c:416
static BOOL spy_init(void)
Definition: spy.c:2531
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:421
static BOOL exclude_dwp(void)
Definition: spy.c:2004
HWND msg_hwnd
Definition: spy.c:2013
#define TRACE(s)
Definition: solgame.cpp:4
WCHAR wnd_name[16]
Definition: spy.c:2019
static INT_PTR get_indent_level(void)
Definition: spy.c:2027
static void SPY_GetMsgStuff(SPY_INSTANCE *sp_e)
Definition: spy.c:2132
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:409
static void set_indent_level(INT_PTR level)
Definition: spy.c:2036
#define SPY_INDENT_UNIT
Definition: spy.c:32
#define msg(x)
Definition: auth_time.c:54
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
static BOOL exclude_msg(UINT msg)
Definition: spy.c:1999
static TfClientId tid
LPARAM lParam
Definition: combotst.c:139
static void SPY_GetWndName(SPY_INSTANCE *sp_e)
Definition: spy.c:2192

Referenced by RealDefWindowProcA(), RealDefWindowProcW(), SendMessageTimeoutA(), and SendMessageTimeoutW().

◆ SPY_ExitMessage()

void SPY_ExitMessage ( INT  iFlag,
HWND  hwnd,
UINT  msg,
LRESULT  lReturn,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 2648 of file spy.c.

2650 {
2651  SPY_INSTANCE sp_e;
2652  int indent;
2653  DWORD save_error = GetLastError();
2654 
2655  if (!TRACE_ON(message) || exclude_msg(msg) ||
2656  (exclude_dwp() && iFlag == SPY_RESULT_DEFWND))
2657  return;
2658 
2659  sp_e.msgnum = msg;
2660  sp_e.msg_hwnd = hWnd;
2661  sp_e.lParam = lParam;
2662  sp_e.wParam = wParam;
2663  SPY_GetWndName(&sp_e);
2664  SPY_GetMsgStuff(&sp_e);
2665 
2666  if ((indent = get_indent_level()))
2667  {
2670  }
2671 
2672  switch(iFlag)
2673  {
2674  case SPY_RESULT_DEFWND:
2675  TRACE(" %*s(%p) DefWindowProc: [%04x] %s returned %08lx\n",
2676  indent, "", hWnd, msg, sp_e.msg_name, lReturn );
2677  break;
2678 
2679  case SPY_RESULT_OK:
2680  TRACE(" %*s(%p) %-16s [%04x] %s returned %08lx\n",
2681  indent, "", hWnd, debugstr_w(sp_e.wnd_name), msg,
2682  sp_e.msg_name, lReturn );
2683  SPY_DumpStructure(&sp_e, FALSE);
2684  break;
2685  }
2686  SetLastError( save_error );
2687 }
LPARAM lParam
Definition: spy.c:2015
Definition: tftpd.h:59
UINT msgnum
Definition: spy.c:2012
static const WCHAR indent[]
Definition: object.c:1156
char msg_name[60]
Definition: spy.c:2017
#define SPY_RESULT_OK
Definition: user32p.h:76
HWND hWnd
Definition: settings.c:17
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static void SPY_DumpStructure(const SPY_INSTANCE *sp_e, BOOL enter)
Definition: spy.c:2304
WPARAM wParam
Definition: combotst.c:138
WPARAM wParam
Definition: spy.c:2014
#define debugstr_w
Definition: kernel32.h:32
static BOOL exclude_dwp(void)
Definition: spy.c:2004
HWND msg_hwnd
Definition: spy.c:2013
#define TRACE(s)
Definition: solgame.cpp:4
WCHAR wnd_name[16]
Definition: spy.c:2019
static INT_PTR get_indent_level(void)
Definition: spy.c:2027
static void SPY_GetMsgStuff(SPY_INSTANCE *sp_e)
Definition: spy.c:2132
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:409
static void set_indent_level(INT_PTR level)
Definition: spy.c:2036
#define SPY_INDENT_UNIT
Definition: spy.c:32
#define SPY_RESULT_DEFWND
Definition: user32p.h:78
#define msg(x)
Definition: auth_time.c:54
static BOOL exclude_msg(UINT msg)
Definition: spy.c:1999
#define TRACE_ON(x)
Definition: compat.h:65
LPARAM lParam
Definition: combotst.c:139
static void SPY_GetWndName(SPY_INSTANCE *sp_e)
Definition: spy.c:2192

Referenced by RealDefWindowProcA(), RealDefWindowProcW(), SendMessageTimeoutA(), and SendMessageTimeoutW().

◆ SPY_GetMsgName()

const char* SPY_GetMsgName ( UINT  msg,
HWND  hWnd 
)

Definition at line 2218 of file spy.c.

2219 {
2220  SPY_INSTANCE ext_sp_e;
2221  DWORD save_error = GetLastError();
2222 
2223  ext_sp_e.msgnum = msg;
2224  ext_sp_e.msg_hwnd = hWnd;
2225  ext_sp_e.lParam = 0;
2226  ext_sp_e.wParam = 0;
2227  ext_sp_e.wnd_class[0] = 0;
2228  SPY_GetMsgStuff(&ext_sp_e);
2229  SetLastError( save_error );
2230  return wine_dbg_sprintf("%s", ext_sp_e.msg_name);
2231 }
LPARAM lParam
Definition: spy.c:2015
UINT msgnum
Definition: spy.c:2012
char msg_name[60]
Definition: spy.c:2017
HWND hWnd
Definition: settings.c:17
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
const char * wine_dbg_sprintf(const char *format,...)
Definition: compat.c:271
WPARAM wParam
Definition: spy.c:2014
HWND msg_hwnd
Definition: spy.c:2013
static void SPY_GetMsgStuff(SPY_INSTANCE *sp_e)
Definition: spy.c:2132
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:409
WCHAR wnd_class[60]
Definition: spy.c:2018
#define msg(x)
Definition: auth_time.c:54

Referenced by ComboWndProc_common(), DefFrameProcW(), DefMDIChildProcA(), DefMDIChildProcW(), EditWndProc_common(), IntScrollHandleScrollEvent(), ListBoxWndProc_common(), and MDIClientWndProc_common().

◆ SPY_GetVKeyName()

const char* SPY_GetVKeyName ( WPARAM  wParam)

Definition at line 2236 of file spy.c.

2237 {
2238  const char *vk_key_name;
2239 
2241  vk_key_name = VK_KeyNames[wParam];
2242  else
2243  vk_key_name = "VK_???";
2244 
2245  return vk_key_name;
2246 }
WPARAM wParam
Definition: combotst.c:138
static const char *const VK_KeyNames[SPY_MAX_VKKEYSNUM+1]
Definition: spy.c:1142
#define SPY_MAX_VKKEYSNUM
Definition: spy.c:1141

◆ TestWindowProcess()

BOOL FASTCALL TestWindowProcess ( PWND  )

Definition at line 176 of file misc.c.

177 {
178  if (Wnd->head.pti == (PTHREADINFO)NtCurrentTeb()->Win32ThreadInfo)
179  return TRUE;
180  else
181  return (NtUserQueryWindow(Wnd->head.h, QUERY_WINDOW_UNIQUE_PROCESS_ID) ==
183 }
#define TRUE
Definition: types.h:120
#define QUERY_WINDOW_UNIQUE_PROCESS_ID
Definition: ntuser.h:2796
HANDLE UniqueProcess
Definition: compat.h:474
DWORD_PTR NTAPI NtUserQueryWindow(HWND hWnd, DWORD Index)
Definition: window.c:3982
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1176
uint32_t DWORD_PTR
Definition: typedefs.h:63
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420

Referenced by DIALOG_FindMsgDestination(), GetWindowTextA(), GetWindowTextLengthA(), GetWindowTextLengthW(), GetWindowTextW(), IntGetWindowLong(), IsDialogMessageW(), SetWindowTextA(), and SetWindowTextW().

◆ UpdatePerUserImmEnabling()

BOOL WINAPI UpdatePerUserImmEnabling ( VOID  )

Definition at line 287 of file imm.c.

288 {
290  if ( Ret )
291  {
292  if ( gpsi->dwSRVIFlags & SRVINFO_IMM32 )
293  {
294  HMODULE imm32 = GetModuleHandleW(L"imm32.dll");
295  if ( !imm32 )
296  {
297  imm32 = LoadLibraryW(L"imm32.dll");
298  if (!imm32)
299  {
300  ERR("UPUIE: Imm32 not installed!\n");
301  Ret = FALSE;
302  }
303  }
304  }
305  }
306  return Ret;
307 }
PSERVERINFO gpsi
Definition: main.c:27
DWORD dwSRVIFlags
Definition: ntuser.h:1004
unsigned int BOOL
Definition: ntddk_ex.h:94
#define LoadLibraryW(x)
Definition: compat.h:404
static const WCHAR L[]
Definition: oid.c:1250
DWORD_PTR NTAPI NtUserCallNoParam(DWORD Routine)
Definition: simplecall.c:59
#define ERR(fmt,...)
Definition: debug.h:109
#define SRVINFO_IMM32
Definition: ntuser.h:910
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:845

Referenced by UpdatePerUserSystemParameters().

◆ UserDrawSysMenuButton()

BOOL UserDrawSysMenuButton ( HWND  hWnd,
HDC  hDC,
LPRECT  ,
BOOL  down 
)

◆ UserGetProp()

HANDLE FASTCALL UserGetProp ( HWND  hWnd,
ATOM  Atom,
BOOLEAN  SystemProp 
)

Definition at line 66 of file prop.c.

67 {
68  PPROPERTY Prop;
69  Prop = IntGetProp(hWnd, Atom, SystemProp);
70  return Prop ? Prop->Data : NULL;
71 }
_In_ ATOM _In_ HANDLE _In_ BOOLEAN SystemProp
Definition: prop.h:22
HWND hWnd
Definition: settings.c:17
_Out_ RTL_ATOM * Atom
Definition: class.h:54
HANDLE Data
Definition: ntuser.h:1054
smooth NULL
Definition: ftsmooth.c:416
PPROPERTY FASTCALL IntGetProp(_In_ PWND Window, _In_ ATOM Atom, _In_ BOOLEAN SystemProp)
Definition: prop.c:16

◆ UserGetWindowBorders()

VOID UserGetWindowBorders ( DWORD  ,
DWORD  ,
SIZE ,
BOOL   
)

Definition at line 885 of file winpos.c.

886 {
887  DWORD Border = 0;
888 
890  Border += 2;
891  else if (ExStyle & WS_EX_STATICEDGE)
892  Border += 1;
893  if ((ExStyle & WS_EX_CLIENTEDGE) && WithClient)
894  Border += 2;
896  Border ++;
897  Size->cx = Size->cy = Border;
898  if ((Style & WS_THICKFRAME) && !(Style & WS_MINIMIZE))
899  {
902  }
905 }
#define WS_THICKFRAME
Definition: pedump.c:630
#define SM_CYFRAME
Definition: winuser.h:986
#define SM_CXFRAME
Definition: winuser.h:984
#define WS_MINIMIZE
Definition: pedump.c:622
#define SM_CYDLGFRAME
Definition: winuser.h:958
#define WS_EX_DLGMODALFRAME
Definition: pedump.c:645
LONG NTAPI UserGetSystemMetrics(ULONG Index)
Definition: metric.c:180
#define WS_CAPTION
Definition: pedump.c:624
const DWORD Style
Definition: appswitch.c:71
#define SM_CXDLGFRAME
Definition: winuser.h:956
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SM_CYBORDER
Definition: winuser.h:955
#define SM_CXBORDER
Definition: winuser.h:954
BOOL UserHasWindowEdge(DWORD Style, DWORD ExStyle)
Definition: winpos.c:841
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define WS_EX_STATICEDGE
Definition: winuser.h:403
const DWORD ExStyle
Definition: appswitch.c:72

Referenced by GetWindowInfo(), NC_HandleNCCalcSize(), RealAdjustWindowRectEx(), UserAdjustWindowRectEx(), and UserDrawCaptionButtonWnd().

◆ UserSetLastError()

VOID WINAPI UserSetLastError ( IN DWORD  dwErrCode)

Definition at line 13 of file misc.c.

14 {
15  /*
16  * Equivalent of SetLastError in kernel32, but without breaking
17  * into the debugger nor checking whether the last old error is
18  * the same as the one we are going to set.
19  */
20  NtCurrentTeb()->LastErrorValue = dwErrCode;
21 }
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420

Referenced by EndTask(), ExitWindowsWorker(), and UserSetLastNTError().

◆ UserSetLastNTError()

VOID WINAPI UserSetLastNTError ( IN NTSTATUS  Status)

Definition at line 25 of file misc.c.

26 {
27  /*
28  * Equivalent of BaseSetLastNTError in kernel32, but using
29  * UserSetLastError: convert from NT to Win32, then set.
30  */
32 }
VOID WINAPI UserSetLastError(IN DWORD dwErrCode)
Definition: misc.c:13
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)

Referenced by EndTask(), ExitWindowsWorker(), GetThreadDesktop(), RegisterLogonProcess(), and RegisterServicesProcess().

◆ ValidateCallProc()

PCALLPROCDATA FASTCALL ValidateCallProc ( HANDLE  hCallProc)

Definition at line 349 of file misc.c.

350 {
351  PUSER_HANDLE_ENTRY pEntry;
352 
353  PCALLPROCDATA CallProc = ValidateHandle(hCallProc, TYPE_CALLPROC);
354 
355  pEntry = GetUser32Handle(hCallProc);
356 
357  if (CallProc != NULL && pEntry->ppi == g_ppi)
358  return CallProc;
359 
360  return NULL;
361 }
struct _PROCESSINFO * ppi
Definition: ntuser.h:26
smooth NULL
Definition: ftsmooth.c:416
PUSER_HANDLE_ENTRY FASTCALL GetUser32Handle(HANDLE handle)
Definition: misc.c:205
PPROCESSINFO g_ppi
Definition: dllmain.c:12
Definition: ntuser.h:19
PVOID FASTCALL ValidateHandle(HANDLE handle, UINT uType)
Definition: misc.c:262

Referenced by CallWindowProcA(), and CallWindowProcW().

◆ ValidateHandle()

PVOID FASTCALL ValidateHandle ( HANDLE  ,
UINT   
)

Definition at line 262 of file misc.c.

263 {
264  PVOID ret;
265  PUSER_HANDLE_ENTRY pEntry;
266 
267  ASSERT(uType < TYPE_CTYPES);
268 
269  pEntry = GetUser32Handle(handle);
270 
271  if (pEntry && uType == 0)
272  uType = pEntry->type;
273 
274 // Must have an entry and must be the same type!
275  if ( (!pEntry) ||
276  (pEntry->type != uType) ||
277  !pEntry->ptr ||
278  (pEntry->flags & HANDLEENTRY_DESTROY) || (pEntry->flags & HANDLEENTRY_INDESTROY) )
279  {
280  switch ( uType )
281  { // Test (with wine too) confirms these results!
282  case TYPE_WINDOW:
284  break;
285  case TYPE_MENU:
287  break;
288  case TYPE_CURSOR:
290  break;
291  case TYPE_SETWINDOWPOS:
293  break;
294  case TYPE_HOOK:
296  break;
297  case TYPE_ACCELTABLE:
299  break;
300  default:
302  break;
303  }
304  return NULL;
305  }
306 
307  if (g_ObjectHeapTypeShared[uType])
308  ret = SharedPtrToUser(pEntry->ptr);
309  else
310  ret = DesktopPtrToUser(pEntry->ptr);
311 
312  return ret;
313 }
#define ERROR_INVALID_CURSOR_HANDLE
Definition: winerror.h:883
#define ERROR_INVALID_DWP_HANDLE
Definition: winerror.h:886
#define ERROR_INVALID_ACCEL_HANDLE
Definition: winerror.h:884
#define ERROR_INVALID_HOOK_HANDLE
Definition: winerror.h:885
unsigned char type
Definition: ntuser.h:28
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
static __inline PVOID DesktopPtrToUser(PVOID Ptr)
Definition: user_x.h:12
#define ERROR_INVALID_MENU_HANDLE
Definition: winerror.h:882
smooth NULL
Definition: ftsmooth.c:416
PUSER_HANDLE_ENTRY FASTCALL GetUser32Handle(HANDLE handle)
Definition: misc.c:205
Definition: ntuser.h:19
static const BOOL g_ObjectHeapTypeShared[TYPE_CTYPES]
Definition: misc.c:231
#define ERROR_INVALID_WINDOW_HANDLE
Definition: winerror.h:881
#define SetLastError(x)
Definition: compat.h:409
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
int ret
#define HANDLEENTRY_DESTROY
Definition: ntuser.h:16
static __inline PVOID SharedPtrToUser(PVOID Ptr)
Definition: user_x.h:4
void * ptr
Definition: ntuser.h:21
#define HANDLEENTRY_INDESTROY
Definition: ntuser.h:17
unsigned char flags
Definition: ntuser.h:29

Referenced by ValidateCallProc(), and ValidateHwnd().

◆ ValidateHandleNoErr()

PVOID FASTCALL ValidateHandleNoErr ( HANDLE  handle,
UINT  uType 
)

Definition at line 320 of file misc.c.

321 {
322  PVOID ret;
323  PUSER_HANDLE_ENTRY pEntry;
324 
325  ASSERT(uType < TYPE_CTYPES);
326 
327  pEntry = GetUser32Handle(handle);
328 
329  if (pEntry && uType == 0)
330  uType = pEntry->type;
331 
332 // Must have an entry and must be the same type!
333  if ( (!pEntry) || (pEntry->type != uType) || !pEntry->ptr )
334  return NULL;
335 
336  if (g_ObjectHeapTypeShared[uType])
337  ret = SharedPtrToUser(pEntry->ptr);
338  else
339  ret = DesktopPtrToUser(pEntry->ptr);
340 
341  return ret;
342 }
unsigned char type
Definition: ntuser.h:28
static __inline PVOID DesktopPtrToUser(PVOID Ptr)
Definition: user_x.h:12
smooth NULL
Definition: ftsmooth.c:416
PUSER_HANDLE_ENTRY FASTCALL GetUser32Handle(HANDLE handle)
Definition: misc.c:205
Definition: ntuser.h:19
static const BOOL g_ObjectHeapTypeShared[TYPE_CTYPES]
Definition: misc.c:231
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
int ret
static __inline PVOID SharedPtrToUser(PVOID Ptr)
Definition: user_x.h:4
void * ptr
Definition: ntuser.h:21

Referenced by MENU_GetMenu(), and ValidateHwndNoErr().

◆ ValidateHwnd()

PWND FASTCALL ValidateHwnd ( HWND  hwnd)

Definition at line 369 of file misc.c.

370 {
372  ASSERT(ClientInfo != NULL);
373 
374  /* See if the window is cached */
375  if (hwnd && hwnd == ClientInfo->CallbackWnd.hWnd)
376  return ClientInfo->CallbackWnd.pWnd;
377 
379 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define GetWin32ClientInfo()
Definition: ntuser.h:320
CLIENT_DATA ClientInfo
smooth NULL
Definition: ftsmooth.c:416
PVOID FASTCALL ValidateHandle(HANDLE handle, UINT uType)
Definition: misc.c:262
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)

Referenced by ButtonWndProc_common(), CallWindowProcA(), CallWindowProcW(), ClientToScreen(), ComboWndProc_common(), CreateWindowExA(), CreateWindowExW(), DIALOG_DoDialogBox(), DIALOG_FindMsgDestination(), DIALOG_get_info(), DispatchMessageA(), DispatchMessageW(), EditWndProc_common(), GetAncestor(), GetClassLongA(), GetClassLongW(), GetClassWord(), GetClientRect(), GetLastActivePopup(), GetMenu(), GetNextDlgTabItem(), GetParent(), GetScrollBarInfo(), GetScrollPos(), GetScrollRange(), GetUpdateRect(), GetUpdateRgn(), GetWindow(), GetWindowInfo(), GetWindowModuleFileNameA(), GetWindowModuleFileNameW(), GetWindowRect(), GetWindowRgn(), GetWindowRgnBox(), GetWindowTextA(), GetWindowTextLengthA(), GetWindowTextLengthW(), GetWindowTextW(), GetWindowThreadProcessId(), Ghost_OnCreate(), ImeWndProc_common(), IntFindChildWindowToOwner(), IntGetProp(), IntGetWindowLong(), IntScrollGetScrollBarRect(), IntScrollGetThumbVal(), IsChild(), IsDialogMessageW(), IsHungAppWindow(), IsIconic(), IsWindowInDestroy(), IsWindowUnicode(), IsWindowVisible(), ListBoxWndProc_common(), MapWindowPoints(), MsgWindowProc(), PopupMenuWndProcA(), PopupMenuWndProcW(), RealDefWindowProcA(), RealDefWindowProcW(), RealGetScrollInfo(), ScreenToClient(), ScrollBarWndProc_common(), ScrollTrackScrollBar(), SendMessageA(), SendMessageW(), SetScrollRange(), SetWindowTextA(), SetWindowTextW(), StaticWndProc_common(), SwitchWndProc_common(), UpdateWindow(), User32DefWindowProc(), ValidateHwndOrDesk(), and WinPosGetMinMaxInfo().

◆ ValidateHwndNoErr()

PWND FASTCALL ValidateHwndNoErr ( HWND  hwnd)

Definition at line 96 of file window.c.

97 {
99  return NULL;
100 }
PVOID UserGetObjectNoErr(PUSER_HANDLE_TABLE ht, HANDLE handle, HANDLE_TYPE type)
Definition: object.c:448
HWND hWnd
Definition: settings.c:17
smooth NULL
Definition: ftsmooth.c:416
Definition: ntuser.h:657
PUSER_HANDLE_TABLE gHandleTable
Definition: object.c:13

Referenced by co_IntDestroyCaret(), co_IntFixCaret(), co_IntProcessKeyboardMessage(), co_IntProcessMouseMessage(), co_IntSendActivateMessages(), co_IntSendDeactivateMessages(), co_MsqSendMessage(), co_UserDestroyWindow(), co_UserProcessHotKeys(), co_UserShowCaret(), co_WinPosSearchChildren(), co_WinPosSetWindowPos(), DefWndHandleSysCommand(), get_win_sys_menu(), IntChildWindowFromPointEx(), IntDeactivateWindow(), IntDestroyMenuObject(), IntEndDeferWindowPosEx(), IntGetMenu(), IntGetWindow(), IntGhostWindowFromHungWindow(), IntHungWindowFromGhostWindow(), IntMakeHungWindowGhosted(), IntRealChildWindowFromPoint(), IntShowOwnedPopups(), IntTrackPopupMenuEx(), IsWindow(), MENU_DoNextMenu(), MENU_DrawBitmapItem(), MENU_EnsureMenuItemVisible(), MENU_FindItemByCoords(), MENU_HideSubPopups(), MENU_IsMenuActive(), MENU_PtMenu(), MENU_SelectItem(), MENU_ShowPopup(), MENU_ShowSubPopup(), MENU_TrackMenu(), MsqSetStateWindow(), NtUserBuildHwndList(), NtUserFlashWindowEx(), UserGhostWindowFromHungWindow(), UserHungWindowFromGhostWindow(), WinPosDoOwnedPopups(), and WinPosFixupFlags().

◆ ValidateHwndOrDesk()

PWND FASTCALL ValidateHwndOrDesk ( HWND  hwnd)

Definition at line 420 of file misc.c.

421 {
422  if (hwnd == HWND_DESKTOP)
423  return GetThreadDesktopWnd();
424 
425  return ValidateHwnd(hwnd);
426 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
#define HWND_DESKTOP
Definition: winuser.h:1195
PWND FASTCALL GetThreadDesktopWnd(VOID)
Definition: misc.c:407

◆ WIN_ListChildren()

HWND* WIN_ListChildren ( HWND  hWndparent)

Definition at line 140 of file mdi.c.

141 {
142 
143  DWORD dwCount = 0;
144  HWND* pHwnd = NULL;
145  HANDLE hHeap;
147 
148  Status = NtUserBuildHwndList ( NULL, hWndparent, FALSE, 0, 0, NULL, &dwCount );
149 
150  if ( !NT_SUCCESS( Status ) )
151  return 0;
152 
153  /* allocate buffer to receive HWND handles */
154  hHeap = GetProcessHeap();
155 
156  pHwnd = HeapAlloc ( hHeap, 0, sizeof(HWND)*(dwCount+1) );
157  if ( !pHwnd )
158  {
160  return 0;
161  }
162 
163  /* now call kernel again to fill the buffer this time */
164  Status = NtUserBuildHwndList (NULL, hWndparent, FALSE, 0, 0, pHwnd, &dwCount );
165 
166  if ( !NT_SUCCESS( Status ) )
167  {
168  if ( pHwnd )
169  HeapFree ( hHeap, 0, pHwnd );
170  return 0;
171  }
172 
173  pHwnd[dwCount] = (HWND) 0;
174 
175  return pHwnd;
176 }
LONG NTSTATUS
Definition: precomp.h:26
HANDLE HWND
Definition: compat.h:13
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetLastError(x)
Definition: compat.h:409
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI NtUserBuildHwndList(HDESK hDesktop, HWND hwndParent, BOOLEAN bChildren, ULONG dwThreadId, ULONG lParam, HWND *pWnd, ULONG *pBufSize)
Definition: window.c:1338
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by AnyPopup(), CalcChildScroll(), DIALOG_IdToHwnd(), GetDlgItem(), MDI_GetWindow(), MDICascade(), MDITile(), and User32DefWindowProc().

◆ WinPosGetMinMaxInfo()

UINT WINAPI WinPosGetMinMaxInfo ( HWND  hWnd,
POINT MaxSize,
POINT MaxPos,
POINT MinTrack,
POINT MaxTrack 
)

Definition at line 28 of file winpos.c.

30 {
31  MINMAXINFO MinMax;
32  HMONITOR monitor;
33  INT xinc, yinc;
35  LONG adjustedStyle;
36  LONG exstyle = GetWindowLongW( hwnd, GWL_EXSTYLE );
37  RECT rc;
38  WND *win;
39 
40  /* Compute default values */
41 
42  GetWindowRect(hwnd, &rc);
43  MinMax.ptReserved.x = rc.left;
44  MinMax.ptReserved.y = rc.top;
45 
46  if ((style & WS_CAPTION) == WS_CAPTION)
47  adjustedStyle = style & ~WS_BORDER; /* WS_CAPTION = WS_DLGFRAME | WS_BORDER */
48  else
49  adjustedStyle = style;
50 
52  AdjustWindowRectEx(&rc, adjustedStyle, ((style & WS_POPUP) && GetMenu(hwnd)), exstyle);
53 
54  xinc = -rc.left;
55  yinc = -rc.top;
56 
57  MinMax.ptMaxSize.x = rc.right - rc.left;
58  MinMax.ptMaxSize.y = rc.bottom - rc.top;
59  if (style & (WS_DLGFRAME | WS_BORDER))
60  {
63  }
64  else
65  {
66  MinMax.ptMinTrackSize.x = 2 * xinc;
67  MinMax.ptMinTrackSize.y = 2 * yinc;
68  }
71  MinMax.ptMaxPosition.x = -xinc;
72  MinMax.ptMaxPosition.y = -yinc;
73 
74  if ((win = ValidateHwnd( hwnd )) )//&& win != WND_DESKTOP && win != WND_OTHER_PROCESS)
75  {
76  if (!EMPTYPOINT(win->InternalPos.MaxPos)) MinMax.ptMaxPosition = win->InternalPos.MaxPos;
77  }
78 
79  SendMessageW( hwnd, WM_GETMINMAXINFO, 0, (LPARAM)&MinMax );
80 
81  /* if the app didn't change the values, adapt them for the current monitor */
82 
83  if ((monitor = MonitorFromWindow( hwnd, MONITOR_DEFAULTTOPRIMARY )))
84  {
85  RECT rc_work;
86  MONITORINFO mon_info;
87 
88  mon_info.cbSize = sizeof(mon_info);
89  GetMonitorInfoW( monitor, &mon_info );
90 
91  rc_work = mon_info.rcMonitor;
92 
93  if (style & WS_MAXIMIZEBOX)
94  {
95  if ((style & WS_CAPTION) == WS_CAPTION || !(style & (WS_CHILD | WS_POPUP)))
96  rc_work = mon_info.rcWork;
97  }
98 
99  if (MinMax.ptMaxSize.x == GetSystemMetrics(SM_CXSCREEN) + 2 * xinc &&
100  MinMax.ptMaxSize.y == GetSystemMetrics(SM_CYSCREEN) + 2 * yinc)
101  {
102  MinMax.ptMaxSize.x = (rc_work.right - rc_work.left) + 2 * xinc;
103  MinMax.ptMaxSize.y = (rc_work.bottom - rc_work.top) + 2 * yinc;
104  }
105  if (MinMax.ptMaxPosition.x == -xinc && MinMax.ptMaxPosition.y == -yinc)
106  {
107  MinMax.ptMaxPosition.x = rc_work.left - xinc;
108  MinMax.ptMaxPosition.y = rc_work.top - yinc;
109  }
110  }
111 
112  /* Some sanity checks */
113 
114  TRACE("%d %d / %d %d / %d %d / %d %d\n",
115  MinMax.ptMaxSize.x, MinMax.ptMaxSize.y,
116  MinMax.ptMaxPosition.x, MinMax.ptMaxPosition.y,
117  MinMax.ptMaxTrackSize.x, MinMax.ptMaxTrackSize.y,
118  MinMax.ptMinTrackSize.x, MinMax.ptMinTrackSize.y);
119  MinMax.ptMaxTrackSize.x = max( MinMax.ptMaxTrackSize.x,
120  MinMax.ptMinTrackSize.x );
121  MinMax.ptMaxTrackSize.y = max( MinMax.ptMaxTrackSize.y,
122  MinMax.ptMinTrackSize.y );
123 
124  if (maxSize) *maxSize = MinMax.ptMaxSize;
125  if (maxPos) *maxPos = MinMax.ptMaxPosition;
126  if (minTrack) *minTrack = MinMax.ptMinTrackSize;
127  if (maxTrack) *maxTrack = MinMax.ptMaxTrackSize;
128 
129  return 0; //FIXME: what does it return?
130 }
POINT ptMinTrackSize
Definition: winuser.h:3572
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HWND WINAPI GetAncestor(_In_ HWND, _In_ UINT)
#define max(a, b)
Definition: svc.c:63
long y
Definition: polytest.cpp:48
POINT ptReserved
Definition: winuser.h:3569
POINT ptMaxSize
Definition: winuser.h:3570
#define SM_CYMINTRACK
Definition: winuser.h:988
long x
Definition: polytest.cpp:48
LONG top
Definition: windef.h:292
#define WS_DLGFRAME
Definition: pedump.c:626
BOOL WINAPI AdjustWindowRectEx(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL, _In_ DWORD)
#define GWL_EXSTYLE
Definition: winuser.h:845
#define WS_CHILD
Definition: pedump.c:617
#define SM_CYMAXTRACK
Definition: winuser.h:1013
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
RECT rcMonitor
Definition: winuser.h:3727
int32_t INT
Definition: typedefs.h:56
#define SM_CXSCREEN
Definition: winuser.h:949
long LONG
Definition: pedump.c:60
#define GA_PARENT
Definition: winuser.h:2742
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define EMPTYPOINT(pt)
Definition: winpos.c:25
LONG_PTR LPARAM
Definition: windef.h:208
#define WS_MAXIMIZEBOX
Definition: pedump.c:632
#define WS_CAPTION
Definition: pedump.c:624
#define SM_CYSCREEN
Definition: winuser.h:950
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI GetMonitorInfoW(_In_ HMONITOR, _Inout_ LPMONITORINFO)
#define SM_CXMINTRACK
Definition: winuser.h:987
int WINAPI GetSystemMetrics(_In_ int)
POINT ptMaxPosition
Definition: winuser.h:3571
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
#define GWL_STYLE
Definition: winuser.h:846
Definition: ntuser.h:657
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define WS_BORDER
Definition: pedump.c:625
static real win[4][36]
DWORD cbSize
Definition: winuser.h:3726
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HMONITOR WINAPI MonitorFromWindow(HWND, DWORD)
#define WS_POPUP
Definition: pedump.c:616
#define SM_CXMAXTRACK
Definition: winuser.h:1012
LONG bottom
Definition: windef.h:294
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
POINT ptMaxTrackSize
Definition: winuser.h:3573
Arabic default style
Definition: afstyles.h:93
HMENU WINAPI GetMenu(_In_ HWND)
#define WM_GETMINMAXINFO
Definition: winuser.h:1622

Variable Documentation

◆ g_ppi

PPROCESSINFO g_ppi

Definition at line 12 of file dllmain.c.

Referenced by ClientThreadSetupHelper(), Init(), and ValidateCallProc().

◆ g_ulSharedDelta

ULONG_PTR g_ulSharedDelta

Definition at line 17 of file dllmain.c.

Referenced by ClientThreadSetupHelper(), Init(), and SharedPtrToUser().

◆ gcsUserApiHook

RTL_CRITICAL_SECTION gcsUserApiHook

Definition at line 39 of file usrapihk.c.

Referenced by ClearUserApiHook(), EndUserApiHook(), Init(), and InitUserApiHook().

◆ gfLogonProcess

BOOLEAN gfLogonProcess

Definition at line 18 of file dllmain.c.

Referenced by RegisterLogonProcess().

◆ gfServerProcess

BOOLEAN gfServerProcess

Definition at line 19 of file dllmain.c.

Referenced by ClientThreadSetupHelper(), DllMain(), Init(), and LoadUserApiHook().

◆ gHandleEntries

PUSER_HANDLE_ENTRY gHandleEntries

Definition at line 14 of file dllmain.c.

Referenced by ClientThreadSetupHelper(), GetUser32Handle(), and Init().

◆ gHandleTable

◆ ghImm32

HINSTANCE ghImm32

Definition at line 22 of file imm.c.

Referenced by DllMain(), IntInitializeImmEntryTable(), and User32InitializeImmEntryTable().

◆ ghmodUserApiHook

◆ gImmApiEntries

Imm32ApiTable gImmApiEntries

Definition at line 21 of file imm.c.

Referenced by IntInitializeImmEntryTable(), and User32InitializeImmEntryTable().

◆ gpsi

Definition at line 27 of file main.c.

Referenced by alloc_user_entry(), ClientThreadSetupHelper(), co_IntInitializeDesktopGraphics(), co_IntSendActivateMessages(), co_IntSendMessageTimeout(), co_IntSetCaretPos(), co_IntSetupOBM(), co_IntSetWndIcons(), co_IntShellHookNotify(), co_MsqInsertMouseMessage(), co_MsqSendMessage(), co_UserCreateWindowEx(), co_UserDestroyWindow(), co_UserShowCaret(), co_WinPosSetWindowPos(), CreateSysColorObjects(), DefWndControlColor(), DefWndGetIcon(), DefWndHandleSetCursor(), DefWndSetIcon(), DrawFocusRect(), DriverEntry(), EnumerateCallback(), free_user_entry(), GetLastInputInfo(), GetSysColor(), GetSysColorBrush(), GetSystemMetrics(), Init(), InitMetrics(), InitUserAtoms(), IntCoalesceMouseMove(), IntCreateClass(), IntCreateDesktop(), IntCreateWindow(), IntDeactivateWindow(), IntDefWindowProc(), IntDrawState(), IntFlashWindowEx(), IntGetSysColor(), IntGetSysColorBrush(), IntGetWindowContextHelpId(), IntGrayString(), IntImmProcessKey(), IntIsFontRenderingEnabled(), IntIsGhostWindow(), IntLastInputTick(), IntNotifyWinEvent(), IntRealChildWindowFromPoint(), IntRemoveEvent(), IntSetCaretBlinkTime(), IntSetSrvEventMask(), IntSetSysColors(), IntTranslateKbdMessage(), IsDialogMessageW(), IsWinEventHookInstalled(), LoadSystemCursors(), LoadUserApiHook(), MENU_AdjustMenuItemRect(), MENU_CalcItemSize(), MENU_DrawMenuItem(), MENU_DrawScrollArrows(), MENU_EnsureMenuItemVisible(), MENU_InitPopup(), MouseSafetyOnDrawEnd(), NC_IconForWindow(), NotifyWinEvent(), NtUserCallHwnd(), NtUserCallHwndParam(), NtUserCallNoParam(), NtUserCallOneParam(), NtUserCreateCaret(), NtUserGetCaretBlinkTime(), NtUserGetClassName(), NtUserGetComboBoxInfo(), NtUserGetCursorInfo(), NtUserGetListBoxInfo(), NtUserInitializeClientPfnArrays(), NtUserMessageCall(), NtUserNotifyWinEvent(), NtUserProcessConnect(), PostTimerMessages(), ProcessKeyEvent(), RealGetSystemMetrics(), RegisterControlAtoms(), SpiGetSet(), SpiUpdatePerUserSystemParameters(), SystemTimerProc(), UITOOLS_DrawCheckedRect(), UpdatePerUserImmEnabling(), User32CallSetWndIconsFromKernel(), UserAttachThreadInput(), UserChangeDisplaySettings(), UserClipCursor(), UserDrawWindowFrame(), UserGetSystemMetrics(), UserInitialize(), UserPaintCaption(), UserPostMessage(), UserPostThreadMessage(), UserRegisterUserApiHook(), UserSendMouseInput(), UserSendNotifyMessage(), UserSetCursor(), UserSetCursorPos(), UserShowCursor(), UserUnregisterUserApiHook(), and UserUpdateMonitorSize().

◆ gSharedInfo

SHAREDINFO gSharedInfo

Definition at line 16 of file dllmain.c.

Referenced by ClientThreadSetupHelper(), Init(), and User32InitializeImmEntryTable().

◆ guah

◆ hIconSmWindows

HICON hIconSmWindows

Definition at line 21 of file dllmain.c.

Referenced by User32CallSetWndIconsFromKernel().

◆ hIconWindows

HICON hIconWindows

Definition at line 21 of file dllmain.c.

Referenced by User32CallSetWndIconsFromKernel().

◆ U32AccelCacheLock

CRITICAL_SECTION U32AccelCacheLock

◆ User32Instance