From patchwork Sun Sep 22 23:08:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lev Stipakov X-Patchwork-Id: 833 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director11.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id 4DC3GfaLiF1nFAAAIUCqbw for ; Mon, 23 Sep 2019 05:10:14 -0400 Received: from proxy4.mail.ord1d.rsapps.net ([172.30.191.6]) by director11.mail.ord1d.rsapps.net with LMTP id sFiIGfaLiF2RHwAAvGGmqA ; Mon, 23 Sep 2019 05:10:14 -0400 Received: from smtp27.gate.ord1c ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy4.mail.ord1d.rsapps.net with LMTP id SAdMGfaLiF30egAAiYrejw ; Mon, 23 Sep 2019 05:10:14 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp27.gate.ord1c.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Suspicious-Flag: YES X-Classification-ID: f32bf978-dde1-11e9-afa2-b8ca3a655ab8-1-1 Received: from [216.105.38.7] ([216.105.38.7:53192] helo=lists.sourceforge.net) by smtp27.gate.ord1c.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id F4/DE-18643-5FB888D5; Mon, 23 Sep 2019 05:10:13 -0400 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1iCKKQ-00066O-Df; Mon, 23 Sep 2019 09:08:18 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1iCKKO-00065y-VZ for openvpn-devel@lists.sourceforge.net; Mon, 23 Sep 2019 09:08:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=+UAKf/cQig1Gs2tiuLzfIre6ZQTkDTVtQyrIqOn4IKs=; b=IiSw18PHhCV/JI6wgC2w14FZqw LQRw72x2D0nsDQuebghhH4xWHRV05+cA6+u2SH6DQeoSs2P4nu3BxLQRxg+pAic6Qk49BRMnXb2Vt MfaOvLbt3KYLKWEyyrpjZbSV09x6kI4tCQ7sxfTnn9Pt3yOJhyHvEY6bxgV1ulo+yisA=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:MIME-Version: Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=+UAKf/cQig1Gs2tiuLzfIre6ZQTkDTVtQyrIqOn4IKs=; b=Df/zXbcYy+JWt4V37zO7NE97t8 Sqs/Jb0IXHJH/DLWfWpIp4Wn8pfVS5GbC46p4B9TISrWIdO4cEUnOshivdGdLMQk3qkFUClHIz5D9 wory8HdVvPUnRAj66b+uS4rdUZSOYiQnE1cDwCUi152dA/5SQlwKhrOJN/Fvv/BbyC54=; Received: from mail-ed1-f68.google.com ([209.85.208.68]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1iCKKL-003rMY-I8 for openvpn-devel@lists.sourceforge.net; Mon, 23 Sep 2019 09:08:16 +0000 Received: by mail-ed1-f68.google.com with SMTP id t3so12074883edw.13 for ; Mon, 23 Sep 2019 02:08:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=+UAKf/cQig1Gs2tiuLzfIre6ZQTkDTVtQyrIqOn4IKs=; b=mg+12OhknDX2eg5neheEyi4NFGE47B0Ym1ZkAn8DtRmHjt608alLoAfxZM77Vgk6FM lpIQ88r0G+4HSQfDduGVnrW0uQyaiWFJ1pZBBXe8LSLCkK52N2ixQ6LQ6z4wZ7D1iRFj iqodX7P52XcA0pSH2jLRfr5+67cl3SY+lXslYDk3WCTQX215TjyFKw1YqxEvadndsvd8 Kvgrd6AmeqJdm+N7uMtY/Fn/NRXIXAsZvj8pFYzn1V/6WvyIwlmXN5Ridtq4eUN2Zpak XOkKQ3IqD6lxKzaHtSpFSKJbAlLsZ9xwpSEbyWgWJq00eQtgrR9JeCNItW/IO9kbu9Ul Mohw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=+UAKf/cQig1Gs2tiuLzfIre6ZQTkDTVtQyrIqOn4IKs=; b=ez4uD791cAXbPDs05/pP2OzVKKktPbZ9TAU+QEvNEBOZnWWDIeAAaCjVYYna2DIHxC jhnzWz/zxg6hB2swdnTZrUlBLhAXB9MhDdkbwWg3ldUWPkS7Z1dmTK3/1nWF7HMsMzWa yMuOUI21AcTwyLlfcjFuFIH2Ai9FVBL1ZyxtLlWKfepHOetlDJFZ/HIk2uAtRpClYAXv PY3gAFp1LuUPgdE+kpUP7lMyB7TRmy2GkkB4HZM/W59Kgy958svsdmJEDrTsVmRhOPF1 JEijL3o5kAItWR5KWrlCYxnn2gTg73vt+EZzamMSwEnK6Nx7kIq3nW0z0o+h+3dnKqLm xk8w== X-Gm-Message-State: APjAAAX5lfojrSQKU1mUi7KXEVn+eRDhjsSvkSo+xIYQ76wGwnZoAisl 92LRoYv3JQvAH+N8cFi5JJiUY3+Gl9E= X-Google-Smtp-Source: APXvYqxN+s8v71jrCvG6k+Owt7BX8TeZE/sTIaO1BjNMpvC1DBThxdAZxtC7dgtetH3T9/tlfu3Yng== X-Received: by 2002:a50:a7c4:: with SMTP id i62mr34778730edc.92.1569229686476; Mon, 23 Sep 2019 02:08:06 -0700 (PDT) Received: from stipakov.fi (stipakov.fi. [128.199.52.117]) by smtp.gmail.com with ESMTPSA id k40sm2236143ede.22.2019.09.23.02.08.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Sep 2019 02:08:05 -0700 (PDT) From: Lev Stipakov To: openvpn-devel@lists.sourceforge.net Date: Mon, 23 Sep 2019 12:08:02 +0300 Message-Id: <1569229682-9731-1-git-send-email-lstipakov@gmail.com> X-Mailer: git-send-email 2.7.4 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.208.68 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (lstipakov[at]gmail.com) -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.208.68 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1iCKKL-003rMY-I8 Subject: [Openvpn-devel] [PATCH] tapctl: add optional "hardware id" parameter X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox From: Lev Stipakov If parameter is not specified, default value "root\tap0901" is used. This enables tapctl to work with different tun drivers, like "tapoas" (from OpenVPN Connect) or "wintun". Signed-off-by: Lev Stipakov Acked-by: Simon Rozman --- src/openvpnmsica/msica_op.c | 10 +++++----- src/openvpnmsica/openvpnmsica.c | 2 +- src/tapctl/main.c | 37 +++++++++++++++++++++++++++++++++---- src/tapctl/tap.c | 24 ++++++++++++++++++------ src/tapctl/tap.h | 10 ++++++++++ 5 files changed, 67 insertions(+), 16 deletions(-) diff --git a/src/openvpnmsica/msica_op.c b/src/openvpnmsica/msica_op.c index 3b9878d..63aa6c8 100644 --- a/src/openvpnmsica/msica_op.c +++ b/src/openvpnmsica/msica_op.c @@ -446,7 +446,7 @@ msica_op_tap_interface_create_exec( /* Get all available network interfaces. */ struct tap_interface_node *pInterfaceList = NULL; - DWORD dwResult = tap_list_interfaces(NULL, &pInterfaceList, TRUE); + DWORD dwResult = tap_list_interfaces(NULL, NULL, &pInterfaceList, TRUE); if (dwResult == ERROR_SUCCESS) { /* Does interface exist? */ @@ -457,7 +457,7 @@ msica_op_tap_interface_create_exec( /* No interface with a same name found. Create one. */ BOOL bRebootRequired = FALSE; GUID guidInterface; - dwResult = tap_create_interface(NULL, NULL, &bRebootRequired, &guidInterface); + dwResult = tap_create_interface(NULL, NULL, NULL, &bRebootRequired, &guidInterface); if (dwResult == ERROR_SUCCESS) { /* Set interface name. */ @@ -601,7 +601,7 @@ msica_op_tap_interface_delete_by_name_exec( /* Get available TUN/TAP interfaces. */ struct tap_interface_node *pInterfaceList = NULL; - DWORD dwResult = tap_list_interfaces(NULL, &pInterfaceList, FALSE); + DWORD dwResult = tap_list_interfaces(NULL, NULL, &pInterfaceList, FALSE); if (dwResult == ERROR_SUCCESS) { /* Does interface exist? */ @@ -659,7 +659,7 @@ msica_op_tap_interface_delete_by_guid_exec( /* Get all available interfaces. */ struct tap_interface_node *pInterfaceList = NULL; - DWORD dwResult = tap_list_interfaces(NULL, &pInterfaceList, TRUE); + DWORD dwResult = tap_list_interfaces(NULL, NULL, &pInterfaceList, TRUE); if (dwResult == ERROR_SUCCESS) { /* Does interface exist? */ @@ -718,7 +718,7 @@ msica_op_tap_interface_set_name_exec( /* Get all available network interfaces. */ struct tap_interface_node *pInterfaceList = NULL; - DWORD dwResult = tap_list_interfaces(NULL, &pInterfaceList, TRUE); + DWORD dwResult = tap_list_interfaces(NULL, NULL, &pInterfaceList, TRUE); if (dwResult == ERROR_SUCCESS) { /* Does interface exist? */ diff --git a/src/openvpnmsica/openvpnmsica.c b/src/openvpnmsica/openvpnmsica.c index f5ad229..16381ea 100644 --- a/src/openvpnmsica/openvpnmsica.c +++ b/src/openvpnmsica/openvpnmsica.c @@ -478,7 +478,7 @@ FindTAPInterfaces(_In_ MSIHANDLE hInstall) /* Get all TUN/TAP network interfaces. */ struct tap_interface_node *pInterfaceList = NULL; - uiResult = tap_list_interfaces(NULL, &pInterfaceList, FALSE); + uiResult = tap_list_interfaces(NULL, NULL, &pInterfaceList, FALSE); if (uiResult != ERROR_SUCCESS) { goto cleanup_CoInitialize; diff --git a/src/tapctl/main.c b/src/tapctl/main.c index 04c03dd..bf21586 100644 --- a/src/tapctl/main.c +++ b/src/tapctl/main.c @@ -81,7 +81,9 @@ static const TCHAR usage_message_create[] = TEXT(" specified, a default interface name is chosen by Windows. \n") TEXT(" Note: This name can also be specified as OpenVPN's --dev-node \n") TEXT(" option. \n") - TEXT("\n") + TEXT("--hwid Interface hardware id. Default value is root\\tap0901, which \n") + TEXT(" describes tap-windows6 driver. To work with wintun driver, \n") + TEXT(" specify 'wintun'. \n") TEXT("Output:\n") TEXT("\n") TEXT("This command prints newly created TUN/TAP interface's GUID to stdout. \n") @@ -96,6 +98,11 @@ static const TCHAR usage_message_list[] = TEXT("\n") TEXT("tapctl list\n") TEXT("\n") + TEXT("Options:\n") + TEXT("\n") + TEXT("--hwid Interface hardware id. Default value is root\\tap0901, which \n") + TEXT(" describes tap-windows6 driver. To work with wintun driver, \n") + TEXT(" specify 'wintun'. \n") TEXT("Output:\n") TEXT("\n") TEXT("This command prints all TUN/TAP interfaces to stdout. \n") @@ -170,6 +177,7 @@ _tmain(int argc, LPCTSTR argv[]) else if (_tcsicmp(argv[1], TEXT("create")) == 0) { LPCTSTR szName = NULL; + LPCTSTR szHwId = NULL; /* Parse options. */ for (int i = 2; i < argc; i++) @@ -179,6 +187,11 @@ _tmain(int argc, LPCTSTR argv[]) szName = argv[++i]; } else + if (_tcsicmp(argv[i], TEXT("--hwid")) == 0) + { + szHwId = argv[++i]; + } + else { _ftprintf(stderr, TEXT("Unknown option \"%s\". Please, use \"tapctl help create\" to list supported options. Ignored.\n"), argv[i]); } @@ -190,6 +203,7 @@ _tmain(int argc, LPCTSTR argv[]) DWORD dwResult = tap_create_interface( NULL, TEXT("Virtual Ethernet"), + szHwId, &bRebootRequired, &guidInterface); if (dwResult != ERROR_SUCCESS) @@ -202,7 +216,7 @@ _tmain(int argc, LPCTSTR argv[]) { /* Get the list of all available interfaces. */ struct tap_interface_node *pInterfaceList = NULL; - dwResult = tap_list_interfaces(NULL, &pInterfaceList, TRUE); + dwResult = tap_list_interfaces(NULL, szHwId, &pInterfaceList, TRUE); if (dwResult != ERROR_SUCCESS) { _ftprintf(stderr, TEXT("Enumerating interfaces failed (error 0x%x).\n"), dwResult); @@ -257,9 +271,24 @@ create_delete_interface: } else if (_tcsicmp(argv[1], TEXT("list")) == 0) { + LPCTSTR szHwId = NULL; + + /* Parse options. */ + for (int i = 2; i < argc; i++) + { + if (_tcsicmp(argv[i], TEXT("--hwid")) == 0) + { + szHwId = argv[++i]; + } + else + { + _ftprintf(stderr, TEXT("Unknown option \"%s\". Please, use \"tapctl help list\" to list supported options. Ignored.\n"), argv[i]); + } + } + /* Output list of TUN/TAP interfaces. */ struct tap_interface_node *pInterfaceList = NULL; - DWORD dwResult = tap_list_interfaces(NULL, &pInterfaceList, FALSE); + DWORD dwResult = tap_list_interfaces(NULL, szHwId, &pInterfaceList, FALSE); if (dwResult != ERROR_SUCCESS) { _ftprintf(stderr, TEXT("Enumerating TUN/TAP interfaces failed (error 0x%x).\n"), dwResult); @@ -290,7 +319,7 @@ create_delete_interface: { /* The argument failed to covert to GUID. Treat it as the interface name. */ struct tap_interface_node *pInterfaceList = NULL; - DWORD dwResult = tap_list_interfaces(NULL, &pInterfaceList, FALSE); + DWORD dwResult = tap_list_interfaces(NULL, NULL, &pInterfaceList, FALSE); if (dwResult != ERROR_SUCCESS) { _ftprintf(stderr, TEXT("Enumerating TUN/TAP interfaces failed (error 0x%x).\n"), dwResult); diff --git a/src/tapctl/tap.c b/src/tapctl/tap.c index e75db35..464ce72 100644 --- a/src/tapctl/tap.c +++ b/src/tapctl/tap.c @@ -41,7 +41,7 @@ const static GUID GUID_DEVCLASS_NET = { 0x4d36e972L, 0xe325, 0x11ce, { 0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18 } }; -const static TCHAR szzHardwareIDs[] = TEXT("root\\") TEXT(TAP_WIN_COMPONENT_ID) TEXT("\0"); +const static TCHAR szzDefaultHardwareIDs[] = TEXT("root\\") TEXT(TAP_WIN_COMPONENT_ID) TEXT("\0"); const static TCHAR szInterfaceRegKeyPathTemplate[] = TEXT("SYSTEM\\CurrentControlSet\\Control\\Network\\%") TEXT(PRIsLPOLESTR) TEXT("\\%") TEXT(PRIsLPOLESTR) TEXT("\\Connection"); #define INTERFACE_REGKEY_PATH_MAX (_countof(TEXT("SYSTEM\\CurrentControlSet\\Control\\Network\\")) - 1 + 38 + _countof(TEXT("\\")) - 1 + 38 + _countof(TEXT("\\Connection"))) @@ -448,6 +448,7 @@ DWORD tap_create_interface( _In_opt_ HWND hwndParent, _In_opt_ LPCTSTR szDeviceDescription, + _In_opt_ LPCTSTR szHwId, _Inout_ LPBOOL pbRebootRequired, _Out_ LPGUID pguidInterface) { @@ -459,6 +460,11 @@ tap_create_interface( return ERROR_BAD_ARGUMENTS; } + if (szHwId == NULL) + { + szHwId = szzDefaultHardwareIDs; + } + /* Create an empty device info set for network adapter device class. */ HDEVINFO hDevInfoList = SetupDiCreateDeviceInfoList(&GUID_DEVCLASS_NET, hwndParent); if (hDevInfoList == INVALID_HANDLE_VALUE) @@ -512,7 +518,7 @@ tap_create_interface( hDevInfoList, &devinfo_data, SPDRP_HARDWAREID, - (const BYTE *)szzHardwareIDs, sizeof(szzHardwareIDs))) + (const BYTE *)szHwId, (DWORD)((_tcslen(szHwId) + 1) * sizeof(TCHAR)))) { dwResult = GetLastError(); msg(M_NONFATAL, "%s: SetupDiSetDeviceRegistryProperty failed", __FUNCTION__); @@ -616,7 +622,7 @@ tap_create_interface( /* Search the list of hardware IDs. */ for (LPTSTR szHwdID = drvinfo_detail_data->HardwareID; szHwdID && szHwdID[0]; szHwdID += _tcslen(szHwdID) + 1) { - if (_tcsicmp(szHwdID, szzHardwareIDs) == 0) + if (_tcsicmp(szHwdID, szHwId) == 0) { /* Matching hardware ID found. Select the driver. */ if (!SetupDiSetSelectedDriver( @@ -643,7 +649,7 @@ tap_create_interface( if (dwlDriverVersion == 0) { dwResult = ERROR_NOT_FOUND; - msg(M_NONFATAL, "%s: No driver for device \"%" PRIsLPTSTR "\" installed.", __FUNCTION__, szzHardwareIDs); + msg(M_NONFATAL, "%s: No driver for device \"%" PRIsLPTSTR "\" installed.", __FUNCTION__, szHwId); goto cleanup_DriverInfoList; } @@ -953,6 +959,7 @@ cleanup_szInterfaceId: DWORD tap_list_interfaces( _In_opt_ HWND hwndParent, + _In_opt_ LPCTSTR szHwId, _Out_ struct tap_interface_node **ppInterface, _In_ BOOL bAll) { @@ -963,6 +970,11 @@ tap_list_interfaces( return ERROR_BAD_ARGUMENTS; } + if (szHwId == NULL) + { + szHwId = szzDefaultHardwareIDs; + } + /* Create a list of network devices. */ HDEVINFO hDevInfoList = SetupDiGetClassDevsEx( &GUID_DEVCLASS_NET, @@ -1034,7 +1046,7 @@ tap_list_interfaces( /* Check that hardware ID is REG_SZ/REG_MULTI_SZ, and optionally if it matches ours. */ if (dwDataType == REG_SZ) { - if (!bAll && _tcsicmp(szzDeviceHardwareIDs, szzHardwareIDs) != 0) + if (!bAll && _tcsicmp(szzDeviceHardwareIDs, szHwId) != 0) { /* This is not our device. Skip it. */ goto cleanup_szzDeviceHardwareIDs; @@ -1051,7 +1063,7 @@ tap_list_interfaces( /* This is not our device. Skip it. */ goto cleanup_szzDeviceHardwareIDs; } - else if (_tcsicmp(szHwdID, szzHardwareIDs) == 0) + else if (_tcsicmp(szHwdID, szHwId) == 0) { /* This is our device. */ break; diff --git a/src/tapctl/tap.h b/src/tapctl/tap.h index 2437d05..f74a39d 100644 --- a/src/tapctl/tap.h +++ b/src/tapctl/tap.h @@ -37,6 +37,10 @@ * @param szDeviceDescription A pointer to a NULL-terminated string that supplies the text * description of the device. This pointer is optional and can be NULL. * + * @param szHwId A pointer to a NULL-terminated string that supplies the hardware id + * of the device. This pointer is optional and can be NULL. Default value + * is root\tap0901. + * * @param pbRebootRequired A pointer to a BOOL flag. If the interface installation requires * a system restart, this flag is set to TRUE. Otherwise, the flag is * left unmodified. This allows the flag to be globally initialized to @@ -50,6 +54,7 @@ DWORD tap_create_interface( _In_opt_ HWND hwndParent, _In_opt_ LPCTSTR szDeviceDescription, + _In_opt_ LPCTSTR szHwId, _Inout_ LPBOOL pbRebootRequired, _Out_ LPGUID pguidInterface); @@ -116,6 +121,10 @@ struct tap_interface_node * and can be NULL. If a specific top-level window is not required, set * hwndParent to NULL. * + * @param szHwId A pointer to a NULL-terminated string that supplies the hardware id + * of the device. This pointer is optional and can be NULL. Default value + * is root\tap0901. + * * @param ppInterfaceList A pointer to the list to receive pointer to the first interface in * the list. After the list is no longer required, free it using * tap_free_interface_list(). @@ -128,6 +137,7 @@ struct tap_interface_node DWORD tap_list_interfaces( _In_opt_ HWND hwndParent, + _In_opt_ LPCTSTR szHwId, _Out_ struct tap_interface_node **ppInterfaceList, _In_ BOOL bAll);