Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Marc Becker <becm@gmx.de>
To: wireguard@lists.zx2c4.com
Subject: [PATCH wintun v2] installer: do not enforce driver removal
Date: Wed, 21 Oct 2020 21:27:01 +0200	[thread overview]
Message-ID: <20201021192701.23402-1-becm@gmx.de> (raw)
In-Reply-To: <20201016125218.13593-1-becm@gmx.de>

Persistend network adapters hold locks on installed driver.
Forced removal breaks service/PnP ownership references.

Do not enforce driver removal and make failure non-fatal.
Old driver is removed by regular disk cleanup or next MSM operation.

Signed-off-by: Marc Becker <becm@gmx.de>
---
Does not change UninstallOEM result error message.

Patch (now correctly) mirrors https://github.com/OpenVPN/tap-windows6/pull/135
Effects discussed in https://github.com/OpenVPN/tap-windows6/issues/129

 installer/installation.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/installer/installation.c b/installer/installation.c
index cd93ffb..9c7992c 100644
--- a/installer/installation.c
+++ b/installer/installation.c
@@ -345,9 +345,9 @@ static BOOL RemoveWintun(VOID)
         {
             PathStripPath(DriverDetail->InfFileName);
             Logger(LOG_INFO, TEXT("Removing existing driver"));
-            if (!SetupUninstallOEMInf(DriverDetail->InfFileName, SUOI_FORCEDELETE, NULL))
+            if (!SetupUninstallOEMInf(DriverDetail->InfFileName, 0, NULL))
             {
-                PrintError(LOG_ERR, TEXT("Unable to remove existing driver"));
+                PrintError(LOG_WARN, TEXT("Unable to remove existing driver"));
                 Ret = FALSE;
             }
         }
@@ -601,8 +601,7 @@ BOOL InstallOrUpdate(VOID)
     }
     if (!RemoveWintun())
     {
-        PrintError(LOG_ERR, TEXT("Failed to uninstall old drivers"));
-        goto cleanupAdapters;
+        PrintError(LOG_WARN, TEXT("Failed to uninstall old drivers, probably some are in use by adapters. Continuing."));
     }
     if (!InstallWintun(!!ExistingAdapters))
     {
--
2.11.0


      parent reply	other threads:[~2020-10-28  0:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-16 12:52 [PATCH wintun] " Marc Becker
2020-10-17 15:00 ` [PATCH wintun v2] " Marc Becker
2020-10-21 19:27 ` Marc Becker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201021192701.23402-1-becm@gmx.de \
    --to=becm@gmx.de \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).