Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -24,6 +24,12 @@ internal struct DacpThreadStoreData
public int fHostConfig; // Uses hosting flags defined above
};

internal struct DacpAppDomainStoreData
{
public ClrDataAddress sharedDomain;
public ClrDataAddress systemDomain;
public int DomainCount;
};
internal struct DacpThreadData
{
public int corThreadId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,36 @@ int ISOSDacInterface.GetAppDomainList(uint count, [In, MarshalUsing(CountElement
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)
=> _legacyImpl is not null ? _legacyImpl.GetAppDomainStoreData(data) : HResults.E_NOTIMPL;
{
DacpAppDomainStoreData* appDomainStoreData = (DacpAppDomainStoreData*)data;
int hr = HResults.S_OK;
try
{
appDomainStoreData->sharedDomain = 0;
TargetPointer systemDomainPtr = _target.ReadGlobalPointer(Constants.Globals.SystemDomain);
appDomainStoreData->systemDomain = _target.ReadPointer(systemDomainPtr).ToClrDataAddress(_target);
TargetPointer appDomainPtr = _target.ReadGlobalPointer(Constants.Globals.AppDomain);
appDomainStoreData->DomainCount = _target.ReadPointer(appDomainPtr) != 0 ? 1 : 0;
}
catch (System.Exception ex)
{
hr = ex.HResult;
}
#if DEBUG
{
if (_legacyImpl is not null)
{
DacpAppDomainStoreData dataLocal = default;
int hrLocal = _legacyImpl.GetAppDomainStoreData(&dataLocal);
Debug.Assert(hrLocal == hr, $"cDAC: {hr:x}, DAC: {hrLocal:x}");
Debug.Assert(appDomainStoreData->sharedDomain == dataLocal.sharedDomain, $"cDAC: {appDomainStoreData->sharedDomain:x}, DAC: {dataLocal.sharedDomain:x}");
Debug.Assert(appDomainStoreData->systemDomain == dataLocal.systemDomain, $"cDAC: {appDomainStoreData->systemDomain:x}, DAC: {dataLocal.systemDomain:x}");
Debug.Assert(appDomainStoreData->DomainCount == dataLocal.DomainCount, $"cDAC: {appDomainStoreData->DomainCount}, DAC: {dataLocal.DomainCount}");
}
}
#endif
return hr;
}
int ISOSDacInterface.GetApplicationBase(ClrDataAddress appDomain, int count, char* appBase, uint* pNeeded)
{
// Method is not supported on CoreCLR
Expand Down
Loading