获取系统处理承载程序的进程的标识符。
HRESULT GetHostPid (
AD_PROCESS_ID * pdwHostPid
);
int GetHostPid (
out AD_PROCESS_ID pdwHostPid
);
参数
- pdwHostPid
[out] 返回该系统进程承载的标识符处理。
返回值
如果成功,则返回; S_OK否则,返回错误代码。
示例
下面的示例演示如何执行简单的 CProgram 对象的方法实现 IDebugProgramNode2 接口。
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;
}