Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.1 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. WebPage6.cpp
  5. Abstract:
  6. The app passes in an uninitialized POINT structure in a call to ScreenToClient API.
  7. The API call fails, however the apps goes on to use the POINT structure
  8. resulting in an AV. This shim zeroes in the POINT structure passed to the API
  9. if the API call fails.
  10. History:
  11. 02/02/2001 a-leelat Created
  12. --*/
  13. #include "precomp.h"
  14. IMPLEMENT_SHIM_BEGIN(WebPage6)
  15. #include "ShimHookMacro.h"
  16. APIHOOK_ENUM_BEGIN
  17. APIHOOK_ENUM_ENTRY(ScreenToClient)
  18. APIHOOK_ENUM_END
  19. BOOL APIHOOK(ScreenToClient)(
  20. HWND hWnd, // handle to window
  21. LPPOINT lpPoint // screen coordinates
  22. )
  23. {
  24. BOOL bRet;
  25. //Call the actual API
  26. bRet = ORIGINAL_API(ScreenToClient)(hWnd,lpPoint);
  27. //Zero fill the POINT structure
  28. if ( (bRet == 0) && lpPoint )
  29. {
  30. ZeroMemory(lpPoint,sizeof(POINT));
  31. }
  32. return bRet;
  33. }
  34. /*++
  35. Register hooked functions
  36. --*/
  37. HOOK_BEGIN
  38. APIHOOK_ENTRY( USER32.DLL, ScreenToClient)
  39. HOOK_END
  40. IMPLEMENT_SHIM_END