IDebugProgramNode2::GetHostPid

Gets the system process identifier for the process hosting the program.

HRESULT GetHostPid ( 
   DWORD* pdwHostPid
);
int GetHostPid ( 
   out uint pdwHostPid
);

Parameters

  • pdwHostPid
    [out] Returns the system process identifier for the hosting process.

Return Value

If successful, returns S_OK; otherwise, returns an error code.

Example

The following example shows how to implement this method for a simple CProgram object that implements the IDebugProgramNode2 interface.

HRESULT CProgram::GetHostPid(DWORD* pdwHostPid) {  
    // Check for valid argument.  
   if (pdwHostPid)  
    {  
        // Get the process identifier of the calling process.  
      *pdwHostPid = GetCurrentProcessId();  
  
        return S_OK;  
    }  
  
    return E_INVALIDARG;  
}  

See Also

Concepts

IDebugProgramNode2