New functions DiscardVirtualMemory, OfferVirtualMemory, and
ReclaimVirtualMemory, added with the Windows 8.1 update.

Signed-off-by: Corinna Vinschen <[email protected]>
---

TODO: How to differ between 8.1 and 8.1 Update?!?


 mingw-w64-crt/lib32/kernel32.def      |  3 +++
 mingw-w64-crt/lib64/kernel32.def      |  3 +++
 mingw-w64-crt/libarm32/kernel32.def   |  3 +++
 mingw-w64-headers/include/memoryapi.h | 14 ++++++++++++++
 4 files changed, 23 insertions(+)

diff --git a/mingw-w64-crt/lib32/kernel32.def b/mingw-w64-crt/lib32/kernel32.def
index d4d4141..845131c 100644
--- a/mingw-w64-crt/lib32/kernel32.def
+++ b/mingw-w64-crt/lib32/kernel32.def
@@ -233,6 +233,7 @@ DeleteVolumeMountPointW@4
 DeviceIoControl@32
 DisableThreadLibraryCalls@4
 DisassociateCurrentThreadFromCallback@4
+DiscardVirtualMemory@8
 DisconnectNamedPipe@4
 DnsHostnameToComputerNameA@12
 DnsHostnameToComputerNameW@12
@@ -872,6 +873,7 @@ NlsWriteEtwEvent@20
 NormalizeString@20
 NotifyMountMgr@12
 NotifyUILanguageChange@20
+OfferVirtualMemory@12
 OpenConsoleW@16
 OpenEventA@12
 OpenEventW@12
@@ -937,6 +939,7 @@ QueueUserWorkItem@12
 RaiseException@16
 RaiseFailFastException@12
 ReOpenFile@16
+ReclaimVirtualMemory@8
 ReadConsoleA@20
 ReadConsoleInputA@16
 ReadConsoleInputExA@20
diff --git a/mingw-w64-crt/lib64/kernel32.def b/mingw-w64-crt/lib64/kernel32.def
index 732ab7e..30d0140 100644
--- a/mingw-w64-crt/lib64/kernel32.def
+++ b/mingw-w64-crt/lib64/kernel32.def
@@ -240,6 +240,7 @@ DeviceIoControl
 DisableThreadLibraryCalls
 DisableThreadProfiling
 DisassociateCurrentThreadFromCallback
+DiscardVirtualMemory
 DisconnectNamedPipe
 DnsHostnameToComputerNameA
 DnsHostnameToComputerNameW
@@ -911,6 +912,7 @@ NlsWriteEtwEvent
 NormalizeString
 NotifyMountMgr
 NotifyUILanguageChange
+OfferVirtualMemory
 OpenConsoleW
 OpenDataFile
 OpenEventA
@@ -980,6 +982,7 @@ QueueUserWorkItem
 RaiseException
 RaiseFailFastException
 ReOpenFile
+ReclaimVirtualMemory
 ReadConsoleA
 ReadConsoleInputA
 ReadConsoleInputExA
diff --git a/mingw-w64-crt/libarm32/kernel32.def 
b/mingw-w64-crt/libarm32/kernel32.def
index 69bc443..4ef5df4 100644
--- a/mingw-w64-crt/libarm32/kernel32.def
+++ b/mingw-w64-crt/libarm32/kernel32.def
@@ -282,6 +282,7 @@ DeviceIoControl
 DisableThreadLibraryCalls
 DisableThreadProfiling
 DisassociateCurrentThreadFromCallback
+DiscardVirtualMemory
 DisconnectNamedPipe
 DnsHostnameToComputerNameA
 DnsHostnameToComputerNameExW
@@ -985,6 +986,7 @@ NotifyMountMgr
 NotifyUILanguageChange
 NtVdm64CreateProcessInternalW
 OOBEComplete
+OfferVirtualMemory
 OpenConsoleW
 OpenConsoleWStub
 OpenEventA
@@ -1085,6 +1087,7 @@ RaiseException
 RaiseFailFastException
 RaiseInvalid16BitExeError
 ReOpenFile
+ReclaimVirtualMemory
 ReadConsoleA
 ReadConsoleInputA
 ReadConsoleInputExA
diff --git a/mingw-w64-headers/include/memoryapi.h 
b/mingw-w64-headers/include/memoryapi.h
index 4286a0c..11f1591 100755
--- a/mingw-w64-headers/include/memoryapi.h
+++ b/mingw-w64-headers/include/memoryapi.h
@@ -26,6 +26,15 @@ extern "C" {
     SIZE_T NumberOfBytes;
   } WIN32_MEMORY_RANGE_ENTRY, *PWIN32_MEMORY_RANGE_ENTRY;
 #endif
+
+#if _WIN32_WINNT >= 0x0603
+  typedef enum _OFFER_PRIORITY {
+    VmOfferPriorityVeryLow = 1,
+    VmOfferPriorityLow,
+    VmOfferPriorityBelowNormal,
+    VmOfferPriorityNormal
+  } OFFER_PRIORITY;
+#endif
 #endif
 
 #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
@@ -92,6 +101,11 @@ extern "C" {
   WINBASEAPI WINBOOL WINAPI PrefetchVirtualMemory (HANDLE hProcess, ULONG_PTR 
NumberOfEntries, PWIN32_MEMORY_RANGE_ENTRY VirtualAddresses, ULONG Flags);
   WINBASEAPI WINBOOL WINAPI UnmapViewOfFileEx (PVOID BaseAddress, ULONG 
UnmapFlags);
 #endif
+#if _WIN32_WINNT >= 0x0603
+  WINBASEAPI DWORD WINAPI DiscardVirtualMemory (PVOID VirtualAddress, SIZE_T 
Size);
+  WINBASEAPI DWORD WINAPI OfferVirtualMemory (PVOID VirtualAddress, SIZE_T 
Size, OFFER_PRIORITY Priority);
+  WINBASEAPI DWORD WINAPI ReclaimVirtualMemory (PVOID VirtualAddress, SIZE_T 
Size);
+#endif
 #endif
 
 #ifdef __cplusplus
-- 
2.1.0


------------------------------------------------------------------------------
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to