wintun/api/driver.h
Simon Rozman e157d421ec api: implement driver version extraction from .inf file
With installer.dll the installer did the decision whether to install or
upgrade the driver according to installer.dll version and hash stored in
registry by MSM.

With wintun.dll we need to know, which version of Wintun driver we are
packing in the resources to decide about driver upgrade. The most
accurate source of the driver version is the DriverVer directive in
[Version] section of the driver's .inf file.

Signed-off-by: Simon Rozman <simon@rozman.si>
2020-10-30 16:51:00 +01:00

33 lines
862 B
C

/* SPDX-License-Identifier: GPL-2.0
*
* Copyright (C) 2018-2020 WireGuard LLC. All Rights Reserved.
*/
#pragma once
#include "api.h"
#include <Windows.h>
#include <SetupAPI.h>
#define WINTUN_HWID L"Wintun"
_Return_type_success_(return != NULL) SP_DRVINFO_DETAIL_DATA_W *DriverGetDrvInfoDetail(
_In_ HDEVINFO DevInfo,
_In_opt_ SP_DEVINFO_DATA *DevInfoData,
_In_ SP_DRVINFO_DATA_W *DrvInfoData);
BOOL
DriverIsWintunAdapter(_In_ HDEVINFO DevInfo, _In_opt_ SP_DEVINFO_DATA *DevInfoData);
_Return_type_success_(return != INVALID_HANDLE_VALUE) HANDLE
DriverGetAdapterDeviceObject(_In_opt_z_ const WCHAR *InstanceId);
#if defined(HAVE_EV) || defined(HAVE_WHQL)
WINTUN_STATUS DriverGetVersion(_Out_ FILETIME *DriverDate, _Out_ DWORDLONG *DriverVersion);
WINTUN_STATUS DriverInstallOrUpdate(VOID);
WINTUN_STATUS DriverUninstall(VOID);
#endif