diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 01939c94d0f..a4e45d6c93c 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -772,6 +772,8 @@ @ stdcall K32GetProcessImageFileNameW(long ptr long) @ stdcall K32EnumProcessModules(long ptr long ptr) @ stdcall K32EnumProcesses(ptr long ptr) +@ stdcall K32QueryWorkingSet(long ptr long) +@ stdcall K32QueryWorkingSetEx(long ptr long) @ stdcall -i386 -private -register K32Thk1632Epilog() krnl386.exe16.K32Thk1632Epilog @ stdcall -i386 -private -register K32Thk1632Prolog() krnl386.exe16.K32Thk1632Prolog @ stdcall LCIDToLocaleName(long ptr long long) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 6ca12791585..5436c062ef7 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -3583,6 +3583,44 @@ BOOL WINAPI K32EnumProcessModules(HANDLE process, HMODULE *lphModule, return ret == 0; } +/*********************************************************************** + * K32QueryWorkingSet (KERNEL32.@) + */ +BOOL WINAPI K32QueryWorkingSet( HANDLE process, LPVOID buffer, DWORD size ) +{ + NTSTATUS status; + + TRACE( "(%p, %p, %d)\n", process, buffer, size ); + + status = NtQueryVirtualMemory( process, NULL, MemoryWorkingSetList, buffer, size, NULL ); + + if (status) + { + SetLastError( RtlNtStatusToDosError( status ) ); + return FALSE; + } + return TRUE; +} + +/*********************************************************************** + * K32QueryWorkingSetEx (KERNEL32.@) + */ +BOOL WINAPI K32QueryWorkingSetEx( HANDLE process, LPVOID buffer, DWORD size ) +{ + NTSTATUS status; + + TRACE( "(%p, %p, %d)\n", process, buffer, size ); + + status = NtQueryVirtualMemory( process, NULL, MemoryWorkingSetList, buffer, size, NULL ); + + if (status) + { + SetLastError( RtlNtStatusToDosError( status ) ); + return FALSE; + } + return TRUE; +} + /*********************************************************************** * ProcessIdToSessionId (KERNEL32.@) * This function is available on Terminal Server 4SP4 and Windows 2000 diff --git a/dlls/psapi/psapi.spec b/dlls/psapi/psapi.spec index 70f1144efb0..37d6e803cab 100644 --- a/dlls/psapi/psapi.spec +++ b/dlls/psapi/psapi.spec @@ -21,5 +21,5 @@ @ stdcall GetProcessMemoryInfo(long ptr long) @ stdcall GetWsChanges(long ptr long) @ stdcall InitializeProcessForWsWatch(long) -@ stdcall QueryWorkingSet(long ptr long) -@ stdcall QueryWorkingSetEx(long ptr long) +@ stdcall QueryWorkingSet(long ptr long) kernel32.K32QueryWorkingSet +@ stdcall QueryWorkingSetEx(long ptr long) kernel32.K32QueryWorkingSetEx diff --git a/dlls/psapi/psapi_main.c b/dlls/psapi/psapi_main.c index 34dfeed6d38..909e7ce1016 100644 --- a/dlls/psapi/psapi_main.c +++ b/dlls/psapi/psapi_main.c @@ -475,41 +475,3 @@ BOOL WINAPI InitializeProcessForWsWatch(HANDLE hProcess) return TRUE; } - -/*********************************************************************** - * QueryWorkingSet (PSAPI.@) - */ -BOOL WINAPI QueryWorkingSet( HANDLE process, LPVOID buffer, DWORD size ) -{ - NTSTATUS status; - - TRACE( "(%p, %p, %d)\n", process, buffer, size ); - - status = NtQueryVirtualMemory( process, NULL, MemoryWorkingSetList, buffer, size, NULL ); - - if (status) - { - SetLastError( RtlNtStatusToDosError( status ) ); - return FALSE; - } - return TRUE; -} - -/*********************************************************************** - * QueryWorkingSetEx (PSAPI.@) - */ -BOOL WINAPI QueryWorkingSetEx( HANDLE process, LPVOID buffer, DWORD size ) -{ - NTSTATUS status; - - TRACE( "(%p, %p, %d)\n", process, buffer, size ); - - status = NtQueryVirtualMemory( process, NULL, MemoryWorkingSetList, buffer, size, NULL ); - - if (status) - { - SetLastError( RtlNtStatusToDosError( status ) ); - return FALSE; - } - return TRUE; -}