Stroika Library
3.0d16
Help-Home
Loading...
Searching...
No Matches
Execution/Platform/Windows/Exception.inl
1
/*
2
* Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3
*/
4
#include "Stroika/Foundation/Characters/SDKString.h"
5
6
#include "Stroika/Foundation/Execution/Throw.h"
7
8
namespace
Stroika::Foundation::Execution
{
9
using
Characters::SDKString
;
10
}
11
12
namespace
Stroika::Foundation::Execution::Platform::Windows
{
13
14
/*
15
********************************************************************************
16
*************************** ThrowIfZeroGetLastError ****************************
17
********************************************************************************
18
*/
19
template
<
typename
WINDOWS_API_RESULT>
20
inline
void
ThrowIfZeroGetLastError
(WINDOWS_API_RESULT test)
21
{
22
if
(test == 0) [[unlikely]] {
23
Execution::ThrowSystemErrNo (::GetLastError ());
// NOTE - REQUIRE GetLastError () MUST be != 0!!! Else assert error
24
}
25
}
26
27
/*
28
********************************************************************************
29
*************************** ThrowIfNotERROR_SUCCESS ****************************
30
********************************************************************************
31
*/
32
inline
void
ThrowIfNotERROR_SUCCESS
(DWORD win32ErrCode)
33
{
34
if
(win32ErrCode != ERROR_SUCCESS) [[unlikely]] {
35
Execution::ThrowSystemErrNo (win32ErrCode);
36
}
37
}
38
39
/*
40
********************************************************************************
41
***************************** ThrowIfNot_NO_ERROR ******************************
42
********************************************************************************
43
*/
44
inline
void
ThrowIfNot_NO_ERROR
(DWORD win32ErrCode)
45
{
46
if
(win32ErrCode != NO_ERROR) [[unlikely]] {
47
Execution::ThrowSystemErrNo (win32ErrCode);
48
}
49
}
50
51
}
Stroika::Foundation::Characters::SDKString
basic_string< SDKChar > SDKString
Definition
SDKString.h:38
Stroika::Foundation::Execution::Platform::Windows
Definition
COM.h:19
Stroika::Foundation::Execution::Platform::Windows::ThrowIfZeroGetLastError
void ThrowIfZeroGetLastError(WINDOWS_API_RESULT test)
Definition
Execution/Platform/Windows/Exception.inl:20
Stroika::Foundation::Execution::Platform::Windows::ThrowIfNotERROR_SUCCESS
void ThrowIfNotERROR_SUCCESS(DWORD win32ErrCode)
Definition
Execution/Platform/Windows/Exception.inl:32
Stroika::Foundation::Execution::Platform::Windows::ThrowIfNot_NO_ERROR
void ThrowIfNot_NO_ERROR(DWORD win32ErrCode)
Definition
Execution/Platform/Windows/Exception.inl:44
Stroika::Foundation::Execution
Definition
SDKString.inl:7
Library
Sources
Stroika
Foundation
Execution
Platform
Windows
Exception.inl
Generated by
1.9.8