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.

63 lines
881 B

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. SingleProcAffinity.cpp
  5. Abstract:
  6. Make the process have single processor affinity to workaround bugs that
  7. are exposed in multi-processor environments.
  8. Notes:
  9. This is a general purpose shim.
  10. History:
  11. 03/19/2000 linstev Created
  12. --*/
  13. #include "precomp.h"
  14. IMPLEMENT_SHIM_BEGIN(SingleProcAffinity)
  15. #include "ShimHookMacro.h"
  16. APIHOOK_ENUM_BEGIN
  17. APIHOOK_ENUM_END
  18. BOOL
  19. NOTIFY_FUNCTION(
  20. DWORD fdwReason
  21. )
  22. {
  23. if (fdwReason == DLL_PROCESS_ATTACH) {
  24. //
  25. // Set single processor affinity
  26. //
  27. SetProcessAffinityMask(GetCurrentProcess(), 1);
  28. LOGN( eDbgLevelInfo, "[NotifyFn] Single processor affinity set");
  29. }
  30. return TRUE;
  31. }
  32. /*++
  33. Register hooked functions
  34. --*/
  35. HOOK_BEGIN
  36. CALL_NOTIFY_FUNCTION
  37. HOOK_END
  38. IMPLEMENT_SHIM_END