From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59228) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zyx7R-0006Ja-58 for qemu-devel@nongnu.org; Wed, 18 Nov 2015 02:25:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zyx7O-0001Kb-0E for qemu-devel@nongnu.org; Wed, 18 Nov 2015 02:25:29 -0500 Received: from smtp.mail.uni-mannheim.de ([134.155.96.80]:53734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zyx7N-0001KU-Q6 for qemu-devel@nongnu.org; Wed, 18 Nov 2015 02:25:25 -0500 References: <1447787363-15216-1-git-send-email-Andrew.Baumann@microsoft.com> <1447787363-15216-2-git-send-email-Andrew.Baumann@microsoft.com> From: Stefan Weil Message-ID: <564C27E6.5070600@weilnetz.de> Date: Wed, 18 Nov 2015 08:25:26 +0100 MIME-Version: 1.0 In-Reply-To: <1447787363-15216-2-git-send-email-Andrew.Baumann@microsoft.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] tap-win32: skip unexpected nodes during registry enumeration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andrew Baumann , qemu-devel@nongnu.org Cc: Jason Wang Am 17.11.2015 um 20:09 schrieb 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 > --- > 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)) { Good catch! Reviewed-by: Stefan Weil