CommonMemoryPch.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. #define MAKE_HR(errnum) (MAKE_HRESULT(SEVERITY_ERROR, FACILITY_CONTROL, errnum))
  10. // === C Runtime Header Files ===
  11. #include <time.h>
  12. #if defined(_UCRT)
  13. #include <cmath>
  14. #else
  15. #include <math.h>
  16. #endif
  17. // Exceptions
  18. #include "Exceptions/ExceptionBase.h"
  19. #include "Exceptions/OutOfMemoryException.h"
  20. #include "../Parser/rterror.h"
  21. // Other Memory headers
  22. #include "Memory/LeakReport.h"
  23. #include "Memory/AutoPtr.h"
  24. // Other core headers
  25. #include "Core/FinalizableObject.h"
  26. #include "Core/EtwTraceCore.h"
  27. #include "Core/ProfileInstrument.h"
  28. #include "Core/ProfileMemory.h"
  29. #include "Core/StackBackTrace.h"
  30. #ifdef _MSC_VER
  31. #pragma warning(push)
  32. #if defined(PROFILE_RECYCLER_ALLOC) || defined(HEAP_TRACK_ALLOC) || defined(ENABLE_DEBUG_CONFIG_OPTIONS)
  33. #ifdef _UCRT
  34. #include <typeinfo>
  35. #else
  36. #include <typeinfo.h>
  37. #endif
  38. #endif
  39. #pragma warning(pop)
  40. #endif
  41. // Inl files
  42. #include "Memory/Recycler.inl"
  43. #include "Memory/MarkContext.inl"
  44. #include "Memory/HeapBucket.inl"
  45. #include "Memory/LargeHeapBucket.inl"
  46. #include "Memory/HeapBlock.inl"
  47. #include "Memory/HeapBlockMap.inl"
  48. // Memory Protections
  49. #ifdef _CONTROL_FLOW_GUARD
  50. #define PAGE_EXECUTE_RW_TARGETS_INVALID (PAGE_EXECUTE_READWRITE | PAGE_TARGETS_INVALID)
  51. #define PAGE_EXECUTE_RW_TARGETS_NO_UPDATE (PAGE_EXECUTE_READWRITE | PAGE_TARGETS_NO_UPDATE)
  52. #define PAGE_EXECUTE_RO_TARGETS_NO_UPDATE (PAGE_EXECUTE_READ | PAGE_TARGETS_NO_UPDATE)
  53. #else
  54. #define PAGE_EXECUTE_RW_TARGETS_INVALID (PAGE_EXECUTE_READWRITE)
  55. #define PAGE_EXECUTE_RW_TARGETS_NO_UPDATE (PAGE_EXECUTE_READWRITE)
  56. #define PAGE_EXECUTE_RO_TARGETS_NO_UPDATE (PAGE_EXECUTE_READ)
  57. #endif