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.0 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. GlobalMemoryStatusLie.cpp
  5. Abstract:
  6. Lies about the amount of swap space returned from the
  7. GlobalMemoryStatus API so app will think it has a huge
  8. swap space like it did on win98.
  9. Notes:
  10. This is a general purpose shim.
  11. History:
  12. 05/08/2001 mnikkel Created
  13. --*/
  14. #include "precomp.h"
  15. #include "CharVector.h"
  16. IMPLEMENT_SHIM_BEGIN(GlobalMemoryStatusLie)
  17. #include "ShimHookMacro.h"
  18. APIHOOK_ENUM_BEGIN
  19. APIHOOK_ENUM_ENTRY(GlobalMemoryStatus)
  20. APIHOOK_ENUM_END
  21. /*++
  22. Increase the Available page file size to 400 mb.
  23. --*/
  24. VOID
  25. APIHOOK(GlobalMemoryStatus)(
  26. LPMEMORYSTATUS lpBuffer
  27. )
  28. {
  29. ORIGINAL_API(GlobalMemoryStatus)(lpBuffer);
  30. // change page file size to 400 mb.
  31. lpBuffer->dwAvailPageFile = 0x17D78400;
  32. return;
  33. }
  34. /*++
  35. Register hooked functions
  36. --*/
  37. HOOK_BEGIN
  38. APIHOOK_ENTRY(KERNEL32.DLL, GlobalMemoryStatus)
  39. HOOK_END
  40. IMPLEMENT_SHIM_END