diff --git a/src/ComputeSharp.D2D1.WinUI/Extensions/ICanvasDeviceExtensions.cs b/src/ComputeSharp.D2D1.WinUI/Extensions/ICanvasDeviceExtensions.cs index cf59c1f5..43d57c5e 100644 --- a/src/ComputeSharp.D2D1.WinUI/Extensions/ICanvasDeviceExtensions.cs +++ b/src/ComputeSharp.D2D1.WinUI/Extensions/ICanvasDeviceExtensions.cs @@ -24,7 +24,7 @@ internal static unsafe class ICanvasDeviceExtensions // Get the ICanvasResourceWrapperNative wrapper around the input device canvasDevice.QueryInterface( riid: Win32.__uuidof(), - ppvObject: canvasDeviceResourceWrapperNative.GetVoidAddressOf()).Assert(); + ppvObject: (void**)canvasDeviceResourceWrapperNative.GetAddressOf()).Assert(); // Get the underlying ID2D1Device1 instance in use HRESULT hresult = canvasDeviceResourceWrapperNative.Get()->GetNativeResource( @@ -61,7 +61,7 @@ internal static unsafe class ICanvasDeviceExtensions // Get the ID2D1DeviceContextPool interface reference canvasDevice.QueryInterface( riid: Win32.__uuidof(), - ppvObject: d2D1DeviceContextPool.GetVoidAddressOf()).Assert(); + ppvObject: (void**)d2D1DeviceContextPool.GetAddressOf()).Assert(); // Get a new ID2D1DeviceContextLease object from the retrieved pool d2D1DeviceContextPool.Get()->GetDeviceContextLease(d2D1DeviceContextLease).Assert(); diff --git a/src/ComputeSharp.D2D1.WinUI/Extensions/IUnknownExtensions.cs b/src/ComputeSharp.D2D1.WinUI/Extensions/IUnknownExtensions.cs index 8166a47c..54e8527a 100644 --- a/src/ComputeSharp.D2D1.WinUI/Extensions/IUnknownExtensions.cs +++ b/src/ComputeSharp.D2D1.WinUI/Extensions/IUnknownExtensions.cs @@ -35,8 +35,8 @@ internal static unsafe class IUnknownExtensions using ComPtr leftUnknown = default; using ComPtr rightUnknown = default; - ((IUnknown*)Unsafe.AsPointer(ref left))->QueryInterface(Win32.__uuidof(), leftUnknown.GetVoidAddressOf()).Assert(); - ((IUnknown*)right)->QueryInterface(Win32.__uuidof(), rightUnknown.GetVoidAddressOf()).Assert(); + ((IUnknown*)Unsafe.AsPointer(ref left))->QueryInterface(Win32.__uuidof(), (void**)leftUnknown.GetAddressOf()).Assert(); + ((IUnknown*)right)->QueryInterface(Win32.__uuidof(), (void**)rightUnknown.GetAddressOf()).Assert(); return leftUnknown.Get() == rightUnknown.Get(); } diff --git a/src/ComputeSharp.D2D1/Extensions/ComPtrExtensions.cs b/src/ComputeSharp.D2D1/Extensions/ComPtrExtensions.cs index 43613112..067b72d2 100644 --- a/src/ComputeSharp.D2D1/Extensions/ComPtrExtensions.cs +++ b/src/ComputeSharp.D2D1/Extensions/ComPtrExtensions.cs @@ -9,20 +9,6 @@ namespace ComputeSharp.D2D1.Extensions; /// Trimmed down version of the same file in ComputeSharp. internal static class ComPtrExtensions { - /// - /// Gets the address of the current instance as a raw double pointer. - /// - /// The type to wrap in the current instance. - /// The input instance to get the address for. - /// The raw pointer to the input instance. - /// This method is only valid when the current instance is on the stack or pinned. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe void** GetVoidAddressOf(this in ComPtr ptr) - where T : unmanaged - { - return (void**)Unsafe.AsPointer(ref Unsafe.AsRef(in ptr)); - } - /// /// Moves the current instance and resets it without releasing the reference. /// diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ReflectionServices.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ReflectionServices.cs index 2141af17..7d478063 100644 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ReflectionServices.cs +++ b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ReflectionServices.cs @@ -44,7 +44,7 @@ public static class D2D1ReflectionServices pSrcData: hlslBytecodePtr, SrcDataSize: (nuint)hlslBytecode.Length, pInterface: Windows.__uuidof(), - ppReflector: d3D11ShaderReflection.GetVoidAddressOf()).Assert(); + ppReflector: (void**)d3D11ShaderReflection.GetAddressOf()).Assert(); } } else @@ -59,7 +59,7 @@ public static class D2D1ReflectionServices pSrcData: (byte*)dynamicBytecode.Get()->GetBufferPointer(), SrcDataSize: dynamicBytecode.Get()->GetBufferSize(), pInterface: Windows.__uuidof(), - ppReflector: d3D11ShaderReflection.GetVoidAddressOf()).Assert(); + ppReflector: (void**)d3D11ShaderReflection.GetAddressOf()).Assert(); } D3D11_SHADER_DESC d3D11ShaderDescription; diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Extensions/ID2D1EffectContextExtensions.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Extensions/ID2D1EffectContextExtensions.cs index a9148353..a96347e7 100644 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Extensions/ID2D1EffectContextExtensions.cs +++ b/src/ComputeSharp.D2D1/Shaders/Interop/Extensions/ID2D1EffectContextExtensions.cs @@ -1,6 +1,5 @@ using System; using System.Runtime.CompilerServices; -using ComputeSharp.D2D1.Extensions; using TerraFX.Interop.DirectX; using TerraFX.Interop.Windows; @@ -89,7 +88,7 @@ internal static unsafe class ID2D1EffectContextExtensions pSrcData: bytecode, SrcDataSize: (uint)bytecodeSize, pInterface: Windows.__uuidof(), - ppReflector: d3D11ShaderReflection.GetVoidAddressOf()); + ppReflector: (void**)d3D11ShaderReflection.GetAddressOf()); if (!Windows.SUCCEEDED(hresult)) {