detoured.cpp 704 B

1234567891011121314151617181920212223242526272829303132
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Presence of this DLL (detoured.dll) marks a process as detoured.
  4. //
  5. // Microsoft Research Detours Package, Version 2.1.
  6. //
  7. // Copyright (c) Microsoft Corporation. All rights reserved.
  8. //
  9. #include <windows.h>
  10. #include "detoured.h"
  11. static HMODULE s_hDll;
  12. HMODULE WINAPI Detoured()
  13. {
  14. return s_hDll;
  15. }
  16. BOOL WINAPI DllMain(HINSTANCE hinst, DWORD dwReason, LPVOID reserved)
  17. {
  18. (void)reserved;
  19. if (dwReason == DLL_PROCESS_ATTACH) {
  20. s_hDll = hinst;
  21. DisableThreadLibraryCalls(hinst);
  22. }
  23. return TRUE;
  24. }
  25. //
  26. ///////////////////////////////////////////////////////////////// End of File.