System.Diagnostics.SymbolStore.SymWriter.SetUnderlyingWriter C# (CSharp) Method

SetUnderlyingWriter() public method

public SetUnderlyingWriter ( IntPtr underlyingWriter ) : void
underlyingWriter System.IntPtr
return void
        public void SetUnderlyingWriter(IntPtr underlyingWriter)
        {
            // Demand the permission to access unmanaged code. We do this since we are casting an int to a COM interface, and
            // this can be used improperly.
            (new SecurityPermission(SecurityPermissionFlag.UnmanagedCode)).Demand();

            int hr;
            COMException Exception;
            SymWriter_Release(m_Writer);
            hr = SymWriter_GetWriter(underlyingWriter, out m_Writer);
            if (hr < 0)
            {
                Exception = new COMException("Call to GetWriter failed.", hr);
                throw Exception;
            }
        }