Commit d7d94ed0 authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

kernelbase: Implement DiscardVirtualMemory().

parent 7f7f06fe
...@@ -371,6 +371,7 @@ ...@@ -371,6 +371,7 @@
@ stdcall -import DeleteProcThreadAttributeList(ptr) @ stdcall -import DeleteProcThreadAttributeList(ptr)
# @ stub DisableThreadProfiling # @ stub DisableThreadProfiling
@ stdcall DisassociateCurrentThreadFromCallback(ptr) NTDLL.TpDisassociateCallback @ stdcall DisassociateCurrentThreadFromCallback(ptr) NTDLL.TpDisassociateCallback
@ stdcall DiscardVirtualMemory(ptr long) kernelbase.DiscardVirtualMemory
@ stdcall DeleteTimerQueue(long) @ stdcall DeleteTimerQueue(long)
@ stdcall -import DeleteTimerQueueEx(long long) @ stdcall -import DeleteTimerQueueEx(long long)
@ stdcall -import DeleteTimerQueueTimer(long long long) @ stdcall -import DeleteTimerQueueTimer(long long long)
......
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
@ stdcall DisablePredefinedHandleTableInternal(long) @ stdcall DisablePredefinedHandleTableInternal(long)
@ stdcall DisableThreadLibraryCalls(long) @ stdcall DisableThreadLibraryCalls(long)
@ stdcall DisassociateCurrentThreadFromCallback(ptr) ntdll.TpDisassociateCallback @ stdcall DisassociateCurrentThreadFromCallback(ptr) ntdll.TpDisassociateCallback
# @ stub DiscardVirtualMemory @ stdcall DiscardVirtualMemory(ptr long)
@ stdcall DisconnectNamedPipe(long) @ stdcall DisconnectNamedPipe(long)
@ stdcall DnsHostnameToComputerNameExW(wstr ptr ptr) @ stdcall DnsHostnameToComputerNameExW(wstr ptr ptr)
# @ stub DsBindWithSpnExW # @ stub DsBindWithSpnExW
......
...@@ -53,6 +53,19 @@ BOOLEAN WINAPI RtlSetUserValueHeap( HANDLE handle, ULONG flags, void *ptr, void ...@@ -53,6 +53,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.@) * FlushViewOfFile (kernelbase.@)
*/ */
BOOL WINAPI DECLSPEC_HOTPATCH FlushViewOfFile( const void *base, SIZE_T size ) BOOL WINAPI DECLSPEC_HOTPATCH FlushViewOfFile( const void *base, SIZE_T size )
......
...@@ -41,5 +41,6 @@ typedef struct WIN32_MEMORY_REGION_INFORMATION ...@@ -41,5 +41,6 @@ typedef struct WIN32_MEMORY_REGION_INFORMATION
SIZE_T CommitSize; SIZE_T CommitSize;
} WIN32_MEMORY_REGION_INFORMATION; } WIN32_MEMORY_REGION_INFORMATION;
DWORD WINAPI DiscardVirtualMemory(void *addr, SIZE_T size);
BOOL WINAPI QueryVirtualMemoryInformation(HANDLE process,const void *addr, BOOL WINAPI QueryVirtualMemoryInformation(HANDLE process,const void *addr,
WIN32_MEMORY_INFORMATION_CLASS info_class, void *info, SIZE_T size, SIZE_T *ret_size); WIN32_MEMORY_INFORMATION_CLASS info_class, void *info, SIZE_T size, SIZE_T *ret_size);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment