From patchwork Tue Feb 20 18:38:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selva Nair X-Patchwork-Id: 239 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director11.mail.ord1d.rsapps.net ([172.28.255.1]) by backend30.mail.ord1d.rsapps.net (Dovecot) with LMTP id HEDVAnWqjVquVgAAIUCqbw for ; Wed, 21 Feb 2018 12:20:53 -0500 Received: from director6.mail.ord1c.rsapps.net ([172.28.255.1]) by director11.mail.ord1d.rsapps.net (Dovecot) with LMTP id o3YHEnWqjVp+MAAAvGGmqA ; Wed, 21 Feb 2018 12:20:53 -0500 Received: from smtp35.gate.ord1a ([172.28.255.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by director6.mail.ord1c.rsapps.net (Dovecot) with LMTP id 8KBsIHWqjVqoDQAA5akwjA ; Wed, 21 Feb 2018 12:20:53 -0500 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: smtp35.gate.ord1a.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-Classification-ID: 9092377e-172b-11e8-928d-001ec9f75e70-1-1 Received: from [216.105.38.7] ([216.105.38.7:15268] helo=lists.sourceforge.net) by smtp35.gate.ord1a.rsapps.net (envelope-from ) (ecelerity 4.2.1.56364 r(Core:4.2.1.14)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id F5/5D-19324-37AAD8A5; Wed, 21 Feb 2018 12:20:52 -0500 Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.89) (envelope-from ) id 1eoY3w-000ANC-9a; Wed, 21 Feb 2018 17:20:12 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89) (envelope-from ) id 1eoY1h-000ADn-K0 for openvpn-devel@lists.sourceforge.net; Wed, 21 Feb 2018 17:17:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:Cc:To:From:Resent-To: Resent-Message-ID:Resent-Date:Resent-From:Sender:Reply-To:MIME-Version: Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Sender:Resent-Cc:In-Reply-To:References:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=U1ZUfiZG++LgzIi4+SdF1pnoI19EObrA7wP3OsxeW98=; b=C7mNkWq7vghvad0gOiakIYr1+V MahaLrRszfNj2eYWW5K0hpVTxSjuCa5M3Uq44QoHIIdxI/U/0/W8Vb2wzBlxpyl+twHFsMwjD7xz9 KUgc1i83JamQtrwzaul1KDorpE9dGCAZ0WoaiDAkwgKhXOAKDgx2QdWQFuAe4CJFol5A=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Message-Id:Date:Subject:Cc:To:From:Resent-To:Resent-Message-ID: Resent-Date:Resent-From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Sender: Resent-Cc:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=U1ZUfiZG++LgzIi4+SdF1pnoI19EObrA7wP3OsxeW98=; b=Wv5TxwDoc17q5mrjFzEu7Av9VM ptBko7iC4YPBcPVBRFD9msByL3BGooy82BZaCglzs+0rWK9NxmVY45H1WtCW000eAqie/h6Z/W8ai /olNJb/oroidBJW/OewRFeq6bbTh8fvuQMppkKtY266uHbDddVhEdeZr31nWyX8OXg6I=; Received: from sfi-lb-mx.v20.lw.sourceforge.com ([172.30.20.201] helo=mail-io0-f172.google.com) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.89) id 1eoY1h-000AKW-HZ for openvpn-devel@lists.sourceforge.net; Wed, 21 Feb 2018 17:17:53 +0000 Received: by mail-io0-f172.google.com with SMTP id m22so2883978iob.12 for ; Wed, 21 Feb 2018 09:17:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=resent-from:resent-date:resent-message-id:resent-to:from:to:cc :subject:date:message-id; bh=U1ZUfiZG++LgzIi4+SdF1pnoI19EObrA7wP3OsxeW98=; b=D7EHuvMzQQ5rtL9/dn8Hb1/z0b6JpcQqZ6p2CrhV5AgSmkjjFXUArn7Nwo4bmRN0QU QOT72y/RjeG1FjyPzx0qXNvIIosz41lQwXrBuf43JqEvnuXU5DPv9/OEr/QuP3f9I13w sHiF/3Hts7SChKOzy4lNLKMPPzWQFZZy5yGw7B6NRhHKJU/hDid2+5iqa3dGXGv04/PF g7sVH9kYP6vmflHZWdWRQ6jCzA9PispaW8rIhR8scSkEvkGau+iNI1VIeNp9RD1IKkU2 J1zM6EaEBJc7H9W8loq8P/pYIdnxm98xSlqhyyprlFHxKoO2JUxJsb6MckkdzPo1BKBU LVuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:resent-from:resent-date:resent-message-id :resent-to:from:to:cc:subject:date:message-id; bh=U1ZUfiZG++LgzIi4+SdF1pnoI19EObrA7wP3OsxeW98=; b=FPmYEtmVJy2uDta++jrn5lm5QI9Nuin3Jdwru7m0fwlsLRPg1Bp29FOSHmdL7rUo3+ qWOzE2anOGTHklUfpNurmGCS4sz8xVlgDBM7LAitOCcvMYP2rA8m1N18KpQriGAypYxI yuhk5M+HOvk3ka8m8OaHV0LwTohdKwstv0j6Wpb2F7ChfDFSlzX8Bt+9gj96fGhemfbO ZTPedV8+qK00SG+U0IR5+fEBIOf+XU+GufVuPdbsdM6gX4DqAwtX1LdOUNOOdIExN7sw 32cens12LJBIwfgOcOWVkMxSJ1p94GGnRwFwvJ082QxsS1TPS8WGEmMo0TeqEGmMrxVs EZqQ== X-Gm-Message-State: APf1xPB/38QKjrxj4XBC+/ZX2NB20MqvPFQ75R+IuaxqnxxSc23aHeeq rAMWyqRC+D5Jktdn2lEU7sgPLUr/ X-Google-Smtp-Source: AH8x226hVbalhGxTYQwTIlSJnD8Gj/Xj+ssTYq9s1XYqAkUaj/uYJa7AUwToe27t5HnoRGNN4HSNgg== X-Received: by 10.107.168.25 with SMTP id r25mr5020971ioe.16.1519233472799; Wed, 21 Feb 2018 09:17:52 -0800 (PST) Received: from saturn.home.sansel.ca (CPE40167ea0e1c2-CM788df74daaa0.cpe.net.cable.rogers.com. [99.228.215.92]) by smtp.gmail.com with ESMTPSA id b123sm15975014iti.22.2018.02.21.09.17.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 09:17:52 -0800 (PST) Resent-From: Selva Nair Resent-Date: Wed, 21 Feb 2018 12:17:50 -0500 Resent-Message-ID: <20180221171750.GA5755@saturn.home.sansel.ca> Resent-To: openvpn-devel@lists.sourceforge.net Received: from saturn.home.sansel.ca (CPE40167ea0e1c2-CM788df74daaa0.cpe.net.cable.rogers.com. [99.228.215.92]) by smtp.gmail.com with ESMTPSA id m32sm862552iti.33.2018.02.20.21.38.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Feb 2018 21:38:37 -0800 (PST) From: selva.nair@gmail.com To: openvpn-devel@lists.sourceforge.net Date: Wed, 21 Feb 2018 00:38:30 -0500 Message-Id: <1519191510-3826-1-git-send-email-selva.nair@gmail.com> X-Mailer: git-send-email 2.1.4 Subject: [Openvpn-devel] [PATCH] Adapt to RegGetValue brokenness in Windows 7 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 Sender: "Openvpn-devel" X-getmail-retrieved-from-mailbox: Inbox From: Selva Nair - RegGetValue with flags = RRF_RT_REG_SZ|RRF_RT_REG_EXPAND_SZ fails in Windows 7 with an "invalid parameter" error. Fix by using RRF_RT_REG_SZ alone. Note: This is not a regression as in no released version did the service support expandable strings (ones with embedded %FOO%) in the registry. However, the GUI does expand such strings. The two can be made consistent by explicitly expanding the strings -- that is left for a future patch. Signed-off-by: Selva Nair Acked-by: Gert Doering --- src/openvpnserv/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpnserv/common.c b/src/openvpnserv/common.c index 6c29f57..dc47666 100644 --- a/src/openvpnserv/common.c +++ b/src/openvpnserv/common.c @@ -59,7 +59,7 @@ openvpn_sntprintf(LPTSTR str, size_t size, LPCTSTR format, ...) static DWORD GetRegString(HKEY key, LPCTSTR value, LPTSTR data, DWORD size, LPCTSTR default_value) { - LONG status = RegGetValue(key, NULL, value, RRF_RT_REG_SZ|RRF_RT_REG_EXPAND_SZ, + LONG status = RegGetValue(key, NULL, value, RRF_RT_REG_SZ, NULL, (LPBYTE) data, &size); if (status == ERROR_FILE_NOT_FOUND && default_value)