taskmgr: Use two kernel32 functions directly.

The yougest one, IsWow64Proces, is available since WinXP SP2 / Vista.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2020-10-20 00:31:48 +02:00 committed by Alexandre Julliard
parent cf3e6c353b
commit c2883d77b8
2 changed files with 2 additions and 13 deletions

View File

@ -30,8 +30,6 @@
#include "taskmgr.h"
#include "perfdata.h"
static PROCGPIC pGetProcessIoCounters = NULL;
static PROCISW64 pIsWow64Process = NULL;
static CRITICAL_SECTION PerfDataCriticalSection;
static PPERFDATA pPerfDataOld = NULL; /* Older perf data (saved to establish delta values) */
static PPERFDATA pPerfData = NULL; /* Most recent copy of perf data */
@ -57,11 +55,7 @@ static size_t size_diff(size_t x, size_t y)
BOOL PerfDataInitialize(void)
{
LONG status;
static const WCHAR wszKernel32[] = {'k','e','r','n','e','l','3','2','.','d','l','l',0};
pGetProcessIoCounters = (PROCGPIC)GetProcAddress(GetModuleHandleW(wszKernel32), "GetProcessIoCounters");
pIsWow64Process = (PROCISW64)GetProcAddress(GetModuleHandleW(wszKernel32), "IsWow64Process");
InitializeCriticalSection(&PerfDataCriticalSection);
/*
@ -291,10 +285,8 @@ void PerfDataRefresh(void)
}
pPerfData[Idx].USERObjectCount = GetGuiResources(hProcess, GR_USEROBJECTS);
pPerfData[Idx].GDIObjectCount = GetGuiResources(hProcess, GR_GDIOBJECTS);
if (pGetProcessIoCounters)
pGetProcessIoCounters(hProcess, &pPerfData[Idx].IOCounters);
if (pIsWow64Process)
pIsWow64Process(hProcess, &pPerfData[Idx].Wow64Process);
GetProcessIoCounters(hProcess, &pPerfData[Idx].IOCounters);
IsWow64Process(hProcess, &pPerfData[Idx].Wow64Process);
CloseHandle(hProcess);
}
pPerfData[Idx].UserTime.QuadPart = pSPI->UserTime.QuadPart;

View File

@ -66,9 +66,6 @@ struct _SYSTEM_PAGEFILE_INFORMATION
#define GR_GDIOBJECTS 0 /* Count of GDI objects */
#define GR_USEROBJECTS 1 /* Count of USER objects */
typedef BOOL (WINAPI *PROCGPIC)(HANDLE,PIO_COUNTERS);
typedef BOOL (WINAPI *PROCISW64)(HANDLE,PBOOL);
BOOL PerfDataInitialize(void);
void PerfDataRefresh(void);