<PropertyGroup>
<RepositoryUrl>https://github.com/dotnet/diagnostics</RepositoryUrl>
<PreReleaseVersionLabel>preview6</PreReleaseVersionLabel>
- <VersionPrefix>1.0.4</VersionPrefix>
+ <VersionPrefix>1.0.5</VersionPrefix>
<DotNetUseShippingVersions>true</DotNetUseShippingVersions>
</PropertyGroup>
PULONG pOffset
);
+// _EFN_GetManagedThread - return the managed thread object for the os thread id
+//
+// osThreadId - os thread id
+// pManagedObject - managed thread object returned
+HRESULT CALLBACK _EFN_GetManagedThread(
+ PDEBUG_CLIENT client,
+ ULONG osThreadId,
+ PULONG64 pManagedObject
+);
+
#ifdef __cplusplus
}
#endif // __cplusplus : extern "C"
return S_OK;
}
+DECLARE_API(VerifyGMT)
+{
+ ULONG osThreadId;
+ {
+ INIT_API();
+
+ CMDValue arg[] =
+ { // vptr, type
+ {&osThreadId, COHEX},
+ };
+ size_t nArg;
+
+ if (!GetCMDOption(args, NULL, 0, arg, _countof(arg), &nArg))
+ {
+ return Status;
+ }
+ }
+ ULONG64 managedObject;
+ HRESULT hr = _EFN_GetManagedThread(client, osThreadId, &managedObject);
+ {
+ INIT_API();
+
+ if (SUCCEEDED(hr)) {
+ ExtOut("%08x %p\n", osThreadId, managedObject);
+ }
+ else {
+ ExtErr("_EFN_GetManagedThread FAILED %08x\n", hr);
+ }
+ }
+ return hr;
+}
+
+HRESULT CALLBACK
+_EFN_GetManagedThread(
+ PDEBUG_CLIENT client,
+ ULONG osThreadId,
+ PULONG64 pManagedObject)
+{
+ INIT_API();
+
+ _ASSERTE(pManagedObject != nullptr);
+ *pManagedObject = 0;
+
+ DacpThreadStoreData threadStore;
+ if ((Status = threadStore.Request(g_sos)) != S_OK)
+ {
+ return Status;
+ }
+
+ CLRDATA_ADDRESS curThread = threadStore.firstThread;
+ while (curThread)
+ {
+ DacpThreadData thread;
+ if ((Status = thread.Request(g_sos, curThread)) != S_OK)
+ {
+ return Status;
+ }
+ if (thread.osThreadId == osThreadId)
+ {
+ *pManagedObject = (ULONG64)curThread;
+ return S_OK;
+ }
+ curThread = thread.nextThread;
+ }
+
+ return E_INVALIDARG;
+}
+
#endif // FEATURE_PAL
//