public interface Psapi extends StdCallLibrary
Modifier and Type | Interface and Description |
---|---|
static class |
Psapi.MODULEINFO |
static class |
Psapi.PERFORMANCE_INFORMATION |
StdCallLibrary.StdCallCallback
Library.Handler
Modifier and Type | Field and Description |
---|---|
static Psapi |
INSTANCE |
FUNCTION_MAPPER, STDCALL_CONVENTION
OPTION_ALLOW_OBJECTS, OPTION_CALLING_CONVENTION, OPTION_CLASSLOADER, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_OPEN_FLAGS, OPTION_STRING_ENCODING, OPTION_STRUCTURE_ALIGNMENT, OPTION_TYPE_MAPPER
Modifier and Type | Method and Description |
---|---|
boolean |
EnumProcesses(int[] lpidProcess,
int cb,
IntByReference lpcbNeeded)
Retrieves the process identifier for each process object in the system.
|
boolean |
EnumProcessModules(WinNT.HANDLE hProcess,
WinDef.HMODULE[] lphModule,
int cb,
IntByReference lpcbNeeded)
The EnumProcessModules function is primarily designed for use by
debuggers and similar applications that must extract module information
from another process.
|
int |
GetModuleFileNameEx(WinNT.HANDLE process,
WinNT.HANDLE module,
Pointer lpFilename,
int nSize)
Retrieves the fully qualified path for the file containing the specified
module.
|
int |
GetModuleFileNameExA(WinNT.HANDLE process,
WinNT.HANDLE module,
byte[] lpFilename,
int nSize)
Retrieves the fully qualified path for the file containing the specified
module.
|
int |
GetModuleFileNameExW(WinNT.HANDLE process,
WinNT.HANDLE module,
char[] lpFilename,
int nSize)
Retrieves the fully qualified path for the file containing the specified
module.
|
boolean |
GetModuleInformation(WinNT.HANDLE hProcess,
WinDef.HMODULE hModule,
Psapi.MODULEINFO lpmodinfo,
int cb)
To get information for the calling process, pass the handle returned by
GetCurrentProcess.
|
boolean |
GetPerformanceInfo(Psapi.PERFORMANCE_INFORMATION pPerformanceInformation,
int cb)
Retrieves the performance values contained in the
Psapi.PERFORMANCE_INFORMATION structure. |
int |
GetProcessImageFileName(WinNT.HANDLE hProcess,
char[] lpImageFileName,
int nSize) |
static final Psapi INSTANCE
int GetModuleFileNameExA(WinNT.HANDLE process, WinNT.HANDLE module, byte[] lpFilename, int nSize)
process
- A handle to the process that contains the module.module
- A handle to the module. If this parameter is NULL,
GetModuleFileNameEx returns the path of the executable file of
the process specified in hProcess.lpFilename
- A pointer to a buffer that receives the fully qualified path
to the module. If the size of the file name is larger than the
value of the nSize parameter, the function succeeds but the
file name is truncated and null-terminated.nSize
- The size of the lpFilename buffer, in characters.Kernel32Util.getLastErrorMessage()
.int GetModuleFileNameExW(WinNT.HANDLE process, WinNT.HANDLE module, char[] lpFilename, int nSize)
process
- A handle to the process that contains the module.module
- A handle to the module. If this parameter is NULL,
GetModuleFileNameEx returns the path of the executable file of
the process specified in hProcess.lpFilename
- A pointer to a buffer that receives the fully qualified path
to the module. If the size of the file name is larger than the
value of the nSize parameter, the function succeeds but the
file name is truncated and null-terminated.nSize
- The size of the lpFilename buffer, in characters.Kernel32Util.getLastErrorMessage()
.int GetModuleFileNameEx(WinNT.HANDLE process, WinNT.HANDLE module, Pointer lpFilename, int nSize)
process
- A handle to the process that contains the module.module
- A handle to the module. If this parameter is NULL,
GetModuleFileNameEx returns the path of the executable file of
the process specified in hProcess.lpFilename
- A pointer to a buffer that receives the fully qualified path
to the module. If the size of the file name is larger than the
value of the nSize parameter, the function succeeds but the
file name is truncated and null-terminated.nSize
- The size of the lpFilename buffer, in characters.Kernel32Util.getLastErrorMessage()
.boolean EnumProcessModules(WinNT.HANDLE hProcess, WinDef.HMODULE[] lphModule, int cb, IntByReference lpcbNeeded)
hProcess
- A handle to the process.lphModule
- An array that receives the list of module handles.cb
- The size of the lphModule array, in bytes.lpcbNeeded
- The number of bytes required to store all module handles in
the lphModule array.boolean GetModuleInformation(WinNT.HANDLE hProcess, WinDef.HMODULE hModule, Psapi.MODULEINFO lpmodinfo, int cb)
hProcess
- A handle to the process that contains the module. The handle
must have the PROCESS_QUERY_INFORMATION and PROCESS_VM_READ
access rights. For more information, see Process Security and
Access Rights.hModule
- A handle to the module.lpmodinfo
- A pointer to the MODULEINFO structure that receives
information about the module.cb
- The size of the MODULEINFO structure, in bytes.int GetProcessImageFileName(WinNT.HANDLE hProcess, char[] lpImageFileName, int nSize)
hProcess
- A handle to the process. The handle must have the
PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION
access right. For more information, see Process Security and
Access Rights. lpImageFileName
- A pointer to a buffer that receives the full path to the
executable file.nSize
- The size of the lpImageFileName buffer, in characters.boolean GetPerformanceInfo(Psapi.PERFORMANCE_INFORMATION pPerformanceInformation, int cb)
Psapi.PERFORMANCE_INFORMATION
structure.pPerformanceInformation
- A pointer to a Psapi.PERFORMANCE_INFORMATION
structure that
receives the performance information.cb
- The size of the Psapi.PERFORMANCE_INFORMATION
structure, in
bytes.Kernel32Util.getLastErrorMessage()
.boolean EnumProcesses(int[] lpidProcess, int cb, IntByReference lpcbNeeded)
lpidProcess
- A pointer to an array that receives the list of process
identifierscb
- The size of the lpidProcess array, in bytes.lpcbNeeded
- The number of bytes returned in the pProcessIds array.