diff --git a/Directory.Build.props b/Directory.Build.props index 4438b28..87db029 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,10 +1,12 @@ - 10.0 + 11.0 enable enable true - + true + true + true CS1591;CS1701 @@ -37,6 +39,11 @@ all runtime; build; native; contentfiles; analyzers + + + all + runtime; build; native; contentfiles; analyzers + diff --git a/NuGet.config b/NuGet.config index 5e7f1cc..4dbd49d 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,13 +1,16 @@ - - - - - - + + + + + + + + + diff --git a/src/Generator/Generator.csproj b/src/Generator/Generator.csproj index 9fab0c8..2d2c2f9 100644 --- a/src/Generator/Generator.csproj +++ b/src/Generator/Generator.csproj @@ -1,7 +1,7 @@ - net6.0 + net7.0 Exe true false diff --git a/src/Vortice.Win32/Com/Variant.cs b/src/Vortice.Win32/Com/Variant.cs index cbd2e40..588b832 100644 --- a/src/Vortice.Win32/Com/Variant.cs +++ b/src/Vortice.Win32/Com/Variant.cs @@ -1,8 +1,6 @@ // Copyright © Amer Koleci and Contributors. // Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. -using System.Globalization; - namespace Win32.Com; /// diff --git a/src/Vortice.Win32/INativeGuid.cs b/src/Vortice.Win32/INativeGuid.cs new file mode 100644 index 0000000..eb718a6 --- /dev/null +++ b/src/Vortice.Win32/INativeGuid.cs @@ -0,0 +1,11 @@ +// Copyright © Amer Koleci and Contributors. +// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. + +namespace Win32; + +public unsafe interface INativeGuid +{ +#if NET6_0_OR_GREATER + protected internal static Guid* NativeGuid { get; } +#endif +} diff --git a/src/Vortice.Win32/IUnknown.cs b/src/Vortice.Win32/IUnknown.cs index fb2fcaa..4fa13e9 100644 --- a/src/Vortice.Win32/IUnknown.cs +++ b/src/Vortice.Win32/IUnknown.cs @@ -7,7 +7,7 @@ using System.Runtime.CompilerServices; namespace Win32; [Guid("00000000-0000-0000-C000-000000000046")] -public unsafe partial struct IUnknown +public unsafe partial struct IUnknown : INativeGuid { public static ref readonly Guid IID_IUnknown { @@ -32,7 +32,11 @@ public unsafe partial struct IUnknown } } +#if NET6_0_OR_GREATER + internal static Guid* NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_IUnknown)); +#else public static Guid* NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_IUnknown)); +#endif public void** lpVtbl; diff --git a/src/Vortice.Win32/Vortice.Win32.csproj b/src/Vortice.Win32/Vortice.Win32.csproj index e24e0bb..0b789e5 100644 --- a/src/Vortice.Win32/Vortice.Win32.csproj +++ b/src/Vortice.Win32/Vortice.Win32.csproj @@ -1,7 +1,7 @@ - netstandard2.0;net6.0; + netstandard2.0;net6.0;net7.0 Windows API low level bindings. 1.6.0