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/resource.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/resource.h')
-rw-r--r-- | api/resource.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/api/resource.h b/api/resource.h index 3cfc0a3..3572ace 100644 --- a/api/resource.h +++ b/api/resource.h @@ -13,14 +13,13 @@ * * ResourceName Name of the RT_RCDATA resource. Use MAKEINTRESOURCEW to locate resource by ID. * - * Address Pointer to a pointer variable to receive resource address. - * * Size Pointer to a variable to receive resource size. * - * @return ERROR_SUCCESS on success; Win32 error code otherwise. + * @return Resource address on success. If the function fails, the return value is NULL. To get extended error + * information, call GetLastError. */ -WINTUN_STATUS -ResourceGetAddress(_In_z_ const WCHAR *ResourceName, _Out_ const void **Address, _Out_ DWORD *Size); +_Return_type_success_(return != NULL) _Ret_bytecount_(*Size) const + void *ResourceGetAddress(_In_z_ const WCHAR *ResourceName, _Out_ DWORD *Size); /** * Copies resource to a file. @@ -29,7 +28,8 @@ ResourceGetAddress(_In_z_ const WCHAR *ResourceName, _Out_ const void **Address, * * ResourceName Name of the RT_RCDATA resource. Use MAKEINTRESOURCEW to locate resource by ID. * - * @return ERROR_SUCCESS on success; Win32 error code otherwise. + * @return If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To + * get extended error information, call GetLastError. */ -WINTUN_STATUS -ResourceCopyToFile(_In_z_ const WCHAR *DestinationPath, _In_z_ const WCHAR *ResourceName); +_Return_type_success_(return != FALSE) BOOL + ResourceCopyToFile(_In_z_ const WCHAR *DestinationPath, _In_z_ const WCHAR *ResourceName); |