From patchwork Tue Jan 31 12:54:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lev Stipakov X-Patchwork-Id: 3032 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7300:c95:b0:82:e4b3:40a0 with SMTP id p21csp87920dyk; Tue, 31 Jan 2023 04:56:21 -0800 (PST) X-Google-Smtp-Source: AK7set+Rg8MSRM77K3s5OHDpAO5hEZxgH87k6zzLQH2aMP+Z02aPz0H02TxyXniLe6CMUZHJh8vR X-Received: by 2002:a05:622a:1a14:b0:3b9:a3e3:4d0b with SMTP id f20-20020a05622a1a1400b003b9a3e34d0bmr7772551qtb.36.1675169781078; Tue, 31 Jan 2023 04:56:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675169781; cv=none; d=google.com; s=arc-20160816; b=uX6onogWMdoXdiqPUqQDG9lY5vpPYKYQcubnW07E4rxj2bJ8J/2r0lWv+Ykn9uBkGB Kd/ufEiHXF6JKN4UGbqQuaRXFdlLvnBNbu6gKWiKfZnXHGhCy7GwM8R8kMfBzNy7QNDy eeLm8gBUxYRytxVk01jHDUbSj2WVqthkcHOpa0x+ZJt/GzyoIA9c2/vKQog8rLSimzO8 zHK57kBEu7IPBV2/3X5o7QyAI8HOTbHZI/o/SoOg+Uj6LLZXTBYaPWE8bjTEsnifWKMh IKebIsqz8CkwWeccx+N9jbWPe9OYbS2fQy81WGb6peCp2oiynFxqbxx3D8VSxAsD3ukc f9Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:content-transfer-encoding:cc:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature:dkim-signature; bh=p/BMk1mZqhpmVq/iBOUdZz2fSuwu56CUVff9zvsT2+0=; b=CRAmx28grnu+577rPJP8bxLTkgtyH5w6sCFf8gEQamHIu8yIdp4gcLAP7HTDEzhALA WWxQ5On0sAbfDp0YPcgdcLgLcDNc5s3r5FUyRnpev8Htg8dBlRNBtzoPNSGW/T84SOF+ K0pyKHns0kcIaEITnr7nExflruK6SQ/I9XfBcRWuY5gYeCwgtlp4q2AItaUYz6do+Foj qcbpl+Q50UJQ+ZZ6LvBGAD2K9vJ4IjCzWR3KTpYLF+NGu8/CJQc1VAolcjOstDCkPS/z BIn2CGXCBmGjdRjOzLT/sL9IaUgy7ct5Pt9qUygXzJj9tpjZfhniK4EIIbIpT8zQFKsF n9Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Vn6dFfI+; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=gsU429Na; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=RYa1S+DG; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id a26-20020ac8611a000000b003b9b48eba12si431383qtm.331.2023.01.31.04.56.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Jan 2023 04:56:21 -0800 (PST) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=Vn6dFfI+; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=gsU429Na; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=RYa1S+DG; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1pMqAQ-0003UE-3X; Tue, 31 Jan 2023 12:55:17 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1pMqAO-0003U8-PL for openvpn-devel@lists.sourceforge.net; Tue, 31 Jan 2023 12:55: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:References: In-Reply-To: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:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=zjFssI3aX1ntVHG29MJfu6kWrKHOk2VXPS817GTYWNU=; b=Vn6dFfI+netCqc1ykVHTs+or1J TOU0JR5o0MiRIVZ3QLWo1KXdT2VynrUvwrxaQRGy8PMnVSfC7mwlGn4rKy46cBcWDy6i1wEHWpzMo fGsnGJFwOyvnwhh9VrSoCdSkwD+73U0ZDdEcKmliyTo4LjMyPAxe3DBy5y4UttwA13P4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: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:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=zjFssI3aX1ntVHG29MJfu6kWrKHOk2VXPS817GTYWNU=; b=gsU429NaOK9WuL9IUzF6q01Mx+ dk+eHO1eC0LI+5RRZtnDcZhmc+RSh2EiNeX2LjAIQ9/EjaDBwkZ7rQjEmahDCfIjh5/4C67tfitOd /OWUTfLADXX3cKBM8X7q8XXanxOVz4AgfIgBNM3lcJDXYtkLOvIAnyMRz15r0pfuHo0E=; Received: from mail-il1-f170.google.com ([209.85.166.170]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1pMqAN-005F9c-En for openvpn-devel@lists.sourceforge.net; Tue, 31 Jan 2023 12:55:16 +0000 Received: by mail-il1-f170.google.com with SMTP id i6so2551466ilq.8 for ; Tue, 31 Jan 2023 04:55:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zjFssI3aX1ntVHG29MJfu6kWrKHOk2VXPS817GTYWNU=; b=RYa1S+DGQLB8Zll/c0JxC+h+w0mia/t6opH1tBGTDalvcIcwjE1Or7toGtSQ8G9DUp j8uCHvosKXan9jcYE8VVa2AlLfqC6CpCzUnnKMEk2Lday1S4wJ/qgPae46ldTGILbn6J PtAvH8JqYTMGVYhMV4wVqnRfJSnykAAwgUyhkk9cZLU69nN2kJ/EShARWvrbMef8kOJ+ oRQ4Ou4Iw9l0mAwd4AaEnsd6+ZumfV8qA5F/jijq0jZI7wRvsRB0Fl9N3O+zX4yl2bmD BgpDIBjPyeEg4QWTtgW539xT8Woy0Jy1RCTTz5ZUMaCR6YlpbhaxUbMPPbasjBOjiw6v Aohw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zjFssI3aX1ntVHG29MJfu6kWrKHOk2VXPS817GTYWNU=; b=lAN+HsqkZmQTjHOUs3U8svUHaZeHo5QCdc/8Ne8Ejbb9FfrGBH8Q8LhtuzGpdWK9mI nuolFjNjMP7192sOfAu9a7bbfEZlwe3K4ObsgEpYi8FIQ9LHBjZWUY7AbKzUv7BW7fMw 1O4A0XxiLtg25xxZGyK6ft4uw2lY1b5R9S9un0tD3lf1HZ1oFCTbR+7QYajk4h+z50NJ SLf3IaDXSIj3ZP69LfTZGP+c50DHmTz9H+6VV3AkjpXDct5Kn2pim8uDeSh+UCfY3SHq Z0dorB3XGatgNTJGbkqKOVlLAFiAl/g4y6s/eYit+VKJlh1VSzrb18A3tfkYRirFW0+5 RJ5Q== X-Gm-Message-State: AO0yUKWmi3lZjjamVf+SIJB5uyD8Ol600TFG+r7TKdj91a0zKPzzTRVJ huuvPigwZ7KabqqQ6nVRIeBfaNOTyCY= X-Received: by 2002:a05:6e02:2181:b0:310:f912:5a7c with SMTP id j1-20020a056e02218100b00310f9125a7cmr5276486ila.25.1675169704520; Tue, 31 Jan 2023 04:55:04 -0800 (PST) Received: from localhost.localdomain ([2a00:1d50:3:0:82:6e:da2d:2e03]) by smtp.gmail.com with ESMTPSA id u6-20020a92da86000000b00310bde806e8sm85355iln.12.2023.01.31.04.55.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 04:55:04 -0800 (PST) From: Lev Stipakov To: openvpn-devel@lists.sourceforge.net Date: Tue, 31 Jan 2023 14:54:48 +0200 Message-Id: <20230131125448.1913-1-lstipakov@gmail.com> X-Mailer: git-send-email 2.38.1.windows.1 In-Reply-To: <008d96b3-3062-85a0-b35b-52a45462faa9@rothenpieler.org> References: <008d96b3-3062-85a0-b35b-52a45462faa9@rothenpieler.org> MIME-Version: 1.0 X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "util-spamd-1.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Lev Stipakov WinAPI uses __stdcall calling convention on x86. Wrong calling convention causes UB, which in this case breaks dco-win functionality. Signed-off-by: Lev Stipakov --- v2: - use WINAPI instead of __stdcall - replace another existing occurence of __stdcall with WINAPI - uncrustify Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [lstipakov[at]gmail.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.166.170 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.166.170 listed in wl.mailspike.net] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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: 1pMqAN-005F9c-En Subject: [Openvpn-devel] [PATCH v2] dco-win: use proper calling convention on x86 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: , Cc: Lev Stipakov Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1756540954557542377?= X-GMAIL-MSGID: =?utf-8?q?1756542828035706677?= From: Lev Stipakov WinAPI uses __stdcall calling convention on x86. Wrong calling convention causes UB, which in this case breaks dco-win functionality. Signed-off-by: Lev Stipakov Acked-by: Gert Doering --- v2: - use WINAPI instead of __stdcall - replace another existing occurence of __stdcall with WINAPI - uncrustify src/openvpn/dco_win.c | 2 +- src/openvpn/win32.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openvpn/dco_win.c b/src/openvpn/dco_win.c index 7594024c..0931fb30 100644 --- a/src/openvpn/dco_win.c +++ b/src/openvpn/dco_win.c @@ -110,7 +110,7 @@ dco_connect_wait(HANDLE handle, OVERLAPPED *ov, int timeout, struct signal_info { volatile int *signal_received = &sig_info->signal_received; /* GetOverlappedResultEx is available starting from Windows 8 */ - typedef BOOL (*get_overlapped_result_ex_t) (HANDLE, LPOVERLAPPED, LPDWORD, DWORD, BOOL); + typedef BOOL (WINAPI *get_overlapped_result_ex_t)(HANDLE, LPOVERLAPPED, LPDWORD, DWORD, BOOL); get_overlapped_result_ex_t get_overlapped_result_ex = (get_overlapped_result_ex_t)GetProcAddress(GetModuleHandle("Kernel32.dll"), "GetOverlappedResultEx"); diff --git a/src/openvpn/win32.c b/src/openvpn/win32.c index 44176936..6d482ef8 100644 --- a/src/openvpn/win32.c +++ b/src/openvpn/win32.c @@ -1352,7 +1352,7 @@ win32_get_arch(arch_t *process_arch, arch_t *host_arch) *process_arch = ARCH_UNKNOWN; *host_arch = ARCH_NATIVE; - typedef BOOL (__stdcall *is_wow64_process2_t)(HANDLE, USHORT *, USHORT *); + typedef BOOL (WINAPI *is_wow64_process2_t)(HANDLE, USHORT *, USHORT *); is_wow64_process2_t is_wow64_process2 = (is_wow64_process2_t) GetProcAddress(GetModuleHandle("Kernel32.dll"), "IsWow64Process2");