Commit 5c4a3bd6 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

msi: Handle some error returns (Coverity).

parent d2812521
...@@ -7475,6 +7475,7 @@ static void test_start_services(void) ...@@ -7475,6 +7475,7 @@ static void test_start_services(void)
} }
scm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS); scm = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
ok(scm != NULL, "Failed to open the SC Manager\n"); ok(scm != NULL, "Failed to open the SC Manager\n");
if (!scm) return;
service = OpenService(scm, "Spooler", SC_MANAGER_ALL_ACCESS); service = OpenService(scm, "Spooler", SC_MANAGER_ALL_ACCESS);
if (!service && GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST) if (!service && GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST)
...@@ -7483,7 +7484,11 @@ static void test_start_services(void) ...@@ -7483,7 +7484,11 @@ static void test_start_services(void)
CloseServiceHandle(scm); CloseServiceHandle(scm);
return; return;
} }
ok(service != NULL, "Failed to open Spooler\n"); ok(service != NULL, "Failed to open Spooler, error %d\n", GetLastError());
if (!service) {
CloseServiceHandle(scm);
return;
}
ret = StartService(service, 0, NULL); ret = StartService(service, 0, NULL);
if (!ret && (error = GetLastError()) != ERROR_SERVICE_ALREADY_RUNNING) if (!ret && (error = GetLastError()) != ERROR_SERVICE_ALREADY_RUNNING)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment