Stroika Library 3.0d16
 
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
10}
11
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}
basic_string< SDKChar > SDKString
Definition SDKString.h:38