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.

69 lines
1.0 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. MapMemoryB0000.cpp
  5. Abstract:
  6. Map memory at 0xB0000 for applications that use this memory. On Win9x, this
  7. is always a valid memory block.
  8. Notes:
  9. This is a general purpose shim.
  10. History:
  11. 05/11/2000 linstev Created
  12. 10/26/2000 linstev Removed unnecessary free code
  13. --*/
  14. #include "precomp.h"
  15. IMPLEMENT_SHIM_BEGIN(MapMemoryB0000)
  16. #include "ShimHookMacro.h"
  17. APIHOOK_ENUM_BEGIN
  18. APIHOOK_ENUM_END
  19. BOOL
  20. NOTIFY_FUNCTION(
  21. DWORD fdwReason
  22. )
  23. {
  24. if (fdwReason == DLL_PROCESS_ATTACH) {
  25. if (VirtualAlloc((LPVOID)0xB0000, 0x10000, MEM_COMMIT, PAGE_READWRITE)) {
  26. LOGN(
  27. eDbgLevelInfo,
  28. "[NotifyFn] Created block at 0xB0000.");
  29. } else {
  30. LOGN(
  31. eDbgLevelError,
  32. "[NotifyFn] Failed to create block at 0xB0000.");
  33. }
  34. }
  35. return TRUE;
  36. }
  37. /*++
  38. Register hooked functions
  39. --*/
  40. HOOK_BEGIN
  41. CALL_NOTIFY_FUNCTION
  42. HOOK_END
  43. IMPLEMENT_SHIM_END