#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER
#ifndef _MEMORYAPI_H_
#define _MEMORYAPI_H_
#include <apiset.h>
#include <apisetcconv.h>
#include <minwindef.h>
#include <minwinbase.h>
#ifdef __cplusplus
extern
"C"
{
#endif
#if _MSC_VER >= 1200
#pragma warning(push)
#pragma warning(disable:4668) // #if not_defined treated as #if 0
#endif
#pragma warning(disable:
4668
)
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#define FILE_MAP_WRITE SECTION_MAP_WRITE
#define FILE_MAP_READ SECTION_MAP_READ
#define FILE_MAP_ALL_ACCESS SECTION_ALL_ACCESS
#define FILE_MAP_EXECUTE SECTION_MAP_EXECUTE_EXPLICIT // not included in FILE_MAP_ALL_ACCESS
#define FILE_MAP_COPY 0x00000001
#define FILE_MAP_RESERVE 0x80000000
#define FILE_MAP_TARGETS_INVALID 0x40000000
#define FILE_MAP_LARGE_PAGES 0x20000000
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
_Ret_maybenull_
_Post_writable_byte_size_(dwSize)
(
_In_opt_ LPVOID lpAddress,
_In_ DWORD flAllocationType,
);
_Success_(return != FALSE)
(
_Out_ PDWORD lpflOldProtect
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
_When_(((dwFreeType&(MEM_RELEASE|MEM_DECOMMIT)))==(MEM_RELEASE|MEM_DECOMMIT),
__drv_reportError("Passing both MEM_RELEASE and MEM_DECOMMIT to VirtualFree is not allowed. This results in the failure of this call"))
_When_(dwFreeType==0,
__drv_reportError("Passing zero as the dwFreeType parameter to VirtualFree is not allowed. This results in the failure of this call"))
_When_(((dwFreeType&MEM_RELEASE))!=0 && dwSize!=0,
__drv_reportError("Passing MEM_RELEASE and a non-zero dwSize parameter to VirtualFree is not allowed. This results in the failure of this call"))
_Success_(return != FALSE)
(
_Pre_notnull_ _When_(dwFreeType == MEM_DECOMMIT,_Post_invalid_) _When_(dwFreeType == MEM_RELEASE,_Post_ptr_invalid_) LPVOID lpAddress,
);
(
_In_opt_ LPCVOID lpAddress,
_Out_writes_bytes_to_(dwLength,return) PMEMORY_BASIC_INFORMATION lpBuffer,
PMEMORY_BASIC_INFORMATION
,
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
_Ret_maybenull_
_Post_writable_byte_size_(dwSize)
(
_In_opt_ LPVOID lpAddress,
_In_ DWORD flAllocationType,
);
_Success_(return != FALSE)
(
_Out_ PDWORD lpflOldProtect
);
(
_In_opt_ LPCVOID lpAddress,
_Out_writes_bytes_to_(dwLength,return) PMEMORY_BASIC_INFORMATION lpBuffer,
PMEMORY_BASIC_INFORMATION
,
);
_Success_(return != FALSE)
(
_In_ LPCVOID lpBaseAddress,
_Out_writes_bytes_to_(nSize,*lpNumberOfBytesRead) LPVOID lpBuffer,
_Out_opt_ SIZE_T* lpNumberOfBytesRead
);
_Success_(return != FALSE)
(
_In_ LPVOID lpBaseAddress,
_In_reads_bytes_(nSize) LPCVOID lpBuffer,
_Out_opt_ SIZE_T* lpNumberOfBytesWritten
);
_Ret_maybenull_
(
_In_opt_ LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
_In_ DWORD dwMaximumSizeHigh,
_In_ DWORD dwMaximumSizeLow,
);
#ifdef UNICODE
#define CreateFileMapping CreateFileMappingW
#endif
_Ret_maybenull_
(
_In_ DWORD dwDesiredAccess,
_In_ BOOL bInheritHandle,
);
#ifdef UNICODE
#define OpenFileMapping OpenFileMappingW
#endif
_Ret_maybenull_ __out_data_source(FILE)
(
_In_ HANDLE hFileMappingObject,
_In_ DWORD dwDesiredAccess,
_In_ DWORD dwFileOffsetHigh,
_In_ DWORD dwFileOffsetLow,
_In_ SIZE_T dwNumberOfBytesToMap
);
_Ret_maybenull_ __out_data_source(FILE)
(
_In_ HANDLE hFileMappingObject,
_In_ DWORD dwDesiredAccess,
_In_ DWORD dwFileOffsetHigh,
_In_ DWORD dwFileOffsetLow,
_In_ SIZE_T dwNumberOfBytesToMap,
_In_opt_ LPVOID lpBaseAddress
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
_When_(((dwFreeType&(MEM_RELEASE|MEM_DECOMMIT)))==(MEM_RELEASE|MEM_DECOMMIT),
__drv_reportError("Passing both MEM_RELEASE and MEM_DECOMMIT to VirtualFree is not allowed. This results in the failure of this call"))
_When_(dwFreeType==0,
__drv_reportError("Passing zero as the dwFreeType parameter to VirtualFree is not allowed. This results in the failure of this call"))
_When_(((dwFreeType&MEM_RELEASE))!=0 && dwSize!=0,
__drv_reportError("Passing MEM_RELEASE and a non-zero dwSize parameter to VirtualFree is not allowed. This results in the failure of this call"))
_When_(((dwFreeType&MEM_DECOMMIT))!=0,
__drv_reportError("Calling VirtualFreeEx without the MEM_RELEASE flag frees memory but not address descriptors (VADs); results in address space leaks"))
_Success_(return != FALSE)
(
_Pre_notnull_ _When_(dwFreeType == MEM_DECOMMIT,_Post_invalid_) _When_(dwFreeType == MEM_RELEASE,_Post_ptr_invalid_) LPVOID lpAddress,
);
(
_In_ LPCVOID lpBaseAddress,
_In_ SIZE_T dwNumberOfBytesToFlush
);
(
_In_ LPCVOID lpBaseAddress
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
(
);
_Success_(return != FALSE)
GetProcessWorkingSetSizeEx
(
_Out_ PSIZE_T lpMinimumWorkingSetSize,
_Out_ PSIZE_T lpMaximumWorkingSetSize,
);
SetProcessWorkingSetSizeEx
(
_In_ SIZE_T dwMinimumWorkingSetSize,
_In_ SIZE_T dwMaximumWorkingSetSize,
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
(
);
(
);
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
_Success_(return == 0)
(
_In_ PVOID lpBaseAddress,
_In_ SIZE_T dwRegionSize,
_Out_writes_to_opt_(*lpdwCount,*lpdwCount) PVOID* lpAddresses,
_Inout_opt_ ULONG_PTR* lpdwCount,
_Out_opt_ LPDWORD lpdwGranularity
);
(
_In_ LPVOID lpBaseAddress,
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#if (_WIN32_WINNT >= _WIN32_WINNT_WINXP)
typedef
enum
_MEMORY_RESOURCE_NOTIFICATION_TYPE
{
LowMemoryResourceNotification
,
HighMemoryResourceNotification
}
MEMORY_RESOURCE_NOTIFICATION_TYPE
;
_Ret_maybenull_
CreateMemoryResourceNotification
(
_In_ MEMORY_RESOURCE_NOTIFICATION_TYPE NotificationType
MEMORY_RESOURCE_NOTIFICATION_TYPE
);
_Success_(return != FALSE)
QueryMemoryResourceNotification
(
_In_ HANDLE ResourceNotificationHandle,
ResourceNotificationHandle
,
_Out_ PBOOL ResourceState
);
#endif // (_WIN32_WINNT >= _WIN32_WINNT_WINXP)
#if (_WIN32_WINNT >= _WIN32_WINNT_WS03)
#define FILE_CACHE_FLAGS_DEFINED
#define FILE_CACHE_MAX_HARD_ENABLE 0x00000001
#define FILE_CACHE_MAX_HARD_DISABLE 0x00000002
#define FILE_CACHE_MIN_HARD_ENABLE 0x00000004
#define FILE_CACHE_MIN_HARD_DISABLE 0x00000008
_Success_(return != FALSE)
(
_Out_ PSIZE_T lpMinimumFileCacheSize,
_Out_ PSIZE_T lpMaximumFileCacheSize,
);
(
_In_ SIZE_T MinimumFileCacheSize,
_In_ SIZE_T MaximumFileCacheSize,
);
#endif // (_WIN32_WINNT >= _WIN32_WINNT_WS03)
#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
_Ret_maybenull_
(
_In_opt_ LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
_In_ DWORD dwMaximumSizeHigh,
_In_ DWORD dwMaximumSizeLow,
);
#ifdef UNICODE
#define CreateFileMappingNuma CreateFileMappingNumaW
#endif
#endif // (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
typedef
struct
_WIN32_MEMORY_RANGE_ENTRY
{
;
;
}
, *
PWIN32_MEMORY_RANGE_ENTRY
;
(
_In_ ULONG_PTR NumberOfEntries,
_In_reads_(NumberOfEntries) PWIN32_MEMORY_RANGE_ENTRY VirtualAddresses,
PWIN32_MEMORY_RANGE_ENTRY
,
);
#endif // (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
_Ret_maybenull_
(
_In_opt_ PSECURITY_ATTRIBUTES SecurityAttributes,
_In_ ULONG PageProtection,
_In_ ULONG64 MaximumSize,
);
_Ret_maybenull_ __out_data_source(FILE)
(
_In_ HANDLE hFileMappingObject,
_In_ ULONG DesiredAccess,
_In_ SIZE_T NumberOfBytesToMap
);
(
);
#endif // (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#if (_WIN32_WINNT >= _WIN32_WINNT_WINXP)
_Success_(return != FALSE)
AllocateUserPhysicalPages
(
_Inout_ PULONG_PTR NumberOfPages,
_Out_writes_to_(*NumberOfPages,*NumberOfPages) PULONG_PTR PageArray
);
_Success_(return != FALSE)
(
_Inout_ PULONG_PTR NumberOfPages,
_In_reads_(*NumberOfPages) PULONG_PTR PageArray
);
_Success_(return != FALSE)
(
_In_ PVOID VirtualAddress,
_In_ ULONG_PTR NumberOfPages,
_In_reads_opt_(NumberOfPages) PULONG_PTR PageArray
);
#endif // (_WIN32_WINNT >= _WIN32_WINNT_WINXP)
#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
_Success_(return != FALSE)
AllocateUserPhysicalPagesNuma
(
_Inout_ PULONG_PTR NumberOfPages,
_Out_writes_to_(*NumberOfPages,*NumberOfPages) PULONG_PTR PageArray,
);
_Post_writable_byte_size_(dwSize)
(
_In_opt_ LPVOID lpAddress,
_In_ DWORD flAllocationType,
);
#endif // (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
#define MEHC_PATROL_SCRUBBER_PRESENT 0x1
_Success_(return != FALSE)
GetMemoryErrorHandlingCapabilities
(
_Out_ PULONG Capabilities
);
_Function_class_(BAD_MEMORY_CALLBACK_ROUTINE)
typedef
BAD_MEMORY_CALLBACK_ROUTINE
(
);
typedef
BAD_MEMORY_CALLBACK_ROUTINE
*
PBAD_MEMORY_CALLBACK_ROUTINE
;
_Success_(return != NULL)
RegisterBadMemoryNotification
(
_In_ PBAD_MEMORY_CALLBACK_ROUTINE Callback
PBAD_MEMORY_CALLBACK_ROUTINE
);
_Success_(return != FALSE)
UnregisterBadMemoryNotification
(
_In_ PVOID RegistrationHandle
);
#endif // (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#if (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE)
#if ((NTDDI_VERSION > NTDDI_WINBLUE) || (NTDDI_VERSION == NTDDI_WINBLUE && defined(WINBLUE_KBSPRING14)))
typedef
enum
{
=
1
,
,
VmOfferPriorityBelowNormal
,
}
;
(
_Inout_updates_(Size) PVOID VirtualAddress,
_In_ OFFER_PRIORITY Priority
);
(
_In_reads_(Size) void const* VirtualAddress,
);
(
_Inout_updates_(Size) PVOID VirtualAddress,
);
#endif /* NTDDI_VERSION > NTDDI_WINBLUE || (NTDDI_VERSION == NTDDI_WINBLUE && defined(WINBLUE_KBSPRING14))) */
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WINBLUE) */
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10)
SetProcessValidCallTargets
(
_In_ PVOID VirtualAddress,
_In_ ULONG NumberOfOffsets,
_Inout_updates_(NumberOfOffsets) PCFG_CALL_TARGET_INFO OffsetInformation
);
(
_In_ PVOID VirtualAddress,
_In_ ULONG NumberOfOffsets,
_Inout_updates_(NumberOfOffsets) PCFG_CALL_TARGET_INFO OffsetInformation,
_In_ ULONG64 ExpectedFileOffset
);
_Ret_maybenull_
_Post_writable_byte_size_(Size)
(
_In_opt_ PVOID BaseAddress,
_In_ ULONG AllocationType,
);
_Success_(return != FALSE)
(
_In_ ULONG NewProtection,
_Out_ PULONG OldProtection
);
_Ret_maybenull_
(
_In_ ULONG DesiredAccess,
);
#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WIN10) */
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Application Family
#if WINAPI_PARTITION_APP && !(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN8)
#define CreateFileMapping CreateFileMappingW
FORCEINLINE
_Ret_maybenull_
HANDLE
WINAPI
CreateFileMappingW(
_In_ HANDLE hFile,
_In_opt_ LPSECURITY_ATTRIBUTES lpFileMappingAttributes,
_In_ DWORD flProtect,
_In_ DWORD dwMaximumSizeHigh,
_In_ DWORD dwMaximumSizeLow,
_In_opt_ LPCWSTR lpName
)
{
return CreateFileMappingFromApp (hFile,
lpFileMappingAttributes,
flProtect,
(((ULONG64) dwMaximumSizeHigh) << 32) | dwMaximumSizeLow,
lpName);
}
FORCEINLINE
_Ret_maybenull_ __out_data_source(FILE)
LPVOID
WINAPI
MapViewOfFile(
_In_ HANDLE hFileMappingObject,
_In_ DWORD dwDesiredAccess,
_In_ DWORD dwFileOffsetHigh,
_In_ DWORD dwFileOffsetLow,
_In_ SIZE_T dwNumberOfBytesToMap
)
{
return MapViewOfFileFromApp (hFileMappingObject,
dwDesiredAccess,
(((ULONG64) dwFileOffsetHigh) << 32) | dwFileOffsetLow,
dwNumberOfBytesToMap);
}
#endif
#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10)
FORCEINLINE
_Ret_maybenull_ _Post_writable_byte_size_(dwSize)
LPVOID
WINAPI
VirtualAlloc(
_In_opt_ LPVOID lpAddress,
_In_ SIZE_T dwSize,
_In_ DWORD flAllocationType,
_In_ DWORD flProtect
)
{
return VirtualAllocFromApp (lpAddress, dwSize, flAllocationType, flProtect);
}
FORCEINLINE
_Success_(return != FALSE)
BOOL
WINAPI
VirtualProtect(
_In_ LPVOID lpAddress,
_In_ SIZE_T dwSize,
_In_ DWORD flNewProtect,
_Out_ PDWORD lpflOldProtect
)
{
return VirtualProtectFromApp (lpAddress, dwSize, flNewProtect, lpflOldProtect);
}
#define OpenFileMapping OpenFileMappingW
FORCEINLINE
_Ret_maybenull_
HANDLE
WINAPI
OpenFileMappingW(
_In_ DWORD dwDesiredAccess,
_In_ BOOL bInheritHandle,
_In_ LPCWSTR lpName
)
{
return OpenFileMappingFromApp (dwDesiredAccess, bInheritHandle, lpName);
}
#endif
#endif /* WINAPI_PARTITION_APP && !(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#if (NTDDI_VERSION >= NTDDI_WIN10_RS1)
typedef
enum
{
}
WIN32_MEMORY_INFORMATION_CLASS
;
#if _MSC_VER >= 1200
#pragma warning(push)
#pragma warning(disable:4201) // unnamed struct
#pragma warning(disable:
4201
)
#pragma warning(disable:4214) // bit fields other than int
#endif
#pragma warning(disable:
4214
)
typedef
struct
{
;
;
union
{
;
struct
{
:
1
;
:
1
;
:
1
;
:
1
;
:
1
;
:
1
;
:
26
;
;
;
}
WIN32_MEMORY_REGION_INFORMATION
;
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif
_Success_(return != FALSE)
(
_In_ const VOID* VirtualAddress,
_In_ WIN32_MEMORY_INFORMATION_CLASS MemoryInformationClass,
WIN32_MEMORY_INFORMATION_CLASS
,
_Out_writes_bytes_(MemoryInformationSize) PVOID MemoryInformation,
_In_ SIZE_T MemoryInformationSize,
_Out_opt_ PSIZE_T ReturnSize
);
#endif // (NTDDI_VERSION >= NTDDI_WIN10_RS1)
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#if (NTDDI_VERSION >= NTDDI_WIN10_RS2)
_Ret_maybenull_ __out_data_source(FILE)
(
_In_ HANDLE FileMappingHandle,
_In_ HANDLE ProcessHandle,
_In_opt_ PVOID BaseAddress,
_In_ ULONG AllocationType,
_In_ ULONG PageProtection,
);
#if !defined(MIDL_PASS)
_Ret_maybenull_ __out_data_source(FILE)
(
_In_ HANDLE FileMappingHandle,
_In_ HANDLE ProcessHandle,
_In_opt_ PVOID BaseAddress,
_In_ ULONG AllocationType,
_In_ ULONG PageProtection
)
{
return
(
,
,
,
,
,
,
,
}
#endif // !defined(MIDL_PASS)
#endif // (NTDDI_VERSION >= NTDDI_WIN10_RS2)
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
(
);
(
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#if (NTDDI_VERSION >= NTDDI_WIN10_RS4)
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
_Ret_maybenull_
_Post_writable_byte_size_(Size)
(
_In_opt_ PVOID BaseAddress,
_In_ ULONG AllocationType,
_In_ ULONG PageProtection,
_Inout_updates_opt_(ParameterCount) MEM_EXTENDED_PARAMETER* ExtendedParameters,
_In_ ULONG ParameterCount
);
_Ret_maybenull_ __out_data_source(FILE)
(
_In_opt_ PVOID BaseAddress,
_In_ ULONG AllocationType,
_In_ ULONG PageProtection,
_Inout_updates_opt_(ParameterCount) MEM_EXTENDED_PARAMETER* ExtendedParameters,
_In_ ULONG ParameterCount
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
_Ret_maybenull_
_Post_writable_byte_size_(Size)
(
_In_opt_ PVOID BaseAddress,
_In_ ULONG AllocationType,
_In_ ULONG PageProtection,
_Inout_updates_opt_(ParameterCount) MEM_EXTENDED_PARAMETER* ExtendedParameters,
_In_ ULONG ParameterCount
);
_Ret_maybenull_ __out_data_source(FILE)
(
_In_opt_ PVOID BaseAddress,
_In_ ULONG AllocationType,
_In_ ULONG PageProtection,
_Inout_updates_opt_(ParameterCount) MEM_EXTENDED_PARAMETER* ExtendedParameters,
_In_ ULONG ParameterCount
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#endif // (NTDDI_VERSION >= NTDDI_WIN10_RS4)
#if (NTDDI_VERSION >= NTDDI_WIN10_RS5)
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
_Ret_maybenull_
(
_In_opt_ SECURITY_ATTRIBUTES* SecurityAttributes,
_In_ ULONG DesiredAccess,
_In_ ULONG PageProtection,
_In_ ULONG AllocationAttributes,
_In_ ULONG64 MaximumSize,
_Inout_updates_opt_(ParameterCount) MEM_EXTENDED_PARAMETER* ExtendedParameters,
_In_ ULONG ParameterCount
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#endif // (NTDDI_VERSION >= NTDDI_WIN10_RS5)
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif
#ifdef __cplusplus
}
#endif
#endif // _MEMORYAPI_H_