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.

66 lines
1.0 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. HotFaxMessageCenter4.cpp
  5. Abstract:
  6. The app was AV'ing as it was passing a NULL handle
  7. ontained from GetDlgItem() to another call.
  8. This appspecific SHIM prevents that from happening.
  9. This is an app specific shim.
  10. History:
  11. 03/13/2001 prashkud Created
  12. --*/
  13. #include "precomp.h"
  14. IMPLEMENT_SHIM_BEGIN(HotFaxMessageCenter4)
  15. #include "ShimHookMacro.h"
  16. APIHOOK_ENUM_BEGIN
  17. APIHOOK_ENUM_ENTRY(GetDlgItem)
  18. APIHOOK_ENUM_END
  19. /*++
  20. Correct the returned HANDLE if it is NULL by passsing the previous valid
  21. HANDLE
  22. --*/
  23. HWND
  24. APIHOOK(GetDlgItem)(
  25. HWND hDlg,
  26. int nIDDlgItem
  27. )
  28. {
  29. static HWND hDlgItem = 0;
  30. HWND hCurDlgItem = 0;
  31. hCurDlgItem = ORIGINAL_API(GetDlgItem)(hDlg, nIDDlgItem);
  32. if (hCurDlgItem != NULL)
  33. {
  34. hDlgItem = hCurDlgItem;
  35. }
  36. return hDlgItem;
  37. }
  38. /*++
  39. Register hooked functions
  40. --*/
  41. HOOK_BEGIN
  42. APIHOOK_ENTRY(USER32.DLL, GetDlgItem)
  43. HOOK_END
  44. IMPLEMENT_SHIM_END