1.1 --- a/Hardware/KernelDriver.cs Sat Aug 11 21:48:54 2012 +0000
1.2 +++ b/Hardware/KernelDriver.cs Sun Sep 23 18:37:43 2012 +0000
1.3 @@ -41,13 +41,13 @@
1.4 null);
1.5
1.6 if (service == IntPtr.Zero) {
1.7 - if (Marshal.GetHRForLastWin32Error() == ERROR_SERVICE_EXISTS)
1.8 - service = NativeMethods.OpenService(manager, id,
1.9 - ServiceAccessRights.SERVICE_ALL_ACCESS);
1.10 - else {
1.11 + if (Marshal.GetHRForLastWin32Error() == ERROR_SERVICE_EXISTS) {
1.12 + errorMessage = "Service already exists";
1.13 + return false;
1.14 + } else {
1.15 errorMessage = "CreateService returned the error: " +
1.16 Marshal.GetExceptionForHR(Marshal.GetHRForLastWin32Error()).Message;
1.17 - NativeMethods.CloseServiceHandle(manager);
1.18 + NativeMethods.CloseServiceHandle(manager);
1.19 return false;
1.20 }
1.21 }