diff options
author | Neil <nyamatongwe@gmail.com> | 2025-02-17 08:48:23 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2025-02-17 08:48:23 +1100 |
commit | dd58631f7a0193dd95523d1ebe4114753fef06c0 (patch) | |
tree | 6305ac65c588c555829c67d57eac998d56e48ef9 /win32/WinTypes.h | |
parent | 99497f846e812b5333eca87fe9f9812eab7daaf0 (diff) | |
download | scintilla-mirror-dd58631f7a0193dd95523d1ebe4114753fef06c0.tar.gz |
Switch to using ComPtr from WRL for render target code for simplicity and
familiarity.
Diffstat (limited to 'win32/WinTypes.h')
-rw-r--r-- | win32/WinTypes.h | 19 |
1 files changed, 0 insertions, 19 deletions
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<typename T> -inline HRESULT UniquePtrFromQI(IUnknown *source, REFIID riid, std::unique_ptr<T, UnknownReleaser> &destination) noexcept { - T *ptr{}; - HRESULT hr = E_FAIL; - try { - hr = source->QueryInterface(riid, reinterpret_cast<void **>(&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<typename T> |