| Message ID | 20190101233547.10100-1-simon@rozman.si |
|---|---|
| State | Accepted |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net> Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director8.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id EA5gCaL5K1wPBAAAIUCqbw for <patchwork@openvpn.net>; Tue, 01 Jan 2019 18:37:06 -0500 Received: from proxy2.mail.ord1d.rsapps.net ([172.30.191.6]) by director8.mail.ord1d.rsapps.net with LMTP id cLoXCaL5K1xgZAAAfY0hYg ; Tue, 01 Jan 2019 18:37:06 -0500 Received: from smtp1.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy2.mail.ord1d.rsapps.net with LMTP id CNnyCKL5K1y9RQAAfawv4w ; Tue, 01 Jan 2019 18:37:06 -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: smtp1.gate.ord1d.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=rozman.si; dkim=fail (signature verification failed) header.d=rozman.si; dmarc=fail (p=none; dis=none) header.from=rozman.si X-Suspicious-Flag: YES X-Classification-ID: 254da3f0-0e1e-11e9-b121-5254002d775b-1-1 Received: from [216.105.38.7] ([216.105.38.7:16882] helo=lists.sourceforge.net) by smtp1.gate.ord1d.rsapps.net (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 68/28-25837-1A9FB2C5; Tue, 01 Jan 2019 18:37:05 -0500 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from <openvpn-devel-bounces@lists.sourceforge.net>) id 1geTa5-0001xv-NV; Tue, 01 Jan 2019 23:36:17 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from <simon@rozman.si>) id 1geTa4-0001xn-O2 for openvpn-devel@lists.sourceforge.net; Tue, 01 Jan 2019 23:36:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: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=zmUeGJe6xKVwkgT9RsCtCtcII78nunm+Bn1trUpCnx8=; b=TS5SiCMhGfI2gOq4O1DEpeMVL+ m42+QLDgF3l3/67hRw0AXUs6gnBcayrUM1KEawyaozHoccxcIAAFwyHlTg5SePWPDgbugikbk9gFl e0PjeJTd9cVI81LlOjAVj04jfjZycF82iofbdKoBmyU9Lse+7J5XaMl41IaeR12UUkMc=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type: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=zmUeGJe6xKVwkgT9RsCtCtcII78nunm+Bn1trUpCnx8=; b=W 703YuYUAGoDlKnUSED+daaqvk2PVYfoppS15DyDpTiW8y4vec8IfznofDHFyFCHoaf85zgKAgK38I DBLjicAX3hWmDK2qkm4EV6LWSrNldWx+v3qfkOV8UYF8N/Y87hyGDn3HfrcgUuBIxf5cKx6JrVuB5 KKkq3m8ApXBdOX6c=; Received: from pub5.amebis.si ([213.250.55.21]) by sfi-mx-4.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1geTa1-00AA0g-R6 for openvpn-devel@lists.sourceforge.net; Tue, 01 Jan 2019 23:36:16 +0000 Received: by pub5.amebis.si (Postfix, from userid 115) id CF08A202CF; Wed, 2 Jan 2019 00:36:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=rozman.si; s=default; t=1546385764; bh=XFxqYq9d4LqD+luKHobGGYl96sCWZ/+tA4Y7wB2aYgE=; h=From:To:Cc:Subject:Date:From; b=TV9ceJTwoGMte1ZZf+/CvIJvno3hoid2eY3pESIJjrWSh1nI0M1pd3yHbeMgmVvtp Rn1SyDwpIQecif6AF923DGzVx82o57RWXBd4b9BqAPDKSkWhylYo8P808phxAFdiEw 8i57f/jaOZyIHO/hLQYeAyiP7mPdjoLh2E4cWhhY= X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on brana.amebis.doma X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RDNS_NONE autolearn=no autolearn_force=no version=3.4.2 Received: from gw0.selo.doma (unknown [213.250.22.160]) by pub5.amebis.si (Postfix) with ESMTP id 1FE6C202CF; Wed, 2 Jan 2019 00:36:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=rozman.si; s=default; t=1546385764; bh=XFxqYq9d4LqD+luKHobGGYl96sCWZ/+tA4Y7wB2aYgE=; h=From:To:Cc:Subject:Date:From; b=TV9ceJTwoGMte1ZZf+/CvIJvno3hoid2eY3pESIJjrWSh1nI0M1pd3yHbeMgmVvtp Rn1SyDwpIQecif6AF923DGzVx82o57RWXBd4b9BqAPDKSkWhylYo8P808phxAFdiEw 8i57f/jaOZyIHO/hLQYeAyiP7mPdjoLh2E4cWhhY= Received: from s0.selo.doma (s0.selo.doma [IPv6:2a00:ee2:1206:8101::d]) by gw0.selo.doma (Postfix) with ESMTP id DE00C21B9829; Wed, 2 Jan 2019 00:36:03 +0100 (CET) From: Simon Rozman <simon@rozman.si> To: openvpn-devel@lists.sourceforge.net Date: Wed, 2 Jan 2019 00:35:47 +0100 Message-Id: <20190101233547.10100-1-simon@rozman.si> X-Mailer: git-send-email 2.19.0.windows.1 MIME-Version: 1.0 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 SPF_PASS SPF: sender matches 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 X-Headers-End: 1geTa1-00AA0g-R6 Subject: [Openvpn-devel] [PATCH] Strip _stdcall suffixes (@nn) for 32-bit builds X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: <openvpn-devel.lists.sourceforge.net> List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel> List-Post: <mailto:openvpn-devel@lists.sourceforge.net> List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>, <mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox |
| Series |
[Openvpn-devel] Strip _stdcall suffixes (@nn) for 32-bit builds
|
|
Commit Message
Simon Rozman
Jan. 1, 2019, 12:35 p.m. UTC
This makes DLL exported function names consistent between 32 and 64-bit
builds.
Signed-off-by: Simon Rozman <simon@rozman.si>
---
src/openvpnmsica/Makefile.am | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Comments
Acked-by: Gert Doering <gert@greenie.muc.de> You really do not like this calling convention, do you? ;-) - learned something new today, what "-Wl,--kill-at" does... (while the original round of stdcall discussion was MSVC, here's the mingw variant) Your patch has been applied to the master branch. commit f9f1605194281a6103d889298d4f303f94bc9d96 Author: Simon Rozman Date: Wed Jan 2 00:35:47 2019 +0100 Strip _stdcall suffixes (@nn) for 32-bit builds Signed-off-by: Simon Rozman <simon@rozman.si> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <20190101233547.10100-1-simon@rozman.si> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg18077.html Signed-off-by: Gert Doering <gert@greenie.muc.de> -- kind regards, Gert Doering
Hi, > You really do not like this calling convention, do you? ;-) - learned > something new today, what "-Wl,--kill-at" does... (while the original > round of stdcall discussion was MSVC, here's the mingw variant) If I was importing this library into a C/C++ project, I wouldn't mind function name decorations at all. However, DLL exported functions are authored in MSI package by name. Having a different name for i386 and x64 platforms would require "#ifdefs" in WiX XML files. I'll explain this in the developer documentation but briefly I can explain it here already: Consider the openvpnmsica.dll as a collection of functions (aka "Custom Actions") the MSI installer calls to perform tasks that are not implemented by stock MSI actions. Some functions are completely stand-alone. FindSystemInfo() and FindTAPInterfaces() are sequenced in the MSI package to execute early. They perform some tests MSI is too limited to do itself, and set various MSI properties accordingly. Later, those MSI properties are used to form conditions in MSI. Like which version of driver to install, should OpenVPNServ be selected to install or not, etc. The CloseOpenVPNGUI() and StartOpenVPNGUI() do just what they say immediately when called. Then there are other functions that form an <evaluation, execute, commit, rollback> tuple. The <EvaluateTAPInterfaces(), ProcessDeferredAction(), ProcessDeferredAction(), ProcessDeferredAction()> is an example of those. They are sequenced in the MSI package like this: 1. EvaluateTAPInterfaces() executes in the first pass. It runs in the current user context and it doesn't touch computer in any way. Well, it just prepares a list of TAP-interface-related operations to be executed and saves it in a temporary file. The list contains operations like: "install TAP interface X", "delete TAP interface X", "rename TAP interface X>Y", "delete file X", etc. Operations are implemented in msica_op.h/.c. 2. ProcessDeferredAction() runs in the so called deferred MSI execution pass run by Windows Installer service as the SYSTEM user. It loads the list of operations from the temporary file and executes them one by one. Let's look at a sample operation "delete file X". Normally, this operation does not really delete the file X. It renames it to Y instead, while adding "delete file Y" to a separate commit list tail, and inserting "move file Y>X" to a rollback list head. Unless MSI rollback is explicitly disabled - in this case it just deletes the file immediately and doesn't touch commit/rollback lists. After all operations on the list are executed, the newly created commit and rollback operation lists are saved to separate temporary files. 3. Should the installation succeed, the MSI calls all deferred commit actions: This time, the ProcessDeferredAction() is called with the commit list filename as the action parameter. Should the installation fail, the MSI calls all deferred rollback actions in reverse order: This time, the ProcessDeferredAction() would be called with the rollback list filename as the action parameter. Since execution, commit and rollback list files are of the same syntax, the same ProcessDeferredAction() function is reused. The only detail worth noting is that when ProcessDeferredAction() detects it is run in the commit/rollback pass it disables the MSI rollback: this makes all sequenced operations execute immediately and no longer bother with commit/rollback lists. Wow, this made a nice text to start the developer documentation of MSI setup. If it was understandable enough. :) Regards, Simon
Hi, never replied to this one... On Sun, Jan 20, 2019 at 02:54:01PM +0000, Simon Rozman wrote: [..] > Wow, this made a nice text to start the developer documentation of MSI > setup. If it was understandable enough. :) It was understandable and matched what I had to guess out of reading quite a bit of code ;-) - so, yes, good start! gert
diff --git a/src/openvpnmsica/Makefile.am b/src/openvpnmsica/Makefile.am index f00a01d8..db8502b8 100644 --- a/src/openvpnmsica/Makefile.am +++ b/src/openvpnmsica/Makefile.am @@ -2,7 +2,7 @@ # openvpnmsica -- Custom Action DLL to provide OpenVPN-specific support to MSI packages # # Copyright (C) 2002-2018 OpenVPN Inc <sales@openvpn.net> -# Copyright (C) 2018 Simon Rozman <simon@rozman.si> +# Copyright (C) 2018-2019 Simon Rozman <simon@rozman.si> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 @@ -40,7 +40,8 @@ lib_LTLIBRARIES = libopenvpnmsica.la libopenvpnmsica_la_CFLAGS = \ -municode -D_UNICODE \ -UNTDDI_VERSION -U_WIN32_WINNT \ - -D_WIN32_WINNT=_WIN32_WINNT_VISTA + -D_WIN32_WINNT=_WIN32_WINNT_VISTA \ + -Wl,--kill-at libopenvpnmsica_la_LDFLAGS = -ladvapi32 -lole32 -lmsi -lsetupapi -liphlpapi -lshell32 -lshlwapi -lversion -no-undefined -avoid-version endif