Пример #1
0
/*
 * @implemented
 */
BOOL WINAPI
SystemParametersInfoW(UINT uiAction,
		      UINT uiParam,
		      PVOID pvParam,
		      UINT fWinIni)
{
   BOOL Hook, Ret = FALSE;

   LoadUserApiHook();

   Hook = BeginIfHookedUserApiHook();

   /* Bypass SEH and go direct. */
   if (!Hook) return RealSystemParametersInfoW(uiAction, uiParam, pvParam, fWinIni);

   _SEH2_TRY
   {
      Ret = guah.SystemParametersInfoW(uiAction, uiParam, pvParam, fWinIni);
   }
   _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
   {
   }
   _SEH2_END;

   EndUserApiHook();

   return Ret;
}
Пример #2
0
BOOL WINAPI
DrawFrameControl(HDC hDC, LPRECT rc, UINT uType, UINT uState)
{
   BOOL Hook, Ret = FALSE;

   LoadUserApiHook();

   Hook = BeginIfHookedUserApiHook();

   /* Bypass SEH and go direct. */
   if (!Hook) return RealDrawFrameControl(hDC, rc, uType, uState);

   _SEH2_TRY
   {
      Ret = guah.DrawFrameControl(hDC, rc, uType, uState);
   }
   _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
   {
   }
   _SEH2_END;

   EndUserApiHook();

   return Ret;
}
Пример #3
0
/*
 * @implemented
 */
int WINAPI
GetSystemMetrics(int nIndex)
{
   BOOL Hook;
   int Ret = 0;

   if (!gpsi) // Fixme! Hax! Need Timos delay load support?
   {
      return RealGetSystemMetrics(nIndex);
   }

   LoadUserApiHook();

   Hook = BeginIfHookedUserApiHook();

   /* Bypass SEH and go direct. */
   if (!Hook) return RealGetSystemMetrics(nIndex);

   _SEH2_TRY
   {
      Ret = guah.GetSystemMetrics(nIndex);
   }
   _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
   {
   }
   _SEH2_END;

   EndUserApiHook();

   return Ret;
}
Пример #4
0
/*
 * @implemented
 */
BOOL WINAPI
DrawCaption(HWND hWnd, HDC hDC, LPCRECT lprc, UINT uFlags)
{
   BOOL Hook, Ret = FALSE;

   LoadUserApiHook();

   Hook = BeginIfHookedUserApiHook();

   /* Bypass SEH and go direct. */
   if (!Hook) return NtUserDrawCaption(hWnd, hDC, lprc, uFlags);

   _SEH2_TRY
   {
      Ret = guah.DrawCaption(hWnd, hDC, lprc, uFlags);
   }
   _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
   {
   }
   _SEH2_END;

   EndUserApiHook();

   return Ret;
}
Пример #5
0
BOOL
WINAPI
MDIRedrawFrame(HWND hWnd, DWORD flags)
{
   BOOL Hook, Ret = FALSE;

   LoadUserApiHook();

   Hook = BeginIfHookedUserApiHook();

   /* Bypass SEH and go direct. */
   if (!Hook) return RealMDIRedrawFrame(hWnd, flags);

   _SEH2_TRY
   {
      Ret = guah.MDIRedrawFrame(hWnd, flags);
   }
   _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
   {
   }
   _SEH2_END;

   EndUserApiHook();

   return Ret;
}
Пример #6
0
/*
 * @implemented
 */
INT WINAPI
SetScrollInfo(HWND Wnd, int SBType, LPCSCROLLINFO Info, BOOL bRedraw)
{
   BOOL Hook;
   INT Ret = 0;

   LoadUserApiHook();

   Hook = BeginIfHookedUserApiHook();

     /* Bypass SEH and go direct. */
   if (!Hook) return RealSetScrollInfo(Wnd, SBType, Info, bRedraw);

   _SEH2_TRY
   {
      Ret = guah.SetScrollInfo(Wnd, SBType, Info, bRedraw);
   }
   _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
   {
   }
   _SEH2_END;

   EndUserApiHook();

   return Ret;

}
Пример #7
0
/*
 * @implemented
 */
BOOL WINAPI
AdjustWindowRectEx(LPRECT lpRect,
		   DWORD dwStyle,
		   BOOL bMenu,
		   DWORD dwExStyle)
{
   BOOL Hook, Ret = FALSE;

   LoadUserApiHook();

   Hook = BeginIfHookedUserApiHook();

     /* Bypass SEH and go direct. */
   if (!Hook) return RealAdjustWindowRectEx(lpRect, dwStyle, bMenu, dwExStyle);

   _SEH2_TRY
   {
      Ret = guah.AdjustWindowRectEx(lpRect, dwStyle, bMenu, dwExStyle);
   }
   _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
   {
   }
   _SEH2_END;

   EndUserApiHook();

   return Ret;
}
Пример #8
0
/*
 * @implemented
 */
BOOL WINAPI
GetScrollInfo(HWND Wnd, INT SBType, LPSCROLLINFO Info)
{
   BOOL Hook, Ret = FALSE;

   LoadUserApiHook();

   Hook = BeginIfHookedUserApiHook();

     /* Bypass SEH and go direct. */
   if (!Hook) return RealGetScrollInfo(Wnd, SBType, Info);

   _SEH2_TRY
   {
      Ret = guah.GetScrollInfo(Wnd, SBType, Info);
   }
   _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
   {
   }
   _SEH2_END;

   EndUserApiHook();

   return Ret;
}
Пример #9
0
/*
 * @implemented
 */
BOOL
WINAPI
DECLSPEC_HOTPATCH
EnableScrollBar( HWND hwnd, UINT nBar, UINT flags )
{
   BOOL Hook, Ret = FALSE;

   LoadUserApiHook();

   Hook = BeginIfHookedUserApiHook();

     /* Bypass SEH and go direct. */
   if (!Hook)
   {
      Ret = NtUserEnableScrollBar(hwnd, nBar, flags);
      if (!Ret) return Ret;
      SCROLL_RefreshScrollBar( hwnd, nBar, TRUE, TRUE );
      return Ret;
   }
   _SEH2_TRY
   {
      Ret = guah.EnableScrollBar(hwnd, nBar, flags);
   }
   _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
   {
   }
   _SEH2_END;

   EndUserApiHook();

   return Ret;
}
Пример #10
0
LRESULT WINAPI
DefWindowProcW(HWND hWnd,
	       UINT Msg,
	       WPARAM wParam,
	       LPARAM lParam)
{
   BOOL Hook, msgOverride = FALSE;
   LRESULT Result = 0;

   LoadUserApiHook();

   Hook = BeginIfHookedUserApiHook();
   if (Hook)
   {
      msgOverride = IsMsgOverride(Msg, &guah.DefWndProcArray);
      if(msgOverride == FALSE)
      {
          EndUserApiHook();
      }
   }

   /* Bypass SEH and go direct. */
   if (!Hook || !msgOverride)
      return RealDefWindowProcW(hWnd, Msg, wParam, lParam);

   _SEH2_TRY
   {
      Result = guah.DefWindowProcW(hWnd, Msg, wParam, lParam);
   }
   _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
   {
   }
   _SEH2_END;

   EndUserApiHook();

   return Result;
}
Пример #11
0
/*
 * @implemented
 */
BOOL WINAPI EnableScrollBar( HWND hwnd, UINT nBar, UINT flags )
{
   BOOL Hook, Ret = FALSE;

   LoadUserApiHook();

   Hook = BeginIfHookedUserApiHook();

     /* Bypass SEH and go direct. */
   if (!Hook) return NtUserEnableScrollBar(hwnd, nBar, flags);

   _SEH2_TRY
   {
      Ret = guah.EnableScrollBar(hwnd, nBar, flags);
   }
   _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
   {
   }
   _SEH2_END;

   EndUserApiHook();

   return Ret;
}
Пример #12
0
/*
 * @implemented
 */
int
WINAPI
SetWindowRgn(
  HWND hWnd,
  HRGN hRgn,
  BOOL bRedraw)
{
   BOOL Hook;
   int Ret = 0;

   LoadUserApiHook();

   Hook = BeginIfHookedUserApiHook();

   /* Bypass SEH and go direct. */
   if (!Hook)
   {
      Ret = NtUserSetWindowRgn(hWnd, hRgn, bRedraw);
      if (Ret)
          DeleteObject(hRgn);
      return Ret;
   }

   _SEH2_TRY
   {
      Ret = guah.SetWindowRgn(hWnd, hRgn, bRedraw);
   }
   _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
   {
   }
   _SEH2_END;

   EndUserApiHook();

   return Ret;
}