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.

67 lines
1.1 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. ChemOffice.cpp
  5. Abstract:
  6. This shim fixes a problem where a dialog box comes up after
  7. selecting Gaussian Run. The dialog box warns of a windows
  8. error that only occurs because we are shim'ing the app with
  9. EmulateHeap. We are unable to remove EmulateHeap since this
  10. causes the app to AV so the only solution at this time is to
  11. ignore the invalid paramater windows error message that occurs.
  12. Notes:
  13. This is a specific shim.
  14. History:
  15. 03/06/2001 mnikkel Created
  16. --*/
  17. #include "precomp.h"
  18. IMPLEMENT_SHIM_BEGIN(ChemOffice)
  19. #include "ShimHookMacro.h"
  20. APIHOOK_ENUM_BEGIN
  21. APIHOOK_ENUM_ENTRY(GetLastError)
  22. APIHOOK_ENUM_END
  23. /*++
  24. Hook GetLastError
  25. --*/
  26. DWORD
  27. APIHOOK(GetLastError)(VOID)
  28. {
  29. DWORD dwResult;
  30. dwResult = ORIGINAL_API(GetLastError)();
  31. if ( dwResult == ERROR_INVALID_PARAMETER )
  32. dwResult = 0;
  33. return dwResult;
  34. }
  35. /*++
  36. Register hooked functions
  37. --*/
  38. HOOK_BEGIN
  39. APIHOOK_ENTRY(KERNEL32.DLL, GetLastError)
  40. HOOK_END
  41. IMPLEMENT_SHIM_END