From e432882d3b08f530741638a66f037a3d10067250 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Wed, 15 Jan 2025 15:02:45 +0100 Subject: [PATCH] Declare handle::detach() It's trivial and used at the point from which no C++ exceptions are expected, as the handle is no longer a subject to RAAI. Signed-off-by: Simon Rozman --- include/WinStd/Common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/WinStd/Common.h b/include/WinStd/Common.h index c818ed5a..d5c28e4f 100644 --- a/include/WinStd/Common.h +++ b/include/WinStd/Common.h @@ -687,7 +687,7 @@ static _Success_(return != 0) int SecureMultiByteToWideChar(_In_ UINT CodePage, template static DWORD FormatMessageA(_In_ DWORD dwFlags, _In_opt_ LPCVOID lpSource, _In_ DWORD dwMessageId, _In_ DWORD dwLanguageId, _Inout_ std::basic_string &str, _In_opt_ va_list *Arguments) { - LPSTR lpBuffer; + LPSTR lpBuffer; DWORD dwResult = FormatMessageA(dwFlags | FORMAT_MESSAGE_ALLOCATE_BUFFER, lpSource, dwMessageId, dwLanguageId, reinterpret_cast(&lpBuffer), 0, Arguments); if (dwResult) { str.assign(lpBuffer, dwResult); @@ -1098,7 +1098,7 @@ namespace winstd /// /// \return Object handle /// - handle_type detach() + handle_type detach() noexcept { handle_type h = m_h; m_h = invalid;