LM_GetProcess
Retrieves information about the current process.Function Signature
Parameters
A pointer to the
lm_process_t structure that will be populated with information about the current process, including PID, parent PID, path, name, start time, and architecture bits.Return Value
Returns
LM_TRUE if the process information was successfully retrieved, or LM_FALSE if there was an error.Example
LM_GetProcessEx
Retrieves information about a specified process identified by its process ID.Function Signature
Parameters
The process ID of the process for which you want to retrieve information.
A pointer to the
lm_process_t structure that will be populated with information about the specified process.Return Value
Returns
LM_TRUE if the process information was successfully retrieved, or LM_FALSE if there was an issue during the retrieval process (e.g., invalid PID, insufficient permissions).Example
Process Structure
Both functions populate the following structure:Field Descriptions
- pid: The unique identifier for the process
- ppid: The process ID of the parent process
- arch: The architecture of the process (see
lm_arch_tenum) - bits: Either 32 or 64, indicating the process bitness
- start_time: Timestamp in milliseconds since the system booted
- path: Full filesystem path to the process executable
- name: Just the executable name (without path)
Usage Comparison
Notes
LM_GetProcessis faster as it only queries the current processLM_GetProcessExmay require elevated privileges on some systems- The process must be running at the time of the call
- Use LM_IsProcessAlive to verify if a process is still running
See Also
- LM_EnumProcesses - Enumerate all processes
- LM_FindProcess - Find a process by name
- LM_IsProcessAlive - Check if a process is alive
- LM_GetCommandLine - Get process command line arguments