[cdac] Implement IXCLRDataProcess::GetTaskByOSThreadID#109230
[cdac] Implement IXCLRDataProcess::GetTaskByOSThreadID#109230elinor-fung merged 5 commits intodotnet:mainfrom
IXCLRDataProcess::GetTaskByOSThreadID#109230Conversation
|
Tagging subscribers to this area: @tommcdon |
| namespace Microsoft.Diagnostics.DataContractReader.Legacy; | ||
|
|
||
| [GeneratedComClass] | ||
| internal sealed unsafe partial class ClrDataTask : IXCLRDataTask |
There was a problem hiding this comment.
I kind of wanted to call this ClrDataThread, since I think that maps more clearly to what it is representing. But I stuck with matching the IXCLRDataTask name and the IXCLRData*::GetTask* APIs that return it (and also the name of the brittle DAC's implementation).
| if (matchingThread == TargetPointer.Null) | ||
| return HResults.E_INVALIDARG; | ||
|
|
||
| ComWrappers cw = new StrategyBasedComWrappers(); |
There was a problem hiding this comment.
Not for this PR specifically, but I've wondered in the past what this thing is and whether it's expensive
There was a problem hiding this comment.
It's an implementation of ComWrappers that gives you our default marshalling (static instances of IUnknown*Strategy implementations), but also lets you customize it (we don't use the customization). It shouldn't be expensive.
That said, I think I must have been doing something weird when I was trying to switch the parameters out IXCLRData* before - so I'm going to look at that again. That would re-use the same StrategyBasedComWrappers (and the same static instances of IUnknnown*Strategy implementations) and be nicer in C#.
ClrDataTaskto cDAC as its implementation ofIXCLRDataTaskIXCLRDataProcess::GetTaskByOSThreadIDThreadcontract to find the address of the thread corresponding to the specified OS thread ID.ClrDataTaskThreadcontractContributes to #108553
cc @AaronRobinsonMSFT @davidwrighton