diff --git a/src/coreclr/debug/daccess/dacdbiimpl.cpp b/src/coreclr/debug/daccess/dacdbiimpl.cpp index 015168aa6494fa..e54b2df84a302d 100644 --- a/src/coreclr/debug/daccess/dacdbiimpl.cpp +++ b/src/coreclr/debug/daccess/dacdbiimpl.cpp @@ -222,7 +222,7 @@ template void DeleteDbiArrayMemory(T *p, int count) // pAllocator - pointer to client allocator object. This lets DD allocate objects and // pass them out back to the client, which can then delete them. // DD takes a weak ref to this, so client must keep it alive until it -// calls Destroy. +// calls Release. // pMetadataLookup - callback interface to do internal metadata lookup. This is because // metadata is not dac-ized. // ppInterface - mandatory out-parameter @@ -238,7 +238,7 @@ template void DeleteDbiArrayMemory(T *p, int count) // This will yield an IDacDbiInterface to provide structured access to the // data-target. // -// Must call Destroy to on interface to free its resources. +// Must call Release on interface to free its resources. // //--------------------------------------------------------------------------------------- STDAPI @@ -295,7 +295,7 @@ DacDbiInterfaceInstance( // pAllocator - pointer to client allocator object. This lets DD allocate objects and // pass them out back to the client, which can then delete them. // DD takes a weak ref to this, so client must keep it alive until it -// calls Destroy. +// calls Release. // pMetadataLookup - callback interface to do internal metadata lookup. This is because // metadata is not dac-ized. // @@ -333,7 +333,7 @@ DacDbiInterfaceImpl::DacDbiInterfaceImpl( // Destructor. // // Notes: -// This gets invoked after Destroy(). +// This gets invoked when the ref count drops to 0 via Release(). //----------------------------------------------------------------------------- DacDbiInterfaceImpl::~DacDbiInterfaceImpl() { @@ -441,19 +441,30 @@ interface IMDInternalImport* DacDbiInterfaceImpl::GetMDImport( // See DacDbiInterface.h for full descriptions of all of these functions //----------------------------------------------------------------------------- -// Destroy the connection, freeing up any resources. -HRESULT DacDbiInterfaceImpl::Destroy() +// IUnknown implementation for DacDbiInterfaceImpl. +// Delegates to ClrDataAccess's ref-counting and adds support for IDacDbiInterface IID. +STDMETHODIMP +DacDbiInterfaceImpl::QueryInterface(THIS_ IN REFIID interfaceId, OUT PVOID* iface) { - HRESULT hr = S_OK; - EX_TRY + if (IsEqualIID(interfaceId, __uuidof(IDacDbiInterface))) { - m_pAllocator = NULL; - - this->Release(); - // Memory is deleted, don't access this object any more + AddRef(); + *iface = static_cast(this); + return S_OK; } - EX_CATCH_HRESULT(hr); - return hr; + return ClrDataAccess::QueryInterface(interfaceId, iface); +} + +STDMETHODIMP_(ULONG) +DacDbiInterfaceImpl::AddRef(THIS) +{ + return ClrDataAccess::AddRef(); +} + +STDMETHODIMP_(ULONG) +DacDbiInterfaceImpl::Release(THIS) +{ + return ClrDataAccess::Release(); } // Check whether the version of the DBI matches the version of the runtime. @@ -495,7 +506,7 @@ HRESULT DacDbiInterfaceImpl::FlushCache() } // enable or disable DAC target consistency checks -HRESULT DacDbiInterfaceImpl::DacSetTargetConsistencyChecks(bool fEnableAsserts) +HRESULT DacDbiInterfaceImpl::DacSetTargetConsistencyChecks(BOOL fEnableAsserts) { HRESULT hr = S_OK; EX_TRY @@ -1172,8 +1183,11 @@ mdSignature DacDbiInterfaceImpl::GetILCodeAndSigHelper(Module * pModule, } -HRESULT DacDbiInterfaceImpl::GetMetaDataFileInfoFromPEFile(VMPTR_PEAssembly vmPEAssembly, DWORD & dwTimeStamp, DWORD & dwImageSize, IStringHolder* pStrFilename, OUT bool * pResult) +HRESULT DacDbiInterfaceImpl::GetMetaDataFileInfoFromPEFile(VMPTR_PEAssembly vmPEAssembly, DWORD * pTimeStamp, DWORD * pImageSize, IStringHolder* pStrFilename, OUT BOOL * pResult) { + if (pTimeStamp == NULL || pImageSize == NULL || pStrFilename == NULL || pResult == NULL) + return E_POINTER; + DD_ENTER_MAY_THROW; HRESULT hr = S_OK; @@ -1186,15 +1200,15 @@ HRESULT DacDbiInterfaceImpl::GetMetaDataFileInfoFromPEFile(VMPTR_PEAssembly vmPE _ASSERTE(pPEAssembly != NULL); if (pPEAssembly == NULL) { - *pResult = false; + *pResult = FALSE; } else { WCHAR wszFilePath[MAX_LONGPATH] = {0}; DWORD cchFilePath = MAX_LONGPATH; bool ret = ClrDataAccess::GetMetaDataFileInfoFromPEFile(pPEAssembly, - dwTimeStamp, - dwImageSize, + *pTimeStamp, + *pImageSize, dwDataSize, dwRvaHint, wszFilePath, @@ -2743,8 +2757,11 @@ HRESULT DacDbiInterfaceImpl::GetApproxTypeHandle(TypeInfoList * pTypeData, OUT V // DacDbiInterface API: Get the exact type handle from type data HRESULT DacDbiInterfaceImpl::GetExactTypeHandle(DebuggerIPCE_ExpandedTypeData * pTypeData, ArgInfoList * pArgInfo, - VMPTR_TypeHandle& vmTypeHandle) + VMPTR_TypeHandle * pVmTypeHandle) { + if (pVmTypeHandle == NULL) + return E_POINTER; + DD_ENTER_MAY_THROW; LOG((LF_CORDB, LL_INFO10000, "D::GETH: getting info.\n")); @@ -2753,12 +2770,12 @@ HRESULT DacDbiInterfaceImpl::GetExactTypeHandle(DebuggerIPCE_ExpandedTypeData * EX_TRY { - vmTypeHandle = vmTypeHandle.NullPtr(); + *pVmTypeHandle = VMPTR_TypeHandle::NullPtr(); // convert the type information to a type handle TypeHandle typeHandle = ExpandedTypeInfoToTypeHandle(pTypeData, pArgInfo); _ASSERTE(!typeHandle.IsNull()); - vmTypeHandle.SetDacTargetPtr(typeHandle.AsTAddr()); + pVmTypeHandle->SetDacTargetPtr(typeHandle.AsTAddr()); } EX_CATCH_HRESULT(hr); @@ -3732,8 +3749,11 @@ HRESULT DacDbiInterfaceImpl::GetLoaderHeapMemoryRanges(DacDbiArrayList& dacStackFrames) +HRESULT DacDbiInterfaceImpl::GetStackFramesFromException(VMPTR_Object vmObject, DacDbiArrayList* pDacStackFrames) { + if (pDacStackFrames == NULL) + return E_POINTER; + DD_ENTER_MAY_THROW; HRESULT hr = S_OK; @@ -3761,12 +3781,12 @@ HRESULT DacDbiInterfaceImpl::GetStackFramesFromException(VMPTR_Object vmObject, if (dacStackFramesLength > 0) { - dacStackFrames.Alloc(dacStackFramesLength); + pDacStackFrames->Alloc(dacStackFramesLength); for (INT32 index = 0; index < dacStackFramesLength; ++index) { DebugStackTrace::Element const& currentElement = stackFramesData.pElements[index]; - DacExceptionCallStackData& currentFrame = dacStackFrames[index]; + DacExceptionCallStackData& currentFrame = (*pDacStackFrames)[index]; AppDomain* pDomain = AppDomain::GetCurrentDomain(); _ASSERTE(pDomain != NULL); @@ -3882,8 +3902,11 @@ HRESULT DacDbiInterfaceImpl::GetRcwCachedInterfacePointers(VMPTR_Object vmObject #endif // FEATURE_COMINTEROP } -HRESULT DacDbiInterfaceImpl::GetCachedWinRTTypesForIIDs(VMPTR_AppDomain vmAppDomain, DacDbiArrayList & iids, OUT DacDbiArrayList * pTypes) +HRESULT DacDbiInterfaceImpl::GetCachedWinRTTypesForIIDs(VMPTR_AppDomain vmAppDomain, DacDbiArrayList * pIids, OUT DacDbiArrayList * pTypes) { + if (pIids == NULL || pTypes == NULL) + return E_POINTER; + HRESULT hr = S_OK; EX_TRY { @@ -4319,7 +4342,7 @@ HRESULT DacDbiInterfaceImpl::IsModuleMapped(VMPTR_Module pModule, OUT BOOL *isMo return hr; } -HRESULT DacDbiInterfaceImpl::MetadataUpdatesApplied(OUT bool * pResult) +HRESULT DacDbiInterfaceImpl::MetadataUpdatesApplied(OUT BOOL * pResult) { DD_ENTER_MAY_THROW; @@ -4329,7 +4352,7 @@ HRESULT DacDbiInterfaceImpl::MetadataUpdatesApplied(OUT bool * pResult) #ifdef FEATURE_METADATA_UPDATER *pResult = g_metadataUpdatesApplied; #else - *pResult = false; + *pResult = FALSE; #endif } EX_CATCH_HRESULT(hr); @@ -4843,7 +4866,7 @@ HRESULT DacDbiInterfaceImpl::EnumerateThreads(FP_THREAD_ENUMERATION_CALLBACK fpC } // public implementation of IsThreadMarkedDead -HRESULT DacDbiInterfaceImpl::IsThreadMarkedDead(VMPTR_Thread vmThread, OUT bool * pResult) +HRESULT DacDbiInterfaceImpl::IsThreadMarkedDead(VMPTR_Thread vmThread, OUT BOOL * pResult) { DD_ENTER_MAY_THROW; @@ -6237,12 +6260,15 @@ HRESULT DacDbiInterfaceImpl::IsVmObjectHandleValid(VMPTR_OBJECTHANDLE vmHandle, } // determines if the specified module is a WinRT module -HRESULT DacDbiInterfaceImpl::IsWinRTModule(VMPTR_Module vmModule, BOOL& isWinRT) +HRESULT DacDbiInterfaceImpl::IsWinRTModule(VMPTR_Module vmModule, BOOL * pIsWinRT) { + if (pIsWinRT == NULL) + return E_POINTER; + DD_ENTER_MAY_THROW; HRESULT hr = S_OK; - isWinRT = FALSE; + *pIsWinRT = FALSE; return hr; } @@ -6723,12 +6749,12 @@ HRESULT DacDbiInterfaceImpl::EnumerateMonitorEventWaitList(VMPTR_Object vmObject } -HRESULT DacDbiInterfaceImpl::AreGCStructuresValid(OUT bool * pResult) +HRESULT DacDbiInterfaceImpl::AreGCStructuresValid(OUT BOOL * pResult) { HRESULT hr = S_OK; EX_TRY { - *pResult = true; + *pResult = TRUE; } EX_CATCH_HRESULT(hr); return hr; @@ -7447,7 +7473,7 @@ HRESULT DacDbiInterfaceImpl::GetHeapSegments(OUT DacDbiArrayList *p return hr; } -HRESULT DacDbiInterfaceImpl::IsValidObject(CORDB_ADDRESS obj, OUT bool * pResult) +HRESULT DacDbiInterfaceImpl::IsValidObject(CORDB_ADDRESS obj, OUT BOOL * pResult) { DD_ENTER_MAY_THROW; @@ -7455,7 +7481,7 @@ HRESULT DacDbiInterfaceImpl::IsValidObject(CORDB_ADDRESS obj, OUT bool * pResult EX_TRY { - bool isValid = false; + BOOL isValid = FALSE; if (obj != 0 && obj != (CORDB_ADDRESS)-1) { @@ -7467,13 +7493,13 @@ HRESULT DacDbiInterfaceImpl::IsValidObject(CORDB_ADDRESS obj, OUT bool * pResult PTR_EEClass cls = mt->GetClass(); if (mt == cls->GetMethodTable()) - isValid = true; + isValid = TRUE; else if (!mt->IsCanonicalMethodTable() || mt->IsContinuation()) isValid = cls->GetMethodTable()->GetClass() == cls; } EX_CATCH { - isValid = false; + isValid = FALSE; } EX_END_CATCH } @@ -7484,7 +7510,7 @@ HRESULT DacDbiInterfaceImpl::IsValidObject(CORDB_ADDRESS obj, OUT bool * pResult return hr; } -HRESULT DacDbiInterfaceImpl::GetAppDomainForObject(CORDB_ADDRESS obj, OUT VMPTR_AppDomain * pApp, OUT VMPTR_Module * pModule, OUT VMPTR_DomainAssembly * pDomainAssembly, OUT bool * pResult) +HRESULT DacDbiInterfaceImpl::GetAppDomainForObject(CORDB_ADDRESS obj, OUT VMPTR_AppDomain * pApp, OUT VMPTR_Module * pModule, OUT VMPTR_DomainAssembly * pDomainAssembly, OUT BOOL * pResult) { DD_ENTER_MAY_THROW; @@ -7494,7 +7520,7 @@ HRESULT DacDbiInterfaceImpl::GetAppDomainForObject(CORDB_ADDRESS obj, OUT VMPTR_ if (obj == 0 || obj == (CORDB_ADDRESS)-1) { - *pResult = false; + *pResult = FALSE; } else { @@ -7506,7 +7532,7 @@ HRESULT DacDbiInterfaceImpl::GetAppDomainForObject(CORDB_ADDRESS obj, OUT VMPTR_ pModule->SetDacTargetPtr(PTR_HOST_TO_TADDR(module)); pDomainAssembly->SetDacTargetPtr(PTR_HOST_TO_TADDR(module->GetDomainAssembly())); - *pResult = true; + *pResult = TRUE; } } EX_CATCH_HRESULT(hr); diff --git a/src/coreclr/debug/daccess/dacdbiimpl.h b/src/coreclr/debug/daccess/dacdbiimpl.h index 5ddf9013a2f228..e989f03528c8e4 100644 --- a/src/coreclr/debug/daccess/dacdbiimpl.h +++ b/src/coreclr/debug/daccess/dacdbiimpl.h @@ -51,6 +51,14 @@ class DacDbiInterfaceImpl : // Destructor. virtual ~DacDbiInterfaceImpl(void); + // IUnknown. + // IDacDbiInterface now extends IUnknown, so DacDbiInterfaceImpl must resolve the + // diamond inheritance by delegating to ClrDataAccess's existing IUnknown implementation + // and adding support for the IDacDbiInterface IID. + STDMETHOD(QueryInterface)(THIS_ IN REFIID interfaceId, OUT PVOID* iface); + STDMETHOD_(ULONG, AddRef)(THIS); + STDMETHOD_(ULONG, Release)(THIS); + // Overridden from ClrDataAccess. Gets an internal metadata importer for the file. virtual IMDInternalImport* GetMDImport( const PEAssembly* pPEAssembly, @@ -65,11 +73,7 @@ class DacDbiInterfaceImpl : HRESULT FlushCache(); // enable or disable DAC target consistency checks - HRESULT DacSetTargetConsistencyChecks(bool fEnableAsserts); - - // Destroy the interface object. The client should call this when it's done - // with the IDacDbiInterface to free up any resources. - HRESULT Destroy(); + HRESULT DacSetTargetConsistencyChecks(BOOL fEnableAsserts); IAllocator * GetAllocator() { @@ -110,10 +114,10 @@ class DacDbiInterfaceImpl : // Initialize the native/IL sequence points and native var info for a function. HRESULT GetNativeCodeSequencePointsAndVarInfo(VMPTR_MethodDesc vmMethodDesc, CORDB_ADDRESS startAddress, BOOL fCodeAvailable, OUT NativeVarData * pNativeVarData, OUT SequencePoints * pSequencePoints); - HRESULT IsThreadSuspendedOrHijacked(VMPTR_Thread vmThread, OUT bool * pResult); + HRESULT IsThreadSuspendedOrHijacked(VMPTR_Thread vmThread, OUT BOOL * pResult); - HRESULT AreGCStructuresValid(OUT bool * pResult); + HRESULT AreGCStructuresValid(OUT BOOL * pResult); HRESULT CreateHeapWalk(HeapWalkHandle *pHandle); HRESULT DeleteHeapWalk(HeapWalkHandle handle); @@ -125,9 +129,9 @@ class DacDbiInterfaceImpl : HRESULT GetHeapSegments(OUT DacDbiArrayList *pSegments); - HRESULT IsValidObject(CORDB_ADDRESS obj, OUT bool * pResult); + HRESULT IsValidObject(CORDB_ADDRESS obj, OUT BOOL * pResult); - HRESULT GetAppDomainForObject(CORDB_ADDRESS obj, OUT VMPTR_AppDomain * pApp, OUT VMPTR_Module * pModule, OUT VMPTR_DomainAssembly * pDomainAssembly, OUT bool * pResult); + HRESULT GetAppDomainForObject(CORDB_ADDRESS obj, OUT VMPTR_AppDomain * pApp, OUT VMPTR_Module * pModule, OUT VMPTR_DomainAssembly * pDomainAssembly, OUT BOOL * pResult); @@ -274,7 +278,7 @@ class DacDbiInterfaceImpl : // Get the exact type handle from type data HRESULT GetExactTypeHandle(DebuggerIPCE_ExpandedTypeData * pTypeData, ArgInfoList * pArgInfo, - VMPTR_TypeHandle& vmTypeHandle); + VMPTR_TypeHandle * pVmTypeHandle); // Retrieve the generic type params for a given MethodDesc. This function is specifically // for stackwalking because it requires the generic type token on the stack. @@ -302,7 +306,7 @@ class DacDbiInterfaceImpl : HRESULT IsExceptionObject(VMPTR_Object vmObject, OUT BOOL * pResult); - HRESULT GetStackFramesFromException(VMPTR_Object vmObject, DacDbiArrayList& dacStackFrames); + HRESULT GetStackFramesFromException(VMPTR_Object vmObject, DacDbiArrayList* pDacStackFrames); // Returns true if the argument is a runtime callable wrapper HRESULT IsRcw(VMPTR_Object vmObject, OUT BOOL * pResult); @@ -327,7 +331,7 @@ class DacDbiInterfaceImpl : HRESULT IsModuleMapped(VMPTR_Module pModule, OUT BOOL *isModuleMapped); - HRESULT MetadataUpdatesApplied(OUT bool * pResult); + HRESULT MetadataUpdatesApplied(OUT BOOL * pResult); // retrieves the list of COM interfaces implemented by vmObject, as it is known at // the time of the call (the list may change as new interface types become available @@ -343,7 +347,7 @@ class DacDbiInterfaceImpl : // list of IIDs. the interface types are retrieved from an app domain // IID / Type cache, that is updated as new types are loaded. will // have NULL entries corresponding to unknown IIDs in "iids" - HRESULT GetCachedWinRTTypesForIIDs(VMPTR_AppDomain vmAppDomain, DacDbiArrayList & iids, OUT DacDbiArrayList * pTypes); + HRESULT GetCachedWinRTTypesForIIDs(VMPTR_AppDomain vmAppDomain, DacDbiArrayList * pIids, OUT DacDbiArrayList * pTypes); // retrieves the whole app domain cache of IID / Type mappings. HRESULT GetCachedWinRTTypes(VMPTR_AppDomain vmAppDomain, OUT DacDbiArrayList * piids, OUT DacDbiArrayList * pTypes); @@ -703,7 +707,7 @@ class DacDbiInterfaceImpl : HRESULT EnumerateThreads(FP_THREAD_ENUMERATION_CALLBACK fpCallback, CALLBACK_DATA pUserData); - HRESULT IsThreadMarkedDead(VMPTR_Thread vmThread, OUT bool * pResult); + HRESULT IsThreadMarkedDead(VMPTR_Thread vmThread, OUT BOOL * pResult); // Return the handle of the specified thread. HRESULT GetThreadHandle(VMPTR_Thread vmThread, OUT HANDLE * pRetVal); @@ -923,7 +927,7 @@ class DacDbiInterfaceImpl : HRESULT IsVmObjectHandleValid(VMPTR_OBJECTHANDLE vmHandle, OUT BOOL * pResult); // if the specified module is a WinRT module then isWinRT will equal TRUE - HRESULT IsWinRTModule(VMPTR_Module vmModule, BOOL& isWinRT); + HRESULT IsWinRTModule(VMPTR_Module vmModule, BOOL * pIsWinRT); // Determines the app domain id for the object referred to by a given VMPTR_OBJECTHANDLE HRESULT GetAppDomainIdFromVmObjectHandle(VMPTR_OBJECTHANDLE vmHandle, OUT ULONG * pRetVal); @@ -1002,7 +1006,7 @@ class DacDbiInterfaceImpl : public: // API for picking up the info needed for a debugger to look up an image from its search path. - HRESULT GetMetaDataFileInfoFromPEFile(VMPTR_PEAssembly vmPEAssembly, DWORD & dwTimeStamp, DWORD & dwImageSize, IStringHolder* pStrFilename, OUT bool * pResult); + HRESULT GetMetaDataFileInfoFromPEFile(VMPTR_PEAssembly vmPEAssembly, DWORD * pTimeStamp, DWORD * pImageSize, IStringHolder* pStrFilename, OUT BOOL * pResult); }; diff --git a/src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp b/src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp index 50a8771a21a6f1..68dd02ffc875e7 100644 --- a/src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp +++ b/src/coreclr/debug/daccess/dacdbiimplstackwalk.cpp @@ -1396,7 +1396,7 @@ BOOL DacDbiInterfaceImpl::UnwindRuntimeStackFrame(StackFrameIterator * pIter) // Return true iff TS_SyncSuspended or TS_Hijacked is set on the specified thread. // -HRESULT DacDbiInterfaceImpl::IsThreadSuspendedOrHijacked(VMPTR_Thread vmThread, OUT bool * pResult) +HRESULT DacDbiInterfaceImpl::IsThreadSuspendedOrHijacked(VMPTR_Thread vmThread, OUT BOOL * pResult) { DD_ENTER_MAY_THROW; @@ -1408,17 +1408,17 @@ HRESULT DacDbiInterfaceImpl::IsThreadSuspendedOrHijacked(VMPTR_Thread vmThread, Thread::ThreadState ts = pThread->GetSnapshotState(); if ((ts & Thread::TS_SyncSuspended) != 0) { - *pResult = true; + *pResult = TRUE; } #ifdef FEATURE_HIJACK else if ((ts & Thread::TS_Hijacked) != 0) { - *pResult = true; + *pResult = TRUE; } #endif else { - *pResult = false; + *pResult = FALSE; } } EX_CATCH_HRESULT(hr); diff --git a/src/coreclr/debug/di/divalue.cpp b/src/coreclr/debug/di/divalue.cpp index 0ca91a172f4257..f1ca7ff2f5bca2 100644 --- a/src/coreclr/debug/di/divalue.cpp +++ b/src/coreclr/debug/di/divalue.cpp @@ -2460,7 +2460,7 @@ HRESULT CordbObjectValue::EnumerateExceptionCallStack(ICorDebugExceptionObjectCa DacDbiArrayList dacStackFrames; - IfFailThrow(pDAC->GetStackFramesFromException(vmObj, dacStackFrames)); + IfFailThrow(pDAC->GetStackFramesFromException(vmObj, &dacStackFrames)); int stackFramesLength = dacStackFrames.Count(); if (stackFramesLength > 0) diff --git a/src/coreclr/debug/di/module.cpp b/src/coreclr/debug/di/module.cpp index 5cda8918098b2a..f7fb4083db2e32 100644 --- a/src/coreclr/debug/di/module.cpp +++ b/src/coreclr/debug/di/module.cpp @@ -797,10 +797,10 @@ HRESULT CordbModule::InitPublicMetaDataFromFile(const WCHAR * pszFullPathName, _ASSERTE(!m_vmPEFile.IsNull()); // MetaData lookup favors the NGEN image, which is what we want here. - bool _mdFileInfoResult; + BOOL _mdFileInfoResult; IfFailThrow(this->GetProcess()->GetDAC()->GetMetaDataFileInfoFromPEFile(m_vmPEFile, - dwImageTimeStamp, - dwImageSize, + &dwImageTimeStamp, + &dwImageSize, &filePath, &_mdFileInfoResult)); if (!_mdFileInfoResult) @@ -1187,10 +1187,10 @@ HRESULT CordbModule::GetName(ULONG32 cchName, ULONG32 *pcchName, _Out_writes_to_ StringCopyHolder filePath; _ASSERTE(!m_vmPEFile.IsNull()); - bool _mdFileInfoResult; + BOOL _mdFileInfoResult; IfFailThrow(this->GetProcess()->GetDAC()->GetMetaDataFileInfoFromPEFile(m_vmPEFile, - dwImageTimeStamp, - dwImageSize, + &dwImageTimeStamp, + &dwImageSize, &filePath, &_mdFileInfoResult)); if (_mdFileInfoResult) diff --git a/src/coreclr/debug/di/process.cpp b/src/coreclr/debug/di/process.cpp index db73aaa7f3fb35..dd3b83dc998406 100644 --- a/src/coreclr/debug/di/process.cpp +++ b/src/coreclr/debug/di/process.cpp @@ -416,8 +416,8 @@ IMDInternalImport * CordbProcess::LookupMetaDataFromDebugger( IMDInternalImport * pMDII = NULL; // First, see if the debugger can locate the exact metadata we want. - bool _metaDataFileInfoResult; - IfFailThrow(this->GetDAC()->GetMetaDataFileInfoFromPEFile(vmPEAssembly, dwImageTimeStamp, dwImageSize, &filePath, &_metaDataFileInfoResult)); + BOOL _metaDataFileInfoResult; + IfFailThrow(this->GetDAC()->GetMetaDataFileInfoFromPEFile(vmPEAssembly, &dwImageTimeStamp, &dwImageSize, &filePath, &_metaDataFileInfoResult)); if (_metaDataFileInfoResult) { _ASSERTE(filePath.IsSet()); @@ -1626,7 +1626,7 @@ void CordbProcess::FreeDac() if (m_pDacPrimitives != NULL) { - m_pDacPrimitives->Destroy(); + m_pDacPrimitives->Release(); m_pDacPrimitives = NULL; } @@ -2250,7 +2250,7 @@ HRESULT CordbProcess::EnumerateHeap(ICorDebugHeapEnum **ppObjects) EX_TRY { - bool gcValid; + BOOL gcValid; IfFailThrow(m_pDacPrimitives->AreGCStructuresValid(&gcValid)); if (gcValid) { @@ -2333,7 +2333,7 @@ HRESULT CordbProcess::GetObjectInternal(CORDB_ADDRESS addr, ICorDebugObjectValue EX_TRY { - bool validObj; + BOOL validObj; IfFailThrow(m_pDacPrimitives->IsValidObject(addr, &validObj)); if (!validObj) { @@ -2601,7 +2601,7 @@ COM_METHOD CordbProcess::GetAsyncStack(CORDB_ADDRESS continuationAddress, ICorDe EX_TRY { - bool validObj; + BOOL validObj; IfFailThrow(m_pDacPrimitives->IsValidObject(continuationAddress, &validObj)); if (!validObj) { @@ -2637,7 +2637,7 @@ HRESULT CordbProcess::GetTypeForObject(CORDB_ADDRESS addr, CordbType **ppType, C VMPTR_DomainAssembly domainAssembly; HRESULT hr = E_FAIL; - bool _appDomainResult; + BOOL _appDomainResult; IfFailThrow(GetDAC()->GetAppDomainForObject(addr, &appDomain, &mod, &domainAssembly, &_appDomainResult)); if (_appDomainResult) { @@ -14579,7 +14579,7 @@ void CordbWin32EventThread::AttachProcess() EX_TRY { // Don't allow attach if any metadata/IL updates have been applied - bool _metadataUpdatesApplied; + BOOL _metadataUpdatesApplied; IfFailThrow(pProcess->GetDAC()->MetadataUpdatesApplied(&_metadataUpdatesApplied)); if (_metadataUpdatesApplied) { @@ -15754,7 +15754,7 @@ bool CordbProcess::IsThreadSuspendedOrHijacked(ICorDebugThread * pICorDebugThrea PUBLIC_REENTRANT_API_ENTRY_FOR_SHIM(this); CordbThread * pCordbThread = static_cast (pICorDebugThread); - bool _isSuspendedOrHijacked; + BOOL _isSuspendedOrHijacked; IfFailThrow(GetDAC()->IsThreadSuspendedOrHijacked(pCordbThread->m_vmThreadToken, &_isSuspendedOrHijacked)); return _isSuspendedOrHijacked; } diff --git a/src/coreclr/debug/di/rspriv.h b/src/coreclr/debug/di/rspriv.h index 22274d2d3cb712..c0cd937112c5a9 100644 --- a/src/coreclr/debug/di/rspriv.h +++ b/src/coreclr/debug/di/rspriv.h @@ -117,7 +117,7 @@ class CordbEval; class RSLock; class NeuterList; -class IDacDbiInterface; +struct IDacDbiInterface; #if defined(FEATURE_DBGIPC_TRANSPORT_DI) class DbgTransportTarget; diff --git a/src/coreclr/debug/di/rsthread.cpp b/src/coreclr/debug/di/rsthread.cpp index f152b5f66c34b6..66f88f534a1750 100644 --- a/src/coreclr/debug/di/rsthread.cpp +++ b/src/coreclr/debug/di/rsthread.cpp @@ -912,7 +912,7 @@ bool CordbThread::IsThreadWaitingOrSleeping() // bool CordbThread::IsThreadDead() { - bool _isDead; + BOOL _isDead; IfFailThrow(GetProcess()->GetDAC()->IsThreadMarkedDead(m_vmThreadToken, &_isDead)); return _isDead; } diff --git a/src/coreclr/debug/di/rstype.cpp b/src/coreclr/debug/di/rstype.cpp index de6922416706ef..612f90583beff0 100644 --- a/src/coreclr/debug/di/rstype.cpp +++ b/src/coreclr/debug/di/rstype.cpp @@ -1569,7 +1569,7 @@ HRESULT CordbType::InitInstantiationTypeHandle(BOOL fForceInit) { // Get the TypeHandle based on the type data RSLockHolder lockHolder(GetProcess()->GetProcessLock()); - hr = pProcess->GetDAC()->GetExactTypeHandle(&typeData, &argInfo, m_typeHandleExact); + hr = pProcess->GetDAC()->GetExactTypeHandle(&typeData, &argInfo, &m_typeHandleExact); } } EX_CATCH_HRESULT(hr); diff --git a/src/coreclr/debug/inc/dacdbi.idl b/src/coreclr/debug/inc/dacdbi.idl new file mode 100644 index 00000000000000..2a2eca68b4b690 --- /dev/null +++ b/src/coreclr/debug/inc/dacdbi.idl @@ -0,0 +1,496 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +/***************************************************************************** + ** ** + ** dacdbi.idl - The interface used for DAC to DBI communication in the ** + ** .NET runtime debugger. ** + ** ** + *****************************************************************************/ +import "unknwn.idl"; + +// +// Forward-declared structs defined in other headers. +// +struct DbiVersion; +struct TypeRefData; +struct TargetBuffer; +struct ModuleInfo; +struct DomainAssemblyInfo; +struct DacThreadAllocInfo; +struct NativeVarData; +struct SequencePoints; +struct DebuggerIPCE_STRData; +struct DebuggerREGDISPLAY; +struct NativeCodeFunctionData; +struct ClassInfo; +struct FieldData; +struct DebuggerIPCE_ExpandedTypeData; +struct DebuggerIPCE_BasicTypeData; +struct EnCHangingFieldInfo; +struct DacExceptionCallStackData; +struct DebuggerIPCE_ObjectData; +struct MonitorLockInfo; +struct DacGcReference; +struct DacSharedReJitInfo; +struct AsyncLocalData; + +// +// Types MIDL cannot handle natively. These dummy definitions satisfy the MIDL +// parser; the real definitions come from C++ headers at compile time. +// +cpp_quote("#if 0") + +// FramePointer - wrapper around a single pointer (LPVOID m_sp in native code) +// Passed by value in IsMatchingParentFrame, GetFramePointer, and the internal frame callback. +typedef struct { UINT_PTR m_sp; } FramePointer; + +// VMPTR types - opaque pointer-sized wrappers +typedef ULONG64 VMPTR_AppDomain; +typedef ULONG64 VMPTR_OBJECTHANDLE; +typedef ULONG64 VMPTR_DomainAssembly; +typedef ULONG64 VMPTR_Assembly; +typedef ULONG64 VMPTR_Module; +typedef ULONG64 VMPTR_Thread; +typedef ULONG64 VMPTR_MethodDesc; +typedef ULONG64 VMPTR_CONTEXT; +typedef ULONG64 VMPTR_TypeHandle; +typedef ULONG64 VMPTR_FieldDesc; +typedef ULONG64 VMPTR_Object; +typedef ULONG64 VMPTR_PEAssembly; +typedef ULONG64 VMPTR_Crst; +typedef ULONG64 VMPTR_SimpleRWLock; +typedef ULONG64 VMPTR_ReJitInfo; +typedef ULONG64 VMPTR_SharedReJitInfo; +typedef ULONG64 VMPTR_ILCodeVersionNode; +typedef ULONG64 VMPTR_NativeCodeVersionNode; + +// Address and token types +typedef ULONG64 CORDB_ADDRESS; +typedef ULONG64 GENERICS_TYPE_TOKEN; +typedef ULONG64 PCODE; +typedef ULONG64 TADDR; +typedef int CONNID; +typedef ULONG64 TASKID; +typedef int mdToken; +typedef int mdTypeDef; +typedef int mdMethodDef; + +// Context types +typedef int T_CONTEXT; +typedef int DT_CONTEXT; +typedef int EXCEPTION_RECORD; + +// Metadata interface +typedef int IMDInternalImport; + +// Enum types +typedef int CorDebugThreadState; +typedef int CorDebugUserState; +typedef int CorDebugSetContextFlag; +typedef int CorDebugNGENPolicy; +typedef int CorElementType; +typedef int AddressType; +typedef int SymbolFormat; +typedef int AreValueTypesBoxed; +typedef int DelegateType; +typedef int DynamicMethodType; +typedef int FrameType; +typedef int EHijackReason; +typedef int CLR_DEBUGGING_PROCESS_FLAGS; + +// Size type +typedef unsigned int SIZE_T; + +// HANDLE type (void* in native header) +typedef UINT_PTR HANDLE; + +// Handle types (void** in native header, use UINT_PTR for pointer-sized IDL compatibility) +typedef UINT_PTR StackWalkHandle; +typedef UINT_PTR HeapWalkHandle; +typedef UINT_PTR RefWalkHandle; + +// Callback data +typedef LPVOID CALLBACK_DATA; + +// Cordebug types +typedef int COR_HEAPOBJECT; +typedef int COR_SEGMENT; +typedef int COR_TYPEID; +typedef int COR_FIELD; +typedef int COR_TYPE_LAYOUT; +typedef int COR_ARRAY_LAYOUT; +typedef int COR_HEAPINFO; +typedef int COR_MEMORY_RANGE; + +// DacDbiArrayList type params +typedef int TypeInfoList; +typedef int ArgInfoList; +typedef int TypeParamsList; + +// DacDbiArrayList instantiations +typedef struct { void *pList; int nEntries; } DacDbiArrayList_FieldData; +typedef struct { void *pList; int nEntries; } DacDbiArrayList_DacExceptionCallStackData; +typedef struct { void *pList; int nEntries; } DacDbiArrayList_ExpandedTypeData; +typedef struct { void *pList; int nEntries; } DacDbiArrayList_CORDB_ADDRESS; +typedef struct { void *pList; int nEntries; } DacDbiArrayList_GUID; +typedef struct { void *pList; int nEntries; } DacDbiArrayList_COR_SEGMENT; +typedef struct { void *pList; int nEntries; } DacDbiArrayList_COR_MEMORY_RANGE; +typedef struct { void *pList; int nEntries; } DacDbiArrayList_AsyncLocalData; + +cpp_quote("#endif") + +// +// Callback function pointer typedefs +// +typedef void (*FP_APPDOMAIN_ENUMERATION_CALLBACK)(VMPTR_AppDomain vmAppDomain, CALLBACK_DATA pUserData); +typedef void (*FP_ASSEMBLY_ENUMERATION_CALLBACK)(VMPTR_DomainAssembly vmDomainAssembly, CALLBACK_DATA pUserData); +typedef void (*FP_MODULE_ENUMERATION_CALLBACK)(VMPTR_Module vmModule, CALLBACK_DATA pUserData); +typedef void (*FP_THREAD_ENUMERATION_CALLBACK)(VMPTR_Thread vmThread, CALLBACK_DATA pUserData); +typedef BOOL (*FP_INTERNAL_FRAME_ENUMERATION_CALLBACK)(FramePointer fpFrame, CALLBACK_DATA pUserData); + + +// +// Inner callback interfaces +// + +// IStringHolder - utility for passing strings out of DAC to DBI. +[ + object, + local, + uuid(F2F195B2-C9F1-4164-B76D-CF4669956ED9) +] +interface IDacDbiStringHolder : IUnknown +{ + HRESULT AssignCopy([in] const WCHAR * psz); +}; + +// IAllocator - utility for DAC to allocate buffers in DBI memory space. +[ + object, + local, + uuid(97441D33-C82F-4106-B025-A912CB507526) +] +interface IDacDbiAllocator : IUnknown +{ + void * Alloc([in] SIZE_T lenBytes); + void Free([in] void * p); +}; + +// IMetaDataLookup - callback for DAC to obtain metadata importers from DBI. +[ + object, + local, + uuid(EF037312-925C-4A13-A9B5-3C1BB07B56FD) +] +interface IDacDbiMetaDataLookup : IUnknown +{ + IMDInternalImport * LookupMetaData([in] VMPTR_PEAssembly addressPEAssembly); +}; + + +// +// IDacDbiInterface - The main DAC to DBI communication interface. +// +// This interface provides the contract between the debugger's right-side (DBI) +// and the data access component (DAC). All methods return HRESULT. +// +[ + object, + local, + uuid(DB505C1B-A327-4A46-8C32-AF55A56F8E09) +] +interface IDacDbiInterface : IUnknown +{ + // Initialization + HRESULT CheckDbiVersion([in] const struct DbiVersion * pVersion); + HRESULT FlushCache(); + HRESULT DacSetTargetConsistencyChecks([in] BOOL fEnableAsserts); + + // Process State + HRESULT IsLeftSideInitialized([out] BOOL * pResult); + + // App Domains + HRESULT GetAppDomainFromId([in] ULONG appdomainId, [out] VMPTR_AppDomain * pRetVal); + HRESULT GetAppDomainId([in] VMPTR_AppDomain vmAppDomain, [out] ULONG * pRetVal); + HRESULT GetAppDomainObject([in] VMPTR_AppDomain vmAppDomain, [out] VMPTR_OBJECTHANDLE * pRetVal); + HRESULT GetAssemblyFromDomainAssembly([in] VMPTR_DomainAssembly vmDomainAssembly, [out] VMPTR_Assembly * vmAssembly); + HRESULT IsAssemblyFullyTrusted([in] VMPTR_DomainAssembly vmDomainAssembly, [out] BOOL * pResult); + HRESULT GetAppDomainFullName([in] VMPTR_AppDomain vmAppDomain, [in] IDacDbiStringHolder * pStrName); + HRESULT GetModuleSimpleName([in] VMPTR_Module vmModule, [in] IDacDbiStringHolder * pStrFilename); + HRESULT GetAssemblyPath([in] VMPTR_Assembly vmAssembly, [in] IDacDbiStringHolder * pStrFilename, [out] BOOL * pResult); + + // Module + HRESULT ResolveTypeReference([in] const struct TypeRefData * pTypeRefInfo, [out] struct TypeRefData * pTargetRefInfo); + HRESULT GetModulePath([in] VMPTR_Module vmModule, [in] IDacDbiStringHolder * pStrFilename, [out] BOOL * pResult); + HRESULT GetMetadata([in] VMPTR_Module vmModule, [out] struct TargetBuffer * pTargetBuffer); + HRESULT GetSymbolsBuffer([in] VMPTR_Module vmModule, [out] struct TargetBuffer * pTargetBuffer, [out] SymbolFormat * pSymbolFormat); + HRESULT GetModuleData([in] VMPTR_Module vmModule, [out] struct ModuleInfo * pData); + HRESULT GetDomainAssemblyData([in] VMPTR_DomainAssembly vmDomainAssembly, [out] struct DomainAssemblyInfo * pData); + HRESULT GetModuleForDomainAssembly([in] VMPTR_DomainAssembly vmDomainAssembly, [out] VMPTR_Module * pModule); + + // Address + HRESULT GetAddressType([in] CORDB_ADDRESS address, [out] AddressType * pRetVal); + HRESULT IsTransitionStub([in] CORDB_ADDRESS address, [out] BOOL * pResult); + + // Compiler + HRESULT GetCompilerFlags([in] VMPTR_DomainAssembly vmDomainAssembly, [out] BOOL * pfAllowJITOpts, [out] BOOL * pfEnableEnC); + HRESULT SetCompilerFlags([in] VMPTR_DomainAssembly vmDomainAssembly, [in] BOOL fAllowJitOpts, [in] BOOL fEnableEnC); + + // Enumeration + HRESULT EnumerateAppDomains([in] FP_APPDOMAIN_ENUMERATION_CALLBACK fpCallback, [in] CALLBACK_DATA pUserData); + HRESULT EnumerateAssembliesInAppDomain([in] VMPTR_AppDomain vmAppDomain, [in] FP_ASSEMBLY_ENUMERATION_CALLBACK fpCallback, [in] CALLBACK_DATA pUserData); + HRESULT EnumerateModulesInAssembly([in] VMPTR_DomainAssembly vmAssembly, [in] FP_MODULE_ENUMERATION_CALLBACK fpCallback, [in] CALLBACK_DATA pUserData); + + // Debug Events + HRESULT RequestSyncAtEvent(); + HRESULT SetSendExceptionsOutsideOfJMC([in] BOOL sendExceptionsOutsideOfJMC); + HRESULT MarkDebuggerAttachPending(); + HRESULT MarkDebuggerAttached([in] BOOL fAttached); + HRESULT Hijack( + [in] VMPTR_Thread vmThread, + [in] ULONG32 dwThreadId, + [in] const EXCEPTION_RECORD * pRecord, + [in] T_CONTEXT * pOriginalContext, + [in] ULONG32 cbSizeContext, + [in] EHijackReason reason, + [in] void * pUserData, + [out] CORDB_ADDRESS * pRemoteContextAddr); + + // Thread + HRESULT EnumerateThreads([in] FP_THREAD_ENUMERATION_CALLBACK fpCallback, [in] CALLBACK_DATA pUserData); + HRESULT IsThreadMarkedDead([in] VMPTR_Thread vmThread, [out] BOOL * pResult); + HRESULT GetThreadHandle([in] VMPTR_Thread vmThread, [out] HANDLE * pRetVal); + HRESULT GetThreadObject([in] VMPTR_Thread vmThread, [out] VMPTR_OBJECTHANDLE * pRetVal); + HRESULT GetThreadAllocInfo([in] VMPTR_Thread vmThread, [out] struct DacThreadAllocInfo * threadAllocInfo); + HRESULT SetDebugState([in] VMPTR_Thread vmThread, [in] CorDebugThreadState debugState); + HRESULT HasUnhandledException([in] VMPTR_Thread vmThread, [out] BOOL * pResult); + HRESULT GetUserState([in] VMPTR_Thread vmThread, [out] CorDebugUserState * pRetVal); + HRESULT GetPartialUserState([in] VMPTR_Thread vmThread, [out] CorDebugUserState * pRetVal); + HRESULT GetConnectionID([in] VMPTR_Thread vmThread, [out] CONNID * pRetVal); + HRESULT GetTaskID([in] VMPTR_Thread vmThread, [out] TASKID * pRetVal); + HRESULT TryGetVolatileOSThreadID([in] VMPTR_Thread vmThread, [out] DWORD * pRetVal); + HRESULT GetUniqueThreadID([in] VMPTR_Thread vmThread, [out] DWORD * pRetVal); + HRESULT GetCurrentException([in] VMPTR_Thread vmThread, [out] VMPTR_OBJECTHANDLE * pRetVal); + HRESULT GetObjectForCCW([in] CORDB_ADDRESS ccwPtr, [out] VMPTR_OBJECTHANDLE * pRetVal); + HRESULT GetCurrentCustomDebuggerNotification([in] VMPTR_Thread vmThread, [out] VMPTR_OBJECTHANDLE * pRetVal); + HRESULT GetCurrentAppDomain([out] VMPTR_AppDomain * pRetVal); + + // Assembly + HRESULT ResolveAssembly([in] VMPTR_DomainAssembly vmScope, [in] mdToken tkAssemblyRef, [out] VMPTR_DomainAssembly * pRetVal); + + // Code and Debugging Info + HRESULT GetNativeCodeSequencePointsAndVarInfo( + [in] VMPTR_MethodDesc vmMethodDesc, + [in] CORDB_ADDRESS startAddress, + [in] BOOL fCodeAvailable, + [out] struct NativeVarData * pNativeVarData, + [out] struct SequencePoints * pSequencePoints); + + // Context and Stack Walking + HRESULT GetManagedStoppedContext([in] VMPTR_Thread vmThread, [out] VMPTR_CONTEXT * pRetVal); + HRESULT CreateStackWalk([in] VMPTR_Thread vmThread, [in, out] DT_CONTEXT * pInternalContextBuffer, [out] StackWalkHandle * ppSFIHandle); + HRESULT DeleteStackWalk([in] StackWalkHandle ppSFIHandle); + HRESULT GetStackWalkCurrentContext([in] StackWalkHandle pSFIHandle, [out] DT_CONTEXT * pContext); + HRESULT SetStackWalkCurrentContext([in] VMPTR_Thread vmThread, [in] StackWalkHandle pSFIHandle, [in] CorDebugSetContextFlag flag, [in] DT_CONTEXT * pContext); + HRESULT UnwindStackWalkFrame([in] StackWalkHandle pSFIHandle, [out] BOOL * pResult); + HRESULT CheckContext([in] VMPTR_Thread vmThread, [in] const DT_CONTEXT * pContext); + HRESULT GetStackWalkCurrentFrameInfo([in] StackWalkHandle pSFIHandle, [out] struct DebuggerIPCE_STRData * pFrameData, [out] FrameType * pRetVal); + HRESULT GetCountOfInternalFrames([in] VMPTR_Thread vmThread, [out] ULONG32 * pRetVal); + HRESULT EnumerateInternalFrames([in] VMPTR_Thread vmThread, [in] FP_INTERNAL_FRAME_ENUMERATION_CALLBACK fpCallback, [in] CALLBACK_DATA pUserData); + HRESULT IsMatchingParentFrame([in] FramePointer fpToCheck, [in] FramePointer fpParent, [out] BOOL * pResult); + HRESULT GetStackParameterSize([in] CORDB_ADDRESS controlPC, [out] ULONG32 * pRetVal); + HRESULT GetFramePointer([in] StackWalkHandle pSFIHandle, [out] FramePointer * pRetVal); + HRESULT IsLeafFrame([in] VMPTR_Thread vmThread, [in] const DT_CONTEXT * pContext, [out] BOOL * pResult); + HRESULT GetContext([in] VMPTR_Thread vmThread, [out] DT_CONTEXT * pContextBuffer); + HRESULT ConvertContextToDebuggerRegDisplay([in] const DT_CONTEXT * pInContext, [out] struct DebuggerREGDISPLAY * pOutDRD, [in] BOOL fActive); + + // Method + HRESULT IsDiagnosticsHiddenOrLCGMethod([in] VMPTR_MethodDesc vmMethodDesc, [out] DynamicMethodType * pRetVal); + HRESULT GetVarArgSig([in] CORDB_ADDRESS VASigCookieAddr, [out] CORDB_ADDRESS * pArgBase, [out] struct TargetBuffer * pRetVal); + HRESULT RequiresAlign8([in] VMPTR_TypeHandle thExact, [out] BOOL * pResult); + HRESULT ResolveExactGenericArgsToken([in] DWORD dwExactGenericArgsTokenIndex, [in] GENERICS_TYPE_TOKEN rawToken, [out] GENERICS_TYPE_TOKEN * pRetVal); + HRESULT GetILCodeAndSig([in] VMPTR_DomainAssembly vmDomainAssembly, [in] mdToken functionToken, [out] struct TargetBuffer * pCodeInfo, [out] mdToken * pLocalSigToken); + HRESULT GetNativeCodeInfo([in] VMPTR_DomainAssembly vmDomainAssembly, [in] mdToken functionToken, [out] struct NativeCodeFunctionData * pCodeInfo); + HRESULT GetNativeCodeInfoForAddr( + [in] CORDB_ADDRESS codeAddress, + [out] struct NativeCodeFunctionData * pCodeInfo, + [out] VMPTR_Module * pVmModule, + [out] mdToken * pFunctionToken); + + // Type + HRESULT IsValueType([in] VMPTR_TypeHandle th, [out] BOOL * pResult); + HRESULT HasTypeParams([in] VMPTR_TypeHandle th, [out] BOOL * pResult); + HRESULT GetClassInfo([in] VMPTR_AppDomain vmAppDomain, [in] VMPTR_TypeHandle thExact, [out] struct ClassInfo * pData); + HRESULT GetInstantiationFieldInfo( + [in] VMPTR_DomainAssembly vmDomainAssembly, + [in] VMPTR_TypeHandle vmThExact, + [in] VMPTR_TypeHandle vmThApprox, + [out] DacDbiArrayList_FieldData * pFieldList, + [out] SIZE_T * pObjectSize); + HRESULT TypeHandleToExpandedTypeInfo([in] AreValueTypesBoxed boxed, [in] VMPTR_AppDomain vmAppDomain, [in] VMPTR_TypeHandle vmTypeHandle, [out] struct DebuggerIPCE_ExpandedTypeData * pTypeInfo); + HRESULT GetObjectExpandedTypeInfo([in] AreValueTypesBoxed boxed, [in] VMPTR_AppDomain vmAppDomain, [in] CORDB_ADDRESS addr, [out] struct DebuggerIPCE_ExpandedTypeData * pTypeInfo); + HRESULT GetObjectExpandedTypeInfoFromID([in] AreValueTypesBoxed boxed, [in] VMPTR_AppDomain vmAppDomain, [in] COR_TYPEID id, [out] struct DebuggerIPCE_ExpandedTypeData * pTypeInfo); + HRESULT GetTypeHandle([in] VMPTR_Module vmModule, [in] mdTypeDef metadataToken, [out] VMPTR_TypeHandle * pRetVal); + HRESULT GetApproxTypeHandle([in] TypeInfoList * pTypeData, [out] VMPTR_TypeHandle * pRetVal); + HRESULT GetExactTypeHandle([in] struct DebuggerIPCE_ExpandedTypeData * pTypeData, [in] ArgInfoList * pArgInfo, [out] VMPTR_TypeHandle * pVmTypeHandle); + HRESULT GetMethodDescParams( + [in] VMPTR_AppDomain vmAppDomain, + [in] VMPTR_MethodDesc vmMethodDesc, + [in] GENERICS_TYPE_TOKEN genericsToken, + [out] UINT32 * pcGenericClassTypeParams, + [out] TypeParamsList * pGenericTypeParams); + + // Field + HRESULT GetThreadStaticAddress([in] VMPTR_FieldDesc vmField, [in] VMPTR_Thread vmRuntimeThread, [out] CORDB_ADDRESS * pRetVal); + HRESULT GetCollectibleTypeStaticAddress([in] VMPTR_FieldDesc vmField, [in] VMPTR_AppDomain vmAppDomain, [out] CORDB_ADDRESS * pRetVal); + HRESULT GetEnCHangingFieldInfo([in] const struct EnCHangingFieldInfo * pEnCFieldInfo, [out] struct FieldData * pFieldData, [out] BOOL * pfStatic); + HRESULT GetTypeHandleParams([in] VMPTR_AppDomain vmAppDomain, [in] VMPTR_TypeHandle vmTypeHandle, [out] TypeParamsList * pParams); + HRESULT GetSimpleType( + [in] VMPTR_AppDomain vmAppDomain, + [in] CorElementType simpleType, + [out] mdTypeDef * pMetadataToken, + [out] VMPTR_Module * pVmModule, + [out] VMPTR_DomainAssembly * pVmDomainAssembly); + + // Exception and COM Interop + HRESULT IsExceptionObject([in] VMPTR_Object vmObject, [out] BOOL * pResult); + HRESULT GetStackFramesFromException([in] VMPTR_Object vmObject, [out] DacDbiArrayList_DacExceptionCallStackData * pDacStackFrames); + HRESULT IsRcw([in] VMPTR_Object vmObject, [out] BOOL * pResult); + HRESULT GetRcwCachedInterfaceTypes([in] VMPTR_Object vmObject, [in] VMPTR_AppDomain vmAppDomain, [in] BOOL bIInspectableOnly, [out] DacDbiArrayList_ExpandedTypeData * pDacInterfaces); + HRESULT GetRcwCachedInterfacePointers([in] VMPTR_Object vmObject, [in] BOOL bIInspectableOnly, [out] DacDbiArrayList_CORDB_ADDRESS * pDacItfPtrs); + HRESULT GetCachedWinRTTypesForIIDs([in] VMPTR_AppDomain vmAppDomain, [in] DacDbiArrayList_GUID * pIids, [out] DacDbiArrayList_ExpandedTypeData * pTypes); + HRESULT GetCachedWinRTTypes([in] VMPTR_AppDomain vmAppDomain, [out] DacDbiArrayList_GUID * piids, [out] DacDbiArrayList_ExpandedTypeData * pTypes); + + // Object Data + HRESULT GetTypedByRefInfo([in] CORDB_ADDRESS pTypedByRef, [in] VMPTR_AppDomain vmAppDomain, [out] struct DebuggerIPCE_ObjectData * pObjectData); + HRESULT GetStringData([in] CORDB_ADDRESS objectAddress, [out] struct DebuggerIPCE_ObjectData * pObjectData); + HRESULT GetArrayData([in] CORDB_ADDRESS objectAddress, [out] struct DebuggerIPCE_ObjectData * pObjectData); + HRESULT GetBasicObjectInfo([in] CORDB_ADDRESS objectAddress, [in] CorElementType type, [in] VMPTR_AppDomain vmAppDomain, [out] struct DebuggerIPCE_ObjectData * pObjectData); + + // Data Consistency (TEST_DATA_CONSISTENCY only) + HRESULT TestCrst([in] VMPTR_Crst vmCrst); + HRESULT TestRWLock([in] VMPTR_SimpleRWLock vmRWLock); + + // Debugger Control Block + HRESULT GetDebuggerControlBlockAddress([out] CORDB_ADDRESS * pRetVal); + + // Object Handles + HRESULT GetObjectFromRefPtr([in] CORDB_ADDRESS ptr, [out] VMPTR_Object * pRetVal); + HRESULT GetObject([in] CORDB_ADDRESS ptr, [out] VMPTR_Object * pRetVal); + + // NGEN + HRESULT EnableNGENPolicy([in] CorDebugNGENPolicy ePolicy); + HRESULT SetNGENCompilerFlags([in] DWORD dwFlags); + HRESULT GetNGENCompilerFlags([out] DWORD * pdwFlags); + + // VM Object Handle + HRESULT GetVmObjectHandle([in] CORDB_ADDRESS handleAddress, [out] VMPTR_OBJECTHANDLE * pRetVal); + HRESULT IsVmObjectHandleValid([in] VMPTR_OBJECTHANDLE vmHandle, [out] BOOL * pResult); + HRESULT IsWinRTModule([in] VMPTR_Module vmModule, [out] BOOL * pIsWinRT); + HRESULT GetAppDomainIdFromVmObjectHandle([in] VMPTR_OBJECTHANDLE vmHandle, [out] ULONG * pRetVal); + HRESULT GetHandleAddressFromVmHandle([in] VMPTR_OBJECTHANDLE vmHandle, [out] CORDB_ADDRESS * pRetVal); + + // Object Contents and Monitor + HRESULT GetObjectContents([in] VMPTR_Object obj, [out] struct TargetBuffer * pRetVal); + HRESULT GetThreadOwningMonitorLock([in] VMPTR_Object vmObject, [out] struct MonitorLockInfo * pRetVal); + HRESULT EnumerateMonitorEventWaitList([in] VMPTR_Object vmObject, [in] FP_THREAD_ENUMERATION_CALLBACK fpCallback, [in] CALLBACK_DATA pUserData); + + // Attach State + HRESULT GetAttachStateFlags([out] CLR_DEBUGGING_PROCESS_FLAGS * pRetVal); + + // Metadata + HRESULT GetMetaDataFileInfoFromPEFile( + [in] VMPTR_PEAssembly vmPEAssembly, + [out] DWORD * pTimeStamp, + [out] DWORD * pImageSize, + [in] IDacDbiStringHolder * pStrFilename, + [out] BOOL * pResult); + + // Thread State + HRESULT IsThreadSuspendedOrHijacked([in] VMPTR_Thread vmThread, [out] BOOL * pResult); + + // GC + HRESULT AreGCStructuresValid([out] BOOL * pResult); + HRESULT CreateHeapWalk([out] HeapWalkHandle * pHandle); + HRESULT DeleteHeapWalk([in] HeapWalkHandle handle); + HRESULT WalkHeap([in] HeapWalkHandle handle, [in] ULONG count, [out] COR_HEAPOBJECT * objects, [out] ULONG * pFetched); + HRESULT GetHeapSegments([out] DacDbiArrayList_COR_SEGMENT * pSegments); + HRESULT IsValidObject([in] CORDB_ADDRESS obj, [out] BOOL * pResult); + HRESULT GetAppDomainForObject( + [in] CORDB_ADDRESS obj, + [out] VMPTR_AppDomain * pApp, + [out] VMPTR_Module * pModule, + [out] VMPTR_DomainAssembly * pDomainAssembly, + [out] BOOL * pResult); + + // Reference Walking + HRESULT CreateRefWalk([out] RefWalkHandle * pHandle, [in] BOOL walkStacks, [in] BOOL walkFQ, [in] UINT32 handleWalkMask); + HRESULT DeleteRefWalk([in] RefWalkHandle handle); + HRESULT WalkRefs([in] RefWalkHandle handle, [in] ULONG count, [out] struct DacGcReference * refs, [out] ULONG * pFetched); + + // Type ID + HRESULT GetTypeID([in] CORDB_ADDRESS obj, [out] COR_TYPEID * pType); + HRESULT GetTypeIDForType([in] VMPTR_TypeHandle vmTypeHandle, [out] COR_TYPEID * pId); + HRESULT GetObjectFields([in] COR_TYPEID id, [in] ULONG32 celt, [out] COR_FIELD * layout, [out] ULONG32 * pceltFetched); + HRESULT GetTypeLayout([in] COR_TYPEID id, [out] COR_TYPE_LAYOUT * pLayout); + HRESULT GetArrayLayout([in] COR_TYPEID id, [out] COR_ARRAY_LAYOUT * pLayout); + HRESULT GetGCHeapInformation([out] COR_HEAPINFO * pHeapInfo); + + // PE File + HRESULT GetPEFileMDInternalRW([in] VMPTR_PEAssembly vmPEAssembly, [out] TADDR * pAddrMDInternalRW); + + // ReJit + HRESULT GetReJitInfo([in] VMPTR_Module vmModule, [in] mdMethodDef methodTk, [out] VMPTR_ReJitInfo * pReJitInfo); + // Note: Named GetReJitInfoByAddress in IDL because COM does not support overloads. + // Corresponds to the second GetReJitInfo overload in dacdbiinterface.h. + HRESULT GetReJitInfoByAddress([in] VMPTR_MethodDesc vmMethod, [in] CORDB_ADDRESS codeStartAddress, [out] VMPTR_ReJitInfo * pReJitInfo); + HRESULT GetSharedReJitInfo([in] VMPTR_ReJitInfo vmReJitInfo, [out] VMPTR_SharedReJitInfo * pSharedReJitInfo); + HRESULT GetSharedReJitInfoData([in] VMPTR_SharedReJitInfo sharedReJitInfo, [out] struct DacSharedReJitInfo * pData); + HRESULT AreOptimizationsDisabled([in] VMPTR_Module vmModule, [in] mdMethodDef methodTk, [out] BOOL * pOptimizationsDisabled); + + // Defines + HRESULT GetDefinesBitField([out] ULONG32 * pDefines); + HRESULT GetMDStructuresVersion([out] ULONG32 * pMDStructuresVersion); + + // Code Versioning (FEATURE_CODE_VERSIONING only) + HRESULT GetActiveRejitILCodeVersionNode([in] VMPTR_Module vmModule, [in] mdMethodDef methodTk, [out] VMPTR_ILCodeVersionNode * pVmILCodeVersionNode); + HRESULT GetNativeCodeVersionNode([in] VMPTR_MethodDesc vmMethod, [in] CORDB_ADDRESS codeStartAddress, [out] VMPTR_NativeCodeVersionNode * pVmNativeCodeVersionNode); + HRESULT GetILCodeVersionNode([in] VMPTR_NativeCodeVersionNode vmNativeCodeVersionNode, [out] VMPTR_ILCodeVersionNode * pVmILCodeVersionNode); + HRESULT GetILCodeVersionNodeData([in] VMPTR_ILCodeVersionNode ilCodeVersionNode, [out] struct DacSharedReJitInfo * pData); + + // Miscellaneous + HRESULT EnableGCNotificationEvents([in] BOOL fEnable); + + // Delegate + HRESULT IsDelegate([in] VMPTR_Object vmObject, [out] BOOL * pResult); + HRESULT GetDelegateType([in] VMPTR_Object delegateObject, [out] DelegateType * delegateType); + HRESULT GetDelegateFunctionData( + [in] DelegateType delegateType, + [in] VMPTR_Object delegateObject, + [out] VMPTR_DomainAssembly * ppFunctionDomainAssembly, + [out] mdMethodDef * pMethodDef); + HRESULT GetDelegateTargetObject( + [in] DelegateType delegateType, + [in] VMPTR_Object delegateObject, + [out] VMPTR_Object * ppTargetObj, + [out] VMPTR_AppDomain * ppTargetAppDomain); + + // Loader Heap + HRESULT GetLoaderHeapMemoryRanges([out] DacDbiArrayList_COR_MEMORY_RANGE * pRanges); + + // Module Mapping + HRESULT IsModuleMapped([in] VMPTR_Module pModule, [out] BOOL * isModuleMapped); + HRESULT MetadataUpdatesApplied([out] BOOL * pResult); + HRESULT GetDomainAssemblyFromModule([in] VMPTR_Module vmModule, [out] VMPTR_DomainAssembly * pVmDomainAssembly); + + // Async and Continuations + HRESULT ParseContinuation( + [in] CORDB_ADDRESS continuationAddress, + [out] PCODE * pDiagnosticIP, + [out] CORDB_ADDRESS * pNextContinuation, + [out] UINT32 * pState); + HRESULT GetAsyncLocals([in] VMPTR_MethodDesc vmMethod, [in] CORDB_ADDRESS codeAddr, [in] UINT32 state, [out] DacDbiArrayList_AsyncLocalData * pAsyncLocals); + + // Generic Arg Token + HRESULT GetGenericArgTokenIndex([in] VMPTR_MethodDesc vmMethod, [out] UINT32 * pTokenIndex); +}; diff --git a/src/coreclr/debug/inc/dacdbiinterface.h b/src/coreclr/debug/inc/dacdbiinterface.h index 1d19b32907de75..35596f56cdcd24 100644 --- a/src/coreclr/debug/inc/dacdbiinterface.h +++ b/src/coreclr/debug/inc/dacdbiinterface.h @@ -163,7 +163,10 @@ const DWORD kCurrentDbiVersionFormat = 1; // // //----------------------------------------------------------------------------- -class IDacDbiInterface + +// {DB505C1B-A327-4A46-8C32-AF55A56F8E09} +MIDL_INTERFACE("DB505C1B-A327-4A46-8C32-AF55A56F8E09") +IDacDbiInterface : public IUnknown { public: class IStringHolder; @@ -200,7 +203,7 @@ class IDacDbiInterface // Notes: // If this fails, the interface is in an undefined state. // This must be called anytime target memory changes, else all other functions - // (besides Destroy) may yield out-of-date or semantically incorrect results. + // (besides Release) may yield out-of-date or semantically incorrect results. // virtual HRESULT FlushCache() = 0; @@ -226,19 +229,7 @@ class IDacDbiInterface // consistency failures exceptions (this is independent from asserts - there are legitimate // scenarios for all 4 combinations). // - virtual HRESULT DacSetTargetConsistencyChecks(bool fEnableAsserts) = 0; - - // - // Destroy the interface object. The client should call this when it's done - // with the IDacDbiInterface to free up any resources. - // - // Return Value: - // S_OK on success; otherwise, an appropriate failure HRESULT. - // - // Notes: - // The client should not call anything else on this interface after Destroy. - // - virtual HRESULT Destroy() = 0; + virtual HRESULT DacSetTargetConsistencyChecks(BOOL fEnableAsserts) = 0; //----------------------------------------------------------------------------- // General purpose target inspection functions @@ -957,7 +948,7 @@ class IDacDbiInterface // Whether a thread is dead can be inferred from the ICorDebug API. However, we have this // on DacDbi to ensure that this definition is consistent with the other DacDbi methods, // especially the enumeration and discovery rules. - virtual HRESULT IsThreadMarkedDead(VMPTR_Thread vmThread, OUT bool * pResult) = 0; + virtual HRESULT IsThreadMarkedDead(VMPTR_Thread vmThread, OUT BOOL * pResult) = 0; // @@ -1742,13 +1733,13 @@ class IDacDbiInterface // for generics or they may represent the element type or referent // type. // pGenericArgData - list of type parameters - // vmTypeHandle - the exact type handle derived from the type information + // pVmTypeHandle - [out] the exact type handle derived from the type information // Return Value: // S_OK on success; otherwise, an appropriate failure HRESULT. virtual HRESULT GetExactTypeHandle(DebuggerIPCE_ExpandedTypeData * pTypeData, ArgInfoList * pArgInfo, - VMPTR_TypeHandle& vmTypeHandle) = 0; + VMPTR_TypeHandle * pVmTypeHandle) = 0; // // Retrieve the generic type params for a given MethodDesc. This function is specifically @@ -1857,7 +1848,7 @@ class IDacDbiInterface virtual HRESULT IsExceptionObject(VMPTR_Object vmObject, OUT BOOL * pResult) = 0; // Get the list of raw stack frames for the specified exception object. - virtual HRESULT GetStackFramesFromException(VMPTR_Object vmObject, DacDbiArrayList& dacStackFrames) = 0; + virtual HRESULT GetStackFramesFromException(VMPTR_Object vmObject, DacDbiArrayList* pDacStackFrames) = 0; // Check whether the argument is a runtime callable wrapper. virtual HRESULT IsRcw(VMPTR_Object vmObject, OUT BOOL * pResult) = 0; @@ -1876,7 +1867,7 @@ class IDacDbiInterface // list of IIDs. the interface types are retrieved from an app domain // IID / Type cache, that is updated as new types are loaded. will // have NULL entries corresponding to unknown IIDs in "iids" - virtual HRESULT GetCachedWinRTTypesForIIDs(VMPTR_AppDomain vmAppDomain, DacDbiArrayList & iids, OUT DacDbiArrayList * pTypes) = 0; + virtual HRESULT GetCachedWinRTTypesForIIDs(VMPTR_AppDomain vmAppDomain, DacDbiArrayList * pIids, OUT DacDbiArrayList * pTypes) = 0; // retrieves the whole app domain cache of IID / Type mappings. virtual HRESULT GetCachedWinRTTypes(VMPTR_AppDomain vmAppDomain, OUT DacDbiArrayList * piids, OUT DacDbiArrayList * pTypes) = 0; @@ -2081,13 +2072,13 @@ class IDacDbiInterface // // Arguments: // vmModule: the module to check - // isWinRT: out parameter indicating state of module + // pIsWinRT: [out] indicating state of module // // Return value: // S_OK on success; otherwise, an appropriate failure HRESULT. // virtual - HRESULT IsWinRTModule(VMPTR_Module vmModule, BOOL& isWinRT) = 0; + HRESULT IsWinRTModule(VMPTR_Module vmModule, BOOL * pIsWinRT) = 0; // Determines the app domain id for the object referred to by a given VMPTR_OBJECTHANDLE // @@ -2165,9 +2156,9 @@ class IDacDbiInterface // to terminate the process when the attach is canceled. virtual HRESULT GetAttachStateFlags(OUT CLR_DEBUGGING_PROCESS_FLAGS * pRetVal) = 0; - virtual HRESULT GetMetaDataFileInfoFromPEFile(VMPTR_PEAssembly vmPEAssembly, DWORD & dwTimeStamp, DWORD & dwImageSize, IStringHolder* pStrFilename, OUT bool * pResult) = 0; + virtual HRESULT GetMetaDataFileInfoFromPEFile(VMPTR_PEAssembly vmPEAssembly, DWORD * pTimeStamp, DWORD * pImageSize, IStringHolder* pStrFilename, OUT BOOL * pResult) = 0; - virtual HRESULT IsThreadSuspendedOrHijacked(VMPTR_Thread vmThread, OUT bool * pResult) = 0; + virtual HRESULT IsThreadSuspendedOrHijacked(VMPTR_Thread vmThread, OUT BOOL * pResult) = 0; typedef void* * HeapWalkHandle; @@ -2175,7 +2166,7 @@ class IDacDbiInterface // Returns true if it is safe to walk the heap. If this function returns false, // you could still create a heap walk and attempt to walk it, but there's no // telling how much of the heap will be available. - virtual HRESULT AreGCStructuresValid(OUT bool * pResult) = 0; + virtual HRESULT AreGCStructuresValid(OUT BOOL * pResult) = 0; // Creates a HeapWalkHandle which can be used to walk the managed heap with the // WalkHeap function. Note if this function completes successfully you will need @@ -2225,9 +2216,9 @@ class IDacDbiInterface virtual HRESULT GetHeapSegments(OUT DacDbiArrayList * pSegments) = 0; - virtual HRESULT IsValidObject(CORDB_ADDRESS obj, OUT bool * pResult) = 0; + virtual HRESULT IsValidObject(CORDB_ADDRESS obj, OUT BOOL * pResult) = 0; - virtual HRESULT GetAppDomainForObject(CORDB_ADDRESS obj, OUT VMPTR_AppDomain * pApp, OUT VMPTR_Module * pModule, OUT VMPTR_DomainAssembly * pDomainAssembly, OUT bool * pResult) = 0; + virtual HRESULT GetAppDomainForObject(CORDB_ADDRESS obj, OUT VMPTR_AppDomain * pApp, OUT VMPTR_Module * pModule, OUT VMPTR_DomainAssembly * pDomainAssembly, OUT BOOL * pResult) = 0; // Reference Walking. @@ -2311,6 +2302,7 @@ class IDacDbiInterface // DEPRECATED - use GetNativeCodeVersionNode // Retrieves the ReJitInfo for a given MethodDesc/code address, if it exists. + // Note: Named GetReJitInfoByAddress in dacdbi.idl because COM does not support overloads. // // // Arguments: @@ -2533,7 +2525,7 @@ class IDacDbiInterface virtual HRESULT IsModuleMapped(VMPTR_Module pModule, OUT BOOL *isModuleMapped) = 0; - virtual HRESULT MetadataUpdatesApplied(OUT bool * pResult) = 0; + virtual HRESULT MetadataUpdatesApplied(OUT BOOL * pResult) = 0; virtual HRESULT GetDomainAssemblyFromModule(VMPTR_Module vmModule, OUT VMPTR_DomainAssembly *pVmDomainAssembly) = 0; @@ -2644,5 +2636,8 @@ class IDacDbiInterface }; // end IDacDbiInterface +// IID declaration for non-Windows platforms where __uuidof() expands to IID_##type. +// The actual IID is defined in corguids (via dacdbi_i.cpp). +EXTERN_C const IID IID_IDacDbiInterface; #endif // _DACDBI_INTERFACE_H_ diff --git a/src/coreclr/inc/CMakeLists.txt b/src/coreclr/inc/CMakeLists.txt index 4edac3b4f1ed9c..bd9a39c053a49e 100644 --- a/src/coreclr/inc/CMakeLists.txt +++ b/src/coreclr/inc/CMakeLists.txt @@ -31,6 +31,15 @@ if(CLR_CMAKE_HOST_WIN32) COMMENT "Compiling ${GENERATE_IDL}") endforeach(GENERATE_IDL) + # dacdbi.idl lives in debug/inc/ rather than inc/, so handle it separately + set(DACDBI_IDL_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../debug/inc/dacdbi.idl) + set(DACDBI_OUT_NAME ${CMAKE_CURRENT_BINARY_DIR}/idls_out/dacdbi_i.c) + list(APPEND CORGUIDS_SOURCES ${DACDBI_OUT_NAME}) + add_custom_command(OUTPUT ${DACDBI_OUT_NAME} + COMMAND ${MIDL} ${MIDL_INCLUDE_DIRECTORIES} /nologo /no_stamp /h ${CMAKE_CURRENT_BINARY_DIR}/idls_out/dacdbi.h ${MIDL_DEFINITIONS} /out ${CMAKE_CURRENT_BINARY_DIR}/idls_out ${DACDBI_IDL_PATH} + DEPENDS ${DACDBI_IDL_PATH} + COMMENT "Compiling dacdbi.idl") + set_source_files_properties(${CORGUIDS_SOURCES} PROPERTIES GENERATED TRUE) @@ -48,6 +57,9 @@ else(CLR_CMAKE_HOST_WIN32) list(APPEND CORGUIDS_SOURCES ${C_SOURCE}) endforeach(IDL_SOURCE) + # dacdbi.idl prebuilt file + list(APPEND CORGUIDS_SOURCES ../pal/prebuilt/idl/dacdbi_i.cpp) + endif(CLR_CMAKE_HOST_WIN32) # Compile *_i.cpp to lib diff --git a/src/coreclr/pal/prebuilt/idl/dacdbi_i.cpp b/src/coreclr/pal/prebuilt/idl/dacdbi_i.cpp new file mode 100644 index 00000000000000..8d0e7f75532a43 --- /dev/null +++ b/src/coreclr/pal/prebuilt/idl/dacdbi_i.cpp @@ -0,0 +1,90 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */ + +/* link this file in with the server and any clients */ + + + /* File created by MIDL compiler version 8.01.0628 */ +/* Compiler settings for dacdbi.idl: + Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0628 + protocol : dce , ms_ext, c_ext, robust + error checks: allocation ref bounds_check enum stub_data + VC __declspec() decoration level: + __declspec(uuid()), __declspec(selectany), __declspec(novtable) + DECLSPEC_UUID(), MIDL_INTERFACE() +*/ +/* @@MIDL_FILE_HEADING( ) */ + +#pragma warning( disable: 4049 ) /* more than 64k source lines */ + + +#ifdef __cplusplus +extern "C"{ +#endif + + +#include +#include + +#ifdef _MIDL_USE_GUIDDEF_ + +#ifndef INITGUID +#define INITGUID +#include +#undef INITGUID +#else +#include +#endif + +#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ + DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) + +#else // !_MIDL_USE_GUIDDEF_ + +#ifndef __IID_DEFINED__ +#define __IID_DEFINED__ + +typedef struct _IID +{ + unsigned long x; + unsigned short s1; + unsigned short s2; + unsigned char c[8]; +} IID; + +#endif // __IID_DEFINED__ + +#ifndef CLSID_DEFINED +#define CLSID_DEFINED +typedef IID CLSID; +#endif // CLSID_DEFINED + +#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \ + EXTERN_C __declspec(selectany) const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} + +#endif // !_MIDL_USE_GUIDDEF_ + +// IDacDbiStringHolder: {F2F195B2-C9F1-4164-B76D-CF4669956ED9} +MIDL_DEFINE_GUID(IID, IID_IDacDbiStringHolder,0xf2f195b2,0xc9f1,0x4164,0xb7,0x6d,0xcf,0x46,0x69,0x95,0x6e,0xd9); + + +// IDacDbiAllocator: {97441D33-C82F-4106-B025-A912CB507526} +MIDL_DEFINE_GUID(IID, IID_IDacDbiAllocator,0x97441d33,0xc82f,0x4106,0xb0,0x25,0xa9,0x12,0xcb,0x50,0x75,0x26); + + +// IDacDbiMetaDataLookup: {EF037312-925C-4A13-A9B5-3C1BB07B56FD} +MIDL_DEFINE_GUID(IID, IID_IDacDbiMetaDataLookup,0xef037312,0x925c,0x4a13,0xa9,0xb5,0x3c,0x1b,0xb0,0x7b,0x56,0xfd); + + +// IDacDbiInterface: {DB505C1B-A327-4A46-8C32-AF55A56F8E09} +MIDL_DEFINE_GUID(IID, IID_IDacDbiInterface,0xdb505c1b,0xa327,0x4a46,0x8c,0x32,0xaf,0x55,0xa5,0x6f,0x8e,0x09); + +#undef MIDL_DEFINE_GUID + +#ifdef __cplusplus +} +#endif + +