From bd46b81520d1efbb9b3b0fa5b3ea3b3037a3e750 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 29 Nov 2022 22:29:30 +0100 Subject: [PATCH] Check HRESULTs in transform mapper property accessors --- .../Effects/PixelShaderEffect.Properties.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Properties.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Properties.cs index a7dcf79c..e18736a2 100644 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Properties.cs +++ b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Properties.cs @@ -215,7 +215,12 @@ unsafe partial struct PixelShaderEffect } else { - _ = ((IUnknown*)@this->d2D1TransformMapper)->QueryInterface(Windows.__uuidof(), (void**)data); + HRESULT hresult = ((IUnknown*)@this->d2D1TransformMapper)->QueryInterface(Windows.__uuidof(), (void**)data); + + if (!Windows.SUCCEEDED(hresult)) + { + return hresult; + } } if (actualSize is not null) @@ -299,7 +304,12 @@ unsafe partial struct PixelShaderEffect using ComPtr resourceTextureManager = this.resourceTextureManagerBuffer[resourceTextureIndex]; - _ = resourceTextureManager.CopyTo((ID2D1ResourceTextureManager**)data); + HRESULT hresult = resourceTextureManager.CopyTo((ID2D1ResourceTextureManager**)data); + + if (!Windows.SUCCEEDED(hresult)) + { + return hresult; + } if (actualSize is not null) {