IDebugClient2::GetRunningProcessSystemIdByExecutableName method

The GetRunningProcessSystemIdByExecutableName method searches for a process with a given executable file name and return its process ID.

Syntax

HRESULT GetRunningProcessSystemIdByExecutableName(
  ULONG64 Server,
  PCSTR   ExeName,
  ULONG   Flags,
  PULONG  Id
);

Parameters

Server

Specifies the process server to search for the executable name. If Server is zero, the engine will search for the executable name among the processes running on the local computer.

ExeName

Specifies the executable file name for which to search.

Flags

Specifies a bit-set that controls how the executable name is matched. The following flags may be present:

Flag Description
DEBUG_GET_PROC_FULL_MATCH ExeName specifies the full path name of the executable file name.

If this flag is not set, this method will not use path names when searching for the process.

DEBUG_GET_PROC_ONLY_MATCH Require that only one process match the executable file name ExeName.

Id

Receives the process ID of the first process to match ExeName.

Return Value

This method may also return error values. See Return Values for more details.

Return code Description
S_OK
The method was successful.
S_FALSE
More than one process matched the executable file name in ExeName, and DEBUG_GET_PROC_ONLY_MATCH was set in Flags.
E_NOINTERFACE
No process matched the executable file name in ExeName.

Remarks

This method is available only for live user-mode debugging.

For more information about creating and attaching to live user-mode targets, see Live User-Mode Targets.

Requirements

   
Target Platform Desktop
Header dbgeng.h (include Dbgeng.h)

See Also

AttachProcess

ConnectProcessServer

CreateProcessAndAttach2

GetRunningProcessDescription

GetRunningProcessSystemIds

IDebugClient

IDebugClient2

IDebugClient3

IDebugClient4

IDebugClient5