Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,11 @@ internal static extern int TestArrayOfStructs2(

[DllImport("PinvokeLib.dll", CallingConvention = CallingConvention.Cdecl)]
internal static extern void TestArrayInStruct(ref MyArrayStruct myStruct);

[DllImport("PinvokeLib.dll", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void* CreateTestClass();

[DllImport("PinvokeLib.dll", CallingConvention = CallingConvention.Cdecl)]
internal static extern unsafe void DeleteTestClass(void* instance);
}
// </NativeMethods>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,13 @@ Friend Class NativeMethods
<DllImport("PinvokeLib.dll", CallingConvention:=CallingConvention.Cdecl)>
Friend Shared Sub TestArrayInStruct(ByRef myStruct As MyArrayStruct)
End Sub

<DllImport("PinvokeLib.dll", CallingConvention:=CallingConvention.Cdecl)>
Friend Shared Function CreateTestClass() As IntPtr
End Function

<DllImport("PinvokeLib.dll", CallingConvention:=CallingConvention.Cdecl)>
Friend Shared Sub DeleteTestClass(ByVal instance As IntPtr)
End Sub
End Class
' </NativeMethods>
Loading