2005-05-08 17:44:37 +00:00
|
|
|
/*
|
|
|
|
psapi.h - Include file for PSAPI.DLL APIs
|
|
|
|
|
|
|
|
Written by Mumit Khan <khan@nanotech.wisc.edu>
|
|
|
|
|
|
|
|
This file is part of a free library for the Win32 API.
|
|
|
|
|
|
|
|
NOTE: This strictly does not belong in the Win32 API since it's
|
|
|
|
really part of Platform SDK. However,GDB needs it and we might
|
|
|
|
as well provide it here.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
*/
|
|
|
|
#ifndef _PSAPI_H
|
|
|
|
#define _PSAPI_H
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef RC_INVOKED
|
|
|
|
|
|
|
|
typedef struct _MODULEINFO {
|
|
|
|
LPVOID lpBaseOfDll;
|
|
|
|
DWORD SizeOfImage;
|
|
|
|
LPVOID EntryPoint;
|
|
|
|
} MODULEINFO,*LPMODULEINFO;
|
|
|
|
|
|
|
|
typedef struct _PSAPI_WS_WATCH_INFORMATION {
|
|
|
|
LPVOID FaultingPc;
|
|
|
|
LPVOID FaultingVa;
|
|
|
|
} PSAPI_WS_WATCH_INFORMATION,*PPSAPI_WS_WATCH_INFORMATION;
|
|
|
|
|
|
|
|
typedef struct _PROCESS_MEMORY_COUNTERS {
|
|
|
|
DWORD cb;
|
|
|
|
DWORD PageFaultCount;
|
|
|
|
DWORD PeakWorkingSetSize;
|
|
|
|
DWORD WorkingSetSize;
|
|
|
|
DWORD QuotaPeakPagedPoolUsage;
|
|
|
|
DWORD QuotaPagedPoolUsage;
|
|
|
|
DWORD QuotaPeakNonPagedPoolUsage;
|
|
|
|
DWORD QuotaNonPagedPoolUsage;
|
|
|
|
DWORD PagefileUsage;
|
|
|
|
DWORD PeakPagefileUsage;
|
|
|
|
} PROCESS_MEMORY_COUNTERS,*PPROCESS_MEMORY_COUNTERS;
|
|
|
|
|
2005-05-08 18:02:41 +00:00
|
|
|
typedef struct _PERFORMANCE_INFORMATION {
|
|
|
|
DWORD cb;
|
|
|
|
SIZE_T CommitTotal;
|
|
|
|
SIZE_T CommitLimit;
|
|
|
|
SIZE_T CommitPeak;
|
|
|
|
SIZE_T PhysicalTotal;
|
|
|
|
SIZE_T PhysicalAvailable;
|
|
|
|
SIZE_T SystemCache;
|
|
|
|
SIZE_T KernelTotal;
|
|
|
|
SIZE_T KernelPaged;
|
|
|
|
SIZE_T KernelNonpaged;
|
|
|
|
SIZE_T PageSize;
|
|
|
|
DWORD HandleCount;
|
|
|
|
DWORD ProcessCount;
|
|
|
|
DWORD ThreadCount;
|
|
|
|
} PERFORMANCE_INFORMATION, *PPERFORMANCE_INFORMATION;
|
|
|
|
|
|
|
|
typedef struct _ENUM_PAGE_FILE_INFORMATION {
|
|
|
|
DWORD cb;
|
|
|
|
DWORD Reserved;
|
|
|
|
SIZE_T TotalSize;
|
|
|
|
SIZE_T TotalInUse;
|
|
|
|
SIZE_T PeakUsage;
|
|
|
|
} ENUM_PAGE_FILE_INFORMATION, *PENUM_PAGE_FILE_INFORMATION;
|
|
|
|
|
2009-08-20 12:09:16 +00:00
|
|
|
typedef BOOL (CALLBACK *PENUM_PAGE_FILE_CALLBACKA)(LPVOID, PENUM_PAGE_FILE_INFORMATION, LPCSTR);
|
|
|
|
typedef BOOL (CALLBACK *PENUM_PAGE_FILE_CALLBACKW)(LPVOID, PENUM_PAGE_FILE_INFORMATION, LPCWSTR);
|
2005-05-08 18:02:41 +00:00
|
|
|
|
2005-05-08 17:44:37 +00:00
|
|
|
/* Grouped by application,not in alphabetical order. */
|
|
|
|
BOOL WINAPI EnumProcesses(DWORD *,DWORD,DWORD *);
|
|
|
|
BOOL WINAPI EnumProcessModules(HANDLE,HMODULE *,DWORD,LPDWORD);
|
2005-05-08 18:02:41 +00:00
|
|
|
BOOL WINAPI EnumPageFilesA(PENUM_PAGE_FILE_CALLBACKA,LPVOID);
|
|
|
|
BOOL WINAPI EnumPageFilesW(PENUM_PAGE_FILE_CALLBACKW,LPVOID);
|
2005-05-08 17:44:37 +00:00
|
|
|
DWORD WINAPI GetModuleBaseNameA(HANDLE,HMODULE,LPSTR,DWORD);
|
|
|
|
DWORD WINAPI GetModuleBaseNameW(HANDLE,HMODULE,LPWSTR,DWORD);
|
|
|
|
DWORD WINAPI GetModuleFileNameExA(HANDLE,HMODULE,LPSTR,DWORD);
|
|
|
|
DWORD WINAPI GetModuleFileNameExW(HANDLE,HMODULE,LPWSTR,DWORD);
|
|
|
|
BOOL WINAPI GetModuleInformation(HANDLE,HMODULE,LPMODULEINFO,DWORD);
|
|
|
|
BOOL WINAPI EmptyWorkingSet(HANDLE);
|
|
|
|
BOOL WINAPI QueryWorkingSet(HANDLE,PVOID,DWORD);
|
|
|
|
BOOL WINAPI InitializeProcessForWsWatch(HANDLE);
|
|
|
|
BOOL WINAPI GetWsChanges(HANDLE,PPSAPI_WS_WATCH_INFORMATION,DWORD);
|
|
|
|
DWORD WINAPI GetMappedFileNameW(HANDLE,LPVOID,LPWSTR,DWORD);
|
|
|
|
DWORD WINAPI GetMappedFileNameA(HANDLE,LPVOID,LPSTR,DWORD);
|
|
|
|
BOOL WINAPI EnumDeviceDrivers(LPVOID *,DWORD,LPDWORD);
|
|
|
|
DWORD WINAPI GetDeviceDriverBaseNameA(LPVOID,LPSTR,DWORD);
|
|
|
|
DWORD WINAPI GetDeviceDriverBaseNameW(LPVOID,LPWSTR,DWORD);
|
|
|
|
DWORD WINAPI GetDeviceDriverFileNameA(LPVOID,LPSTR,DWORD);
|
|
|
|
DWORD WINAPI GetDeviceDriverFileNameW(LPVOID,LPWSTR,DWORD);
|
|
|
|
BOOL WINAPI GetProcessMemoryInfo(HANDLE,PPROCESS_MEMORY_COUNTERS,DWORD);
|
2005-05-08 18:02:41 +00:00
|
|
|
BOOL WINAPI GetPerformanceInfo(PPERFORMANCE_INFORMATION,DWORD);
|
|
|
|
DWORD WINAPI GetProcessImageFileNameW(HANDLE,LPWSTR,DWORD);
|
|
|
|
DWORD WINAPI GetProcessImageFileNameA(HANDLE,LPSTR,DWORD);
|
2005-05-08 17:44:37 +00:00
|
|
|
|
|
|
|
#endif /* not RC_INVOKED */
|
|
|
|
|
|
|
|
#ifdef UNICODE
|
2005-05-08 18:02:41 +00:00
|
|
|
#define PENUM_PAGE_FILE_CALLBACK PENUM_PAGE_FILE_CALLBACKW
|
|
|
|
#define EnumPageFiles EnumPageFilesW
|
2005-05-08 17:44:37 +00:00
|
|
|
#define GetModuleBaseName GetModuleBaseNameW
|
|
|
|
#define GetModuleFileNameEx GetModuleFileNameExW
|
|
|
|
#define GetMappedFilenameEx GetMappedFilenameExW
|
|
|
|
#define GetDeviceDriverBaseName GetDeviceDriverBaseNameW
|
|
|
|
#define GetDeviceDriverFileName GetDeviceDriverFileNameW
|
2005-05-08 18:02:41 +00:00
|
|
|
#define GetProcessImageFileName GetProcessImageFileNameW
|
2005-05-08 17:44:37 +00:00
|
|
|
#else
|
2005-05-08 18:02:41 +00:00
|
|
|
#define PENUM_PAGE_FILE_CALLBACK PENUM_PAGE_FILE_CALLBACKA
|
|
|
|
#define EnumPageFiles EnumPageFilesA
|
2005-05-08 17:44:37 +00:00
|
|
|
#define GetModuleBaseName GetModuleBaseNameA
|
|
|
|
#define GetModuleFileNameEx GetModuleFileNameExA
|
|
|
|
#define GetMappedFilenameEx GetMappedFilenameExA
|
|
|
|
#define GetDeviceDriverBaseName GetDeviceDriverBaseNameA
|
|
|
|
#define GetDeviceDriverFileName GetDeviceDriverFileNameA
|
2005-05-08 18:02:41 +00:00
|
|
|
#define GetProcessImageFileName GetProcessImageFileNameA
|
2005-05-08 17:44:37 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _PSAPI_H */
|
|
|
|
|