Add C# 11 support WIP and net7.0 support.

This commit is contained in:
Amer Koleci
2022-09-21 16:47:20 +02:00
parent 79d42b1fd5
commit 0a7fbd4c5f
7 changed files with 36 additions and 13 deletions

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsPackable>false</IsPackable>

View File

@@ -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;
/// <summary>

View File

@@ -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
}

View File

@@ -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;

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net7.0</TargetFrameworks>
<Description>Windows API low level bindings.</Description>
<VersionPrefix>1.6.0</VersionPrefix>
<VersionSuffix Condition="'$(VersionSuffix)' == ''"></VersionSuffix>