CommonMemoryPch.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. #pragma once
  6. #include "CommonMinMemory.h"
  7. typedef _Return_type_success_(return >= 0) LONG NTSTATUS;
  8. #define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)
  9. // === C Runtime Header Files ===
  10. #include <time.h>
  11. #if defined(_UCRT)
  12. #include <cmath>
  13. #else
  14. #include <math.h>
  15. #endif
  16. // Exceptions
  17. #include "Exceptions\Exceptionbase.h"
  18. #include "Exceptions\OutOfMemoryException.h"
  19. // Other Memory headers
  20. #include "Memory\leakreport.h"
  21. #include "Memory\AutoPtr.h"
  22. // Other core headers
  23. #include "Core\FinalizableObject.h"
  24. #include "core\EtwTraceCore.h"
  25. #include "core\ProfileInstrument.h"
  26. #include "core\ProfileMemory.h"
  27. #include "core\StackBackTrace.h"
  28. #pragma warning(push)
  29. #if defined(PROFILE_RECYCLER_ALLOC) || defined(HEAP_TRACK_ALLOC) || defined(ENABLE_DEBUG_CONFIG_OPTIONS)
  30. #include <typeinfo.h>
  31. #endif
  32. #pragma warning(pop)
  33. // Inl files
  34. #include "Memory\Recycler.inl"
  35. #include "Memory\MarkContext.inl"
  36. #include "Memory\HeapBucket.inl"
  37. #include "Memory\LargeHeapBucket.inl"
  38. #include "Memory\HeapBlock.inl"
  39. #include "Memory\HeapBlockMap.inl"
  40. // Memory Protections
  41. #ifdef _CONTROL_FLOW_GUARD
  42. #define PAGE_EXECUTE_RW_TARGETS_INVALID (PAGE_EXECUTE_READWRITE | PAGE_TARGETS_INVALID)
  43. #define PAGE_EXECUTE_RW_TARGETS_NO_UPDATE (PAGE_EXECUTE_READWRITE | PAGE_TARGETS_NO_UPDATE)
  44. #define PAGE_EXECUTE_RO_TARGETS_NO_UPDATE (PAGE_EXECUTE | PAGE_TARGETS_NO_UPDATE)
  45. #else
  46. #define PAGE_EXECUTE_RW_TARGETS_INVALID (PAGE_EXECUTE_READWRITE)
  47. #define PAGE_EXECUTE_RW_TARGETS_NO_UPDATE (PAGE_EXECUTE_READWRITE)
  48. #define PAGE_EXECUTE_RO_TARGETS_NO_UPDATE (PAGE_EXECUTE)
  49. #endif