forked from Mirrors/wine-wine
advapi32/service: Set correct error when the service doesn't exist.
parent
b67b66d7b3
commit
07af2fe2b5
|
@ -2352,6 +2352,8 @@ BOOL WINAPI GetServiceDisplayNameW( SC_HANDLE hSCManager, LPCWSTR lpServiceName,
|
||||||
SetLastError(ERROR_INSUFFICIENT_BUFFER);
|
SetLastError(ERROR_INSUFFICIENT_BUFFER);
|
||||||
*lpcchBuffer = (size / sizeof(WCHAR)) - 1;
|
*lpcchBuffer = (size / sizeof(WCHAR)) - 1;
|
||||||
}
|
}
|
||||||
|
else if (ret == ERROR_FILE_NOT_FOUND)
|
||||||
|
SetLastError(ERROR_SERVICE_DOES_NOT_EXIST);
|
||||||
else
|
else
|
||||||
SetLastError(ret);
|
SetLastError(ret);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -420,7 +420,6 @@ static void test_get_displayname(void)
|
||||||
displaysize = -1;
|
displaysize = -1;
|
||||||
ret = GetServiceDisplayNameA(scm_handle, deadbeef, NULL, &displaysize);
|
ret = GetServiceDisplayNameA(scm_handle, deadbeef, NULL, &displaysize);
|
||||||
ok(!ret, "Expected failure\n");
|
ok(!ret, "Expected failure\n");
|
||||||
todo_wine
|
|
||||||
ok(GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST,
|
ok(GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST,
|
||||||
"Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n", GetLastError());
|
"Expected ERROR_SERVICE_DOES_NOT_EXIST, got %d\n", GetLastError());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue