Class UnmanagedFunction<TResult>
Allows to call unmanaged functions with TResult
return type.
Inherited Members
Namespace: DotNext.Runtime.InteropServices
Assembly: DotNext.Unsafe.dll
Syntax
[Obsolete("Use function pointers in C# 9")]
public static class UnmanagedFunction<TResult>
where TResult : struct
Type Parameters
Name | Description |
---|---|
TResult | The return type of the unmanage function. |
Methods
| Improve this Doc View SourceCdecl(IntPtr)
Invokes unmanaged function with CDECL calling convention by its pointer.
Declaration
public static TResult Cdecl(IntPtr functionPtr)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | functionPtr | The pointer to the unmanaged function. |
Returns
Type | Description |
---|---|
TResult | The value returned by unmanaged function. |
Cdecl<T>(IntPtr, T)
Invokes unmanaged function with CDECL calling convention by its pointer.
Declaration
public static TResult Cdecl<T>(IntPtr functionPtr, T arg)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
IntPtr | functionPtr | The pointer to the unmanaged function. |
T | arg | The first argument to be passed into the unmanaged function. |
Returns
Type | Description |
---|---|
TResult | The value returned by unmanaged function. |
Type Parameters
Name | Description |
---|---|
T | The type of the first argument. |
Cdecl<T1, T2>(IntPtr, T1, T2)
Invokes unmanaged function with CDECL calling convention by its pointer.
Declaration
public static TResult Cdecl<T1, T2>(IntPtr functionPtr, T1 arg1, T2 arg2)
where T1 : struct where T2 : struct
Parameters
Type | Name | Description |
---|---|---|
IntPtr | functionPtr | The pointer to the unmanaged function. |
T1 | arg1 | The first argument to be passed into the unmanaged function. |
T2 | arg2 | The second argument to be passed into the unmanaged function. |
Returns
Type | Description |
---|---|
TResult | The value returned by unmanaged function. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
Cdecl<T1, T2, T3>(IntPtr, T1, T2, T3)
Invokes unmanaged function with CDECL calling convention by its pointer.
Declaration
public static TResult Cdecl<T1, T2, T3>(IntPtr functionPtr, T1 arg1, T2 arg2, T3 arg3)
where T1 : struct where T2 : struct where T3 : struct
Parameters
Type | Name | Description |
---|---|---|
IntPtr | functionPtr | The pointer to the unmanaged function. |
T1 | arg1 | The first argument to be passed into the unmanaged function. |
T2 | arg2 | The second argument to be passed into the unmanaged function. |
T3 | arg3 | The third argument to be passed into the unmanaged function. |
Returns
Type | Description |
---|---|
TResult | The value returned by unmanaged function. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
Cdecl<T1, T2, T3, T4>(IntPtr, T1, T2, T3, T4)
Invokes unmanaged function with CDECL calling convention by its pointer.
Declaration
public static TResult Cdecl<T1, T2, T3, T4>(IntPtr functionPtr, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
where T1 : struct where T2 : struct where T3 : struct where T4 : struct
Parameters
Type | Name | Description |
---|---|---|
IntPtr | functionPtr | The pointer to the unmanaged function. |
T1 | arg1 | The first argument to be passed into the unmanaged function. |
T2 | arg2 | The second argument to be passed into the unmanaged function. |
T3 | arg3 | The third argument to be passed into the unmanaged function. |
T4 | arg4 | The fourth argument to be passed into the unmanaged function. |
Returns
Type | Description |
---|---|
TResult | The value returned by unmanaged function. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
Cdecl<T1, T2, T3, T4, T5>(IntPtr, T1, T2, T3, T4, T5)
Invokes unmanaged function with CDECL calling convention by its pointer.
Declaration
public static TResult Cdecl<T1, T2, T3, T4, T5>(IntPtr functionPtr, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
where T1 : struct where T2 : struct where T3 : struct where T4 : struct where T5 : struct
Parameters
Type | Name | Description |
---|---|---|
IntPtr | functionPtr | The pointer to the unmanaged function. |
T1 | arg1 | The first argument to be passed into the unmanaged function. |
T2 | arg2 | The second argument to be passed into the unmanaged function. |
T3 | arg3 | The third argument to be passed into the unmanaged function. |
T4 | arg4 | The fourth argument to be passed into the unmanaged function. |
T5 | arg5 | The fifth argument to be passed into the unmanaged function. |
Returns
Type | Description |
---|---|
TResult | The value returned by unmanaged function. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
T5 | The type of the fifth argument. |
Cdecl<T1, T2, T3, T4, T5, T6>(IntPtr, T1, T2, T3, T4, T5, T6)
Invokes unmanaged function with CDECL calling convention by its pointer.
Declaration
public static TResult Cdecl<T1, T2, T3, T4, T5, T6>(IntPtr functionPtr, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)
where T1 : struct where T2 : struct where T3 : struct where T4 : struct where T5 : struct where T6 : struct
Parameters
Type | Name | Description |
---|---|---|
IntPtr | functionPtr | The pointer to the unmanaged function. |
T1 | arg1 | The first argument to be passed into the unmanaged function. |
T2 | arg2 | The second argument to be passed into the unmanaged function. |
T3 | arg3 | The third argument to be passed into the unmanaged function. |
T4 | arg4 | The fourth argument to be passed into the unmanaged function. |
T5 | arg5 | The fifth argument to be passed into the unmanaged function. |
T6 | arg6 | The sixth argument to be passed into the unmanaged function. |
Returns
Type | Description |
---|---|
TResult | The value returned by unmanaged function. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
T5 | The type of the fifth argument. |
T6 | The type of the sixth argument. |
Cdecl<T1, T2, T3, T4, T5, T6, T7>(IntPtr, T1, T2, T3, T4, T5, T6, T7)
Invokes unmanaged function with CDECL calling convention by its pointer.
Declaration
public static TResult Cdecl<T1, T2, T3, T4, T5, T6, T7>(IntPtr functionPtr, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7)
where T1 : struct where T2 : struct where T3 : struct where T4 : struct where T5 : struct where T6 : struct where T7 : struct
Parameters
Type | Name | Description |
---|---|---|
IntPtr | functionPtr | The pointer to the unmanaged function. |
T1 | arg1 | The first argument to be passed into the unmanaged function. |
T2 | arg2 | The second argument to be passed into the unmanaged function. |
T3 | arg3 | The third argument to be passed into the unmanaged function. |
T4 | arg4 | The fourth argument to be passed into the unmanaged function. |
T5 | arg5 | The fifth argument to be passed into the unmanaged function. |
T6 | arg6 | The sixth argument to be passed into the unmanaged function. |
T7 | arg7 | The seventh argument to be passed into the unmanaged function. |
Returns
Type | Description |
---|---|
TResult | The value returned by unmanaged function. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
T5 | The type of the fifth argument. |
T6 | The type of the sixth argument. |
T7 | The type of the seventh argument. |
Cdecl<T1, T2, T3, T4, T5, T6, T7, T8>(IntPtr, T1, T2, T3, T4, T5, T6, T7, T8)
Invokes unmanaged function with CDECL calling convention by its pointer.
Declaration
public static TResult Cdecl<T1, T2, T3, T4, T5, T6, T7, T8>(IntPtr functionPtr, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8)
where T1 : struct where T2 : struct where T3 : struct where T4 : struct where T5 : struct where T6 : struct where T7 : struct where T8 : struct
Parameters
Type | Name | Description |
---|---|---|
IntPtr | functionPtr | The pointer to the unmanaged function. |
T1 | arg1 | The first argument to be passed into the unmanaged function. |
T2 | arg2 | The second argument to be passed into the unmanaged function. |
T3 | arg3 | The third argument to be passed into the unmanaged function. |
T4 | arg4 | The fourth argument to be passed into the unmanaged function. |
T5 | arg5 | The fifth argument to be passed into the unmanaged function. |
T6 | arg6 | The sixth argument to be passed into the unmanaged function. |
T7 | arg7 | The seventh argument to be passed into the unmanaged function. |
T8 | arg8 | The eighth argument to be passed into the unmanaged function. |
Returns
Type | Description |
---|---|
TResult | The value returned by unmanaged function. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
T5 | The type of the fifth argument. |
T6 | The type of the sixth argument. |
T7 | The type of the seventh argument. |
T8 | The type of the eighth argument. |
Cdecl<T1, T2, T3, T4, T5, T6, T7, T8, T9>(IntPtr, T1, T2, T3, T4, T5, T6, T7, T8, T9)
Invokes unmanaged function with CDECL calling convention by its pointer.
Declaration
public static TResult Cdecl<T1, T2, T3, T4, T5, T6, T7, T8, T9>(IntPtr functionPtr, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9)
where T1 : struct where T2 : struct where T3 : struct where T4 : struct where T5 : struct where T6 : struct where T7 : struct where T8 : struct where T9 : struct
Parameters
Type | Name | Description |
---|---|---|
IntPtr | functionPtr | The pointer to the unmanaged function. |
T1 | arg1 | The first argument to be passed into the unmanaged function. |
T2 | arg2 | The second argument to be passed into the unmanaged function. |
T3 | arg3 | The third argument to be passed into the unmanaged function. |
T4 | arg4 | The fourth argument to be passed into the unmanaged function. |
T5 | arg5 | The fifth argument to be passed into the unmanaged function. |
T6 | arg6 | The sixth argument to be passed into the unmanaged function. |
T7 | arg7 | The seventh argument to be passed into the unmanaged function. |
T8 | arg8 | The eighth argument to be passed into the unmanaged function. |
T9 | arg9 | The ninth argument to be passed into the unmanaged function. |
Returns
Type | Description |
---|---|
TResult | The value returned by unmanaged function. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
T5 | The type of the fifth argument. |
T6 | The type of the sixth argument. |
T7 | The type of the seventh argument. |
T8 | The type of the eighth argument. |
T9 | The type of the ninth argument. |
StdCall(IntPtr)
Invokes unmanaged function with STDCALL calling convention by its pointer.
Declaration
public static TResult StdCall(IntPtr functionPtr)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | functionPtr | The pointer to the unmanaged function. |
Returns
Type | Description |
---|---|
TResult | The value returned by unmanaged function. |
StdCall<T>(IntPtr, T)
Invokes unmanaged function with STDCALL calling convention by its pointer.
Declaration
public static TResult StdCall<T>(IntPtr functionPtr, T arg)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
IntPtr | functionPtr | The pointer to the unmanaged function. |
T | arg | The first argument to be passed into the unmanaged function. |
Returns
Type | Description |
---|---|
TResult | The value returned by unmanaged function. |
Type Parameters
Name | Description |
---|---|
T | The type of the first argument. |
StdCall<T1, T2>(IntPtr, T1, T2)
Invokes unmanaged function with STDCALL calling convention by its pointer.
Declaration
public static TResult StdCall<T1, T2>(IntPtr functionPtr, T1 arg1, T2 arg2)
where T1 : struct where T2 : struct
Parameters
Type | Name | Description |
---|---|---|
IntPtr | functionPtr | The pointer to the unmanaged function. |
T1 | arg1 | The first argument to be passed into the unmanaged function. |
T2 | arg2 | The second argument to be passed into the unmanaged function. |
Returns
Type | Description |
---|---|
TResult | The value returned by unmanaged function. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
StdCall<T1, T2, T3>(IntPtr, T1, T2, T3)
Invokes unmanaged function with STDCALL calling convention by its pointer.
Declaration
public static TResult StdCall<T1, T2, T3>(IntPtr functionPtr, T1 arg1, T2 arg2, T3 arg3)
where T1 : struct where T2 : struct where T3 : struct
Parameters
Type | Name | Description |
---|---|---|
IntPtr | functionPtr | The pointer to the unmanaged function. |
T1 | arg1 | The first argument to be passed into the unmanaged function. |
T2 | arg2 | The second argument to be passed into the unmanaged function. |
T3 | arg3 | The third argument to be passed into the unmanaged function. |
Returns
Type | Description |
---|---|
TResult | The value returned by unmanaged function. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
StdCall<T1, T2, T3, T4>(IntPtr, T1, T2, T3, T4)
Invokes unmanaged function with STDCALL calling convention by its pointer.
Declaration
public static TResult StdCall<T1, T2, T3, T4>(IntPtr functionPtr, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
where T1 : struct where T2 : struct where T3 : struct where T4 : struct
Parameters
Type | Name | Description |
---|---|---|
IntPtr | functionPtr | The pointer to the unmanaged function. |
T1 | arg1 | The first argument to be passed into the unmanaged function. |
T2 | arg2 | The second argument to be passed into the unmanaged function. |
T3 | arg3 | The third argument to be passed into the unmanaged function. |
T4 | arg4 | The fourth argument to be passed into the unmanaged function. |
Returns
Type | Description |
---|---|
TResult | The value returned by unmanaged function. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
StdCall<T1, T2, T3, T4, T5>(IntPtr, T1, T2, T3, T4, T5)
Invokes unmanaged function with STDCALL calling convention by its pointer.
Declaration
public static TResult StdCall<T1, T2, T3, T4, T5>(IntPtr functionPtr, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5)
where T1 : struct where T2 : struct where T3 : struct where T4 : struct where T5 : struct
Parameters
Type | Name | Description |
---|---|---|
IntPtr | functionPtr | The pointer to the unmanaged function. |
T1 | arg1 | The first argument to be passed into the unmanaged function. |
T2 | arg2 | The second argument to be passed into the unmanaged function. |
T3 | arg3 | The third argument to be passed into the unmanaged function. |
T4 | arg4 | The fourth argument to be passed into the unmanaged function. |
T5 | arg5 | The fifth argument to be passed into the unmanaged function. |
Returns
Type | Description |
---|---|
TResult | The value returned by unmanaged function. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
T5 | The type of the fifth argument. |
StdCall<T1, T2, T3, T4, T5, T6>(IntPtr, T1, T2, T3, T4, T5, T6)
Invokes unmanaged function with STDCALL calling convention by its pointer.
Declaration
public static TResult StdCall<T1, T2, T3, T4, T5, T6>(IntPtr functionPtr, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6)
where T1 : struct where T2 : struct where T3 : struct where T4 : struct where T5 : struct where T6 : struct
Parameters
Type | Name | Description |
---|---|---|
IntPtr | functionPtr | The pointer to the unmanaged function. |
T1 | arg1 | The first argument to be passed into the unmanaged function. |
T2 | arg2 | The second argument to be passed into the unmanaged function. |
T3 | arg3 | The third argument to be passed into the unmanaged function. |
T4 | arg4 | The fourth argument to be passed into the unmanaged function. |
T5 | arg5 | The fifth argument to be passed into the unmanaged function. |
T6 | arg6 | The sixth argument to be passed into the unmanaged function. |
Returns
Type | Description |
---|---|
TResult | The value returned by unmanaged function. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
T5 | The type of the fifth argument. |
T6 | The type of the sixth argument. |
StdCall<T1, T2, T3, T4, T5, T6, T7>(IntPtr, T1, T2, T3, T4, T5, T6, T7)
Invokes unmanaged function with STDCALL calling convention by its pointer.
Declaration
public static TResult StdCall<T1, T2, T3, T4, T5, T6, T7>(IntPtr functionPtr, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7)
where T1 : struct where T2 : struct where T3 : struct where T4 : struct where T5 : struct where T6 : struct where T7 : struct
Parameters
Type | Name | Description |
---|---|---|
IntPtr | functionPtr | The pointer to the unmanaged function. |
T1 | arg1 | The first argument to be passed into the unmanaged function. |
T2 | arg2 | The second argument to be passed into the unmanaged function. |
T3 | arg3 | The third argument to be passed into the unmanaged function. |
T4 | arg4 | The fourth argument to be passed into the unmanaged function. |
T5 | arg5 | The fifth argument to be passed into the unmanaged function. |
T6 | arg6 | The sixth argument to be passed into the unmanaged function. |
T7 | arg7 | The seventh argument to be passed into the unmanaged function. |
Returns
Type | Description |
---|---|
TResult | The value returned by unmanaged function. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
T5 | The type of the fifth argument. |
T6 | The type of the sixth argument. |
T7 | The type of the seventh argument. |
StdCall<T1, T2, T3, T4, T5, T6, T7, T8>(IntPtr, T1, T2, T3, T4, T5, T6, T7, T8)
Invokes unmanaged function with STDCALL calling convention by its pointer.
Declaration
public static TResult StdCall<T1, T2, T3, T4, T5, T6, T7, T8>(IntPtr functionPtr, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8)
where T1 : struct where T2 : struct where T3 : struct where T4 : struct where T5 : struct where T6 : struct where T7 : struct where T8 : struct
Parameters
Type | Name | Description |
---|---|---|
IntPtr | functionPtr | The pointer to the unmanaged function. |
T1 | arg1 | The first argument to be passed into the unmanaged function. |
T2 | arg2 | The second argument to be passed into the unmanaged function. |
T3 | arg3 | The third argument to be passed into the unmanaged function. |
T4 | arg4 | The fourth argument to be passed into the unmanaged function. |
T5 | arg5 | The fifth argument to be passed into the unmanaged function. |
T6 | arg6 | The sixth argument to be passed into the unmanaged function. |
T7 | arg7 | The seventh argument to be passed into the unmanaged function. |
T8 | arg8 | The eighth argument to be passed into the unmanaged function. |
Returns
Type | Description |
---|---|
TResult | The value returned by unmanaged function. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
T5 | The type of the fifth argument. |
T6 | The type of the sixth argument. |
T7 | The type of the seventh argument. |
T8 | The type of the eighth argument. |
StdCall<T1, T2, T3, T4, T5, T6, T7, T8, T9>(IntPtr, T1, T2, T3, T4, T5, T6, T7, T8, T9)
Invokes unmanaged function with STDCALL calling convention by its pointer.
Declaration
public static TResult StdCall<T1, T2, T3, T4, T5, T6, T7, T8, T9>(IntPtr functionPtr, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9)
where T1 : struct where T2 : struct where T3 : struct where T4 : struct where T5 : struct where T6 : struct where T7 : struct where T8 : struct where T9 : struct
Parameters
Type | Name | Description |
---|---|---|
IntPtr | functionPtr | The pointer to the unmanaged function. |
T1 | arg1 | The first argument to be passed into the unmanaged function. |
T2 | arg2 | The second argument to be passed into the unmanaged function. |
T3 | arg3 | The third argument to be passed into the unmanaged function. |
T4 | arg4 | The fourth argument to be passed into the unmanaged function. |
T5 | arg5 | The fifth argument to be passed into the unmanaged function. |
T6 | arg6 | The sixth argument to be passed into the unmanaged function. |
T7 | arg7 | The seventh argument to be passed into the unmanaged function. |
T8 | arg8 | The eighth argument to be passed into the unmanaged function. |
T9 | arg9 | The ninth argument to be passed into the unmanaged function. |
Returns
Type | Description |
---|---|
TResult | The value returned by unmanaged function. |
Type Parameters
Name | Description |
---|---|
T1 | The type of the first argument. |
T2 | The type of the second argument. |
T3 | The type of the third argument. |
T4 | The type of the fourth argument. |
T5 | The type of the fifth argument. |
T6 | The type of the sixth argument. |
T7 | The type of the seventh argument. |
T8 | The type of the eighth argument. |
T9 | The type of the ninth argument. |