Aracılığıyla paylaş


IDebugProgramNode2::GetHostPid

Programı barındıran işlemin sistem işlemi tanımlayıcısını alır.

Sözdizimi

int GetHostPid ( 
   out AD_PROCESS_ID pdwHostPid
);

Parametreler

pdwHostPid
[out] Barındırma işlemi için sistem işlemi tanımlayıcısını döndürür.

İade Değeri

Başarılı olursa döndürür S_OK; aksi takdirde bir hata kodu döndürür.

Örnek

Aşağıdaki örnek, IDebugProgramNode2 arabirimini uygulayan basit CProgram bir nesne için bu yöntemin nasıl uygulandığını gösterir.

HRESULT CProgram::GetHostPid(AD_PROCESS_ID* pdwHostPid) {
   // Check for valid argument.
   if (pdwHostPid == NULL)
     return E_INVALIDARG;

   // Get the process identifier of the calling process.
   pdwHostPid->ProcessIdType = AD_PROCESS_ID_SYSTEM;
   pdwHostPid->ProcessId.dwProcessId = GetCurrentProcessId();
   return S_OK;
}

Ayrıca bkz.