diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 50b4c35..dd49721 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -13,13 +13,14 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Setup .NET 6 & 7 & 8 + - name: Setup .NET 6 & 7 & 8 & 10 uses: actions/setup-dotnet@v3 with: dotnet-version: | - 6.0.427 - 7.0.120 - 8.0.403 + 6.0.428 + 7.0.410 + 8.0.420 + 10.0.203 - name: Restore dependencies run: dir "C:\Program Files\dotnet\\shared\Microsoft.WindowsDesktop.App\" - name: Restore dependencies diff --git a/Directory.Build.props b/Directory.Build.props index c8c5009..465c874 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,9 @@ + True True + True + True False $(DefineConstants);USE_WPF 0.5.0 diff --git a/Directory.Build.targets b/Directory.Build.targets index c8dcf6d..2d80688 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -2,19 +2,21 @@ C:\Program Files\dotnet\ $(NetCoreRoot) - $(DotnetInstallLocation)shared\Microsoft.WindowsDesktop.App\8.0.10\Accessibility.dll + $(DotnetInstallLocation)shared\Microsoft.WindowsDesktop.App\10.0.7\Accessibility.dll + $(DotnetInstallLocation)shared\Microsoft.WindowsDesktop.App\8.0.26\Accessibility.dll $(DotnetInstallLocation)shared\Microsoft.WindowsDesktop.App\7.0.20\Accessibility.dll - $(DotnetInstallLocation)shared\Microsoft.WindowsDesktop.App\6.0.35\Accessibility.dll + $(DotnetInstallLocation)shared\Microsoft.WindowsDesktop.App\6.0.36\Accessibility.dll - + $(AccessibilityLocation) - - - + + + + \ No newline at end of file diff --git a/WinFormsComInterop/WinFormsComInterop.csproj b/WinFormsComInterop/WinFormsComInterop.csproj index 9bcffd4..d53f1a5 100644 --- a/WinFormsComInterop/WinFormsComInterop.csproj +++ b/WinFormsComInterop/WinFormsComInterop.csproj @@ -1,7 +1,8 @@  - net6.0;net7.0;net8.0 + net6.0;net7.0;net8.0;net10.0 + true true enable diff --git a/WinFormsComInterop/WinFormsComWrappers.cs b/WinFormsComInterop/WinFormsComWrappers.cs index fc08a73..d24d84b 100644 --- a/WinFormsComInterop/WinFormsComWrappers.cs +++ b/WinFormsComInterop/WinFormsComWrappers.cs @@ -60,6 +60,9 @@ public unsafe partial class WinFormsComWrappers : ComWrappers #if !NET8_0_OR_GREATER static ComWrappers.ComInterfaceEntry* formsFileDialogEventsEntry; #endif +#if NET10_0_OR_GREATER + static ComWrappers.ComInterfaceEntry* comObjectEntry; +#endif #if !NET7_0_OR_GREATER static ComWrappers.ComInterfaceEntry* enumVariantEntry; #endif @@ -128,6 +131,9 @@ static WinFormsComWrappers() formsWebBrowserEventEntry = CreateWebBrowserEventEntry(); formsFileDialogEventsEntry = CreateFileDialogEventsEntry(); #endif +#if NET10_0_OR_GREATER + comObjectEntry = CreateComObjectEntry(); +#endif #if USE_WPF oleDropTargetEntry = CreateOleDropTargetEntry(); winbaseTfContextEntry = CreateWinbaseITfContextEntry(); @@ -221,6 +227,7 @@ static WinFormsComWrappers() wrapperEntry->Vtable = vtbl; return wrapperEntry; } +#if !NET10_0_OR_GREATER private static void CreatePrimitivesIServiceProviderProxyVtbl(out IntPtr vtbl) { @@ -229,18 +236,29 @@ private static void CreatePrimitivesIServiceProviderProxyVtbl(out IntPtr vtbl) primitives::Windows.Win32.System.Com.IServiceProvider.PopulateVTable((primitives::Windows.Win32.System.Com.IServiceProvider.Vtbl*)vtblRaw); vtbl = (System.IntPtr)vtblRaw; } +#endif #endif private static ComInterfaceEntry* CreateAccessibleObjectEntry() { CreatePrimitivesIRawElementProviderSimpleProxyVtbl(out var rawElementProviderSimpleVtbl); +#if !NET10_0_OR_GREATER CreatePrimitivesIServiceProviderProxyVtbl(out var serviceProviderVtbl); +#endif - var comInterfaceEntryMemory = RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(WinFormsComWrappers), sizeof(ComInterfaceEntry) * 2); + var comInterfaceEntryMemory = RuntimeHelpers.AllocateTypeAssociatedMemory( + typeof(WinFormsComWrappers), + sizeof(ComInterfaceEntry) +#if !NET10_0_OR_GREATER + * 2 +#endif + ); var wrapperEntry = (ComInterfaceEntry*)comInterfaceEntryMemory.ToPointer(); wrapperEntry[0].IID = IID_IRawElementProviderSimple; wrapperEntry[0].Vtable = rawElementProviderSimpleVtbl; +#if !NET10_0_OR_GREATER wrapperEntry[1].IID = IID_IServiceProvider; wrapperEntry[1].Vtable = serviceProviderVtbl; +#endif return wrapperEntry; } #if !NET8_0_OR_GREATER @@ -315,6 +333,19 @@ private static void CreatePrimitivesIServiceProviderProxyVtbl(out IntPtr vtbl) } #endif +#if NET10_0_OR_GREATER + private static ComInterfaceEntry* CreateComObjectEntry() + { + CreatePrimitivesIOleClientSiteProxyVtbl(out var vtbl); + + var comInterfaceEntryMemory = RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(WinFormsComWrappers), sizeof(ComInterfaceEntry) * 1); + var wrapperEntry = (ComInterfaceEntry*)comInterfaceEntryMemory.ToPointer(); + wrapperEntry->IID = IID_IOleClientSite; + wrapperEntry->Vtable = vtbl; + return wrapperEntry; + } +#endif + #if !NET7_0_OR_GREATER private static ComInterfaceEntry* CreateEnumVariantEntry() { diff --git a/facades/System.Windows.Forms.Primitives/Ole32/Interop.IServiceProvider.cs b/facades/System.Windows.Forms.Primitives/Ole32/Interop.IServiceProvider.cs index 3423b73..36c36aa 100644 --- a/facades/System.Windows.Forms.Primitives/Ole32/Interop.IServiceProvider.cs +++ b/facades/System.Windows.Forms.Primitives/Ole32/Interop.IServiceProvider.cs @@ -2,7 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -#if NET8_0_OR_GREATER +#if NET10_0_OR_GREATER +#elif NET8_0_OR_GREATER namespace Windows.Win32.System.Com; using global::System; using global::System.CodeDom.Compiler; diff --git a/facades/System.Windows.Forms.Primitives/System.Windows.Forms.Primitives.csproj b/facades/System.Windows.Forms.Primitives/System.Windows.Forms.Primitives.csproj index 94f5341..be8c82e 100644 --- a/facades/System.Windows.Forms.Primitives/System.Windows.Forms.Primitives.csproj +++ b/facades/System.Windows.Forms.Primitives/System.Windows.Forms.Primitives.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0;net8.0 + net6.0;net7.0;net8.0;net10.0 true 6.0.0.0 6.0.0.0 diff --git a/facades/System.Windows.Forms/System.Windows.Forms.csproj b/facades/System.Windows.Forms/System.Windows.Forms.csproj index 94f5341..be8c82e 100644 --- a/facades/System.Windows.Forms/System.Windows.Forms.csproj +++ b/facades/System.Windows.Forms/System.Windows.Forms.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0;net8.0 + net6.0;net7.0;net8.0;net10.0 true 6.0.0.0 6.0.0.0 diff --git a/global.json b/global.json index 2e44195..91c6bce 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.200", + "version": "10.0.203", "allowPrerelease": true, "rollForward": "major" } diff --git a/samples/SampleWindowsForms/SampleWindowsForms.csproj b/samples/SampleWindowsForms/SampleWindowsForms.csproj index 12cbdca..bb1b152 100644 --- a/samples/SampleWindowsForms/SampleWindowsForms.csproj +++ b/samples/SampleWindowsForms/SampleWindowsForms.csproj @@ -3,7 +3,7 @@ WinExe - net8.0-windows + net10.0-windows True enable <_SuppressWinFormsTrimError>true