diff options
author | Simon Rozman <simon@rozman.si> | 2020-11-03 12:29:34 +0100 |
---|---|---|
committer | Simon Rozman <simon@rozman.si> | 2020-11-04 13:21:42 +0100 |
commit | f657e6fd278732d054b064bb4836702d06e176f0 (patch) | |
tree | 3f113195349908e0390b1abc8f315619df4d598e /api/entry.h | |
parent | example: account for adapter reuse (diff) | |
download | wintun-f657e6fd278732d054b064bb4836702d06e176f0.tar.xz wintun-f657e6fd278732d054b064bb4836702d06e176f0.zip |
api: use GetLastError() to report failures like standard Win32
Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'api/entry.h')
-rw-r--r-- | api/entry.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/api/entry.h b/api/entry.h index ac37680..4f925b1 100644 --- a/api/entry.h +++ b/api/entry.h @@ -26,6 +26,8 @@ #endif #pragma warning(disable : 4127) /* conditional expression is constant */ +#define RET_ERROR(Ret, Error) ((Error) == ERROR_SUCCESS ? (Ret) : (SetLastError(Error), 0)) + extern HINSTANCE ResourceModule; extern HANDLE ModuleHeap; extern SECURITY_ATTRIBUTES SecurityAttributes; |