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.

63 lines
922 B

  1. /*++
  2. Copyright (c) 2002 Microsoft Corporation
  3. Module Name:
  4. AutoCad.cpp
  5. Abstract:
  6. Prevent AV when IsEmptyRect is called with a bad pointer. This fixes a hard to
  7. repro Watson bug.
  8. Notes:
  9. This is an app specific shim.
  10. History:
  11. 02/13/2002 linstev Created
  12. --*/
  13. #include "precomp.h"
  14. IMPLEMENT_SHIM_BEGIN(AutoCad)
  15. #include "ShimHookMacro.h"
  16. APIHOOK_ENUM_BEGIN
  17. APIHOOK_ENUM_ENTRY(IsRectEmpty)
  18. APIHOOK_ENUM_END
  19. /*++
  20. IsEmptyRect
  21. --*/
  22. BOOL
  23. APIHOOK(IsRectEmpty)(
  24. CONST RECT *lprc
  25. )
  26. {
  27. if (IsBadReadPtr(lprc, sizeof(RECT))) {
  28. LOGN(eDbgLevelInfo, "[IsRectEmpty] invalid lprc pointer, returning TRUE");
  29. return TRUE;
  30. }
  31. return ORIGINAL_API(IsRectEmpty)(lprc);
  32. }
  33. /*++
  34. Register hooked functions
  35. --*/
  36. HOOK_BEGIN
  37. APIHOOK_ENTRY(USER32.DLL, IsRectEmpty)
  38. HOOK_END
  39. IMPLEMENT_SHIM_END