public enum CallingConvention
Object
ValueType
Enum
CallingConvention
mscorlib
RuntimeInfrastructure
Indicates the calling convention used by a method located in an unmanaged shared library.
The values of this enumeration are used to specify the calling conventions required to call unmanaged methods implemented in shared libraries.[Note: Implementers should map the semantics of specified calling conventions onto the calling conventions of the host OS.]
[Note: For additional information on shared libraries and an example of the use of the CallingConvention enumeration, see the DllImportAttribute class overview.]
System.Runtime.InteropServices Namespace
CallingConvention Fields
CallingConvention.Cdecl Field
CallingConvention.FastCall Field
CallingConvention.StdCall Field
CallingConvention.ThisCall Field
CallingConvention.value__ Field
Cdecl = 2;
Indicates that thecdecl
calling convention is appropriate for a method call.For example, on a Windows platform the System.Runtime.InteropServices.CallingConvention.Cdecl convention produces the following behavior:
[Note: This is the default calling convention for functions compiled with 32-bit C and C++ language compilers.]
Element Behavior Argument-passing order Right to left. Stack-maintenance responsibility Calling function pops the arguments from the stack.
System.Runtime.InteropServices.CallingConvention Enum, System.Runtime.InteropServices Namespace
FastCall = 5;
Indicates that thefastcall
calling convention is appropriate for a method call.[Note: On a Windows platform this convention indicates that arguments to functions are to be passed in registers whenever possible.]
System.Runtime.InteropServices.CallingConvention Enum, System.Runtime.InteropServices Namespace
StdCall = 3;
Indicates that thestdcall
calling convention is appropriate for a method.For example, on a Windows platform the System.Runtime.InteropServices.CallingConvention.StdCall convention produces the following behavior:
Element Behavior Argument-passing order Right to left. Stack-maintenance responsibility Called function pops its own arguments from the stack.
System.Runtime.InteropServices.CallingConvention Enum, System.Runtime.InteropServices Namespace
ThisCall = 4;
Indicates that thethiscall
calling convention is appropriate for a method. This convention is similar to the System.Runtime.InteropServices.CallingConvention.Cdecl calling convention, except that the last element that the caller pushes the stack is thethis
pointer.For example, on a Windows platform the System.Runtime.InteropServices.CallingConvention.ThisCall convention produces the following behavior:
[Note: The
Element Behavior Argument-passing order Right to left. Stack-maintenance responsibility Calling function pops the arguments from the stack. this
pointerPushed last onto the stack. thiscall
calling convention is the default calling convention used by C++ member functions that are not called with a variable number of arguments.]
System.Runtime.InteropServices.CallingConvention Enum, System.Runtime.InteropServices Namespace
value__;
System.Runtime.InteropServices.CallingConvention Enum, System.Runtime.InteropServices Namespace