Show / Hide Table of Contents

Class UnmanagedFunction

Allows to call unmanaged functions with langword_csharp_void return type.

Inheritance
Object
UnmanagedFunction
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: DotNext.Runtime.InteropServices
Assembly: DotNext.Unsafe.dll
Syntax
[Obsolete("Use function pointers in C# 9")]
public static class UnmanagedFunction

Methods

| Improve this Doc View Source

Cdecl(IntPtr)

Invokes unmanaged function with CDECL calling convention by its pointer.

Declaration
public static void Cdecl(IntPtr functionPtr)
Parameters
Type Name Description
IntPtr functionPtr

The pointer to the unmanaged function.

| Improve this Doc View Source

Cdecl<T>(IntPtr, T)

Invokes unmanaged function with CDECL calling convention by its pointer.

Declaration
public static void 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.

Type Parameters
Name Description
T

The type of the first argument.

| Improve this Doc View Source

Cdecl<T1, T2>(IntPtr, T1, T2)

Invokes unmanaged function with CDECL calling convention by its pointer.

Declaration
public static void 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.

Type Parameters
Name Description
T1

The type of the first argument.

T2

The type of the second argument.

| Improve this Doc View Source

Cdecl<T1, T2, T3>(IntPtr, T1, T2, T3)

Invokes unmanaged function with CDECL calling convention by its pointer.

Declaration
public static void 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.

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.

| Improve this Doc View Source

Cdecl<T1, T2, T3, T4>(IntPtr, T1, T2, T3, T4)

Invokes unmanaged function with CDECL calling convention by its pointer.

Declaration
public static void 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.

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.

| Improve this Doc View Source

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 void 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.

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.

| Improve this Doc View Source

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 void 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.

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.

| Improve this Doc View Source

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 void 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.

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.

| Improve this Doc View Source

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 void 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.

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.

| Improve this Doc View Source

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 void 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.

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.

| Improve this Doc View Source

StdCall(IntPtr)

Invokes unmanaged function with STDCALL calling convention by its pointer.

Declaration
public static void StdCall(IntPtr functionPtr)
Parameters
Type Name Description
IntPtr functionPtr

The pointer to the unmanaged function.

| Improve this Doc View Source

StdCall<T>(IntPtr, T)

Invokes unmanaged function with STDCALL calling convention by its pointer.

Declaration
public static void 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.

Type Parameters
Name Description
T

The type of the first argument.

| Improve this Doc View Source

StdCall<T1, T2>(IntPtr, T1, T2)

Invokes unmanaged function with STDCALL calling convention by its pointer.

Declaration
public static void 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.

Type Parameters
Name Description
T1

The type of the first argument.

T2

The type of the second argument.

| Improve this Doc View Source

StdCall<T1, T2, T3>(IntPtr, T1, T2, T3)

Invokes unmanaged function with STDCALL calling convention by its pointer.

Declaration
public static void 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.

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.

| Improve this Doc View Source

StdCall<T1, T2, T3, T4>(IntPtr, T1, T2, T3, T4)

Invokes unmanaged function with STDCALL calling convention by its pointer.

Declaration
public static void 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.

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.

| Improve this Doc View Source

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 void 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.

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.

| Improve this Doc View Source

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 void 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.

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.

| Improve this Doc View Source

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 void 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.

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.

| Improve this Doc View Source

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 void 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.

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.

| Improve this Doc View Source

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 void 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.

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.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX