﻿<?xml version="1.0" encoding="utf-8"?><Type Name="PreserveSigAttribute" FullName="System.Runtime.InteropServices.PreserveSigAttribute"><TypeSignature Maintainer="auto" Language="C#" Value="public sealed class PreserveSigAttribute : Attribute" /><TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit PreserveSigAttribute extends System.Attribute" /><AssemblyInfo><AssemblyName>mscorlib</AssemblyName><AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the &lt;link location="node:gtk-sharp/programming/threads"&gt;Gtk# Thread Programming&lt;/link&gt; for details.</ThreadSafetyStatement><Base><BaseTypeName>System.Attribute</BaseTypeName></Base><Interfaces /><Attributes><Attribute><AttributeName>System.AttributeUsage(System.AttributeTargets.Method, Inherited=false)</AttributeName></Attribute><Attribute><AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName></Attribute></Attributes><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>You can apply this attribute to methods.</para><para>By default, the <format type="text/html"><a href="A487D61B-D166-467B-A7CA-D8B52FBFF42D">[&lt;topic://cpgrfTypeLibraryExporterTlbexpexe&gt;]</a></format> ensures that a call that returns an HRESULT of S_OK is transformed such that the [out, retval] parameter is used as the function return value. The S_OK HRESULT is discarded. For HRESULTs other than S_OK, the runtime throws an exception and discards the [out, retval] parameter. When you apply the <see cref="T:System.Runtime.InteropServices.PreserveSigAttribute" /> to a managed method signature, the managed and unmanaged signatures of the attributed method are identical.</para><para>Preserving the original method signature is necessary if the member returns more than one success HRESULT value and you want to detect the different values. Since most COM member return an HRESULT, by applying the <see cref="T:System.Runtime.InteropServices.PreserveSigAttribute" />, you can retrieve an integer representing the success or failure HRESULT. Tlbexp.exe preserves any [out, retavl] parameters as out parameters in the managed signature.</para><para>The <format type="text/html"><a href="EC0A8D63-11B3-4ACD-B398-DA1E37E97382">[&lt;topic://cpgrfTypeLibraryImporterTlbimpexe&gt;]</a></format> also applies this attribute; it applies the attribute to dispinterfaces when it imports a type library.</para><block subset="none" type="note"><para>Return types of <see cref="F:System.Runtime.InteropServices.UnmanagedType.Currency" />, <see cref="T:System.Guid" />, and <see cref="T:System.Object" /> are not supported by the <see cref="T:System.Runtime.InteropServices.PreserveSigAttribute" /> class when interoperation occurs from COM to managed code and the managed code is marked with the <see cref="T:System.Runtime.InteropServices.PreserveSigAttribute" /> class.  When you attempt to use one of these return types with the <see cref="T:System.Runtime.InteropServices.PreserveSigAttribute" /> class during these conditions, a <see cref="T:System.TypeLoadException" /> is thrown.   </para></block></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Indicates that the HRESULT or retval signature transformation that takes place during COM interop calls should be suppressed.</para></summary></Docs><Members><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public PreserveSigAttribute ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue /><Parameters /><Docs><remarks>To be added</remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.PreserveSigAttribute" /> class.</para></summary></Docs></Member></Members></Type>