BinaryFeatureControl.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #include "CommonCorePch.h"
  6. #include "Core/BinaryFeatureControl.h"
  7. //For making direct call in release binaries.
  8. #if !defined(DELAYLOAD_SET_CFG_TARGET)
  9. #ifdef _WIN32
  10. extern "C"
  11. WINBASEAPI
  12. BOOL
  13. WINAPI
  14. GetProcessMitigationPolicy(
  15. __in HANDLE hProcess,
  16. __in PROCESS_MITIGATION_POLICY MitigationPolicy,
  17. __out_bcount(nLength) PVOID lpBuffer,
  18. __in SIZE_T nLength
  19. );
  20. #endif // ENABLE_DEBUG_CONFIG_OPTIONS
  21. #endif
  22. bool
  23. BinaryFeatureControl::RecyclerTest()
  24. {
  25. #ifdef RECYCLER_TEST
  26. return true;
  27. #else
  28. return false;
  29. #endif
  30. }
  31. #ifdef _WIN32
  32. BOOL
  33. BinaryFeatureControl::GetMitigationPolicyForProcess(__in HANDLE hProcess, __in PROCESS_MITIGATION_POLICY MitigationPolicy, __out_bcount(nLength) PVOID lpBuffer, __in SIZE_T nLength)
  34. {
  35. #if !defined(DELAYLOAD_SET_CFG_TARGET)
  36. return GetProcessMitigationPolicy(hProcess, MitigationPolicy, lpBuffer, nLength);
  37. #else
  38. return FALSE;
  39. #endif
  40. }
  41. #endif