From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz8fw-0008C5-Nw for qemu-devel@nongnu.org; Wed, 18 Nov 2015 14:45:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zz8ft-0008NF-HP for qemu-devel@nongnu.org; Wed, 18 Nov 2015 14:45:52 -0500 Received: from mail-bl2on0124.outbound.protection.outlook.com ([65.55.169.124]:34336 helo=na01-bl2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz8ft-0008N8-DG for qemu-devel@nongnu.org; Wed, 18 Nov 2015 14:45:49 -0500 From: Andrew Baumann Date: Wed, 18 Nov 2015 11:45:08 -0800 Message-ID: <1447875909-14632-2-git-send-email-Andrew.Baumann@microsoft.com> In-Reply-To: <1447875909-14632-1-git-send-email-Andrew.Baumann@microsoft.com> References: <1447875909-14632-1-git-send-email-Andrew.Baumann@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH v2 1/2] tap-win32: skip unexpected nodes during registry enumeration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Stefan Weil , Jason Wang , Andrew Baumann In order to find a named tap device, get_device_guid() enumerates children of HKLM\SYSTEM\CCS\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318} (aka NETWORK_CONNECTIONS_KEY). For each child, it then looks for a "Connection" subkey, but if this key doesn't exist, it aborts the entire search. This was observed to fail on at least one Windows 10 machine, where there is an additional child of NETWORK_CONNECTIONS_KEY (named "Descriptions"). Since registry enumeration doesn't guarantee any particular sort order, we should continue to search for matching children rather than aborting the search. Signed-off-by: Andrew Baumann Reviewed-by: Stefan Weil --- net/tap-win32.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/tap-win32.c b/net/tap-win32.c index 4e2fa55..5e5d6db 100644 --- a/net/tap-win32.c +++ b/net/tap-win32.c @@ -356,7 +356,8 @@ static int get_device_guid( &len); if (status != ERROR_SUCCESS || name_type != REG_SZ) { - return -1; + ++i; + continue; } else { if (is_tap_win32_dev(enum_name)) { -- 2.5.3