aboutsummaryrefslogtreecommitdiffstats
path: root/api/api.h
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2020-07-21 11:11:14 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2020-10-30 16:50:58 +0100
commitc8bf62ac19ca81c9a488c71af0453da474a46b3b (patch)
tree202a2147e1167e8d785ba030ae2049bb5d748901 /api/api.h
parentapi: port GetInterface member from wireguard-go (diff)
downloadwintun-c8bf62ac19ca81c9a488c71af0453da474a46b3b.tar.xz
wintun-c8bf62ac19ca81c9a488c71af0453da474a46b3b.zip
api: unify Win32 error type
This makes the code more readable and works around the clang-format.exe issues with _Return_type_success_ source annotation. Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'api/api.h')
-rw-r--r--api/api.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/api/api.h b/api/api.h
index 6b05de2..0e31fd7 100644
--- a/api/api.h
+++ b/api/api.h
@@ -7,6 +7,7 @@
#include <Windows.h>
+typedef _Return_type_success_(return == ERROR_SUCCESS) DWORD WINSTATUS;
extern HINSTANCE ResourceModule;
_Check_return_
@@ -22,10 +23,9 @@ NamespaceInit();
void
NamespaceCleanup();
-_Return_type_success_(return ==
- 0) extern DWORD(WINAPI *NciSetConnectionName)(_In_ LPCGUID Guid, _In_z_ LPCWSTR NewName);
+extern WINSTATUS(WINAPI *NciSetConnectionName)(_In_ LPCGUID Guid, _In_z_ LPCWSTR NewName);
-_Return_type_success_(return == 0) extern DWORD(WINAPI *NciGetConnectionName)(
+extern WINSTATUS(WINAPI *NciGetConnectionName)(
_In_ LPCGUID Guid,
_Out_z_bytecap_(InDestNameBytes) LPWSTR Name,
_In_ DWORD InDestNameBytes,
@@ -52,5 +52,5 @@ typedef struct _WINTUN_ADAPTER
VOID WINAPI
WintunFreeAdapter(_In_ WINTUN_ADAPTER *Adapter);
-_Return_type_success_(return == 0) DWORD WINAPI
- WintunGetAdapter(_In_z_count_c_(MAX_POOL) LPCWSTR Pool, _In_z_ LPCWSTR IfName, _Out_ WINTUN_ADAPTER **Adapter);
+WINSTATUS WINAPI
+WintunGetAdapter(_In_z_count_c_(MAX_POOL) LPCWSTR Pool, _In_z_ LPCWSTR IfName, _Out_ WINTUN_ADAPTER **Adapter);