From dd58631f7a0193dd95523d1ebe4114753fef06c0 Mon Sep 17 00:00:00 2001 From: Neil Date: Mon, 17 Feb 2025 08:48:23 +1100 Subject: Switch to using ComPtr from WRL for render target code for simplicity and familiarity. --- win32/WinTypes.h | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'win32/WinTypes.h') diff --git a/win32/WinTypes.h b/win32/WinTypes.h index 9c930bb7c..c0d6c558d 100644 --- a/win32/WinTypes.h +++ b/win32/WinTypes.h @@ -38,25 +38,6 @@ struct UnknownReleaser { } }; -// Wrap COM IUnknown::QueryInterface to produce std::unique_ptr objects to help -// ensure safe reference counting. -template -inline HRESULT UniquePtrFromQI(IUnknown *source, REFIID riid, std::unique_ptr &destination) noexcept { - T *ptr{}; - HRESULT hr = E_FAIL; - try { - hr = source->QueryInterface(riid, reinterpret_cast(&ptr)); - } catch (...) { - // Shouldn't have exceptions from QueryInterface but not marked noexcept - } - if (SUCCEEDED(hr)) { - destination.reset(ptr); - } else { - destination.reset(); - } - return hr; -} - /// Find a function in a DLL and convert to a function pointer. /// This avoids undefined and conditionally defined behaviour. template -- cgit v1.2.3