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 <simon@rozman.si>
This commit is contained in:
Simon Rozman 2025-01-15 15:02:45 +01:00
parent f33010e6b6
commit e432882d3b

View File

@ -687,7 +687,7 @@ static _Success_(return != 0) int SecureMultiByteToWideChar(_In_ UINT CodePage,
template<class _Traits, class _Ax> template<class _Traits, class _Ax>
static DWORD FormatMessageA(_In_ DWORD dwFlags, _In_opt_ LPCVOID lpSource, _In_ DWORD dwMessageId, _In_ DWORD dwLanguageId, _Inout_ std::basic_string<char, _Traits, _Ax> &str, _In_opt_ va_list *Arguments) static DWORD FormatMessageA(_In_ DWORD dwFlags, _In_opt_ LPCVOID lpSource, _In_ DWORD dwMessageId, _In_ DWORD dwLanguageId, _Inout_ std::basic_string<char, _Traits, _Ax> &str, _In_opt_ va_list *Arguments)
{ {
LPSTR lpBuffer; LPSTR lpBuffer;
DWORD dwResult = FormatMessageA(dwFlags | FORMAT_MESSAGE_ALLOCATE_BUFFER, lpSource, dwMessageId, dwLanguageId, reinterpret_cast<LPSTR>(&lpBuffer), 0, Arguments); DWORD dwResult = FormatMessageA(dwFlags | FORMAT_MESSAGE_ALLOCATE_BUFFER, lpSource, dwMessageId, dwLanguageId, reinterpret_cast<LPSTR>(&lpBuffer), 0, Arguments);
if (dwResult) { if (dwResult) {
str.assign(lpBuffer, dwResult); str.assign(lpBuffer, dwResult);
@ -1098,7 +1098,7 @@ namespace winstd
/// ///
/// \return Object handle /// \return Object handle
/// ///
handle_type detach() handle_type detach() noexcept
{ {
handle_type h = m_h; handle_type h = m_h;
m_h = invalid; m_h = invalid;