Esempio n. 1
0
 //------------------------------------------------------------------------------
 // Ctor
 //------------------------------------------------------------------------------
 internal SymDocumentWriter(PunkSafeHandle pDocumentWriterSafeHandle)
 {
     m_pDocumentWriterSafeHandle = pDocumentWriterSafeHandle;
     // The handle is actually a pointer to a native ISymUnmanagedDocumentWriter.
     m_pDocWriter = (ISymUnmanagedDocumentWriter *)m_pDocumentWriterSafeHandle.DangerousGetHandle();
     m_vtable     = (ISymUnmanagedDocumentWriterVTable)(Marshal.PtrToStructure(m_pDocWriter->m_unmanagedVTable, typeof(ISymUnmanagedDocumentWriterVTable))) !;
 }
 [System.Security.SecurityCritical] // auto-generated
 #endif
 internal SymDocumentWriter(PunkSafeHandle pDocumentWriterSafeHandle)
 {
     m_pDocumentWriterSafeHandle = pDocumentWriterSafeHandle;
     // The handle is actually a pointer to a native ISymUnmanagedDocumentWriter.
     m_pDocWriter = (ISymUnmanagedDocumentWriter *)m_pDocumentWriterSafeHandle.DangerousGetHandle();
     m_vtable = (ISymUnmanagedDocumentWriterVTable)(Marshal.PtrToStructure(m_pDocWriter->m_unmanagedVTable, typeof(ISymUnmanagedDocumentWriterVTable)));
 }
Esempio n. 3
0
 internal SymDocumentWriter(PunkSafeHandle pDocumentWriterSafeHandle)
 {
     m_pDocumentWriterSafeHandle = pDocumentWriterSafeHandle;
     // The handle is actually a pointer to a native ISymUnmanagedDocumentWriter.
     m_pDocWriter = (ISymUnmanagedDocumentWriter *)m_pDocumentWriterSafeHandle.DangerousGetHandle();
     m_vtable     = (ISymUnmanagedDocumentWriterVTable)(Marshal.PtrToStructure(m_pDocWriter->m_unmanagedVTable, typeof(ISymUnmanagedDocumentWriterVTable))) !; // TODO-NULLABLE: https://github.com/dotnet/roslyn/issues/34976
 }
Esempio n. 4
0
            ISymbolDocumentWriter?ISymbolWriter.DefineDocument(string url,
                                                               Guid language,
                                                               Guid languageVendor,
                                                               Guid documentType)
            {
                PunkSafeHandle psymUnmanagedDocumentWriter = new PunkSafeHandle();

                int hr = m_vtable.DefineDocument(m_pWriter, url, ref language, ref languageVendor, ref documentType, out psymUnmanagedDocumentWriter);

                if (hr < 0)
                {
                    throw Marshal.GetExceptionForHR(hr) !;
                }
                if (psymUnmanagedDocumentWriter.IsInvalid)
                {
                    return(null);
                }
                return(new SymDocumentWriter(psymUnmanagedDocumentWriter));
            }
            [System.Security.SecurityCritical] // auto-generated
            #endif
            ISymbolDocumentWriter ISymbolWriter.DefineDocument(String url,
                                                               Guid language,
                                                               Guid languageVendor,
                                                               Guid documentType)
            {
                PunkSafeHandle psymUnmanagedDocumentWriter = new PunkSafeHandle();

                int hr = m_vtable.DefineDocument(m_pWriter, url, ref language, ref languageVendor, ref documentType, out psymUnmanagedDocumentWriter);
                if (hr < 0)
                {
                    throw Marshal.GetExceptionForHR(hr);
                }
                if (psymUnmanagedDocumentWriter.IsInvalid)
                {
                    return null;
                }
                return new SymDocumentWriter(psymUnmanagedDocumentWriter);
            }