From cc5f2d10ceaba8593f6188efbffe6b9440b55974 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Sat, 15 Jan 2005 02:44:25 +0000 Subject: [PATCH] implemented QueryWorkingSet() svn path=/trunk/; revision=13052 --- reactos/lib/psapi/makefile | 1 - reactos/lib/psapi/misc/stubs.c | 22 ---------------------- reactos/lib/psapi/misc/win32.c | 27 +++++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 23 deletions(-) delete mode 100644 reactos/lib/psapi/misc/stubs.c diff --git a/reactos/lib/psapi/makefile b/reactos/lib/psapi/makefile index db62edba3f4..8aa4c427c18 100644 --- a/reactos/lib/psapi/makefile +++ b/reactos/lib/psapi/makefile @@ -22,7 +22,6 @@ TARGET_PCH = precomp.h TARGET_OBJECTS = \ misc/dllmain.o \ misc/malloc.o \ - misc/stubs.o \ misc/win32.o DEP_OBJECTS = $(TARGET_OBJECTS) diff --git a/reactos/lib/psapi/misc/stubs.c b/reactos/lib/psapi/misc/stubs.c deleted file mode 100644 index a27bae87945..00000000000 --- a/reactos/lib/psapi/misc/stubs.c +++ /dev/null @@ -1,22 +0,0 @@ -/* $Id$ */ -#include "precomp.h" - -#define NDEBUG -#include - - -/* - * @unimplemented - */ -BOOL -STDCALL -QueryWorkingSet(HANDLE hProcess, - PVOID pv, - DWORD cb) -{ - DPRINT1("PSAPI: QueryWorkingSet is UNIMPLEMENTED!\n"); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; -} - -/* EOF */ diff --git a/reactos/lib/psapi/misc/win32.c b/reactos/lib/psapi/misc/win32.c index a1870db1ffe..025610fe7f4 100644 --- a/reactos/lib/psapi/misc/win32.c +++ b/reactos/lib/psapi/misc/win32.c @@ -1365,4 +1365,31 @@ GetProcessMemoryInfo(HANDLE Process, return Ret; } + +/* + * @implemented + */ +BOOL +STDCALL +QueryWorkingSet(HANDLE hProcess, + PVOID pv, + DWORD cb) +{ + NTSTATUS Status; + + Status = NtQueryVirtualMemory(hProcess, + NULL, + MemoryWorkingSetList, + pv, + cb, + NULL); + if(!NT_SUCCESS(Status)) + { + SetLastErrorByStatus(Status); + return FALSE; + } + + return TRUE; +} + /* EOF */