mirror of https://github.com/icsharpcode/ILSpy.git
18 changed files with 1051 additions and 116 deletions
@ -1,96 +0,0 @@
@@ -1,96 +0,0 @@
|
||||
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Runtime.InteropServices; |
||||
|
||||
// P/Invoke and marshalling attribute tests
|
||||
public class PInvoke |
||||
{ |
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 2)] |
||||
public struct MarshalAsTest |
||||
{ |
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] |
||||
public uint[] FixedArray; |
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.Bool)] |
||||
public int[] FixedBoolArray; |
||||
|
||||
[MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)] |
||||
public string[] SafeBStrArray; |
||||
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] |
||||
public string FixedString; |
||||
} |
||||
|
||||
[StructLayout(LayoutKind.Explicit)] |
||||
public struct Rect |
||||
{ |
||||
[FieldOffset(0)] |
||||
public int left; |
||||
[FieldOffset(4)] |
||||
public int top; |
||||
[FieldOffset(8)] |
||||
public int right; |
||||
[FieldOffset(12)] |
||||
public int bottom; |
||||
} |
||||
|
||||
public static decimal MarshalAttributesOnPropertyAccessors |
||||
{ |
||||
[return: MarshalAs(UnmanagedType.Currency)] |
||||
get |
||||
{ |
||||
return 0m; |
||||
} |
||||
[param: MarshalAs(UnmanagedType.Currency)] |
||||
set |
||||
{ |
||||
} |
||||
} |
||||
|
||||
[DllImport("xyz.dll", CharSet = CharSet.Auto)] |
||||
[return: MarshalAs(UnmanagedType.Bool)] |
||||
public static extern bool Method([MarshalAs(UnmanagedType.LPStr)] string input); |
||||
|
||||
[DllImport("xyz.dll")] |
||||
private static extern void New1(int ElemCnt, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] int[] ar); |
||||
|
||||
[DllImport("xyz.dll")] |
||||
private static extern void New2([MarshalAs(UnmanagedType.LPArray, SizeConst = 128)] int[] ar); |
||||
|
||||
[DllImport("xyz.dll")] |
||||
private static extern void New3([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Bool, SizeConst = 64, SizeParamIndex = 1)] int[] ar); |
||||
|
||||
public void CustomMarshal1([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "MyCompany.MyMarshaler")] object o) |
||||
{ |
||||
} |
||||
|
||||
public void CustomMarshal2([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "MyCompany.MyMarshaler", MarshalCookie = "Cookie")] object o) |
||||
{ |
||||
} |
||||
|
||||
[DllImport("ws2_32.dll", SetLastError = true)] |
||||
internal static extern IntPtr ioctlsocket([In] IntPtr socketHandle, [In] int cmd, [In] [Out] ref int argp); |
||||
|
||||
public void CallMethodWithInOutParameter() |
||||
{ |
||||
int num = 0; |
||||
PInvoke.ioctlsocket(IntPtr.Zero, 0, ref num); |
||||
} |
||||
} |
@ -0,0 +1,99 @@
@@ -0,0 +1,99 @@
|
||||
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
||||
// software and associated documentation files (the "Software"), to deal in the Software
|
||||
// without restriction, including without limitation the rights to use, copy, modify, merge,
|
||||
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
||||
// to whom the Software is furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all copies or
|
||||
// substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
||||
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System; |
||||
using System.Runtime.InteropServices; |
||||
|
||||
namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty |
||||
{ |
||||
// P/Invoke and marshalling attribute tests
|
||||
public class PInvoke |
||||
{ |
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 2)] |
||||
public struct MarshalAsTest |
||||
{ |
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] |
||||
public uint[] FixedArray; |
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4, ArraySubType = UnmanagedType.Bool)] |
||||
public int[] FixedBoolArray; |
||||
|
||||
[MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)] |
||||
public string[] SafeBStrArray; |
||||
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] |
||||
public string FixedString; |
||||
} |
||||
|
||||
[StructLayout(LayoutKind.Explicit)] |
||||
public struct Rect |
||||
{ |
||||
[FieldOffset(0)] |
||||
public int left; |
||||
[FieldOffset(4)] |
||||
public int top; |
||||
[FieldOffset(8)] |
||||
public int right; |
||||
[FieldOffset(12)] |
||||
public int bottom; |
||||
} |
||||
|
||||
public static decimal MarshalAttributesOnPropertyAccessors { |
||||
[return: MarshalAs(UnmanagedType.Currency)] |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
[param: MarshalAs(UnmanagedType.Currency)] |
||||
set { |
||||
} |
||||
} |
||||
|
||||
[DllImport("xyz.dll", CharSet = CharSet.Auto)] |
||||
[return: MarshalAs(UnmanagedType.Bool)] |
||||
public static extern bool Method([MarshalAs(UnmanagedType.LPStr)] string input); |
||||
|
||||
[DllImport("xyz.dll")] |
||||
private static extern void New1(int ElemCnt, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] int[] ar); |
||||
|
||||
[DllImport("xyz.dll")] |
||||
private static extern void New2([MarshalAs(UnmanagedType.LPArray, SizeConst = 128)] int[] ar); |
||||
|
||||
[DllImport("xyz.dll")] |
||||
private static extern void New3([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Bool, SizeConst = 64, SizeParamIndex = 1)] int[] ar); |
||||
|
||||
[DllImport("xyz.dll")] |
||||
private static extern void New4([MarshalAs(UnmanagedType.LPArray)] int[] ar); |
||||
|
||||
public void CustomMarshal1([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "MyCompany.MyMarshaler")] object o) |
||||
{ |
||||
} |
||||
|
||||
public void CustomMarshal2([MarshalAs(UnmanagedType.CustomMarshaler, MarshalType = "MyCompany.MyMarshaler", MarshalCookie = "Cookie")] object o) |
||||
{ |
||||
} |
||||
|
||||
[DllImport("ws2_32.dll", SetLastError = true)] |
||||
internal static extern IntPtr ioctlsocket([In] IntPtr socketHandle, [In] int cmd, [In] [Out] ref int argp); |
||||
|
||||
public void CallMethodWithInOutParameter() |
||||
{ |
||||
int num = 0; |
||||
PInvoke.ioctlsocket(IntPtr.Zero, 0, ref num); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,207 @@
@@ -0,0 +1,207 @@
|
||||
.module extern xyz.dll |
||||
.module extern ws2_32.dll |
||||
.assembly extern mscorlib |
||||
{ |
||||
.publickeytoken = ( |
||||
b7 7a 5c 56 19 34 e0 89 |
||||
) |
||||
.ver 4:0:0:0 |
||||
} |
||||
.assembly c0d101lq |
||||
{ |
||||
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( |
||||
01 00 08 00 00 00 00 00 |
||||
) |
||||
.custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( |
||||
01 00 01 00 54 02 16 57 72 61 70 4e 6f 6e 45 78 |
||||
63 65 70 74 69 6f 6e 54 68 72 6f 77 73 01 |
||||
) |
||||
.permissionset reqmin = { |
||||
[mscorlib]System.Security.Permissions.SecurityPermissionAttribute = { |
||||
property bool SkipVerification = bool(true) |
||||
} |
||||
} |
||||
.hash algorithm 0x00008004 // SHA1 |
||||
.ver 0:0:0:0 |
||||
} |
||||
|
||||
.module PInvoke |
||||
// MVID: {F608732B-D0A2-45AE-9706-B0B2379F8AAE} |
||||
.corflags 0x00000001 // ILOnly |
||||
.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( |
||||
01 00 00 00 |
||||
) |
||||
|
||||
.class private auto ansi '<Module>' |
||||
{ |
||||
} // end of class <Module> |
||||
|
||||
.class public auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.PInvoke |
||||
extends [mscorlib]System.Object |
||||
{ |
||||
// Nested Types |
||||
.class nested public sequential unicode sealed beforefieldinit MarshalAsTest |
||||
extends [mscorlib]System.ValueType |
||||
{ |
||||
.pack 2 |
||||
.size 0 |
||||
|
||||
// Fields |
||||
.field public marshal(fixed array[3]) uint32[] FixedArray |
||||
.field public marshal(fixed array[4] bool) int32[] FixedBoolArray |
||||
.field public marshal(safearray bstr) string[] SafeBStrArray |
||||
.field public marshal(fixed sysstring[8]) string FixedString |
||||
|
||||
} // end of class MarshalAsTest |
||||
|
||||
.class nested public explicit ansi sealed beforefieldinit Rect |
||||
extends [mscorlib]System.ValueType |
||||
{ |
||||
// Fields |
||||
.field [0] public int32 left |
||||
.field [4] public int32 top |
||||
.field [8] public int32 right |
||||
.field [12] public int32 bottom |
||||
|
||||
} // end of class Rect |
||||
|
||||
|
||||
// Methods |
||||
.method public hidebysig specialname static |
||||
valuetype [mscorlib]System.Decimal marshal(currency) get_MarshalAttributesOnPropertyAccessors () cil managed |
||||
{ |
||||
// Method begins at RVA 0x2050 |
||||
// Code size 7 (0x7) |
||||
.maxstack 8 |
||||
|
||||
IL_0000: nop |
||||
IL_0001: newobj instance void [mscorlib]System.NotImplementedException::.ctor() |
||||
IL_0006: throw |
||||
} // end of method PInvoke::get_MarshalAttributesOnPropertyAccessors |
||||
|
||||
.method public hidebysig specialname static |
||||
void set_MarshalAttributesOnPropertyAccessors ( |
||||
valuetype [mscorlib]System.Decimal marshal(currency) 'value' |
||||
) cil managed |
||||
{ |
||||
// Method begins at RVA 0x2058 |
||||
// Code size 2 (0x2) |
||||
.maxstack 8 |
||||
|
||||
IL_0000: nop |
||||
IL_0001: ret |
||||
} // end of method PInvoke::set_MarshalAttributesOnPropertyAccessors |
||||
|
||||
.method public hidebysig static pinvokeimpl("xyz.dll" autochar winapi) |
||||
bool marshal(bool) Method ( |
||||
string marshal(lpstr) input |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::Method |
||||
|
||||
.method private hidebysig static pinvokeimpl("xyz.dll" winapi) |
||||
void New1 ( |
||||
int32 ElemCnt, |
||||
int32[] marshal([ + 0]) ar |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::New1 |
||||
|
||||
.method private hidebysig static pinvokeimpl("xyz.dll" winapi) |
||||
void New2 ( |
||||
int32[] marshal([128]) ar |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::New2 |
||||
|
||||
.method private hidebysig static pinvokeimpl("xyz.dll" winapi) |
||||
void New3 ( |
||||
int32[] marshal(bool[64 + 1]) ar |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::New3 |
||||
|
||||
.method private hidebysig static pinvokeimpl("xyz.dll" winapi) |
||||
void New4 ( |
||||
int32[] marshal([]) ar |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::New4 |
||||
|
||||
.method public hidebysig |
||||
instance void CustomMarshal1 ( |
||||
object marshal(custom("MyCompany.MyMarshaler", "")) o |
||||
) cil managed |
||||
{ |
||||
// Method begins at RVA 0x205b |
||||
// Code size 2 (0x2) |
||||
.maxstack 8 |
||||
|
||||
IL_0000: nop |
||||
IL_0001: ret |
||||
} // end of method PInvoke::CustomMarshal1 |
||||
|
||||
.method public hidebysig |
||||
instance void CustomMarshal2 ( |
||||
object marshal(custom("MyCompany.MyMarshaler", "Cookie")) o |
||||
) cil managed |
||||
{ |
||||
// Method begins at RVA 0x205e |
||||
// Code size 2 (0x2) |
||||
.maxstack 8 |
||||
|
||||
IL_0000: nop |
||||
IL_0001: ret |
||||
} // end of method PInvoke::CustomMarshal2 |
||||
|
||||
.method assembly hidebysig static pinvokeimpl("ws2_32.dll" lasterr winapi) |
||||
native int ioctlsocket ( |
||||
[in] native int socketHandle, |
||||
[in] int32 cmd, |
||||
[in] [out] int32& argp |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::ioctlsocket |
||||
|
||||
.method public hidebysig |
||||
instance void CallMethodWithInOutParameter () cil managed |
||||
{ |
||||
// Method begins at RVA 0x2064 |
||||
// Code size 18 (0x12) |
||||
.maxstack 3 |
||||
.locals init ( |
||||
[0] int32 |
||||
) |
||||
|
||||
IL_0000: nop |
||||
IL_0001: ldc.i4.0 |
||||
IL_0002: stloc.0 |
||||
IL_0003: ldsfld native int [mscorlib]System.IntPtr::Zero |
||||
IL_0008: ldc.i4.0 |
||||
IL_0009: ldloca.s 0 |
||||
IL_000b: call native int ICSharpCode.Decompiler.Tests.TestCases.Pretty.PInvoke::ioctlsocket(native int, int32, int32&) |
||||
IL_0010: pop |
||||
IL_0011: ret |
||||
} // end of method PInvoke::CallMethodWithInOutParameter |
||||
|
||||
.method public hidebysig specialname rtspecialname |
||||
instance void .ctor () cil managed |
||||
{ |
||||
// Method begins at RVA 0x2082 |
||||
// Code size 7 (0x7) |
||||
.maxstack 8 |
||||
|
||||
IL_0000: ldarg.0 |
||||
IL_0001: call instance void [mscorlib]System.Object::.ctor() |
||||
IL_0006: ret |
||||
} // end of method PInvoke::.ctor |
||||
|
||||
// Properties |
||||
.property valuetype [mscorlib]System.Decimal MarshalAttributesOnPropertyAccessors() |
||||
{ |
||||
.get valuetype [mscorlib]System.Decimal ICSharpCode.Decompiler.Tests.TestCases.Pretty.PInvoke::get_MarshalAttributesOnPropertyAccessors() |
||||
.set void ICSharpCode.Decompiler.Tests.TestCases.Pretty.PInvoke::set_MarshalAttributesOnPropertyAccessors(valuetype [mscorlib]System.Decimal) |
||||
} |
||||
|
||||
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.PInvoke |
||||
|
@ -0,0 +1,202 @@
@@ -0,0 +1,202 @@
|
||||
.module extern xyz.dll |
||||
.module extern ws2_32.dll |
||||
.assembly extern mscorlib |
||||
{ |
||||
.publickeytoken = ( |
||||
b7 7a 5c 56 19 34 e0 89 |
||||
) |
||||
.ver 4:0:0:0 |
||||
} |
||||
.assembly jfi2am5n |
||||
{ |
||||
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( |
||||
01 00 08 00 00 00 00 00 |
||||
) |
||||
.custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( |
||||
01 00 01 00 54 02 16 57 72 61 70 4e 6f 6e 45 78 |
||||
63 65 70 74 69 6f 6e 54 68 72 6f 77 73 01 |
||||
) |
||||
.permissionset reqmin = { |
||||
[mscorlib]System.Security.Permissions.SecurityPermissionAttribute = { |
||||
property bool SkipVerification = bool(true) |
||||
} |
||||
} |
||||
.hash algorithm 0x00008004 // SHA1 |
||||
.ver 0:0:0:0 |
||||
} |
||||
|
||||
.module PInvoke.opt |
||||
// MVID: {8A131D15-EAC0-48F2-A958-1AF6CBD25557} |
||||
.corflags 0x00000001 // ILOnly |
||||
.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( |
||||
01 00 00 00 |
||||
) |
||||
|
||||
.class private auto ansi '<Module>' |
||||
{ |
||||
} // end of class <Module> |
||||
|
||||
.class public auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.PInvoke |
||||
extends [mscorlib]System.Object |
||||
{ |
||||
// Nested Types |
||||
.class nested public sequential unicode sealed beforefieldinit MarshalAsTest |
||||
extends [mscorlib]System.ValueType |
||||
{ |
||||
.pack 2 |
||||
.size 0 |
||||
|
||||
// Fields |
||||
.field public marshal(fixed array[3]) uint32[] FixedArray |
||||
.field public marshal(fixed array[4] bool) int32[] FixedBoolArray |
||||
.field public marshal(safearray bstr) string[] SafeBStrArray |
||||
.field public marshal(fixed sysstring[8]) string FixedString |
||||
|
||||
} // end of class MarshalAsTest |
||||
|
||||
.class nested public explicit ansi sealed beforefieldinit Rect |
||||
extends [mscorlib]System.ValueType |
||||
{ |
||||
// Fields |
||||
.field [0] public int32 left |
||||
.field [4] public int32 top |
||||
.field [8] public int32 right |
||||
.field [12] public int32 bottom |
||||
|
||||
} // end of class Rect |
||||
|
||||
|
||||
// Methods |
||||
.method public hidebysig specialname static |
||||
valuetype [mscorlib]System.Decimal marshal(currency) get_MarshalAttributesOnPropertyAccessors () cil managed |
||||
{ |
||||
// Method begins at RVA 0x2050 |
||||
// Code size 6 (0x6) |
||||
.maxstack 8 |
||||
|
||||
IL_0000: newobj instance void [mscorlib]System.NotImplementedException::.ctor() |
||||
IL_0005: throw |
||||
} // end of method PInvoke::get_MarshalAttributesOnPropertyAccessors |
||||
|
||||
.method public hidebysig specialname static |
||||
void set_MarshalAttributesOnPropertyAccessors ( |
||||
valuetype [mscorlib]System.Decimal marshal(currency) 'value' |
||||
) cil managed |
||||
{ |
||||
// Method begins at RVA 0x2057 |
||||
// Code size 1 (0x1) |
||||
.maxstack 8 |
||||
|
||||
IL_0000: ret |
||||
} // end of method PInvoke::set_MarshalAttributesOnPropertyAccessors |
||||
|
||||
.method public hidebysig static pinvokeimpl("xyz.dll" autochar winapi) |
||||
bool marshal(bool) Method ( |
||||
string marshal(lpstr) input |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::Method |
||||
|
||||
.method private hidebysig static pinvokeimpl("xyz.dll" winapi) |
||||
void New1 ( |
||||
int32 ElemCnt, |
||||
int32[] marshal([ + 0]) ar |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::New1 |
||||
|
||||
.method private hidebysig static pinvokeimpl("xyz.dll" winapi) |
||||
void New2 ( |
||||
int32[] marshal([128]) ar |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::New2 |
||||
|
||||
.method private hidebysig static pinvokeimpl("xyz.dll" winapi) |
||||
void New3 ( |
||||
int32[] marshal(bool[64 + 1]) ar |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::New3 |
||||
|
||||
.method private hidebysig static pinvokeimpl("xyz.dll" winapi) |
||||
void New4 ( |
||||
int32[] marshal([]) ar |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::New4 |
||||
|
||||
.method public hidebysig |
||||
instance void CustomMarshal1 ( |
||||
object marshal(custom("MyCompany.MyMarshaler", "")) o |
||||
) cil managed |
||||
{ |
||||
// Method begins at RVA 0x2059 |
||||
// Code size 1 (0x1) |
||||
.maxstack 8 |
||||
|
||||
IL_0000: ret |
||||
} // end of method PInvoke::CustomMarshal1 |
||||
|
||||
.method public hidebysig |
||||
instance void CustomMarshal2 ( |
||||
object marshal(custom("MyCompany.MyMarshaler", "Cookie")) o |
||||
) cil managed |
||||
{ |
||||
// Method begins at RVA 0x205b |
||||
// Code size 1 (0x1) |
||||
.maxstack 8 |
||||
|
||||
IL_0000: ret |
||||
} // end of method PInvoke::CustomMarshal2 |
||||
|
||||
.method assembly hidebysig static pinvokeimpl("ws2_32.dll" lasterr winapi) |
||||
native int ioctlsocket ( |
||||
[in] native int socketHandle, |
||||
[in] int32 cmd, |
||||
[in] [out] int32& argp |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::ioctlsocket |
||||
|
||||
.method public hidebysig |
||||
instance void CallMethodWithInOutParameter () cil managed |
||||
{ |
||||
// Method begins at RVA 0x2060 |
||||
// Code size 17 (0x11) |
||||
.maxstack 3 |
||||
.locals init ( |
||||
[0] int32 |
||||
) |
||||
|
||||
IL_0000: ldc.i4.0 |
||||
IL_0001: stloc.0 |
||||
IL_0002: ldsfld native int [mscorlib]System.IntPtr::Zero |
||||
IL_0007: ldc.i4.0 |
||||
IL_0008: ldloca.s 0 |
||||
IL_000a: call native int ICSharpCode.Decompiler.Tests.TestCases.Pretty.PInvoke::ioctlsocket(native int, int32, int32&) |
||||
IL_000f: pop |
||||
IL_0010: ret |
||||
} // end of method PInvoke::CallMethodWithInOutParameter |
||||
|
||||
.method public hidebysig specialname rtspecialname |
||||
instance void .ctor () cil managed |
||||
{ |
||||
// Method begins at RVA 0x207d |
||||
// Code size 7 (0x7) |
||||
.maxstack 8 |
||||
|
||||
IL_0000: ldarg.0 |
||||
IL_0001: call instance void [mscorlib]System.Object::.ctor() |
||||
IL_0006: ret |
||||
} // end of method PInvoke::.ctor |
||||
|
||||
// Properties |
||||
.property valuetype [mscorlib]System.Decimal MarshalAttributesOnPropertyAccessors() |
||||
{ |
||||
.get valuetype [mscorlib]System.Decimal ICSharpCode.Decompiler.Tests.TestCases.Pretty.PInvoke::get_MarshalAttributesOnPropertyAccessors() |
||||
.set void ICSharpCode.Decompiler.Tests.TestCases.Pretty.PInvoke::set_MarshalAttributesOnPropertyAccessors(valuetype [mscorlib]System.Decimal) |
||||
} |
||||
|
||||
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.PInvoke |
||||
|
@ -0,0 +1,205 @@
@@ -0,0 +1,205 @@
|
||||
.module extern xyz.dll |
||||
.module extern ws2_32.dll |
||||
.assembly extern mscorlib |
||||
{ |
||||
.publickeytoken = ( |
||||
b7 7a 5c 56 19 34 e0 89 |
||||
) |
||||
.ver 4:0:0:0 |
||||
} |
||||
.assembly PInvoke |
||||
{ |
||||
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( |
||||
01 00 08 00 00 00 00 00 |
||||
) |
||||
.custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( |
||||
01 00 01 00 54 02 16 57 72 61 70 4e 6f 6e 45 78 |
||||
63 65 70 74 69 6f 6e 54 68 72 6f 77 73 01 |
||||
) |
||||
.custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( |
||||
01 00 02 00 00 00 00 00 |
||||
) |
||||
.permissionset reqmin = { |
||||
[mscorlib]System.Security.Permissions.SecurityPermissionAttribute = { |
||||
property bool SkipVerification = bool(true) |
||||
} |
||||
} |
||||
.hash algorithm 0x00008004 // SHA1 |
||||
.ver 0:0:0:0 |
||||
} |
||||
|
||||
.module PInvoke.opt.roslyn |
||||
// MVID: {63CD2985-0EDA-4C6F-91E0-BFDEBA4905D5} |
||||
.corflags 0x00000001 // ILOnly |
||||
.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( |
||||
01 00 00 00 |
||||
) |
||||
|
||||
.class private auto ansi '<Module>' |
||||
{ |
||||
} // end of class <Module> |
||||
|
||||
.class public auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.PInvoke |
||||
extends [mscorlib]System.Object |
||||
{ |
||||
// Nested Types |
||||
.class nested public sequential unicode sealed beforefieldinit MarshalAsTest |
||||
extends [mscorlib]System.ValueType |
||||
{ |
||||
.pack 2 |
||||
.size 0 |
||||
|
||||
// Fields |
||||
.field public marshal(fixed array[3]) uint32[] FixedArray |
||||
.field public marshal(fixed array[4] bool) int32[] FixedBoolArray |
||||
.field public marshal(safearray bstr) string[] SafeBStrArray |
||||
.field public marshal(fixed sysstring[8]) string FixedString |
||||
|
||||
} // end of class MarshalAsTest |
||||
|
||||
.class nested public explicit ansi sealed beforefieldinit Rect |
||||
extends [mscorlib]System.ValueType |
||||
{ |
||||
// Fields |
||||
.field [0] public int32 left |
||||
.field [4] public int32 top |
||||
.field [8] public int32 right |
||||
.field [12] public int32 bottom |
||||
|
||||
} // end of class Rect |
||||
|
||||
|
||||
// Methods |
||||
.method public hidebysig specialname static |
||||
valuetype [mscorlib]System.Decimal marshal(currency) get_MarshalAttributesOnPropertyAccessors () cil managed |
||||
{ |
||||
// Method begins at RVA 0x2050 |
||||
// Code size 6 (0x6) |
||||
.maxstack 8 |
||||
|
||||
IL_0000: newobj instance void [mscorlib]System.NotImplementedException::.ctor() |
||||
IL_0005: throw |
||||
} // end of method PInvoke::get_MarshalAttributesOnPropertyAccessors |
||||
|
||||
.method public hidebysig specialname static |
||||
void set_MarshalAttributesOnPropertyAccessors ( |
||||
valuetype [mscorlib]System.Decimal marshal(currency) 'value' |
||||
) cil managed |
||||
{ |
||||
// Method begins at RVA 0x2057 |
||||
// Code size 1 (0x1) |
||||
.maxstack 8 |
||||
|
||||
IL_0000: ret |
||||
} // end of method PInvoke::set_MarshalAttributesOnPropertyAccessors |
||||
|
||||
.method public hidebysig static pinvokeimpl("xyz.dll" autochar winapi) |
||||
bool marshal(bool) Method ( |
||||
string marshal(lpstr) input |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::Method |
||||
|
||||
.method private hidebysig static pinvokeimpl("xyz.dll" winapi) |
||||
void New1 ( |
||||
int32 ElemCnt, |
||||
int32[] marshal([ + 0]) ar |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::New1 |
||||
|
||||
.method private hidebysig static pinvokeimpl("xyz.dll" winapi) |
||||
void New2 ( |
||||
int32[] marshal([128]) ar |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::New2 |
||||
|
||||
.method private hidebysig static pinvokeimpl("xyz.dll" winapi) |
||||
void New3 ( |
||||
int32[] marshal(bool[64 + 1]) ar |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::New3 |
||||
|
||||
.method private hidebysig static pinvokeimpl("xyz.dll" winapi) |
||||
void New4 ( |
||||
int32[] marshal([]) ar |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::New4 |
||||
|
||||
.method public hidebysig |
||||
instance void CustomMarshal1 ( |
||||
object marshal(custom("MyCompany.MyMarshaler", "")) o |
||||
) cil managed |
||||
{ |
||||
// Method begins at RVA 0x2059 |
||||
// Code size 1 (0x1) |
||||
.maxstack 8 |
||||
|
||||
IL_0000: ret |
||||
} // end of method PInvoke::CustomMarshal1 |
||||
|
||||
.method public hidebysig |
||||
instance void CustomMarshal2 ( |
||||
object marshal(custom("MyCompany.MyMarshaler", "Cookie")) o |
||||
) cil managed |
||||
{ |
||||
// Method begins at RVA 0x205b |
||||
// Code size 1 (0x1) |
||||
.maxstack 8 |
||||
|
||||
IL_0000: ret |
||||
} // end of method PInvoke::CustomMarshal2 |
||||
|
||||
.method assembly hidebysig static pinvokeimpl("ws2_32.dll" lasterr winapi) |
||||
native int ioctlsocket ( |
||||
[in] native int socketHandle, |
||||
[in] int32 cmd, |
||||
[in] [out] int32& argp |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::ioctlsocket |
||||
|
||||
.method public hidebysig |
||||
instance void CallMethodWithInOutParameter () cil managed |
||||
{ |
||||
// Method begins at RVA 0x2060 |
||||
// Code size 17 (0x11) |
||||
.maxstack 3 |
||||
.locals init ( |
||||
[0] int32 |
||||
) |
||||
|
||||
IL_0000: ldc.i4.0 |
||||
IL_0001: stloc.0 |
||||
IL_0002: ldsfld native int [mscorlib]System.IntPtr::Zero |
||||
IL_0007: ldc.i4.0 |
||||
IL_0008: ldloca.s 0 |
||||
IL_000a: call native int ICSharpCode.Decompiler.Tests.TestCases.Pretty.PInvoke::ioctlsocket(native int, int32, int32&) |
||||
IL_000f: pop |
||||
IL_0010: ret |
||||
} // end of method PInvoke::CallMethodWithInOutParameter |
||||
|
||||
.method public hidebysig specialname rtspecialname |
||||
instance void .ctor () cil managed |
||||
{ |
||||
// Method begins at RVA 0x207d |
||||
// Code size 7 (0x7) |
||||
.maxstack 8 |
||||
|
||||
IL_0000: ldarg.0 |
||||
IL_0001: call instance void [mscorlib]System.Object::.ctor() |
||||
IL_0006: ret |
||||
} // end of method PInvoke::.ctor |
||||
|
||||
// Properties |
||||
.property valuetype [mscorlib]System.Decimal MarshalAttributesOnPropertyAccessors() |
||||
{ |
||||
.get valuetype [mscorlib]System.Decimal ICSharpCode.Decompiler.Tests.TestCases.Pretty.PInvoke::get_MarshalAttributesOnPropertyAccessors() |
||||
.set void ICSharpCode.Decompiler.Tests.TestCases.Pretty.PInvoke::set_MarshalAttributesOnPropertyAccessors(valuetype [mscorlib]System.Decimal) |
||||
} |
||||
|
||||
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.PInvoke |
||||
|
@ -0,0 +1,211 @@
@@ -0,0 +1,211 @@
|
||||
.module extern xyz.dll |
||||
.module extern ws2_32.dll |
||||
.assembly extern mscorlib |
||||
{ |
||||
.publickeytoken = ( |
||||
b7 7a 5c 56 19 34 e0 89 |
||||
) |
||||
.ver 4:0:0:0 |
||||
} |
||||
.assembly PInvoke |
||||
{ |
||||
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( |
||||
01 00 08 00 00 00 00 00 |
||||
) |
||||
.custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( |
||||
01 00 01 00 54 02 16 57 72 61 70 4e 6f 6e 45 78 |
||||
63 65 70 74 69 6f 6e 54 68 72 6f 77 73 01 |
||||
) |
||||
.custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( |
||||
01 00 07 01 00 00 00 00 |
||||
) |
||||
.permissionset reqmin = { |
||||
[mscorlib]System.Security.Permissions.SecurityPermissionAttribute = { |
||||
property bool SkipVerification = bool(true) |
||||
} |
||||
} |
||||
.hash algorithm 0x00008004 // SHA1 |
||||
.ver 0:0:0:0 |
||||
} |
||||
|
||||
.module PInvoke.roslyn |
||||
// MVID: {86F00A7C-01D7-4EA0-AFE1-EB3A06A0C1FD} |
||||
.corflags 0x00000001 // ILOnly |
||||
.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( |
||||
01 00 00 00 |
||||
) |
||||
|
||||
.class private auto ansi '<Module>' |
||||
{ |
||||
} // end of class <Module> |
||||
|
||||
.class public auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.PInvoke |
||||
extends [mscorlib]System.Object |
||||
{ |
||||
// Nested Types |
||||
.class nested public sequential unicode sealed beforefieldinit MarshalAsTest |
||||
extends [mscorlib]System.ValueType |
||||
{ |
||||
.pack 2 |
||||
.size 0 |
||||
|
||||
// Fields |
||||
.field public marshal(fixed array[3]) uint32[] FixedArray |
||||
.field public marshal(fixed array[4] bool) int32[] FixedBoolArray |
||||
.field public marshal(safearray bstr) string[] SafeBStrArray |
||||
.field public marshal(fixed sysstring[8]) string FixedString |
||||
|
||||
} // end of class MarshalAsTest |
||||
|
||||
.class nested public explicit ansi sealed beforefieldinit Rect |
||||
extends [mscorlib]System.ValueType |
||||
{ |
||||
// Fields |
||||
.field [0] public int32 left |
||||
.field [4] public int32 top |
||||
.field [8] public int32 right |
||||
.field [12] public int32 bottom |
||||
|
||||
} // end of class Rect |
||||
|
||||
|
||||
// Methods |
||||
.method public hidebysig specialname static |
||||
valuetype [mscorlib]System.Decimal marshal(currency) get_MarshalAttributesOnPropertyAccessors () cil managed |
||||
{ |
||||
// Method begins at RVA 0x2050 |
||||
// Code size 7 (0x7) |
||||
.maxstack 8 |
||||
|
||||
IL_0000: nop |
||||
IL_0001: newobj instance void [mscorlib]System.NotImplementedException::.ctor() |
||||
IL_0006: throw |
||||
} // end of method PInvoke::get_MarshalAttributesOnPropertyAccessors |
||||
|
||||
.method public hidebysig specialname static |
||||
void set_MarshalAttributesOnPropertyAccessors ( |
||||
valuetype [mscorlib]System.Decimal marshal(currency) 'value' |
||||
) cil managed |
||||
{ |
||||
// Method begins at RVA 0x2058 |
||||
// Code size 2 (0x2) |
||||
.maxstack 8 |
||||
|
||||
IL_0000: nop |
||||
IL_0001: ret |
||||
} // end of method PInvoke::set_MarshalAttributesOnPropertyAccessors |
||||
|
||||
.method public hidebysig static pinvokeimpl("xyz.dll" autochar winapi) |
||||
bool marshal(bool) Method ( |
||||
string marshal(lpstr) input |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::Method |
||||
|
||||
.method private hidebysig static pinvokeimpl("xyz.dll" winapi) |
||||
void New1 ( |
||||
int32 ElemCnt, |
||||
int32[] marshal([ + 0]) ar |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::New1 |
||||
|
||||
.method private hidebysig static pinvokeimpl("xyz.dll" winapi) |
||||
void New2 ( |
||||
int32[] marshal([128]) ar |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::New2 |
||||
|
||||
.method private hidebysig static pinvokeimpl("xyz.dll" winapi) |
||||
void New3 ( |
||||
int32[] marshal(bool[64 + 1]) ar |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::New3 |
||||
|
||||
.method private hidebysig static pinvokeimpl("xyz.dll" winapi) |
||||
void New4 ( |
||||
int32[] marshal([]) ar |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::New4 |
||||
|
||||
.method public hidebysig |
||||
instance void CustomMarshal1 ( |
||||
object marshal(custom("MyCompany.MyMarshaler", "")) o |
||||
) cil managed |
||||
{ |
||||
// Method begins at RVA 0x205b |
||||
// Code size 2 (0x2) |
||||
.maxstack 8 |
||||
|
||||
IL_0000: nop |
||||
IL_0001: ret |
||||
} // end of method PInvoke::CustomMarshal1 |
||||
|
||||
.method public hidebysig |
||||
instance void CustomMarshal2 ( |
||||
object marshal(custom("MyCompany.MyMarshaler", "Cookie")) o |
||||
) cil managed |
||||
{ |
||||
// Method begins at RVA 0x205e |
||||
// Code size 2 (0x2) |
||||
.maxstack 8 |
||||
|
||||
IL_0000: nop |
||||
IL_0001: ret |
||||
} // end of method PInvoke::CustomMarshal2 |
||||
|
||||
.method assembly hidebysig static pinvokeimpl("ws2_32.dll" lasterr winapi) |
||||
native int ioctlsocket ( |
||||
[in] native int socketHandle, |
||||
[in] int32 cmd, |
||||
[in] [out] int32& argp |
||||
) cil managed preservesig |
||||
{ |
||||
} // end of method PInvoke::ioctlsocket |
||||
|
||||
.method public hidebysig |
||||
instance void CallMethodWithInOutParameter () cil managed |
||||
{ |
||||
// Method begins at RVA 0x2064 |
||||
// Code size 18 (0x12) |
||||
.maxstack 3 |
||||
.locals init ( |
||||
[0] int32 |
||||
) |
||||
|
||||
IL_0000: nop |
||||
IL_0001: ldc.i4.0 |
||||
IL_0002: stloc.0 |
||||
IL_0003: ldsfld native int [mscorlib]System.IntPtr::Zero |
||||
IL_0008: ldc.i4.0 |
||||
IL_0009: ldloca.s 0 |
||||
IL_000b: call native int ICSharpCode.Decompiler.Tests.TestCases.Pretty.PInvoke::ioctlsocket(native int, int32, int32&) |
||||
IL_0010: pop |
||||
IL_0011: ret |
||||
} // end of method PInvoke::CallMethodWithInOutParameter |
||||
|
||||
.method public hidebysig specialname rtspecialname |
||||
instance void .ctor () cil managed |
||||
{ |
||||
// Method begins at RVA 0x2082 |
||||
// Code size 8 (0x8) |
||||
.maxstack 8 |
||||
|
||||
IL_0000: ldarg.0 |
||||
IL_0001: call instance void [mscorlib]System.Object::.ctor() |
||||
IL_0006: nop |
||||
IL_0007: ret |
||||
} // end of method PInvoke::.ctor |
||||
|
||||
// Properties |
||||
.property valuetype [mscorlib]System.Decimal MarshalAttributesOnPropertyAccessors() |
||||
{ |
||||
.get valuetype [mscorlib]System.Decimal ICSharpCode.Decompiler.Tests.TestCases.Pretty.PInvoke::get_MarshalAttributesOnPropertyAccessors() |
||||
.set void ICSharpCode.Decompiler.Tests.TestCases.Pretty.PInvoke::set_MarshalAttributesOnPropertyAccessors(valuetype [mscorlib]System.Decimal) |
||||
} |
||||
|
||||
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.PInvoke |
||||
|
Loading…
Reference in new issue