From b592e071d28f29efd0565614af79dfca9075747a Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 24 Jul 2020 10:36:24 +0200 Subject: [PATCH] api: tighten source code annotation Signed-off-by: Simon Rozman --- api/api.h | 4 ++-- api/devmgmt.c | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/api/api.h b/api/api.h index e409b8b..9524706 100644 --- a/api/api.h +++ b/api/api.h @@ -94,7 +94,7 @@ void WINAPI WintunFreeAdapter(_In_ WINTUN_ADAPTER *Adapter); WINTUN_STATUS WINAPI -WintunGetAdapter(_In_z_count_c_(MAX_POOL) const WCHAR *Pool, _In_z_ const WCHAR *Name, _Out_ WINTUN_ADAPTER **Adapter); +WintunGetAdapter(_In_z_count_c_(MAX_POOL) const WCHAR *Pool, _In_z_count_c_(MAX_ADAPTER_NAME) const WCHAR *Name, _Out_ WINTUN_ADAPTER **Adapter); WINTUN_STATUS WINAPI WintunGetAdapterName(_In_ const WINTUN_ADAPTER *Adapter, _Out_cap_c_(MAX_ADAPTER_NAME) WCHAR *Name); @@ -114,7 +114,7 @@ WintunGetAdapterDeviceObject(_In_ const WINTUN_ADAPTER *Adapter, _Out_ HANDLE *H WINTUN_STATUS WINAPI WintunCreateAdapter( _In_z_count_c_(MAX_POOL) const WCHAR *Pool, - _In_z_ const WCHAR *Name, + _In_z_count_c_(MAX_ADAPTER_NAME) const WCHAR *Name, _In_opt_ const GUID *RequestedGUID, _Out_ WINTUN_ADAPTER **Adapter, _Inout_ BOOL *RebootRequired); diff --git a/api/devmgmt.c b/api/devmgmt.c index e9ff176..6454979 100644 --- a/api/devmgmt.c +++ b/api/devmgmt.c @@ -570,7 +570,10 @@ WintunFreeAdapter(_In_ WINTUN_ADAPTER *Adapter) * if adapter is found but not a Wintun-class or not a member of the pool; Win32 error code otherwise */ WINTUN_STATUS WINAPI -WintunGetAdapter(_In_z_count_c_(MAX_POOL) const WCHAR *Pool, _In_z_ const WCHAR *Name, _Out_ WINTUN_ADAPTER **Adapter) +WintunGetAdapter( + _In_z_count_c_(MAX_POOL) const WCHAR *Pool, + _In_z_count_c_(MAX_ADAPTER_NAME) const WCHAR *Name, + _Out_ WINTUN_ADAPTER **Adapter) { DWORD Result; HANDLE Mutex = TakeNameMutex(Pool); @@ -859,7 +862,7 @@ IsNewer(_In_ const SP_DRVINFO_DATA_W *DriverData, _In_ const FILETIME *DriverDat WINTUN_STATUS WINAPI WintunCreateAdapter( _In_z_count_c_(MAX_POOL) const WCHAR *Pool, - _In_z_ const WCHAR *Name, + _In_z_count_c_(MAX_ADAPTER_NAME) const WCHAR *Name, _In_opt_ const GUID *RequestedGUID, _Out_ WINTUN_ADAPTER **Adapter, _Inout_ BOOL *RebootRequired)