api: rename WINSTATUS to WINTUN_STATUS

...to reduce name collision probability.

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2020-07-21 16:43:34 +02:00 committed by Jason A. Donenfeld
parent 7e3740018d
commit a283add85b
5 changed files with 52 additions and 52 deletions

View File

@ -8,7 +8,7 @@
#include <Windows.h> #include <Windows.h>
#include <IPExport.h> #include <IPExport.h>
typedef _Return_type_success_(return == ERROR_SUCCESS) DWORD WINSTATUS; typedef _Return_type_success_(return == ERROR_SUCCESS) DWORD WINTUN_STATUS;
extern HINSTANCE ResourceModule; extern HINSTANCE ResourceModule;
_Check_return_ _Check_return_
@ -24,9 +24,9 @@ NamespaceInit();
void void
NamespaceCleanup(); NamespaceCleanup();
extern WINSTATUS(WINAPI *NciSetConnectionName)(_In_ LPCGUID Guid, _In_z_ LPCWSTR NewName); extern DWORD(WINAPI *NciSetConnectionName)(_In_ LPCGUID Guid, _In_z_ LPCWSTR NewName);
extern WINSTATUS(WINAPI *NciGetConnectionName)( extern DWORD(WINAPI *NciGetConnectionName)(
_In_ LPCGUID Guid, _In_ LPCGUID Guid,
_Out_z_bytecap_(InDestNameBytes) LPWSTR Name, _Out_z_bytecap_(InDestNameBytes) LPWSTR Name,
_In_ DWORD InDestNameBytes, _In_ DWORD InDestNameBytes,
@ -38,7 +38,7 @@ NciInit();
void void
NciCleanup(); NciCleanup();
WINSTATUS WINTUN_STATUS
RegistryOpenKeyWait( RegistryOpenKeyWait(
_In_ HKEY Key, _In_ HKEY Key,
_In_z_count_c_(MAX_PATH) LPCWSTR Path, _In_z_count_c_(MAX_PATH) LPCWSTR Path,
@ -46,28 +46,28 @@ RegistryOpenKeyWait(
_In_ DWORD Timeout, _In_ DWORD Timeout,
_Out_ HKEY *KeyOut); _Out_ HKEY *KeyOut);
WINSTATUS WINTUN_STATUS
RegistryWaitForKey(_In_ HKEY Key, _In_z_count_c_(MAX_PATH) LPCWSTR Path, _In_ DWORD Timeout); RegistryWaitForKey(_In_ HKEY Key, _In_z_count_c_(MAX_PATH) LPCWSTR Path, _In_ DWORD Timeout);
WINSTATUS WINTUN_STATUS
RegistryGetString(_Inout_ LPWSTR *Buf, _In_ DWORD Len, _In_ DWORD ValueType); RegistryGetString(_Inout_ LPWSTR *Buf, _In_ DWORD Len, _In_ DWORD ValueType);
WINSTATUS WINTUN_STATUS
RegistryGetMultiString(_Inout_ LPWSTR *Buf, _In_ DWORD Len, _In_ DWORD ValueType); RegistryGetMultiString(_Inout_ LPWSTR *Buf, _In_ DWORD Len, _In_ DWORD ValueType);
WINSTATUS WINTUN_STATUS
RegistryQueryString(_In_ HKEY Key, _In_opt_z_ LPCWSTR Name, _Out_ LPWSTR *Value); RegistryQueryString(_In_ HKEY Key, _In_opt_z_ LPCWSTR Name, _Out_ LPWSTR *Value);
WINSTATUS WINTUN_STATUS
RegistryQueryStringWait(_In_ HKEY Key, _In_opt_z_ LPCWSTR Name, _In_ DWORD Timeout, _Out_ LPWSTR *Value); RegistryQueryStringWait(_In_ HKEY Key, _In_opt_z_ LPCWSTR Name, _In_ DWORD Timeout, _Out_ LPWSTR *Value);
WINSTATUS WINTUN_STATUS
RegistryQueryDWORD(_In_ HKEY Key, _In_opt_z_ LPCWSTR Name, _Out_ DWORD *Value); RegistryQueryDWORD(_In_ HKEY Key, _In_opt_z_ LPCWSTR Name, _Out_ DWORD *Value);
WINSTATUS WINTUN_STATUS
RegistryQueryDWORDWait(_In_ HKEY Key, _In_opt_z_ LPCWSTR Name, _In_ DWORD Timeout, _Out_ DWORD *Value); RegistryQueryDWORDWait(_In_ HKEY Key, _In_opt_z_ LPCWSTR Name, _In_ DWORD Timeout, _Out_ DWORD *Value);
WINSTATUS WINAPI WINTUN_STATUS WINAPI
WintunGetVersion( WintunGetVersion(
_Out_ DWORD *DriverVersionMaj, _Out_ DWORD *DriverVersionMaj,
_Out_ DWORD *DriverVersionMin, _Out_ DWORD *DriverVersionMin,
@ -89,13 +89,13 @@ typedef struct _WINTUN_ADAPTER
VOID WINAPI VOID WINAPI
WintunFreeAdapter(_In_ WINTUN_ADAPTER *Adapter); WintunFreeAdapter(_In_ WINTUN_ADAPTER *Adapter);
WINSTATUS WINAPI WINTUN_STATUS WINAPI
WintunGetAdapter(_In_z_count_c_(MAX_POOL) LPCWSTR Pool, _In_z_ LPCWSTR Name, _Out_ WINTUN_ADAPTER **Adapter); WintunGetAdapter(_In_z_count_c_(MAX_POOL) LPCWSTR Pool, _In_z_ LPCWSTR Name, _Out_ WINTUN_ADAPTER **Adapter);
WINSTATUS WINAPI WINTUN_STATUS WINAPI
WintunGetAdapterName(_In_ const WINTUN_ADAPTER *Adapter, _Out_cap_c_(MAX_ADAPTER_NAME) LPWSTR Name); WintunGetAdapterName(_In_ const WINTUN_ADAPTER *Adapter, _Out_cap_c_(MAX_ADAPTER_NAME) LPWSTR Name);
WINSTATUS WINAPI WINTUN_STATUS WINAPI
WintunSetAdapterName(_In_ const WINTUN_ADAPTER *Adapter, _In_z_count_c_(MAX_ADAPTER_NAME) LPCWSTR Name); WintunSetAdapterName(_In_ const WINTUN_ADAPTER *Adapter, _In_z_count_c_(MAX_ADAPTER_NAME) LPCWSTR Name);
void WINAPI void WINAPI
@ -104,10 +104,10 @@ WintunGetAdapterGUID(_In_ const WINTUN_ADAPTER *Adapter, _Out_ GUID *Guid);
void WINAPI void WINAPI
WintunGetAdapterLUID(_In_ const WINTUN_ADAPTER *Adapter, _Out_ LUID *Luid); WintunGetAdapterLUID(_In_ const WINTUN_ADAPTER *Adapter, _Out_ LUID *Luid);
WINSTATUS WINAPI WINTUN_STATUS WINAPI
WintunGetAdapterDeviceObject(_In_ const WINTUN_ADAPTER *Adapter, _Out_ HANDLE *Handle); WintunGetAdapterDeviceObject(_In_ const WINTUN_ADAPTER *Adapter, _Out_ HANDLE *Handle);
WINSTATUS WINAPI WINTUN_STATUS WINAPI
WintunCreateAdapter( WintunCreateAdapter(
_In_z_count_c_(MAX_POOL) LPCWSTR Pool, _In_z_count_c_(MAX_POOL) LPCWSTR Pool,
_In_z_ LPCWSTR Name, _In_z_ LPCWSTR Name,
@ -115,10 +115,10 @@ WintunCreateAdapter(
_Out_ WINTUN_ADAPTER **Adapter, _Out_ WINTUN_ADAPTER **Adapter,
_Inout_ BOOL *RebootRequired); _Inout_ BOOL *RebootRequired);
WINSTATUS WINAPI WINTUN_STATUS WINAPI
WintunDeleteAdapter(_In_ const WINTUN_ADAPTER *Adapter, _Inout_ BOOL *RebootRequired); WintunDeleteAdapter(_In_ const WINTUN_ADAPTER *Adapter, _Inout_ BOOL *RebootRequired);
typedef BOOL(CALLBACK *WINTUN_ENUMPROC)(_In_ const WINTUN_ADAPTER *Adapter, _In_ LPARAM Param); typedef BOOL(CALLBACK *WINTUN_ENUMPROC)(_In_ const WINTUN_ADAPTER *Adapter, _In_ LPARAM Param);
WINSTATUS WINAPI WINTUN_STATUS WINAPI
WintunEnumAdapters(_In_z_count_c_(MAX_POOL) LPCWSTR Pool, _In_ WINTUN_ENUMPROC Func, _In_ LPARAM Param); WintunEnumAdapters(_In_z_count_c_(MAX_POOL) LPCWSTR Pool, _In_ WINTUN_ENUMPROC Func, _In_ LPARAM Param);

View File

@ -23,7 +23,7 @@ const static GUID ADAPTER_NET_GUID = { 0xcac88484L,
/** /**
* Returns the version of the Wintun driver and NDIS system currently loaded. * Returns the version of the Wintun driver and NDIS system currently loaded.
*/ */
WINSTATUS WINAPI WINTUN_STATUS WINAPI
WintunGetVersion( WintunGetVersion(
_Out_ DWORD *DriverVersionMaj, _Out_ DWORD *DriverVersionMaj,
_Out_ DWORD *DriverVersionMin, _Out_ DWORD *DriverVersionMin,
@ -72,7 +72,7 @@ cleanupKey:
* *
* @return ERROR_SUCCESS on success; Win32 error code otherwise * @return ERROR_SUCCESS on success; Win32 error code otherwise
*/ */
static WINSTATUS static WINTUN_STATUS
GetDeviceRegistryProperty( GetDeviceRegistryProperty(
_In_ HDEVINFO DevInfo, _In_ HDEVINFO DevInfo,
_In_ SP_DEVINFO_DATA *DevInfoData, _In_ SP_DEVINFO_DATA *DevInfoData,
@ -122,7 +122,7 @@ GetDeviceRegistryProperty(
* *
* @return ERROR_SUCCESS on success; Win32 error code otherwise * @return ERROR_SUCCESS on success; Win32 error code otherwise
*/ */
static WINSTATUS static WINTUN_STATUS
GetDeviceRegistryString( GetDeviceRegistryString(
_In_ HDEVINFO DevInfo, _In_ HDEVINFO DevInfo,
_In_ SP_DEVINFO_DATA *DevInfoData, _In_ SP_DEVINFO_DATA *DevInfoData,
@ -164,7 +164,7 @@ GetDeviceRegistryString(
* *
* @return ERROR_SUCCESS on success; Win32 error code otherwise * @return ERROR_SUCCESS on success; Win32 error code otherwise
*/ */
static WINSTATUS static WINTUN_STATUS
GetDeviceRegistryMultiString( GetDeviceRegistryMultiString(
_In_ HDEVINFO DevInfo, _In_ HDEVINFO DevInfo,
_In_ SP_DEVINFO_DATA *DevInfoData, _In_ SP_DEVINFO_DATA *DevInfoData,
@ -246,7 +246,7 @@ GetPoolDeviceTypeName(_In_z_count_c_(MAX_POOL) LPCWSTR Pool, _Out_cap_c_(MAX_POO
/** /**
* Checks if SPDRP_DEVICEDESC or SPDRP_FRIENDLYNAME match device type name. * Checks if SPDRP_DEVICEDESC or SPDRP_FRIENDLYNAME match device type name.
*/ */
static WINSTATUS static WINTUN_STATUS
IsPoolMember( IsPoolMember(
_In_z_count_c_(MAX_POOL) LPCWSTR Pool, _In_z_count_c_(MAX_POOL) LPCWSTR Pool,
_In_ HDEVINFO DevInfo, _In_ HDEVINFO DevInfo,
@ -300,7 +300,7 @@ cleanupDeviceDesc:
* *
* @return ERROR_SUCCESS on success; Win32 error code otherwise * @return ERROR_SUCCESS on success; Win32 error code otherwise
*/ */
static WINSTATUS static WINTUN_STATUS
GetDriverInfoDetail( GetDriverInfoDetail(
_In_ HDEVINFO DevInfo, _In_ HDEVINFO DevInfo,
_In_ SP_DEVINFO_DATA *DevInfoData, _In_ SP_DEVINFO_DATA *DevInfoData,
@ -330,7 +330,7 @@ GetDriverInfoDetail(
/** /**
* Check if the device is using Wintun driver. * Check if the device is using Wintun driver.
*/ */
static WINSTATUS static WINTUN_STATUS
IsUsingOurDriver(_In_ HDEVINFO DevInfo, _In_ SP_DEVINFO_DATA *DevInfoData, _Out_ BOOL *IsOurDriver) IsUsingOurDriver(_In_ HDEVINFO DevInfo, _In_ SP_DEVINFO_DATA *DevInfoData, _Out_ BOOL *IsOurDriver)
{ {
if (!SetupDiBuildDriverInfoList(DevInfo, DevInfoData, SPDIT_COMPATDRIVER)) if (!SetupDiBuildDriverInfoList(DevInfo, DevInfoData, SPDIT_COMPATDRIVER))
@ -378,7 +378,7 @@ IsUsingOurDriver(_In_ HDEVINFO DevInfo, _In_ SP_DEVINFO_DATA *DevInfoData, _Out_
* *
* @return ERROR_SUCCESS on success; Win32 error code otherwise * @return ERROR_SUCCESS on success; Win32 error code otherwise
*/ */
static WINSTATUS static WINTUN_STATUS
GetNetCfgInstanceId(_In_ HDEVINFO DevInfo, _In_ SP_DEVINFO_DATA *DevInfoData, _Out_ GUID *CfgInstanceID) GetNetCfgInstanceId(_In_ HDEVINFO DevInfo, _In_ SP_DEVINFO_DATA *DevInfoData, _Out_ GUID *CfgInstanceID)
{ {
HKEY Key = SetupDiOpenDevRegKey(DevInfo, DevInfoData, DICS_FLAG_GLOBAL, 0, DIREG_DRV, KEY_QUERY_VALUE); HKEY Key = SetupDiOpenDevRegKey(DevInfo, DevInfoData, DICS_FLAG_GLOBAL, 0, DIREG_DRV, KEY_QUERY_VALUE);
@ -410,7 +410,7 @@ cleanupKey:
* *
* @return ERROR_SUCCESS on success; Win32 error code otherwise * @return ERROR_SUCCESS on success; Win32 error code otherwise
*/ */
static WINSTATUS static WINTUN_STATUS
CreateAdapterData( CreateAdapterData(
_In_ HDEVINFO DevInfo, _In_ HDEVINFO DevInfo,
_In_ SP_DEVINFO_DATA *DevInfoData, _In_ SP_DEVINFO_DATA *DevInfoData,
@ -508,7 +508,7 @@ GetTcpipAdapterRegPath(_In_ const WINTUN_ADAPTER *Adapter, _Out_cap_c_(MAX_PATH)
/** /**
* Returns the interface-specific TCP/IP network registry key path. * Returns the interface-specific TCP/IP network registry key path.
*/ */
static WINSTATUS static WINTUN_STATUS
GetTcpipInterfaceRegPath(_In_ const WINTUN_ADAPTER *Adapter, _Out_cap_c_(MAX_PATH) LPWSTR Path) GetTcpipInterfaceRegPath(_In_ const WINTUN_ADAPTER *Adapter, _Out_cap_c_(MAX_PATH) LPWSTR Path)
{ {
DWORD Result; DWORD Result;
@ -560,7 +560,7 @@ WintunFreeAdapter(_In_ WINTUN_ADAPTER *Adapter)
* ERROR_FILE_NOT_FOUND if adapter with given name is not found; * ERROR_FILE_NOT_FOUND if adapter with given name is not found;
* ERROR_ALREADY_EXISTS if adapter is found but not a Wintun-class or not a member of the pool * ERROR_ALREADY_EXISTS if adapter is found but not a Wintun-class or not a member of the pool
*/ */
WINSTATUS WINAPI WINTUN_STATUS WINAPI
WintunGetAdapter(_In_z_count_c_(MAX_POOL) LPCWSTR Pool, _In_z_ LPCWSTR Name, _Out_ WINTUN_ADAPTER **Adapter) WintunGetAdapter(_In_z_count_c_(MAX_POOL) LPCWSTR Pool, _In_z_ LPCWSTR Name, _Out_ WINTUN_ADAPTER **Adapter)
{ {
DWORD Result; DWORD Result;
@ -648,13 +648,13 @@ cleanupMutex:
/** /**
* Returns the name of the Wintun interface. * Returns the name of the Wintun interface.
*/ */
WINSTATUS WINAPI WINTUN_STATUS WINAPI
WintunGetAdapterName(_In_ const WINTUN_ADAPTER *Adapter, _Out_cap_c_(MAX_ADAPTER_NAME) LPWSTR Name) WintunGetAdapterName(_In_ const WINTUN_ADAPTER *Adapter, _Out_cap_c_(MAX_ADAPTER_NAME) LPWSTR Name)
{ {
return NciGetConnectionName(&Adapter->CfgInstanceID, Name, MAX_ADAPTER_NAME * sizeof(WCHAR), NULL); return NciGetConnectionName(&Adapter->CfgInstanceID, Name, MAX_ADAPTER_NAME * sizeof(WCHAR), NULL);
} }
static WINSTATUS static WINTUN_STATUS
InterfaceGuidFromAlias(_In_z_ LPCWSTR Alias, _Out_ GUID *Guid) InterfaceGuidFromAlias(_In_z_ LPCWSTR Alias, _Out_ GUID *Guid)
{ {
NET_LUID Luid; NET_LUID Luid;
@ -667,7 +667,7 @@ InterfaceGuidFromAlias(_In_z_ LPCWSTR Alias, _Out_ GUID *Guid)
/** /**
* Sets name of the Wintun interface. * Sets name of the Wintun interface.
*/ */
WINSTATUS WINAPI WINTUN_STATUS WINAPI
WintunSetAdapterName(_In_ const WINTUN_ADAPTER *Adapter, _In_z_count_c_(MAX_ADAPTER_NAME) LPCWSTR Name) WintunSetAdapterName(_In_ const WINTUN_ADAPTER *Adapter, _In_z_count_c_(MAX_ADAPTER_NAME) LPCWSTR Name)
{ {
DWORD Result; DWORD Result;
@ -759,7 +759,7 @@ WintunGetAdapterLUID(_In_ const WINTUN_ADAPTER *Adapter, _Out_ LUID *Luid)
/** /**
* Returns a handle to the adapter device object. * Returns a handle to the adapter device object.
*/ */
WINSTATUS WINAPI WINTUN_STATUS WINAPI
WintunGetAdapterDeviceObject(_In_ const WINTUN_ADAPTER *Adapter, _Out_ HANDLE *Handle) WintunGetAdapterDeviceObject(_In_ const WINTUN_ADAPTER *Adapter, _Out_ HANDLE *Handle)
{ {
HANDLE Heap = GetProcessHeap(); HANDLE Heap = GetProcessHeap();
@ -800,7 +800,7 @@ cleanupBuf:
/** /**
* Sets device install parameters for a quiet installation. * Sets device install parameters for a quiet installation.
*/ */
static WINSTATUS static WINTUN_STATUS
SetQuietInstall(_In_ HDEVINFO DevInfo, _In_ SP_DEVINFO_DATA *DevInfoData) SetQuietInstall(_In_ HDEVINFO DevInfo, _In_ SP_DEVINFO_DATA *DevInfoData)
{ {
SP_DEVINSTALL_PARAMS_W DevInstallParams = { .cbSize = sizeof(SP_DEVINSTALL_PARAMS_W) }; SP_DEVINSTALL_PARAMS_W DevInstallParams = { .cbSize = sizeof(SP_DEVINSTALL_PARAMS_W) };
@ -870,7 +870,7 @@ CheckReboot(_In_ HDEVINFO DevInfo, _In_ SP_DEVINFO_DATA *DevInfoData)
* *
* @return ERROR_SUCCESS on success; Win32 error code otherwise * @return ERROR_SUCCESS on success; Win32 error code otherwise
*/ */
WINSTATUS WINAPI WINTUN_STATUS WINAPI
WintunCreateAdapter( WintunCreateAdapter(
_In_z_count_c_(MAX_POOL) LPCWSTR Pool, _In_z_count_c_(MAX_POOL) LPCWSTR Pool,
_In_z_ LPCWSTR Name, _In_z_ LPCWSTR Name,
@ -1118,7 +1118,7 @@ cleanupMutex:
* Returns TUN device info list handle and interface device info data. The device info list handle must be closed after * Returns TUN device info list handle and interface device info data. The device info list handle must be closed after
* use. In case the device is not found, ERROR_OBJECT_NOT_FOUND is returned. * use. In case the device is not found, ERROR_OBJECT_NOT_FOUND is returned.
*/ */
static WINSTATUS static WINTUN_STATUS
GetDevInfoData(_In_ const GUID *CfgInstanceID, _Out_ HDEVINFO *DevInfo, _Out_ SP_DEVINFO_DATA *DevInfoData) GetDevInfoData(_In_ const GUID *CfgInstanceID, _Out_ HDEVINFO *DevInfo, _Out_ SP_DEVINFO_DATA *DevInfoData)
{ {
DWORD Result; DWORD Result;
@ -1163,7 +1163,7 @@ GetDevInfoData(_In_ const GUID *CfgInstanceID, _Out_ HDEVINFO *DevInfo, _Out_ SP
* *
* @return ERROR_SUCCESS on success; Win32 error code otherwise. This function succeeds if the interface was not found. * @return ERROR_SUCCESS on success; Win32 error code otherwise. This function succeeds if the interface was not found.
*/ */
WINSTATUS WINAPI WINTUN_STATUS WINAPI
WintunDeleteAdapter(_In_ const WINTUN_ADAPTER *Adapter, _Inout_ BOOL *RebootRequired) WintunDeleteAdapter(_In_ const WINTUN_ADAPTER *Adapter, _Inout_ BOOL *RebootRequired)
{ {
HDEVINFO DevInfo; HDEVINFO DevInfo;
@ -1198,7 +1198,7 @@ WintunDeleteAdapter(_In_ const WINTUN_ADAPTER *Adapter, _Inout_ BOOL *RebootRequ
* *
* @return ERROR_SUCCESS on success; Win32 error code otherwise * @return ERROR_SUCCESS on success; Win32 error code otherwise
*/ */
WINSTATUS WINAPI WINTUN_STATUS WINAPI
WintunEnumAdapters(_In_z_count_c_(MAX_POOL) LPCWSTR Pool, _In_ WINTUN_ENUMPROC Func, _In_ LPARAM Param) WintunEnumAdapters(_In_z_count_c_(MAX_POOL) LPCWSTR Pool, _In_ WINTUN_ENUMPROC Func, _In_ LPARAM Param)
{ {
DWORD Result; DWORD Result;

View File

@ -46,7 +46,7 @@ Bin2Hex(_In_bytecount_(Size) const void *Source, size_t Size, _Out_capcount_(Siz
} }
} }
static DWORD static WINTUN_STATUS
NamespaceRuntimeInit() NamespaceRuntimeInit()
{ {
DWORD Result; DWORD Result;

View File

@ -7,9 +7,9 @@
static HMODULE NciModule; static HMODULE NciModule;
WINSTATUS(WINAPI *NciSetConnectionName)(_In_ LPCGUID Guid, _In_z_ LPCWSTR NewName); DWORD(WINAPI *NciSetConnectionName)(_In_ LPCGUID Guid, _In_z_ LPCWSTR NewName);
WINSTATUS(WINAPI *NciGetConnectionName) DWORD(WINAPI *NciGetConnectionName)
(_In_ LPCGUID Guid, (_In_ LPCGUID Guid,
_Out_z_bytecap_(InDestNameBytes) LPWSTR Name, _Out_z_bytecap_(InDestNameBytes) LPWSTR Name,
_In_ DWORD InDestNameBytes, _In_ DWORD InDestNameBytes,

View File

@ -7,7 +7,7 @@
#include <string.h> #include <string.h>
#include <wchar.h> #include <wchar.h>
static WINSTATUS static WINTUN_STATUS
OpenKeyWait(_In_ HKEY Key, _Inout_z_ LPWSTR Path, _In_ DWORD Access, _In_ ULONGLONG Deadline, _Out_ HKEY *KeyOut) OpenKeyWait(_In_ HKEY Key, _Inout_z_ LPWSTR Path, _In_ DWORD Access, _In_ ULONGLONG Deadline, _Out_ HKEY *KeyOut)
{ {
DWORD Result; DWORD Result;
@ -65,7 +65,7 @@ OpenKeyWait(_In_ HKEY Key, _Inout_z_ LPWSTR Path, _In_ DWORD Access, _In_ ULONGL
* *
* @return ERROR_SUCCESS on success; WAIT_TIMEOUT on timeout; error code otherwise * @return ERROR_SUCCESS on success; WAIT_TIMEOUT on timeout; error code otherwise
*/ */
WINSTATUS WINTUN_STATUS
RegistryOpenKeyWait( RegistryOpenKeyWait(
_In_ HKEY Key, _In_ HKEY Key,
_In_z_count_c_(MAX_PATH) LPCWSTR Path, _In_z_count_c_(MAX_PATH) LPCWSTR Path,
@ -78,7 +78,7 @@ RegistryOpenKeyWait(
return OpenKeyWait(Key, Buf, Access, GetTickCount64() + Timeout, KeyOut); return OpenKeyWait(Key, Buf, Access, GetTickCount64() + Timeout, KeyOut);
} }
WINSTATUS WINTUN_STATUS
RegistryWaitForKey(_In_ HKEY Key, _In_z_count_c_(MAX_PATH) LPCWSTR Path, _In_ DWORD Timeout) RegistryWaitForKey(_In_ HKEY Key, _In_z_count_c_(MAX_PATH) LPCWSTR Path, _In_ DWORD Timeout)
{ {
HKEY k; HKEY k;
@ -104,7 +104,7 @@ RegistryWaitForKey(_In_ HKEY Key, _In_z_count_c_(MAX_PATH) LPCWSTR Path, _In_ DW
* *
* @return ERROR_SUCCESS on success; Win32 error code otherwise * @return ERROR_SUCCESS on success; Win32 error code otherwise
*/ */
WINSTATUS WINTUN_STATUS
RegistryGetString(_Inout_ LPWSTR *Buf, _In_ DWORD Len, _In_ DWORD ValueType) RegistryGetString(_Inout_ LPWSTR *Buf, _In_ DWORD Len, _In_ DWORD ValueType)
{ {
HANDLE Heap = GetProcessHeap(); HANDLE Heap = GetProcessHeap();
@ -168,7 +168,7 @@ RegistryGetString(_Inout_ LPWSTR *Buf, _In_ DWORD Len, _In_ DWORD ValueType)
* *
* @return ERROR_SUCCESS on success; Win32 error code otherwise * @return ERROR_SUCCESS on success; Win32 error code otherwise
*/ */
WINSTATUS WINTUN_STATUS
RegistryGetMultiString(_Inout_ LPWSTR *Buf, _In_ DWORD Len, _In_ DWORD ValueType) RegistryGetMultiString(_Inout_ LPWSTR *Buf, _In_ DWORD Len, _In_ DWORD ValueType)
{ {
HANDLE Heap = GetProcessHeap(); HANDLE Heap = GetProcessHeap();
@ -241,7 +241,7 @@ RegistryGetMultiString(_Inout_ LPWSTR *Buf, _In_ DWORD Len, _In_ DWORD ValueType
* *
* @return ERROR_SUCCESS on success; Win32 error code otherwise * @return ERROR_SUCCESS on success; Win32 error code otherwise
*/ */
static WINSTATUS static WINTUN_STATUS
RegistryQuery( RegistryQuery(
_In_ HKEY Key, _In_ HKEY Key,
_In_opt_z_ LPCWSTR Name, _In_opt_z_ LPCWSTR Name,
@ -279,7 +279,7 @@ RegistryQuery(
* *
* @return ERROR_SUCCESS on success; Win32 error code otherwise * @return ERROR_SUCCESS on success; Win32 error code otherwise
*/ */
WINSTATUS WINTUN_STATUS
RegistryQueryString(_In_ HKEY Key, _In_opt_z_ LPCWSTR Name, _Out_ LPWSTR *Value) RegistryQueryString(_In_ HKEY Key, _In_opt_z_ LPCWSTR Name, _Out_ LPWSTR *Value)
{ {
DWORD ValueType, Size = 256 * sizeof(WCHAR); DWORD ValueType, Size = 256 * sizeof(WCHAR);
@ -318,7 +318,7 @@ RegistryQueryString(_In_ HKEY Key, _In_opt_z_ LPCWSTR Name, _Out_ LPWSTR *Value)
* *
* @return ERROR_SUCCESS on success; Win32 error code otherwise * @return ERROR_SUCCESS on success; Win32 error code otherwise
*/ */
WINSTATUS WINTUN_STATUS
RegistryQueryStringWait(_In_ HKEY Key, _In_opt_z_ LPCWSTR Name, _In_ DWORD Timeout, _Out_ LPWSTR *Value) RegistryQueryStringWait(_In_ HKEY Key, _In_opt_z_ LPCWSTR Name, _In_ DWORD Timeout, _Out_ LPWSTR *Value)
{ {
DWORD Result; DWORD Result;
@ -356,7 +356,7 @@ RegistryQueryStringWait(_In_ HKEY Key, _In_opt_z_ LPCWSTR Name, _In_ DWORD Timeo
* *
* @return ERROR_SUCCESS on success; Win32 error code otherwise * @return ERROR_SUCCESS on success; Win32 error code otherwise
*/ */
WINSTATUS WINTUN_STATUS
RegistryQueryDWORD(_In_ HKEY Key, _In_opt_z_ LPCWSTR Name, _Out_ DWORD *Value) RegistryQueryDWORD(_In_ HKEY Key, _In_opt_z_ LPCWSTR Name, _Out_ DWORD *Value)
{ {
DWORD ValueType, Size = sizeof(DWORD); DWORD ValueType, Size = sizeof(DWORD);
@ -384,7 +384,7 @@ RegistryQueryDWORD(_In_ HKEY Key, _In_opt_z_ LPCWSTR Name, _Out_ DWORD *Value)
* *
* @return ERROR_SUCCESS on success; Win32 error code otherwise * @return ERROR_SUCCESS on success; Win32 error code otherwise
*/ */
WINSTATUS WINTUN_STATUS
RegistryQueryDWORDWait(_In_ HKEY Key, _In_opt_z_ LPCWSTR Name, _In_ DWORD Timeout, _Out_ DWORD *Value) RegistryQueryDWORDWait(_In_ HKEY Key, _In_opt_z_ LPCWSTR Name, _In_ DWORD Timeout, _Out_ DWORD *Value)
{ {
DWORD Result; DWORD Result;