1
0
mirror of https://github.com/wine-mirror/wine synced 2024-06-29 06:14:34 +00:00

kernelbase: Implement DiscardVirtualMemory().

This commit is contained in:
Brendan Shanks 2023-03-03 10:49:18 -08:00 committed by Alexandre Julliard
parent 7f7f06fe61
commit d7d94ed0df
4 changed files with 16 additions and 1 deletions

View File

@ -371,6 +371,7 @@
@ stdcall -import DeleteProcThreadAttributeList(ptr)
# @ stub DisableThreadProfiling
@ stdcall DisassociateCurrentThreadFromCallback(ptr) NTDLL.TpDisassociateCallback
@ stdcall DiscardVirtualMemory(ptr long) kernelbase.DiscardVirtualMemory
@ stdcall DeleteTimerQueue(long)
@ stdcall -import DeleteTimerQueueEx(long long)
@ stdcall -import DeleteTimerQueueTimer(long long long)

View File

@ -269,7 +269,7 @@
@ stdcall DisablePredefinedHandleTableInternal(long)
@ stdcall DisableThreadLibraryCalls(long)
@ stdcall DisassociateCurrentThreadFromCallback(ptr) ntdll.TpDisassociateCallback
# @ stub DiscardVirtualMemory
@ stdcall DiscardVirtualMemory(ptr long)
@ stdcall DisconnectNamedPipe(long)
@ stdcall DnsHostnameToComputerNameExW(wstr ptr ptr)
# @ stub DsBindWithSpnExW

View File

@ -52,6 +52,19 @@ BOOLEAN WINAPI RtlSetUserValueHeap( HANDLE handle, ULONG flags, void *ptr, void
***********************************************************************/
/***********************************************************************
* DiscardVirtualMemory (kernelbase.@)
*/
DWORD WINAPI DECLSPEC_HOTPATCH DiscardVirtualMemory( void *addr, SIZE_T size )
{
NTSTATUS status;
LPVOID ret = addr;
status = NtAllocateVirtualMemory( GetCurrentProcess(), &ret, 0, &size, MEM_RESET, PAGE_NOACCESS );
return RtlNtStatusToDosError( status );
}
/***********************************************************************
* FlushViewOfFile (kernelbase.@)
*/

View File

@ -41,5 +41,6 @@ typedef struct WIN32_MEMORY_REGION_INFORMATION
SIZE_T CommitSize;
} WIN32_MEMORY_REGION_INFORMATION;
DWORD WINAPI DiscardVirtualMemory(void *addr, SIZE_T size);
BOOL WINAPI QueryVirtualMemoryInformation(HANDLE process,const void *addr,
WIN32_MEMORY_INFORMATION_CLASS info_class, void *info, SIZE_T size, SIZE_T *ret_size);