You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modernize the COM/HRESULT call idioms in the native code using WIL — purely a readability/consistency pass, no behavior change. Split out of #37 to keep that PR scoped to resource RAII (handles + BSTR/CoTaskMem).
This is polish, not a bug fix — low priority. Good to do whenever those files are being touched anyway.
Manual if (FAILED(hr)) → WIL result macros (#include <wil/result.h>): RETURN_IF_FAILED, RETURN_HR_IF, RETURN_HR_IF_NULL, RETURN_LAST_ERROR_IF; LOG_IF_FAILED for void paths.
Hard constraints
TAP DLLs are /MT with no C++ exceptions — use ONLY the non-throwing families. NEVER THROW_* or FAIL_FAST_*.
Do NOT place these macros inside __try/__except SEH frames (SEH is isolated in thin wrappers like CollectBoundsForNodeSEH/SetSite; keep the macros in the pure-C++ bodies).
Behavior must be identical; keep build\lvt_unit_tests.exe + integration tests green.
Ordering
Do this after#24 (com_ptr) and #37 (handles+BSTR) land, so it layers cleanly on the finalized COM/HRESULT sites. One small, easy-to-review PR.
Goal
Modernize the COM/HRESULT call idioms in the native code using WIL — purely a readability/consistency pass, no behavior change. Split out of #37 to keep that PR scoped to resource RAII (handles + BSTR/CoTaskMem).
This is polish, not a bug fix — low priority. Good to do whenever those files are being touched anyway.
Scope
try_query: replacex->QueryInterface(IID_PPV_ARGS(y.put()))withy = src.try_query<IY>()(when the source is awil::com_ptr) orwil::try_com_query<IY>(raw)(raw source). ~6 sites, mainlysrc/tap/lvt_tap.cpp(~3),src/tap_wpf/wpf_tap_native.cpp(~1), plus any surfaced by Replace manual COM pointers with wil::com_ptr #24/Adopt wil/resource.h (wil::unique_*) for Win32 handles across the codebase #37.if (FAILED(hr))→ WIL result macros (#include <wil/result.h>):RETURN_IF_FAILED,RETURN_HR_IF,RETURN_HR_IF_NULL,RETURN_LAST_ERROR_IF;LOG_IF_FAILEDfor void paths.Hard constraints
THROW_*orFAIL_FAST_*.__try/__exceptSEH frames (SEH is isolated in thin wrappers likeCollectBoundsForNodeSEH/SetSite; keep the macros in the pure-C++ bodies).build\lvt_unit_tests.exe+ integration tests green.Ordering
Do this after #24 (com_ptr) and #37 (handles+BSTR) land, so it layers cleanly on the finalized COM/HRESULT sites. One small, easy-to-review PR.
Relates to #10, #37.