diff -r 7af3aaeb42e9 -r 573f1fff48b2 Hardware/KernelDriver.cs --- a/Hardware/KernelDriver.cs Sat Aug 11 21:48:54 2012 +0000 +++ b/Hardware/KernelDriver.cs Sun Sep 23 18:37:43 2012 +0000 @@ -41,13 +41,13 @@ null); if (service == IntPtr.Zero) { - if (Marshal.GetHRForLastWin32Error() == ERROR_SERVICE_EXISTS) - service = NativeMethods.OpenService(manager, id, - ServiceAccessRights.SERVICE_ALL_ACCESS); - else { + if (Marshal.GetHRForLastWin32Error() == ERROR_SERVICE_EXISTS) { + errorMessage = "Service already exists"; + return false; + } else { errorMessage = "CreateService returned the error: " + Marshal.GetExceptionForHR(Marshal.GetHRForLastWin32Error()).Message; - NativeMethods.CloseServiceHandle(manager); + NativeMethods.CloseServiceHandle(manager); return false; } }