diff --git a/docs/standard/native-interop/snippets/marshalling-data-with-platform-invoke/csharp/PInvokeLibManaged/NativeMethods.cs b/docs/standard/native-interop/snippets/marshalling-data-with-platform-invoke/csharp/PInvokeLibManaged/NativeMethods.cs index 95ad89611b78d..62856b31866d4 100644 --- a/docs/standard/native-interop/snippets/marshalling-data-with-platform-invoke/csharp/PInvokeLibManaged/NativeMethods.cs +++ b/docs/standard/native-interop/snippets/marshalling-data-with-platform-invoke/csharp/PInvokeLibManaged/NativeMethods.cs @@ -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); } // diff --git a/docs/standard/native-interop/snippets/marshalling-data-with-platform-invoke/csharp/PInvokeLibManaged/PInvokeLibManaged.csproj b/docs/standard/native-interop/snippets/marshalling-data-with-platform-invoke/csharp/PInvokeLibManaged/PInvokeLibManaged.csproj index ed9781c223ab9..598db52879f65 100644 --- a/docs/standard/native-interop/snippets/marshalling-data-with-platform-invoke/csharp/PInvokeLibManaged/PInvokeLibManaged.csproj +++ b/docs/standard/native-interop/snippets/marshalling-data-with-platform-invoke/csharp/PInvokeLibManaged/PInvokeLibManaged.csproj @@ -5,6 +5,7 @@ net10.0 enable enable + true diff --git a/docs/standard/native-interop/snippets/marshalling-data-with-platform-invoke/vb/PInvokeLibManaged/NativeMethods.vb b/docs/standard/native-interop/snippets/marshalling-data-with-platform-invoke/vb/PInvokeLibManaged/NativeMethods.vb index bbccef564a151..3234efc5ef2be 100644 --- a/docs/standard/native-interop/snippets/marshalling-data-with-platform-invoke/vb/PInvokeLibManaged/NativeMethods.vb +++ b/docs/standard/native-interop/snippets/marshalling-data-with-platform-invoke/vb/PInvokeLibManaged/NativeMethods.vb @@ -90,5 +90,13 @@ Friend Class NativeMethods Friend Shared Sub TestArrayInStruct(ByRef myStruct As MyArrayStruct) End Sub + + + Friend Shared Function CreateTestClass() As IntPtr + End Function + + + Friend Shared Sub DeleteTestClass(ByVal instance As IntPtr) + End Sub End Class '