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;
}
}