4#ifndef _Stroika_Foundation_Execution_Platform_Windows_HRESULTErrorException_h_
5#define _Stroika_Foundation_Execution_Platform_Windows_HRESULTErrorException_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
9#if qStroika_Foundation_Common_Platform_Windows
12#error "WINDOWS REQUIRED FOR THIS MODULE"
15#include "Stroika/Foundation/Common/Common.h"
17#include "Stroika/Foundation/Execution/Exceptions.h"
18#include "Stroika/Foundation/Execution/Throw.h"
34#define CATCH_AND_HANDLE_EXCEPTIONS_IN_HRESULT_FUNCTION() \
39 catch (const system_error& h) \
41 if (h.code ().category () == Stroika::Foundation::Execution::Platform::Windows::HRESULT_error_category ()) { \
42 return h.code ().value (); \
44 if (h.code ().category () == system_category ()) { \
45 return (HRESULT_FROM_WIN32 (h.code ().value ())); \
47 return DISP_E_EXCEPTION; \
49 catch (const bad_alloc&) \
51 return E_OUTOFMEMORY; \
55 return DISP_E_EXCEPTION; \
67 using ConstVoidStar =
const void*;
74 void ThrowIfNull (
const Private_::ConstVoidStar& p,
const HRESULT& hr);
83#include "HRESULTErrorException.inl"
basic_string< SDKChar > SDKString
void ThrowIfNull(const Private_::ConstVoidStar &p, const HRESULT &hr)
Template specialization for ThrowIfNull (), for thing being thrown HRESULT - really throw HRESULTErro...