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.

71 lines
1.3 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. StoneAge.cpp
  5. Abstract:
  6. The app is trying to create a window with NULL WndProc, and later it seems does
  7. not really use it , and just launch the installshield setup program and exit.
  8. Fix this by providing a dummy WndProc.
  9. BUGBUG: Need to add to EmulateUSER when possible.
  10. Notes:
  11. This is an app specific shim.
  12. History:
  13. 06/09/2001 xiaoz Created
  14. --*/
  15. #include "precomp.h"
  16. IMPLEMENT_SHIM_BEGIN(StoneAge)
  17. #include "ShimHookMacro.h"
  18. APIHOOK_ENUM_BEGIN
  19. APIHOOK_ENUM_ENTRY(RegisterClassExA)
  20. APIHOOK_ENUM_END
  21. /*++
  22. Set the WndProc to DefWndProc if it's NULL.
  23. --*/
  24. ATOM
  25. APIHOOK(RegisterClassExA)(
  26. CONST WNDCLASSEXA *lpwcx // class data
  27. )
  28. {
  29. if (!(lpwcx->lpfnWndProc)) {
  30. WNDCLASSEXA wcNewWndClassEx = *lpwcx;
  31. LOGN(eDbgLevelError, "[RegisterClassExA] Null WndProc specified - correcting.");
  32. wcNewWndClassEx.lpfnWndProc = DefWindowProcA;
  33. return ORIGINAL_API(RegisterClassExA)(&wcNewWndClassEx);
  34. }
  35. else
  36. {
  37. return ORIGINAL_API(RegisterClassExA)(lpwcx);
  38. }
  39. }
  40. /*++
  41. Register hooked functions
  42. --*/
  43. HOOK_BEGIN
  44. APIHOOK_ENTRY(USER32.DLL, RegisterClassExA)
  45. HOOK_END
  46. IMPLEMENT_SHIM_END