Skip to content
Merged
Changes from 20 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,45 @@ int ISOSDacInterface.GetAppDomainConfigFile(ClrDataAddress appDomain, int count,
int ISOSDacInterface.GetAppDomainData(ClrDataAddress addr, void* data)
=> _legacyImpl is not null ? _legacyImpl.GetAppDomainData(addr, data) : HResults.E_NOTIMPL;
int ISOSDacInterface.GetAppDomainList(uint count, [In, MarshalUsing(CountElementName = "count"), Out] ClrDataAddress[] values, uint* pNeeded)
=> _legacyImpl is not null ? _legacyImpl.GetAppDomainList(count, values, pNeeded) : HResults.E_NOTIMPL;
{
int hr = HResults.S_OK;
try
{
uint i = 0;
TargetPointer appDomainPointer = _target.ReadGlobalPointer(Constants.Globals.AppDomain);
TargetPointer appDomain = _target.ReadPointer(appDomainPointer);

if (appDomain != TargetPointer.Null && values.Length > 0)
{
values[0] = appDomain.ToClrDataAddress(_target);
i = 1;
}

if (pNeeded is not null)
{
*pNeeded = i;
}
}
catch (System.Exception ex)
{
hr = ex.HResult;
}
#if DEBUG
if (_legacyImpl is not null)
{
ClrDataAddress[] valuesLocal = new ClrDataAddress[count];
uint neededLocal;
int hrLocal = _legacyImpl.GetAppDomainList(count, valuesLocal, &neededLocal);
Debug.Assert(hrLocal == HResults.S_OK, $"cDAC: {HResults.S_OK:x}, DAC: {hrLocal:x}");
Debug.Assert(pNeeded == null || *pNeeded == neededLocal);
if (values is not null && values.Length > 0 && valuesLocal.Length > 0)
{
Debug.Assert(values[0] == valuesLocal[0], $"cDAC: {values[0]:x}, DAC: {valuesLocal[0]:x}");
}
}
#endif
return hr;
}
int ISOSDacInterface.GetAppDomainName(ClrDataAddress addr, uint count, char* name, uint* pNeeded)
=> _legacyImpl is not null ? _legacyImpl.GetAppDomainName(addr, count, name, pNeeded) : HResults.E_NOTIMPL;
int ISOSDacInterface.GetAppDomainStoreData(void* data)
Expand Down