diff --git a/src/ComputeSharp.Win32.D2D1/ComputeSharp.Win32.D2D1.projitems b/src/ComputeSharp.Win32.D2D1/ComputeSharp.Win32.D2D1.projitems index b234ef39..0a1d313a 100644 --- a/src/ComputeSharp.Win32.D2D1/ComputeSharp.Win32.D2D1.projitems +++ b/src/ComputeSharp.Win32.D2D1/ComputeSharp.Win32.D2D1.projitems @@ -58,7 +58,7 @@ - + @@ -72,6 +72,6 @@ - + \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/Windows/shared/uuids/Windows.Manual.cs b/src/ComputeSharp.Win32.D2D1/Windows/shared/uuids/Windows.Manual.cs deleted file mode 100644 index bf27777e..00000000 --- a/src/ComputeSharp.Win32.D2D1/Windows/shared/uuids/Windows.Manual.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. - -// Ported from shared/uuids.h in the Windows SDK for Windows 10.0.20348.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; -using System.ComponentModel; -using System.Runtime.CompilerServices; - -namespace ComputeSharp.Win32; - -internal static partial class Windows -{ - /// Retrieves the GUID of of a specified type. - /// A value of type . - /// The type to retrieve the GUID for. - /// A value wrapping a pointer to the GUID data for the input type. This value can be either converted to a pointer, or implicitly assigned to a value. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe UuidOfType __uuidof(T value) // for type inference similar to C++'s __uuidof - where T : unmanaged - { - return new UuidOfType(UUID.RIID); - } - - /// Retrieves the GUID of of a specified type. - /// A pointer to a value of type . - /// The type to retrieve the GUID for. - /// A value wrapping a pointer to the GUID data for the input type. This value can be either converted to a pointer, or implicitly assigned to a value. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe UuidOfType __uuidof(T* value) // for type inference similar to C++'s __uuidof - where T : unmanaged - { - return new UuidOfType(UUID.RIID); - } - - /// Retrieves the GUID of of a specified type. - /// The type to retrieve the GUID for. - /// A value wrapping a pointer to the GUID data for the input type. This value can be either converted to a pointer, or implicitly assigned to a value. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe UuidOfType __uuidof() - where T : unmanaged - { - return new UuidOfType(UUID.RIID); - } - - /// A proxy type that wraps a pointer to GUID data. Values of this type can be implicitly converted to and assigned to * or parameters. - [EditorBrowsable(EditorBrowsableState.Never)] - public readonly unsafe ref struct UuidOfType - { - private readonly Guid* riid; - - internal UuidOfType(Guid* riid) - { - this.riid = riid; - } - - /// Reads a value from the GUID buffer for a given instance. - /// The input instance to read data for. - public static implicit operator Guid(UuidOfType guid) => *guid.riid; - - /// Returns the * pointer to the GUID buffer for a given instance. - /// The input instance to read data for. - public static implicit operator Guid*(UuidOfType guid) => guid.riid; - } - - /// A helper type to provide static GUID buffers for specific types. - /// The type to allocate a GUID buffer for. - private static unsafe class UUID - where T : unmanaged - { - /// The pointer to the value for the current type. - /// The target memory area should never be written to. - public static readonly Guid* RIID = CreateRIID(); - - /// Allocates memory for a value and initializes it. - /// A pointer to memory holding the value for the current type. - private static Guid* CreateRIID() - { - var p = (Guid*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(T), sizeof(Guid)); - *p = typeof(T).GUID; - return p; - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/Windows/shared/winerror/Windows.cs b/src/ComputeSharp.Win32.D2D1/Windows/shared/winerror/Windows.cs deleted file mode 100644 index 9882754c..00000000 --- a/src/ComputeSharp.Win32.D2D1/Windows/shared/winerror/Windows.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. - -// Ported from shared/winerror.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal static partial class Windows -{ - public static bool SUCCEEDED(HRESULT hr) - { - return hr >= 0; - } -} \ No newline at end of file