Share via


ICorProfilerInfo::GetAppDomainInfo Method

Accepts an application domain ID. Returns an application domain name and the ID of the process that contains it.

HRESULT GetAppDomainInfo(
    [in]  AppDomainID appDomainId,
    [in]  ULONG       cchName,
    [out] ULONG       *pcchName,
    [out, size_is(cchName), length_is(*pcchName)]
          WCHAR       szName[] ,
    [out] ProcessID   *pProcessId);

Parameters

  • appDomainId
    [in] The ID of the application domain.

  • cchName
    [in] The length, in characters, of the szName return buffer.

  • pcchName
    [out] A pointer to the total character length of the application domain name.

  • szName
    [out] A caller-provided wide character buffer. When the method returns, szName will contain the full or partial application domain name.

  • pProcessId
    [out] A pointer to the ID of the process that contains the application domain.

Remarks

After this method returns, you must verify that the szName buffer was large enough to contain the full name of the application domain. To do this, compare the value that pcchName points to with the value of the cchName parameter. If pcchName points to a value that is larger than cchName, allocate a larger szName buffer, update cchName with the new, larger size, and call GetAppDomainInfo again.

Alternatively, you can first call GetAppDomainInfo with a zero-length szName buffer to obtain the correct buffer size. You can then set the buffer size to the value returned in pcchName and call GetAppDomainInfo again.

For more information about these two approaches, see Caller-Allocated Buffers.

Requirements

Platforms: See .NET Framework System Requirements.

Header: CorProf.idl, CorProf.h

Library: CorGuids.lib

.NET Framework Versions: 4, 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0

See Also

Reference

ICorProfilerInfo Interface

Other Resources

Profiling Interfaces

Profiling (Unmanaged API Reference)