Source code of Windows XP (NT5)
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.

76 lines
1.0 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. Quicken2001.cpp
  5. Abstract:
  6. The app was passing bad string pointers to the
  7. lstrcmpiA() function which was causing it to crash
  8. during the app update.
  9. Notes:
  10. This is an app specific shim.
  11. History:
  12. 05/09/2001 prashkud Created
  13. --*/
  14. #include "precomp.h"
  15. IMPLEMENT_SHIM_BEGIN(Quicken2001)
  16. #include "ShimHookMacro.h"
  17. APIHOOK_ENUM_BEGIN
  18. APIHOOK_ENUM_ENTRY(lstrcmpiA)
  19. APIHOOK_ENUM_END
  20. /*++
  21. Checks the parameters for invalid string pointers.
  22. --*/
  23. LONG
  24. APIHOOK(lstrcmpiA)(
  25. LPCSTR lpString1,
  26. LPCSTR lpString2
  27. )
  28. {
  29. if (IsBadStringPtrA(lpString1, MAX_PATH))
  30. {
  31. lpString1 = 0;
  32. }
  33. if (IsBadStringPtrA(lpString2, MAX_PATH))
  34. {
  35. lpString2 = 0;
  36. }
  37. /*
  38. * Call the original API
  39. */
  40. return ORIGINAL_API(lstrcmpiA)(lpString1, lpString2);
  41. }
  42. /*++
  43. Register hooked functions
  44. --*/
  45. HOOK_BEGIN
  46. APIHOOK_ENTRY(KERNEL32.DLL, lstrcmpiA)
  47. HOOK_END
  48. IMPLEMENT_SHIM_END