From 46e4752c8fbdbb3c5122094826329f3df64fb8af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=B6ller?= Date: Fri, 11 Feb 2011 22:29:26 +0000 Subject: [PATCH] Added code to delete any kernel driver service that can't be opened before reinstalling it. --- Hardware/Ring0.cs | 8 ++++++-- Properties/AssemblyVersion.cs | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Hardware/Ring0.cs b/Hardware/Ring0.cs index 0336f44..91bf471 100644 --- a/Hardware/Ring0.cs +++ b/Hardware/Ring0.cs @@ -112,7 +112,9 @@ namespace OpenHardwareMonitor.Hardware { driver.Open(); if (!driver.IsOpen) { - // driver is not loaded, try to install and open + // driver is not loaded, try to reinstall and open + + driver.Delete(); string fileName = Path.GetTempFileName(); if (ExtractDriver(fileName)) { if (driver.Install(fileName)) { @@ -124,7 +126,9 @@ namespace OpenHardwareMonitor.Hardware { report.AppendLine("Status: Opening driver failed"); } } else { - report.AppendLine("Status: Installing driver failed"); + report.AppendLine("Status: Installing driver \"" + + fileName + "\" failed" + + (File.Exists(fileName) ? " and file exists" : "")); report.AppendLine(); report.Append("Exception: " + Marshal.GetExceptionForHR( Marshal.GetHRForLastWin32Error()).Message); diff --git a/Properties/AssemblyVersion.cs b/Properties/AssemblyVersion.cs index da9cfbf..781e555 100644 --- a/Properties/AssemblyVersion.cs +++ b/Properties/AssemblyVersion.cs @@ -16,7 +16,7 @@ The Initial Developer of the Original Code is Michael Möller . - Portions created by the Initial Developer are Copyright (C) 2009-2010 + Portions created by the Initial Developer are Copyright (C) 2009-2011 the Initial Developer. All Rights Reserved. Contributor(s): @@ -37,5 +37,5 @@ using System.Reflection; -[assembly: AssemblyVersion("0.2.1.12")] -[assembly: AssemblyInformationalVersion("0.2.1.12 Alpha")] \ No newline at end of file +[assembly: AssemblyVersion("0.2.1.13")] +[assembly: AssemblyInformationalVersion("0.2.1.13 Alpha")] \ No newline at end of file