Class PInvokeParams
Represents the parameters of the imported unmanaged method
Inheritance
Inherited Members
Namespace: CilTools.Reflection
Assembly: CilTools.BytecodeAnalysis.dll
Syntax
public class PInvokeParams
Remarks
This type is used with the GetPInvokeParams() method.
Imported unmanaged method is a method implemented as a Platform Invoke (P/Invoke) call. The call to such method is marshalled into the call to corresponding native function by Common Language Runtime. P/Invoke method is defined in .NET using System.Runtime.InteropServices.DllImportAttribute. See the .NET documentation for more information about P/Invoke: https://docs.microsoft.com/dotnet/standard/native-interop/pinvoke.
Constructors
PInvokeParams(String, String, CharSet, Boolean, Boolean, Nullable<Boolean>, CallingConvention)
Creates the new instance of PInvokeParams
object.
Declaration
public PInvokeParams(string module, string func, CharSet charSet, bool exactSpelling, bool setLastError, bool? bestFitMapping, CallingConvention callConv)
Parameters
Type | Name | Description |
---|---|---|
System.String | module | Unmanaged module from which the method is imported |
System.String | func | The name of the imported native function |
System.Runtime.InteropServices.CharSet | charSet | The character set used by this method |
System.Boolean | exactSpelling | The value indicating that the marshaller should not probe for charset-specific names when searching for an entry point. |
System.Boolean | setLastError | The value indicating that the imported function sets the last WinAPI error. |
System.Nullable<System.Boolean> | bestFitMapping | The value indicating whether the marshaller should use the best fit mapping behaviour when converting characters between character sets. |
System.Runtime.InteropServices.CallingConvention | callConv | The clling convention of the imported function. |
Properties
BestFitMapping
Gets the value indicating whether the marshaller should use the best fit mapping behaviour when converting characters between character sets.
Declaration
public bool? BestFitMapping { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Boolean> |
CallingConvention
Gets the calling convention for the imported function.
Declaration
public CallingConvention CallingConvention { get; }
Property Value
Type | Description |
---|---|
System.Runtime.InteropServices.CallingConvention |
Remarks
Calling convention is a set of rules defining how the function interacts with its caller. See https://docs.microsoft.com/en-us/cpp/cpp/argument-passing-and-naming-conventions for more information about native calling conventions.
CharSet
Gets the character set used by this method
Declaration
public CharSet CharSet { get; }
Property Value
Type | Description |
---|---|
System.Runtime.InteropServices.CharSet |
ExactSpelling
Gets the value indicating that the marshaller should not probe for charset-specific names when searching for an entry point.
Declaration
public bool ExactSpelling { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
FunctionName
Gets the name of the imported native function
Declaration
public string FunctionName { get; }
Property Value
Type | Description |
---|---|
System.String |
ModuleName
Gets the name of the unmanaged module from which the method is imported
Declaration
public string ModuleName { get; }
Property Value
Type | Description |
---|---|
System.String |
SetLastError
Gets the value indicating that the imported function sets the last WinAPI error.
Declaration
public bool SetLastError { get; }
Property Value
Type | Description |
---|---|
System.Boolean |