From 9291fbf1e46d34c5a6fc9af6581be41f3f699a2b Mon Sep 17 00:00:00 2001 From: Dmitry Chapyshev Date: Tue, 10 Feb 2009 18:34:54 +0000 Subject: [PATCH] - Implement HeapSetInformation - Implement HeapQueryInformation svn path=/trunk/; revision=39536 --- reactos/dll/win32/kernel32/mem/heap.c | 54 +++++++++++++++++++++++++ reactos/dll/win32/kernel32/misc/stubs.c | 33 --------------- 2 files changed, 54 insertions(+), 33 deletions(-) diff --git a/reactos/dll/win32/kernel32/mem/heap.c b/reactos/dll/win32/kernel32/mem/heap.c index 2158629546d..41228b737aa 100644 --- a/reactos/dll/win32/kernel32/mem/heap.c +++ b/reactos/dll/win32/kernel32/mem/heap.c @@ -271,4 +271,58 @@ HeapWalk(HANDLE hHeap, return TRUE; } +/* + * @implemented + */ +BOOL +WINAPI +HeapQueryInformation(HANDLE HeapHandle, + HEAP_INFORMATION_CLASS HeapInformationClass, + PVOID HeapInformation OPTIONAL, + SIZE_T HeapInformationLength OPTIONAL, + PSIZE_T ReturnLength OPTIONAL) +{ + NTSTATUS Status; + + Status = RtlQueryHeapInformation(HeapHandle, + HeapInformationClass, + HeapInformation, + HeapInformationLength, + ReturnLength); + + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus(Status); + return FALSE; + } + + return TRUE; +} + +/* + * @implemented + */ +BOOL +WINAPI +HeapSetInformation(HANDLE HeapHandle, + HEAP_INFORMATION_CLASS HeapInformationClass, + PVOID HeapInformation OPTIONAL, + SIZE_T HeapInformationLength OPTIONAL) +{ + NTSTATUS Status; + + Status = RtlSetHeapInformation(HeapHandle, + HeapInformationClass, + HeapInformation, + HeapInformationLength); + + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus(Status); + return FALSE; + } + + return TRUE; +} + /* EOF */ diff --git a/reactos/dll/win32/kernel32/misc/stubs.c b/reactos/dll/win32/kernel32/misc/stubs.c index f7cd214da09..bf758b78d71 100644 --- a/reactos/dll/win32/kernel32/misc/stubs.c +++ b/reactos/dll/win32/kernel32/misc/stubs.c @@ -386,39 +386,6 @@ GetNumaProcessorNode( return 0; } -/* - * @unimplemented - */ -BOOL -WINAPI -HeapQueryInformation ( - HANDLE HeapHandle, - HEAP_INFORMATION_CLASS HeapInformationClass, - PVOID HeapInformation OPTIONAL, - SIZE_T HeapInformationLength OPTIONAL, - PSIZE_T ReturnLength OPTIONAL - ) -{ - STUB; - return 0; -} - -/* - * @unimplemented - */ -BOOL -WINAPI -HeapSetInformation ( - HANDLE HeapHandle, - HEAP_INFORMATION_CLASS HeapInformationClass, - PVOID HeapInformation OPTIONAL, - SIZE_T HeapInformationLength OPTIONAL - ) -{ - STUB; - return 0; -} - /* * @implemented */