ReactOS  0.4.15-dev-5499-g1341c38
usrapihk.c File Reference
#include <user32.h>
Include dependency graph for usrapihk.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (user32)
 
BOOL WINAPI RealAdjustWindowRectEx (LPRECT, DWORD, BOOL, DWORD)
 
LRESULT WINAPI RealDefWindowProcA (HWND, UINT, WPARAM, LPARAM)
 
LRESULT WINAPI RealDefWindowProcW (HWND, UINT, WPARAM, LPARAM)
 
BOOL WINAPI RealDrawFrameControl (HDC, LPRECT, UINT, UINT)
 
BOOL WINAPI RealGetScrollInfo (HWND, INT, LPSCROLLINFO)
 
int WINAPI RealGetSystemMetrics (int)
 
BOOL WINAPI RealMDIRedrawFrame (HWND, DWORD)
 
INT WINAPI RealSetScrollInfo (HWND, int, LPCSCROLLINFO, BOOL)
 
BOOL WINAPI RealSystemParametersInfoA (UINT, UINT, PVOID, UINT)
 
BOOL WINAPI RealSystemParametersInfoW (UINT, UINT, PVOID, UINT)
 
DWORD WINAPI GetRealWindowOwner (HWND)
 
BOOL WINAPI RealUserDrawCaption (HWND hWnd, HDC hDC, LPCRECT lpRc, UINT uFlags)
 
LRESULT WINAPI DefaultOWP (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR lResult, PDWORD pData)
 
BOOL FASTCALL IsMsgOverride (UINT Msg, PUAHOWP puaowpOverride)
 
VOID FASTCALL CopyMsgMask (PUAHOWP Dest, PUAHOWP Src, PVOID hkmsg, DWORD Size)
 
BOOL FASTCALL IsInsideUserApiHook (VOID)
 
BOOL FASTCALL BeginIfHookedUserApiHook (VOID)
 
BOOL WINAPI ForceResetUserApiHook (HINSTANCE hInstance)
 
VOID FASTCALL ResetUserApiHook (PUSERAPIHOOK puah)
 
BOOL FASTCALL EndUserApiHook (VOID)
 
BOOL WINAPI ClearUserApiHook (HINSTANCE hInstance)
 
BOOL WINAPI InitUserApiHook (HINSTANCE hInstance, USERAPIHOOKPROC pfn)
 
BOOL WINAPI MDIRedrawFrame (HWND hWnd, DWORD flags)
 
BOOL WINAPI RegisterUserApiHook (PUSERAPIHOOKINFO puah)
 
BOOL WINAPI UnregisterUserApiHook (VOID)
 

Variables

DWORD gcLoadUserApiHook = 0
 
LONG gcCallUserApiHook = 0
 
DWORD gfUserApiHook = 0
 
HINSTANCE ghmodUserApiHook = NULL
 
USERAPIHOOKPROC gpfnInitUserApi
 
RTL_CRITICAL_SECTION gcsUserApiHook
 
BYTE grgbDwpLiteHookMsg [128]
 
BYTE grgbWndLiteHookMsg [128]
 
BYTE grgbDlgLiteHookMsg [128]
 
USERAPIHOOK guah
 

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
#define FALSE
Definition: types.h:117
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:370
HINSTANCE hInstance
Definition: charmap.c:19
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
DWORD gcLoadUserApiHook
Definition: usrapihk.c:34
#define NULL
Definition: types.h:112
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().

◆ CopyMsgMask()

VOID FASTCALL CopyMsgMask ( PUAHOWP  Dest,
PUAHOWP  Src,
PVOID  hkmsg,
DWORD  Size 
)

Definition at line 76 of file usrapihk.c.

77 {
78  DWORD nSize;
79 
80  if ( Src && Src->Size > 0 )
81  {
82  Dest->MsgBitArray = hkmsg;
83  nSize = Src->Size;
84  if ( Size < nSize) nSize = Size;
85  Dest->Size = nSize;
87  return;
88  }
89 
90  Dest->MsgBitArray = NULL;
91  Dest->Size = 0;
92  return;
93 }
*nSize LPSTR _Inout_ LPDWORD nSize
Definition: winbase.h:2061
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD Size
Definition: undocuser.h:329
BYTE * MsgBitArray
Definition: undocuser.h:328
#define NULL
Definition: types.h:112
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263

Referenced by InitUserApiHook().

◆ DefaultOWP()

LRESULT WINAPI DefaultOWP ( HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam,
ULONG_PTR  lResult,
PDWORD  pData 
)

Definition at line 52 of file usrapihk.c.

53 {
54  return 0;
55 }

Referenced by ResetUserApiHook().

◆ 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:370
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
#define FreeLibrary(x)
Definition: compat.h:748
#define InterlockedDecrement
Definition: armddk.h:52
DWORD gcLoadUserApiHook
Definition: usrapihk.c:34
#define NULL
Definition: types.h:112
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().

◆ ForceResetUserApiHook()

BOOL WINAPI ForceResetUserApiHook ( HINSTANCE  hInstance)

Definition at line 117 of file usrapihk.c.

118 {
119  if ( ghmodUserApiHook == hInstance &&
121  {
124  return TRUE;
125  }
126  return FALSE;
127 }
VOID FASTCALL ResetUserApiHook(PUSERAPIHOOK puah)
Definition: usrapihk.c:131
#define TRUE
Definition: types.h:120
HINSTANCE ghmodUserApiHook
Definition: usrapihk.c:37
HINSTANCE hInstance
Definition: charmap.c:19
#define FALSE
Definition: types.h:117
BOOLEAN NTAPI RtlIsThreadWithinLoaderCallout(VOID)
Definition: libsupp.c:348
#define NULL
Definition: types.h:112
USERAPIHOOK guah
Definition: usrapihk.c:344
USERAPIHOOKPROC gpfnInitUserApi
Definition: usrapihk.c:38

Referenced by InitUserApiHook(), and ResetUserApiHook().

◆ GetRealWindowOwner()

DWORD WINAPI GetRealWindowOwner ( HWND  )

Definition at line 1900 of file window.c.

1901 {
1903 }
#define QUERY_WINDOW_REAL_ID
Definition: ntuser.h:2955
DWORD_PTR APIENTRY NtUserQueryWindow(HWND hWnd, DWORD Index)
Definition: window.c:4181
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4022

Referenced by ResetUserApiHook().

◆ 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 }
VOID FASTCALL ResetUserApiHook(PUSERAPIHOOK puah)
Definition: usrapihk.c:131
#define TRUE
Definition: types.h:120
UAHOWP DlgProcArray
Definition: undocuser.h:352
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:19
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
UAHOWP DefWndProcArray
Definition: undocuser.h:341
FORCERESETUSERAPIHOOK ForceResetUserApiHook
Definition: undocuser.h:356
DWORD gcLoadUserApiHook
Definition: usrapihk.c:34
BYTE grgbDlgLiteHookMsg[128]
Definition: usrapihk.c:43
UAHOWP WndProcArray
Definition: undocuser.h:349
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
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
RTL_CRITICAL_SECTION gcsUserApiHook
Definition: usrapihk.c:39
USERAPIHOOKPROC gpfnInitUserApi
Definition: usrapihk.c:38
DWORD gfUserApiHook
Definition: usrapihk.c:36

Referenced by ClientLoadLibrary().

◆ 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
#define FALSE
Definition: types.h:117
DWORD gfUserApiHook
Definition: usrapihk.c:36

Referenced by BeginIfHookedUserApiHook(), and LoadUserApiHook().

◆ IsMsgOverride()

BOOL FASTCALL IsMsgOverride ( UINT  Msg,
PUAHOWP  puaowpOverride 
)

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 }
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
#define FALSE
Definition: types.h:117
BYTE * MsgBitArray
Definition: undocuser.h:328
unsigned int UINT
Definition: ndis.h:50
#define WM_SETFOCUS
Definition: winuser.h:1603
struct @1595 Msg[]

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

◆ MDIRedrawFrame()

BOOL WINAPI MDIRedrawFrame ( HWND  hWnd,
DWORD  flags 
)

Definition at line 318 of file usrapihk.c.

319 {
320  BOOL Hook, Ret = FALSE;
321 
322  LoadUserApiHook();
323 
324  Hook = BeginIfHookedUserApiHook();
325 
326  /* Bypass SEH and go direct. */
327  if (!Hook) return RealMDIRedrawFrame(hWnd, flags);
328 
329  _SEH2_TRY
330  {
331  Ret = guah.MDIRedrawFrame(hWnd, flags);
332  }
334  {
335  ERR("Got exception in hooked MDIRedrawFrame!\n");
336  }
337  _SEH2_END;
338 
339  EndUserApiHook();
340 
341  return Ret;
342 }
_SEH2_TRY
Definition: create.c:4226
BOOL WINAPI RealMDIRedrawFrame(HWND, DWORD)
Definition: usrapihk.c:311
HWND hWnd
Definition: settings.c:17
BOOL FASTCALL BeginIfHookedUserApiHook(VOID)
Definition: usrapihk.c:106
_SEH2_END
Definition: create.c:4400
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
MDIREDRAWFRAME MDIRedrawFrame
Definition: undocuser.h:359
BOOL FASTCALL EndUserApiHook(VOID)
Definition: usrapihk.c:164
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
GLbitfield flags
Definition: glext.h:7161
#define ERR(fmt,...)
Definition: debug.h:110
static __inline void LoadUserApiHook()
Definition: user_x.h:85
USERAPIHOOK guah
Definition: usrapihk.c:344
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:40

◆ RealAdjustWindowRectEx()

BOOL WINAPI RealAdjustWindowRectEx ( LPRECT  ,
DWORD  ,
BOOL  ,
DWORD   
)

Definition at line 90 of file nonclient.c.

94 {
95  SIZE BorderSize;
96 
97  if (bMenu)
98  {
99  lpRect->top -= GetSystemMetrics(SM_CYMENU);
100  }
101  if ((dwStyle & WS_CAPTION) == WS_CAPTION)
102  {
103  if (dwExStyle & WS_EX_TOOLWINDOW)
104  lpRect->top -= GetSystemMetrics(SM_CYSMCAPTION);
105  else
106  lpRect->top -= GetSystemMetrics(SM_CYCAPTION);
107  }
108  UserGetWindowBorders(dwStyle, dwExStyle, &BorderSize, TRUE);
109  InflateRect(
110  lpRect,
111  BorderSize.cx,
112  BorderSize.cy);
113 
114  return TRUE;
115 }
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define TRUE
Definition: types.h:120
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
LONG cx
Definition: windef.h:334
VOID UserGetWindowBorders(DWORD Style, DWORD ExStyle, SIZE *Size, BOOL WithClient)
Definition: nonclient.c:53
#define WS_CAPTION
Definition: pedump.c:624
#define SM_CYCAPTION
Definition: winuser.h:957
int WINAPI GetSystemMetrics(_In_ int)
#define SM_CYMENU
Definition: winuser.h:970
#define SM_CYSMCAPTION
Definition: winuser.h:1008
LONG cy
Definition: windef.h:335

Referenced by AdjustWindowRectEx(), and ResetUserApiHook().

◆ RealDefWindowProcA()

LRESULT WINAPI RealDefWindowProcA ( HWND  ,
UINT  ,
WPARAM  ,
LPARAM   
)

Definition at line 813 of file defwnd.c.

817 {
818  LRESULT Result = 0;
819  PWND Wnd;
820 
821  Wnd = ValidateHwnd(hWnd);
822 
823  if ( !Wnd &&
824  Msg != WM_CTLCOLORMSGBOX &&
825  Msg != WM_CTLCOLORBTN &&
826  Msg != WM_CTLCOLORDLG &&
828  return 0;
829 
831  switch (Msg)
832  {
833  case WM_NCCREATE:
834  {
835  if ( Wnd &&
836  Wnd->style & (WS_HSCROLL | WS_VSCROLL) )
837  {
838  if (!Wnd->pSBInfo)
839  {
840  SCROLLINFO si = {sizeof si, SIF_ALL, 0, 100, 0, 0, 0};
841  SetScrollInfo( hWnd, SB_HORZ, &si, FALSE );
842  SetScrollInfo( hWnd, SB_VERT, &si, FALSE );
843  }
844  }
845 
846  if (lParam)
847  {
849  /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP)
850  * may have child window IDs instead of window name */
851  if (HIWORD(cs->lpszName))
852  {
853  DefSetText(hWnd, (PCWSTR)cs->lpszName, TRUE);
854  }
855  Result = 1;
856  }
857  break;
858  }
859 
860  case WM_GETTEXTLENGTH:
861  {
862  PWSTR buf;
863  ULONG len;
864 
865  if (Wnd != NULL && Wnd->strName.Length != 0)
866  {
868  if (buf != NULL &&
870  buf,
871  Wnd->strName.Length)))
872  {
873  Result = (LRESULT) len;
874  }
875  }
876  else Result = 0L;
877 
878  break;
879  }
880 
881  case WM_GETTEXT:
882  {
883  PWSTR buf = NULL;
884  PSTR outbuf = (PSTR)lParam;
885  SIZE_T copy;
886 
887  if (Wnd != NULL && wParam != 0)
888  {
889  if (Wnd->strName.Buffer != NULL)
891  else
892  outbuf[0] = L'\0';
893 
894  if (buf != NULL)
895  {
896  if (Wnd->strName.Length != 0)
897  {
898  copy = min(Wnd->strName.Length / sizeof(WCHAR), wParam - 1);
900  0,
901  buf,
902  copy,
903  outbuf,
904  wParam,
905  NULL,
906  NULL);
907  outbuf[Result] = '\0';
908  }
909  else
910  outbuf[0] = '\0';
911  }
912  }
913  break;
914  }
915 
916  case WM_SETTEXT:
917  {
919 
921  {
923  IntNotifyWinEvent(EVENT_OBJECT_NAMECHANGE, hWnd, OBJID_WINDOW, CHILDID_SELF, 0);
924  }
925  Result = 1;
926  break;
927  }
928 
929  case WM_IME_KEYDOWN:
930  {
932  break;
933  }
934 
935  case WM_IME_KEYUP:
936  {
938  break;
939  }
940 
941  case WM_IME_CHAR:
942  {
943  if (HIBYTE(wParam))
946  break;
947  }
948 
949  case WM_IME_COMPOSITION:
950  if (lParam & GCS_RESULTSTR)
951  {
952  LONG size, i;
953  unsigned char lead = 0;
954  char *buf = NULL;
955  HIMC himc = IMM_FN(ImmGetContext)( hWnd );
956 
957  if (himc)
958  {
959  if ((size = IMM_FN(ImmGetCompositionStringA)( himc, GCS_RESULTSTR, NULL, 0 )))
960  {
961  if (!(buf = HeapAlloc( GetProcessHeap(), 0, size ))) size = 0;
963  }
964  IMM_FN(ImmReleaseContext)( hWnd, himc );
965 
966  for (i = 0; i < size; i++)
967  {
968  unsigned char c = buf[i];
969  if (!lead)
970  {
971  if (IsDBCSLeadByte( c ))
972  lead = c;
973  else
974  SendMessageA( hWnd, WM_IME_CHAR, c, 1 );
975  }
976  else
977  {
978  SendMessageA( hWnd, WM_IME_CHAR, MAKEWORD(c, lead), 1 );
979  lead = 0;
980  }
981  }
982  HeapFree( GetProcessHeap(), 0, buf );
983  }
984  }
985  /* fall through */
986  case WM_IME_STARTCOMPOSITION:
987  case WM_IME_ENDCOMPOSITION:
988  case WM_IME_SELECT:
989  case WM_IME_NOTIFY:
990  case WM_IME_CONTROL:
991  case WM_IME_SETCONTEXT:
992 NormalImeMsgHandling:
993  {
994  HWND hwndIME;
995 
996  if (GetWin32ClientInfo()->dwTIFlags & TIF_DISABLEIME)
997  {
998  TRACE("This thread's IME is disabled\n");
999  break;
1000  }
1001 
1002  hwndIME = IMM_FN(ImmGetDefaultIMEWnd)(hWnd);
1003  if (!hwndIME)
1004  {
1005  ERR("hwndIME was NULL\n");
1006  break;
1007  }
1008 
1009  if (hwndIME == hWnd)
1010  {
1011  ImeWndProc_common(hwndIME, Msg, wParam, lParam, FALSE);
1012  break;
1013  }
1014 
1015  Result = SendMessageA(hwndIME, Msg, wParam, lParam);
1016  break;
1017  }
1018 
1019  case WM_IME_SYSTEM:
1020  {
1021  if (wParam == 4)
1022  break;
1023 
1024  goto NormalImeMsgHandling;
1025  }
1026 
1027  default:
1029  }
1030 
1032  return Result;
1033 }
#define WM_GETTEXTLENGTH
Definition: winuser.h:1609
#define WM_IME_KEYUP
Definition: winuser.h:1829
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define WM_IME_NOTIFY
Definition: winuser.h:1820
LONG WINAPI ImmGetCompositionStringA(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
Definition: compstr.c:855
#define WM_IME_KEYDOWN
Definition: winuser.h:1828
#define WM_CHAR
Definition: winuser.h:1707
#define WideCharToMultiByte
Definition: compat.h:111
#define WM_IME_CHAR
Definition: winuser.h:1824
#define LOBYTE(W)
Definition: jmemdos.c:487
#define MAKEWORD(a, b)
Definition: typedefs.h:248
#define SB_VERT
Definition: winuser.h:553
#define TRUE
Definition: types.h:120
BOOL WINAPI PostMessageA(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CTLCOLORDLG
Definition: winuser.h:1760
LRESULT WINAPI SendMessageA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
uint16_t * PWSTR
Definition: typedefs.h:56
#define CP_ACP
Definition: compat.h:109
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1762
#define WM_GETTEXT
Definition: winuser.h:1608
#define SB_HORZ
Definition: winuser.h:552
VOID FASTCALL IntNotifyWinEvent(DWORD Event, PWND pWnd, LONG idObject, LONG idChild, DWORD flags)
Definition: event.c:179
#define OBJID_WINDOW
Definition: winable.h:15
HWND hWnd
Definition: settings.c:17
#define HIBYTE(W)
Definition: jmemdos.c:486
#define WM_IME_SELECT
Definition: winuser.h:1823
PSBINFO pSBInfo
Definition: ntuser.h:721
#define GetWin32ClientInfo()
Definition: ntuser.h:347
#define GetWindowLongPtrW
Definition: winuser.h:4819
#define WM_NCCREATE
Definition: winuser.h:1673
void SPY_ExitMessage(INT iFlag, HWND hwnd, UINT msg, LRESULT lReturn, WPARAM wParam, LPARAM lParam)
Definition: spy.c:2648
WPARAM wParam
Definition: combotst.c:138
#define SPY_DEFWNDPROC
Definition: user32p.h:69
struct tagCREATESTRUCTA * LPCREATESTRUCTA
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
uint32_t cs
Definition: isohybrid.c:75
#define L(x)
Definition: ntvdm.h:50
#define WM_CTLCOLORBTN
Definition: winuser.h:1759
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
#define CHILDID_SELF
Definition: winable.h:14
_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:426
BOOL WINAPI IsDBCSLeadByte(BYTE TestByte)
Definition: nls.c:2359
#define WM_KEYDOWN
Definition: winuser.h:1705
#define WM_CTLCOLORMSGBOX
Definition: winuser.h:1756
#define WM_IME_SYSTEM
Definition: undocuser.h:60
DWORD HIMC
Definition: dimm.idl:75
#define WM_SETTEXT
Definition: winuser.h:1607
LARGE_UNICODE_STRING strName
Definition: ntuser.h:731
#define TIF_DISABLEIME
Definition: ntuser.h:287
#define WS_CAPTION
Definition: pedump.c:624
BOOL FASTCALL DefSetText(HWND hWnd, PCWSTR String, BOOL Ansi)
Definition: defwnd.c:65
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:736
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define WM_IME_SETCONTEXT
Definition: winuser.h:1819
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1057
#define WM_IME_CONTROL
Definition: winuser.h:1821
const GLubyte * c
Definition: glext.h:8905
#define WM_KEYUP
Definition: winuser.h:1706
LRESULT WINAPI ImeWndProc_common(HWND, UINT, WPARAM, LPARAM, BOOL)
Definition: imm.c:935
void SPY_EnterMessage(INT iFlag, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: spy.c:2593
#define WS_HSCROLL
Definition: pedump.c:628
GLenum GLsizei len
Definition: glext.h:6722
#define LRESULT
Definition: ole.h:14
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:1098
#define ERR(fmt,...)
Definition: debug.h:110
#define GWL_STYLE
Definition: winuser.h:846
Definition: ntuser.h:688
ULONG_PTR SIZE_T
Definition: typedefs.h:80
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
Definition: ime.c:890
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
_Use_decl_annotations_ NTSTATUS NTAPI RtlUnicodeToMultiByteSize(_Out_ PULONG MbSize, _In_ PCWCH UnicodeString, _In_ ULONG UnicodeSize)
Definition: nlsboot.c:145
signed char * PSTR
Definition: retypes.h:7
INT copy(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], INT append, DWORD lpdwFlags, BOOL bTouch)
Definition: copy.c:51
#define min(a, b)
Definition: monoChain.cc:55
#define SPY_RESULT_DEFWND
Definition: user32p.h:72
#define NULL
Definition: types.h:112
BOOL UserPaintCaption(PWND pWnd, INT Flags)
Definition: defwnd.c:399
static PVOID FASTCALL DesktopPtrToUser(PVOID ptr)
Definition: utils.c:324
#define WS_VSCROLL
Definition: pedump.c:627
LRESULT WINAPI User32DefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL bUnicode)
Definition: defwnd.c:317
#define HIWORD(l)
Definition: typedefs.h:247
unsigned int ULONG
Definition: retypes.h:1
#define GCS_RESULTSTR
Definition: imm.h:374
LONG_PTR LRESULT
Definition: windef.h:209
struct @1595 Msg[]
LPARAM lParam
Definition: combotst.c:139
int WINAPI SetScrollInfo(_In_ HWND, _In_ int, _In_ LPCSCROLLINFO, _In_ BOOL)
#define HeapFree(x, y, z)
Definition: compat.h:735
#define DC_TEXT
Definition: winuser.h:430
#define SIF_ALL
Definition: winuser.h:1222
#define ValidateHwnd(hwnd)
Definition: precomp.h:85
#define IMM_FN(name)
Definition: user32p.h:56
DWORD style
Definition: ntuser.h:701

Referenced by DefWindowProcA(), and ResetUserApiHook().

◆ RealDefWindowProcW()

LRESULT WINAPI RealDefWindowProcW ( HWND  ,
UINT  ,
WPARAM  ,
LPARAM   
)

Definition at line 1037 of file defwnd.c.

1041 {
1042  LRESULT Result = 0;
1043  PWND Wnd;
1044 
1045  Wnd = ValidateHwnd(hWnd);
1046 
1047  if ( !Wnd &&
1048  Msg != WM_CTLCOLORMSGBOX &&
1049  Msg != WM_CTLCOLORBTN &&
1050  Msg != WM_CTLCOLORDLG &&
1051  Msg != WM_CTLCOLORSTATIC )
1052  return 0;
1053 
1055  switch (Msg)
1056  {
1057  case WM_NCCREATE:
1058  {
1059  if ( Wnd &&
1060  Wnd->style & (WS_HSCROLL | WS_VSCROLL) )
1061  {
1062  if (!Wnd->pSBInfo)
1063  {
1064  SCROLLINFO si = {sizeof si, SIF_ALL, 0, 100, 0, 0, 0};
1065  if (Wnd->style & WS_HSCROLL)
1066  SetScrollInfo( hWnd, SB_HORZ, &si, FALSE );
1067  if (Wnd->style & WS_VSCROLL)
1068  SetScrollInfo( hWnd, SB_VERT, &si, FALSE );
1069  }
1070  }
1071 
1072  if (lParam)
1073  {
1075  /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP)
1076  * may have child window IDs instead of window name */
1077  if (HIWORD(cs->lpszName))
1078  {
1079  DefSetText(hWnd, cs->lpszName, FALSE);
1080  }
1081  Result = 1;
1082  }
1083  break;
1084  }
1085 
1086  case WM_GETTEXTLENGTH:
1087  {
1088  PWSTR buf;
1089  ULONG len;
1090 
1091  if (Wnd != NULL && Wnd->strName.Length != 0)
1092  {
1094  if (buf != NULL &&
1096  buf,
1097  Wnd->strName.Length)))
1098  {
1099  Result = (LRESULT) (Wnd->strName.Length / sizeof(WCHAR));
1100  }
1101  }
1102  else Result = 0L;
1103 
1104  break;
1105  }
1106 
1107  case WM_GETTEXT:
1108  {
1109  PWSTR buf = NULL;
1110  PWSTR outbuf = (PWSTR)lParam;
1111 
1112  if (Wnd != NULL && wParam != 0)
1113  {
1114  if (Wnd->strName.Buffer != NULL)
1116  else
1117  outbuf[0] = L'\0';
1118 
1119  if (buf != NULL)
1120  {
1121  if (Wnd->strName.Length != 0)
1122  {
1123  Result = min(Wnd->strName.Length / sizeof(WCHAR), wParam - 1);
1124  RtlCopyMemory(outbuf,
1125  buf,
1126  Result * sizeof(WCHAR));
1127  outbuf[Result] = L'\0';
1128  }
1129  else
1130  outbuf[0] = L'\0';
1131  }
1132  }
1133  break;
1134  }
1135 
1136  case WM_SETTEXT:
1137  {
1139 
1141  UserPaintCaption(Wnd, DC_TEXT);
1142  Result = 1;
1143  break;
1144  }
1145 
1146  case WM_IME_CHAR:
1147  {
1149  Result = 0;
1150  break;
1151  }
1152 
1153  case WM_IME_KEYDOWN:
1154  {
1156  break;
1157  }
1158 
1159  case WM_IME_KEYUP:
1160  {
1162  break;
1163  }
1164 
1165  case WM_IME_COMPOSITION:
1166  if (lParam & GCS_RESULTSTR)
1167  {
1168  LONG size, i;
1169  WCHAR *buf = NULL;
1170  HIMC himc = IMM_FN(ImmGetContext)( hWnd );
1171 
1172  if (himc)
1173  {
1174  if ((size = IMM_FN(ImmGetCompositionStringW)( himc, GCS_RESULTSTR, NULL, 0 )))
1175  {
1176  if (!(buf = HeapAlloc( GetProcessHeap(), 0, size * sizeof(WCHAR) ))) size = 0;
1177  else size = IMM_FN(ImmGetCompositionStringW)( himc, GCS_RESULTSTR, buf, size * sizeof(WCHAR) );
1178  }
1179  IMM_FN(ImmReleaseContext)( hWnd, himc );
1180 
1181  for (i = 0; i < size / sizeof(WCHAR); i++)
1182  SendMessageW( hWnd, WM_IME_CHAR, buf[i], 1 );
1183  HeapFree( GetProcessHeap(), 0, buf );
1184  }
1185  }
1186  /* fall through */
1187  case WM_IME_STARTCOMPOSITION:
1188  case WM_IME_ENDCOMPOSITION:
1189  case WM_IME_SELECT:
1190  case WM_IME_NOTIFY:
1191  case WM_IME_CONTROL:
1192  case WM_IME_SETCONTEXT:
1193 NormalImeMsgHandling:
1194  {
1195  HWND hwndIME;
1196 
1197  if (GetWin32ClientInfo()->dwTIFlags & TIF_DISABLEIME)
1198  {
1199  TRACE("This thread's IME is disabled\n");
1200  break;
1201  }
1202 
1203  hwndIME = IMM_FN(ImmGetDefaultIMEWnd)(hWnd);
1204  if (!hwndIME)
1205  {
1206  ERR("hwndIME was NULL\n");
1207  break;
1208  }
1209 
1210  if (hwndIME == hWnd)
1211  {
1212  ImeWndProc_common(hwndIME, Msg, wParam, lParam, TRUE);
1213  break;
1214  }
1215 
1216  Result = SendMessageW(hwndIME, Msg, wParam, lParam);
1217  break;
1218  }
1219 
1220  case WM_IME_SYSTEM:
1221  {
1222  if (wParam == 4)
1223  break;
1224 
1225  goto NormalImeMsgHandling;
1226  }
1227 
1228  default:
1230  }
1232 
1233  return Result;
1234 }
#define WM_GETTEXTLENGTH
Definition: winuser.h:1609
#define WM_IME_KEYUP
Definition: winuser.h:1829
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define WM_IME_NOTIFY
Definition: winuser.h:1820
#define WM_IME_KEYDOWN
Definition: winuser.h:1828
#define WM_CHAR
Definition: winuser.h:1707
#define WM_IME_CHAR
Definition: winuser.h:1824
#define SB_VERT
Definition: winuser.h:553
#define TRUE
Definition: types.h:120
#define WM_CTLCOLORDLG
Definition: winuser.h:1760
uint16_t * PWSTR
Definition: typedefs.h:56
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1762
#define WM_GETTEXT
Definition: winuser.h:1608
#define SB_HORZ
Definition: winuser.h:552
HWND hWnd
Definition: settings.c:17
#define WM_IME_SELECT
Definition: winuser.h:1823
PSBINFO pSBInfo
Definition: ntuser.h:721
#define GetWin32ClientInfo()
Definition: ntuser.h:347
#define GetWindowLongPtrW
Definition: winuser.h:4819
#define WM_NCCREATE
Definition: winuser.h:1673
void SPY_ExitMessage(INT iFlag, HWND hwnd, UINT msg, LRESULT lReturn, WPARAM wParam, LPARAM lParam)
Definition: spy.c:2648
WPARAM wParam
Definition: combotst.c:138
#define SPY_DEFWNDPROC
Definition: user32p.h:69
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
uint32_t cs
Definition: isohybrid.c:75
#define L(x)
Definition: ntvdm.h:50
#define WM_CTLCOLORBTN
Definition: winuser.h:1759
#define FALSE
Definition: types.h:117
long LONG
Definition: pedump.c:60
_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:426
#define WM_KEYDOWN
Definition: winuser.h:1705
#define WM_CTLCOLORMSGBOX
Definition: winuser.h:1756
#define WM_IME_SYSTEM
Definition: undocuser.h:60
DWORD HIMC
Definition: dimm.idl:75
#define WM_SETTEXT
Definition: winuser.h:1607
LARGE_UNICODE_STRING strName
Definition: ntuser.h:731
#define TIF_DISABLEIME
Definition: ntuser.h:287
#define WS_CAPTION
Definition: pedump.c:624
BOOL FASTCALL DefSetText(HWND hWnd, PCWSTR String, BOOL Ansi)
Definition: defwnd.c:65
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:736
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG WINAPI ImmGetCompositionStringW(HIMC hIMC, DWORD dwIndex, LPVOID lpBuf, DWORD dwBufLen)
Definition: compstr.c:898
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define WM_IME_SETCONTEXT
Definition: winuser.h:1819
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1057
#define WM_IME_CONTROL
Definition: winuser.h:1821
#define WM_KEYUP
Definition: winuser.h:1706
LRESULT WINAPI ImeWndProc_common(HWND, UINT, WPARAM, LPARAM, BOOL)
Definition: imm.c:935
void SPY_EnterMessage(INT iFlag, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: spy.c:2593
#define WS_HSCROLL
Definition: pedump.c:628
GLenum GLsizei len
Definition: glext.h:6722
#define LRESULT
Definition: ole.h:14
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:1098
#define ERR(fmt,...)
Definition: debug.h:110
#define GWL_STYLE
Definition: winuser.h:846
Definition: ntuser.h:688
HWND WINAPI ImmGetDefaultIMEWnd(HWND hWnd)
Definition: ime.c:890
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
_Use_decl_annotations_ NTSTATUS NTAPI RtlUnicodeToMultiByteSize(_Out_ PULONG MbSize, _In_ PCWCH UnicodeString, _In_ ULONG UnicodeSize)
Definition: nlsboot.c:145
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
struct tagCREATESTRUCTW * LPCREATESTRUCTW
#define min(a, b)
Definition: monoChain.cc:55
#define SPY_RESULT_DEFWND
Definition: user32p.h:72
#define NULL
Definition: types.h:112
BOOL UserPaintCaption(PWND pWnd, INT Flags)
Definition: defwnd.c:399
static PVOID FASTCALL DesktopPtrToUser(PVOID ptr)
Definition: utils.c:324
#define WS_VSCROLL
Definition: pedump.c:627
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI User32DefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL bUnicode)
Definition: defwnd.c:317
#define HIWORD(l)
Definition: typedefs.h:247
unsigned int ULONG
Definition: retypes.h:1
#define GCS_RESULTSTR
Definition: imm.h:374
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
LONG_PTR LRESULT
Definition: windef.h:209
struct @1595 Msg[]
LPARAM lParam
Definition: combotst.c:139
int WINAPI SetScrollInfo(_In_ HWND, _In_ int, _In_ LPCSCROLLINFO, _In_ BOOL)
#define HeapFree(x, y, z)
Definition: compat.h:735
#define DC_TEXT
Definition: winuser.h:430
#define SIF_ALL
Definition: winuser.h:1222
#define ValidateHwnd(hwnd)
Definition: precomp.h:85
#define IMM_FN(name)
Definition: user32p.h:56
DWORD style
Definition: ntuser.h:701

Referenced by DefWindowProcW(), and ResetUserApiHook().

◆ RealDrawFrameControl()

BOOL WINAPI RealDrawFrameControl ( HDC  ,
LPRECT  ,
UINT  ,
UINT   
)

Definition at line 1423 of file draw.c.

1424 {
1425  if (GetMapMode(hDC) != MM_TEXT)
1426  return FALSE;
1427 
1428  switch(uType)
1429  {
1430  case DFC_BUTTON:
1431  return UITOOLS95_DrawFrameButton(hDC, rc, uState);
1432  case DFC_CAPTION:
1433  return UITOOLS95_DrawFrameCaption(hDC, rc, uState);
1434  case DFC_MENU:
1435  {
1436  BOOL ret;
1437  COLORREF rgbOldText;
1438  INT iOldBackMode;
1439 
1440  if (uState & (DFCS_MENUARROWUP | DFCS_MENUARROWDOWN))
1441  {
1442  if (!(uState & DFCS_TRANSPARENT))
1443  FillRect(hDC, rc, (HBRUSH)(COLOR_MENU + 1)); /* Fill by menu color */
1444  }
1445  else
1446  {
1447  FillRect(hDC, rc, (HBRUSH)GetStockObject(WHITE_BRUSH)); /* Fill by white */
1448  }
1449 
1450  rgbOldText = SetTextColor(hDC, RGB(0, 0, 0)); /* Draw by black */
1451  iOldBackMode = SetBkMode(hDC, TRANSPARENT);
1452  ret = UITOOLS95_DrawFrameMenu(hDC, rc, uState);
1453  SetBkMode(hDC, iOldBackMode);
1454  SetTextColor(hDC, rgbOldText);
1455  return ret;
1456  }
1457 #if 0
1458  case DFC_POPUPMENU:
1459  UNIMPLEMENTED;
1460  break;
1461 #endif
1462  case DFC_SCROLL:
1463  return UITOOLS95_DrawFrameScroll(hDC, rc, uState);
1464  }
1465  return FALSE;
1466 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define DFC_BUTTON
Definition: winuser.h:476
#define RGB(r, g, b)
Definition: precomp.h:62
#define WHITE_BRUSH
Definition: wingdi.h:902
INT WINAPI FillRect(HDC hDC, CONST RECT *lprc, HBRUSH hbr)
Definition: draw.c:1057
int32_t INT
Definition: typedefs.h:58
BOOL FASTCALL UITOOLS95_DrawFrameScroll(HDC dc, LPRECT r, UINT uFlags)
Definition: draw.c:856
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
BOOL FASTCALL UITOOLS95_DrawFrameCaption(HDC dc, LPRECT r, UINT uFlags)
Definition: draw.c:788
#define FALSE
Definition: types.h:117
BOOL FASTCALL UITOOLS95_DrawFrameButton(HDC hdc, LPRECT rc, UINT uState)
Definition: draw.c:759
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRANSPARENT
Definition: wingdi.h:950
#define COLOR_MENU
Definition: winuser.h:911
#define DFCS_MENUARROWDOWN
Definition: undocuser.h:159
BOOL FASTCALL UITOOLS95_DrawFrameMenu(HDC dc, LPRECT r, UINT uFlags)
Definition: draw.c:959
#define DFCS_MENUARROWUP
Definition: undocuser.h:158
DWORD COLORREF
Definition: windef.h:300
int ret
int WINAPI GetMapMode(_In_ HDC)
Definition: coord.c:114
#define DFC_CAPTION
Definition: winuser.h:473
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
static HDC hDC
Definition: 3dtext.c:33
#define DFC_SCROLL
Definition: winuser.h:475
#define MM_TEXT
Definition: wingdi.h:873
#define UNIMPLEMENTED
Definition: debug.h:115
#define DFC_MENU
Definition: winuser.h:474

Referenced by DrawFrameControl(), and ResetUserApiHook().

◆ RealGetScrollInfo()

BOOL WINAPI RealGetScrollInfo ( HWND  ,
INT  ,
LPSCROLLINFO   
)

Definition at line 1513 of file scrollbar.c.

1514 {
1515  PWND pWnd;
1516  PSBDATA pSBData;
1517 
1518  if (SB_CTL == SBType)
1519  {
1520  return SendMessageW(Wnd, SBM_GETSCROLLINFO, 0, (LPARAM) Info);
1521  }
1522 
1523  pWnd = ValidateHwnd(Wnd);
1524  if (!pWnd) return FALSE;
1525 
1526  if (SBType < SB_HORZ || SBType > SB_VERT)
1527  {
1529  return FALSE;
1530  }
1531  if (!pWnd->pSBInfo)
1532  {
1534  return FALSE;
1535  }
1536  pSBData = IntGetSBData(pWnd, SBType);
1537  return NtUserSBGetParms(Wnd, SBType, pSBData, Info);
1538 }
PSBDATA FASTCALL IntGetSBData(PWND pwnd, INT Bar)
Definition: scrollbar.c:83
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SB_CTL
Definition: winuser.h:554
#define SB_VERT
Definition: winuser.h:553
PSBINFO pSBInfo
Definition: ntuser.h:721
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
#define FALSE
Definition: types.h:117
LONG_PTR LPARAM
Definition: windef.h:208
BOOL APIENTRY NtUserSBGetParms(HWND hWnd, int fnBar, PSBDATA pSBData, LPSCROLLINFO lpsi)
Definition: scrollbar.c:1325
#define ERROR_NO_SCROLLBARS
Definition: winerror.h:928
#define SetLastError(x)
Definition: compat.h:752
Definition: ntuser.h:688
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define ValidateHwnd(hwnd)
Definition: precomp.h:85

Referenced by GetScrollInfo(), and ResetUserApiHook().

◆ RealGetSystemMetrics()

int WINAPI RealGetSystemMetrics ( int  )

Definition at line 128 of file desktop.c.

129 {
130  //FIXME("Global Server Data -> %x\n",gpsi);
131  if (nIndex < 0 || nIndex >= SM_CMETRICS) return 0;
132  return gpsi->aiSysMet[nIndex];
133 }
PSERVERINFO gpsi
Definition: imm.c:18
#define SM_CMETRICS
Definition: winuser.h:1059

Referenced by GetSystemMetrics(), and ResetUserApiHook().

◆ RealMDIRedrawFrame()

BOOL WINAPI RealMDIRedrawFrame ( HWND  hWnd,
DWORD  flags 
)

Definition at line 311 of file usrapihk.c.

312 {
313  return NtUserxMDIRedrawFrame(hWnd);
314 }
EXTINLINE BOOL NtUserxMDIRedrawFrame(HWND hWnd)
Definition: ntwrapper.h:783
HWND hWnd
Definition: settings.c:17

Referenced by MDIRedrawFrame(), and ResetUserApiHook().

◆ RealSetScrollInfo()

INT WINAPI RealSetScrollInfo ( HWND  ,
int  ,
LPCSCROLLINFO  ,
BOOL   
)

Definition at line 1666 of file scrollbar.c.

1667 {
1668  if (SB_CTL == SBType)
1669  {
1670  return SendMessageW(Wnd, SBM_SETSCROLLINFO, (WPARAM) bRedraw, (LPARAM) Info);
1671  }
1672  else
1673  {
1674  return NtUserSetScrollInfo(Wnd, SBType, Info, bRedraw);
1675  }
1676 }
#define SB_CTL
Definition: winuser.h:554
UINT_PTR WPARAM
Definition: windef.h:207
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:683
DWORD APIENTRY NtUserSetScrollInfo(HWND hWnd, int fnBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
Definition: scrollbar.c:1474
LONG_PTR LPARAM
Definition: windef.h:208
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by ResetUserApiHook(), and SetScrollInfo().

◆ RealSystemParametersInfoA()

BOOL WINAPI RealSystemParametersInfoA ( UINT  ,
UINT  ,
PVOID  ,
UINT   
)

Definition at line 180 of file desktop.c.

184 {
185  switch (uiAction)
186  {
187 
188  case SPI_GETNONCLIENTMETRICS:
189  {
190  LPNONCLIENTMETRICSA pnclma = (LPNONCLIENTMETRICSA)pvParam;
191  NONCLIENTMETRICSW nclmw;
192  if(pnclma->cbSize != sizeof(NONCLIENTMETRICSA))
193  {
195  return FALSE;
196  }
197  nclmw.cbSize = sizeof(NONCLIENTMETRICSW);
198 
199  if (!SystemParametersInfoW(uiAction, sizeof(NONCLIENTMETRICSW),
200  &nclmw, fWinIni))
201  return FALSE;
202 
203  pnclma->iBorderWidth = nclmw.iBorderWidth;
204  pnclma->iScrollWidth = nclmw.iScrollWidth;
205  pnclma->iScrollHeight = nclmw.iScrollHeight;
206  pnclma->iCaptionWidth = nclmw.iCaptionWidth;
207  pnclma->iCaptionHeight = nclmw.iCaptionHeight;
208  pnclma->iSmCaptionWidth = nclmw.iSmCaptionWidth;
209  pnclma->iSmCaptionHeight = nclmw.iSmCaptionHeight;
210  pnclma->iMenuWidth = nclmw.iMenuWidth;
211  pnclma->iMenuHeight = nclmw.iMenuHeight;
212  LogFontW2A(&(pnclma->lfCaptionFont), &(nclmw.lfCaptionFont));
213  LogFontW2A(&(pnclma->lfSmCaptionFont), &(nclmw.lfSmCaptionFont));
214  LogFontW2A(&(pnclma->lfMenuFont), &(nclmw.lfMenuFont));
215  LogFontW2A(&(pnclma->lfStatusFont), &(nclmw.lfStatusFont));
216  LogFontW2A(&(pnclma->lfMessageFont), &(nclmw.lfMessageFont));
217  return TRUE;
218  }
219  case SPI_SETNONCLIENTMETRICS:
220  {
221  LPNONCLIENTMETRICSA pnclma = (LPNONCLIENTMETRICSA)pvParam;
222  NONCLIENTMETRICSW nclmw;
223  if(pnclma->cbSize != sizeof(NONCLIENTMETRICSA))
224  {
226  return FALSE;
227  }
228  nclmw.cbSize = sizeof(NONCLIENTMETRICSW);
229  nclmw.iBorderWidth = pnclma->iBorderWidth;
230  nclmw.iScrollWidth = pnclma->iScrollWidth;
231  nclmw.iScrollHeight = pnclma->iScrollHeight;
232  nclmw.iCaptionWidth = pnclma->iCaptionWidth;
233  nclmw.iCaptionHeight = pnclma->iCaptionHeight;
234  nclmw.iSmCaptionWidth = pnclma->iSmCaptionWidth;
235  nclmw.iSmCaptionHeight = pnclma->iSmCaptionHeight;
236  nclmw.iMenuWidth = pnclma->iMenuWidth;
237  nclmw.iMenuHeight = pnclma->iMenuHeight;
238  LogFontA2W(&(nclmw.lfCaptionFont), &(pnclma->lfCaptionFont));
239  LogFontA2W(&(nclmw.lfSmCaptionFont), &(pnclma->lfSmCaptionFont));
240  LogFontA2W(&(nclmw.lfMenuFont), &(pnclma->lfMenuFont));
241  LogFontA2W(&(nclmw.lfStatusFont), &(pnclma->lfStatusFont));
242  LogFontA2W(&(nclmw.lfMessageFont), &(pnclma->lfMessageFont));
243 
244  return SystemParametersInfoW(uiAction, sizeof(NONCLIENTMETRICSW),
245  &nclmw, fWinIni);
246  }
247  case SPI_GETICONMETRICS:
248  {
249  LPICONMETRICSA picma = (LPICONMETRICSA)pvParam;
250  ICONMETRICSW icmw;
251  if(picma->cbSize != sizeof(ICONMETRICSA))
252  {
254  return FALSE;
255  }
256  icmw.cbSize = sizeof(ICONMETRICSW);
257  if (!SystemParametersInfoW(uiAction, sizeof(ICONMETRICSW),
258  &icmw, fWinIni))
259  return FALSE;
260 
261  picma->iHorzSpacing = icmw.iHorzSpacing;
262  picma->iVertSpacing = icmw.iVertSpacing;
263  picma->iTitleWrap = icmw.iTitleWrap;
264  LogFontW2A(&(picma->lfFont), &(icmw.lfFont));
265  return TRUE;
266  }
267  case SPI_SETICONMETRICS:
268  {
269  LPICONMETRICSA picma = (LPICONMETRICSA)pvParam;
270  ICONMETRICSW icmw;
271  if(picma->cbSize != sizeof(ICONMETRICSA))
272  {
274  return FALSE;
275  }
276  icmw.cbSize = sizeof(ICONMETRICSW);
277  icmw.iHorzSpacing = picma->iHorzSpacing;
278  icmw.iVertSpacing = picma->iVertSpacing;
279  icmw.iTitleWrap = picma->iTitleWrap;
280  LogFontA2W(&(icmw.lfFont), &(picma->lfFont));
281 
282  return SystemParametersInfoW(uiAction, sizeof(ICONMETRICSW),
283  &icmw, fWinIni);
284  }
286  {
287  LOGFONTW lfw;
288  if (!SystemParametersInfoW(uiAction, 0, &lfw, fWinIni))
289  return FALSE;
290  LogFontW2A(pvParam, &lfw);
291  return TRUE;
292  }
294  {
295  LPLOGFONTA plfa = (LPLOGFONTA)pvParam;
296  LOGFONTW lfw;
297  LogFontA2W(&lfw,plfa);
298  return SystemParametersInfoW(uiAction, 0, &lfw, fWinIni);
299  }
301  {
302  BOOL Ret;
303  WCHAR awc[MAX_PATH];
304  UNICODE_STRING ustrWallpaper;
305  ANSI_STRING astrWallpaper;
306 
308  RtlInitUnicodeString(&ustrWallpaper, awc);
309  RtlInitEmptyAnsiString(&astrWallpaper, pvParam, uiParam);
310  RtlUnicodeStringToAnsiString(&astrWallpaper, &ustrWallpaper, FALSE);
311  return Ret;
312  }
313 
315  {
316  UNICODE_STRING ustrWallpaper;
317  BOOL Ret;
318 
319  if (pvParam)
320  {
321  if (!RtlCreateUnicodeStringFromAsciiz(&ustrWallpaper, pvParam))
322  {
323  ERR("RtlCreateUnicodeStringFromAsciiz failed\n");
324  return FALSE;
325  }
326  pvParam = &ustrWallpaper;
327  }
328 
329  Ret = NtUserSystemParametersInfo(SPI_SETDESKWALLPAPER, uiParam, pvParam, fWinIni);
330 
331  if (pvParam)
332  RtlFreeUnicodeString(&ustrWallpaper);
333 
334  return Ret;
335  }
336  }
337  return NtUserSystemParametersInfo(uiAction, uiParam, pvParam, fWinIni);
338 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define TRUE
Definition: types.h:120
#define SPI_SETDESKWALLPAPER
Definition: winuser.h:1359
VOID WINAPI LogFontW2A(LPLOGFONTA pA, CONST LOGFONTW *pW)
Definition: desktop.c:103
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToAnsiString(PANSI_STRING DestinationString, PUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
VOID WINAPI LogFontA2W(LPLOGFONTW pW, CONST LOGFONTA *pA)
Definition: desktop.c:77
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define SetLastError(x)
Definition: compat.h:752
BOOL WINAPI SystemParametersInfoW(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
Definition: desktop.c:398
#define ERR(fmt,...)
Definition: debug.h:110
#define SPI_SETICONTITLELOGFONT
Definition: winuser.h:1373
BOOL NTAPI NtUserSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
Definition: sysparams.c:2153
#define SPI_GETICONTITLELOGFONT
Definition: winuser.h:1370
struct tagLOGFONTA * LPLOGFONTA
#define SPI_GETDESKWALLPAPER
Definition: sysparams.c:34
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)

Referenced by ResetUserApiHook(), and SystemParametersInfoA().

◆ RealSystemParametersInfoW()

BOOL WINAPI RealSystemParametersInfoW ( UINT  ,
UINT  ,
PVOID  ,
UINT   
)

Definition at line 341 of file desktop.c.

345 {
346  switch(uiAction)
347  {
348 
350  {
351  UNICODE_STRING ustrWallpaper;
352 
353  RtlInitUnicodeString(&ustrWallpaper, pvParam);
354  return NtUserSystemParametersInfo(SPI_SETDESKWALLPAPER, uiParam, &ustrWallpaper, fWinIni);
355  }
356  }
357  return NtUserSystemParametersInfo(uiAction, uiParam, pvParam, fWinIni);
358 }
#define SPI_SETDESKWALLPAPER
Definition: winuser.h:1359
BOOL NTAPI NtUserSystemParametersInfo(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
Definition: sysparams.c:2153
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)

Referenced by ResetUserApiHook(), and SystemParametersInfoW().

◆ RealUserDrawCaption()

BOOL WINAPI RealUserDrawCaption ( HWND  hWnd,
HDC  hDC,
LPCRECT  lpRc,
UINT  uFlags 
)

Definition at line 80 of file nonclient.c.

81 {
82  ERR("Real DC flags %08x\n",uFlags);
83  return NtUserDrawCaption(hWnd, hDC, lpRc, uFlags);
84 }
HWND hWnd
Definition: settings.c:17
UINT uFlags
Definition: api.c:59
#define ERR(fmt,...)
Definition: debug.h:110
static HDC hDC
Definition: 3dtext.c:33
BOOL NTAPI NtUserDrawCaption(HWND hWnd, HDC hDc, LPCRECT lpRc, UINT uFlags)
Definition: painting.c:2462

Referenced by ResetUserApiHook().

◆ RegisterUserApiHook()

BOOL WINAPI RegisterUserApiHook ( PUSERAPIHOOKINFO  puah)

Definition at line 376 of file usrapihk.c.

377 {
378  UNICODE_STRING m_dllname1;
379  UNICODE_STRING m_funname1;
380 
381  if (puah->m_size == sizeof(USERAPIHOOKINFO))
382  {
383  WARN("RegisterUserApiHook: %S and %S\n", puah->m_dllname1, puah->m_funname1);
384  RtlInitUnicodeString(&m_dllname1, puah->m_dllname1);
385  RtlInitUnicodeString(&m_funname1, puah->m_funname1);
386  return NtUserRegisterUserApiHook( &m_dllname1, &m_funname1, 0, 0);
387  }
388  return FALSE;
389 }
BOOL NTAPI NtUserRegisterUserApiHook(PUNICODE_STRING m_dllname1, PUNICODE_STRING m_funname1, DWORD dwUnknown3, DWORD dwUnknown4)
Definition: hook.c:1724
#define WARN(fmt,...)
Definition: debug.h:112
LPCWSTR m_funname1
Definition: undocuser.h:376
#define FALSE
Definition: types.h:117
LPCWSTR m_dllname1
Definition: undocuser.h:375
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)

◆ ResetUserApiHook()

VOID FASTCALL ResetUserApiHook ( PUSERAPIHOOK  puah)

Definition at line 131 of file usrapihk.c.

132 {
133  // Setup Structure.....
134  puah->size = sizeof(USERAPIHOOK);
138  puah->DefWndProcArray.Size = 0;
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;
160 }
struct tagUSERAPIHOOK USERAPIHOOK
BOOL WINAPI RealMDIRedrawFrame(HWND, DWORD)
Definition: usrapihk.c:311
GETREALWINDOWOWNER GetRealWindowOwner
Definition: undocuser.h:360
WNDPROC_OWP PostDefDlgProc
Definition: undocuser.h:351
UAHOWP DlgProcArray
Definition: undocuser.h:352
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:1389
DRAWCAPTION DrawCaption
Definition: undocuser.h:358
SETWINDOWRGN SetWindowRgn
Definition: undocuser.h:346
ADJUSTWINDOWRECTEX AdjustWindowRectEx
Definition: undocuser.h:345
WNDPROC DefWindowProcW
Definition: undocuser.h:340
WNDPROC_OWP PostWndProc
Definition: undocuser.h:348
ENABLESCROLLBAR EnableScrollBar
Definition: undocuser.h:344
INT WINAPI RealSetScrollInfo(HWND, int, LPCSCROLLINFO, BOOL)
Definition: scrollbar.c:1666
SYSTEMPARAMETERSINFOW SystemParametersInfoW
Definition: undocuser.h:355
UAHOWP DefWndProcArray
Definition: undocuser.h:341
MDIREDRAWFRAME MDIRedrawFrame
Definition: undocuser.h:359
GETSCROLLINFO GetScrollInfo
Definition: undocuser.h:342
LRESULT WINAPI DefaultOWP(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR lResult, PDWORD pData)
Definition: usrapihk.c:52
GETSYSTEMMETRICS GetSystemMetrics
Definition: undocuser.h:353
BOOL WINAPI RealGetScrollInfo(HWND, INT, LPSCROLLINFO)
Definition: scrollbar.c:1513
DRAWFRAMECONTROL DrawFrameControl
Definition: undocuser.h:357
DWORD Size
Definition: undocuser.h:329
FORCERESETUSERAPIHOOK ForceResetUserApiHook
Definition: undocuser.h:356
WNDPROC_OWP PreDefDlgProc
Definition: undocuser.h:350
WNDPROC DefWindowProcA
Definition: undocuser.h:339
BOOL WINAPI RealAdjustWindowRectEx(LPRECT, DWORD, BOOL, DWORD)
Definition: nonclient.c:90
BYTE * MsgBitArray
Definition: undocuser.h:328
SYSTEMPARAMETERSINFOA SystemParametersInfoA
Definition: undocuser.h:354
BOOL WINAPI RealDrawFrameControl(HDC, LPRECT, UINT, UINT)
Definition: draw.c:1423
int WINAPI RealGetSystemMetrics(int)
Definition: desktop.c:128
WNDPROC_OWP PreWndProc
Definition: undocuser.h:347
#define NULL
Definition: types.h:112
UAHOWP WndProcArray
Definition: undocuser.h:349
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:1900
LRESULT WINAPI RealDefWindowProcA(HWND, UINT, WPARAM, LPARAM)
Definition: defwnd.c:813
LRESULT WINAPI RealDefWindowProcW(HWND, UINT, WPARAM, LPARAM)
Definition: defwnd.c:1037
INT NTAPI NtUserSetWindowRgn(HWND hWnd, HRGN hRgn, BOOL bRedraw)
Definition: winpos.c:3522
SETSCROLLINFO SetScrollInfo
Definition: undocuser.h:343

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

◆ UnregisterUserApiHook()

BOOL WINAPI UnregisterUserApiHook ( VOID  )

Definition at line 394 of file usrapihk.c.

395 {
397 }
BOOL NTAPI NtUserUnregisterUserApiHook(VOID)
Definition: hook.c:1770

Referenced by ThemeHooksRemove().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( user32  )

Variable Documentation

◆ gcCallUserApiHook

LONG gcCallUserApiHook = 0

Definition at line 35 of file usrapihk.c.

Referenced by BeginIfHookedUserApiHook(), ClearUserApiHook(), and EndUserApiHook().

◆ gcLoadUserApiHook

DWORD gcLoadUserApiHook = 0

Definition at line 34 of file usrapihk.c.

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

◆ gcsUserApiHook

RTL_CRITICAL_SECTION gcsUserApiHook

Definition at line 39 of file usrapihk.c.

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

◆ gfUserApiHook

DWORD gfUserApiHook = 0

Definition at line 36 of file usrapihk.c.

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

◆ ghmodUserApiHook

◆ gpfnInitUserApi

USERAPIHOOKPROC gpfnInitUserApi

◆ grgbDlgLiteHookMsg

BYTE grgbDlgLiteHookMsg[128]

Definition at line 43 of file usrapihk.c.

Referenced by InitUserApiHook().

◆ grgbDwpLiteHookMsg

BYTE grgbDwpLiteHookMsg[128]

Definition at line 41 of file usrapihk.c.

Referenced by InitUserApiHook().

◆ grgbWndLiteHookMsg

BYTE grgbWndLiteHookMsg[128]

Definition at line 42 of file usrapihk.c.

Referenced by InitUserApiHook().

◆ guah

Initial value:
=
{
sizeof(USERAPIHOOK),
{NULL, 0},
{NULL, 0},
{NULL, 0},
}
struct tagUSERAPIHOOK USERAPIHOOK
BOOL WINAPI RealMDIRedrawFrame(HWND, DWORD)
Definition: usrapihk.c:311
BOOL WINAPI RealSystemParametersInfoW(UINT, UINT, PVOID, UINT)
Definition: desktop.c:341
BOOL NTAPI NtUserEnableScrollBar(HWND hWnd, UINT wSBflags, UINT wArrows)
Definition: scrollbar.c:1389
INT WINAPI RealSetScrollInfo(HWND, int, LPCSCROLLINFO, BOOL)
Definition: scrollbar.c:1666
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:1513
BOOL WINAPI RealAdjustWindowRectEx(LPRECT, DWORD, BOOL, DWORD)
Definition: nonclient.c:90
BOOL WINAPI RealDrawFrameControl(HDC, LPRECT, UINT, UINT)
Definition: draw.c:1423
int WINAPI RealGetSystemMetrics(int)
Definition: desktop.c:128
#define NULL
Definition: types.h:112
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:1900
LRESULT WINAPI RealDefWindowProcA(HWND, UINT, WPARAM, LPARAM)
Definition: defwnd.c:813
LRESULT WINAPI RealDefWindowProcW(HWND, UINT, WPARAM, LPARAM)
Definition: defwnd.c:1037
INT NTAPI NtUserSetWindowRgn(HWND hWnd, HRGN hRgn, BOOL bRedraw)
Definition: winpos.c:3522
BOOL NTAPI NtUserDrawCaption(HWND hWnd, HDC hDc, LPCRECT lpRc, UINT uFlags)
Definition: painting.c:2462

Definition at line 344 of file usrapihk.c.

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