diff --git a/reactos/lib/kernel32/misc/stubs.c b/reactos/lib/kernel32/misc/stubs.c index 7a8ad64a804..4b9aadb7087 100644 --- a/reactos/lib/kernel32/misc/stubs.c +++ b/reactos/lib/kernel32/misc/stubs.c @@ -1,4 +1,4 @@ -/* $Id: stubs.c,v 1.84 2004/09/21 19:17:26 weiden Exp $ +/* $Id: stubs.c,v 1.85 2004/09/21 21:53:45 weiden Exp $ * * KERNEL32.DLL stubs (unimplemented functions) * Remove from this file, if you implement them. @@ -814,20 +814,6 @@ GetNumaProcessorNode( return 0; } -/* - * @unimplemented - */ -BOOL -STDCALL -GetProcessHandleCount( - HANDLE hProcess, - PDWORD pdwHandleCount - ) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - /* * @unimplemented */ diff --git a/reactos/lib/kernel32/process/proc.c b/reactos/lib/kernel32/process/proc.c index 7df05ccad9e..f6561f6ff68 100644 --- a/reactos/lib/kernel32/process/proc.c +++ b/reactos/lib/kernel32/process/proc.c @@ -1,4 +1,4 @@ -/* $Id: proc.c,v 1.66 2004/09/19 14:36:47 weiden Exp $ +/* $Id: proc.c,v 1.67 2004/09/21 21:53:45 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -940,4 +940,31 @@ SetProcessPriorityBoost(HANDLE hProcess, return TRUE; } + +/* + * @implemented + */ +BOOL +STDCALL +GetProcessHandleCount(HANDLE hProcess, + PDWORD pdwHandleCount) +{ + ULONG phc, BytesWritten; + NTSTATUS Status; + + Status = NtQueryInformationProcess(hProcess, + ProcessHandleCount, + &phc, + sizeof(ULONG), + &BytesWritten); + if(NT_SUCCESS(Status)) + { + *pdwHandleCount = ProcessHandleCount; + return TRUE; + } + + SetLastErrorByStatus(Status); + return FALSE; +} + /* EOF */