For non-English languages the Spooler display name may contain non-ASCII characters, typically a smart quote. On Windows 7 GetServiceKeyName() fails when it gets such characters.
Signed-off-by: Francois Gouget fgouget@codeweavers.com --- dlls/advapi32/tests/service.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/dlls/advapi32/tests/service.c b/dlls/advapi32/tests/service.c index 38726660850..484167656f1 100644 --- a/dlls/advapi32/tests/service.c +++ b/dlls/advapi32/tests/service.c @@ -720,6 +720,17 @@ static void test_get_displayname(void) CloseServiceHandle(scm_handle); }
+static int is_printable_ascii_str(const char *s) +{ + while (*s) + { + if (*s < 32 || *s >= 127) + return 0; + s++; + } + return 1; +} + static void test_get_servicekeyname(void) { SC_HANDLE scm_handle, svc_handle; @@ -861,6 +872,14 @@ static void test_get_servicekeyname(void) servicesize = 0; ret = GetServiceKeyNameA(scm_handle, displayname, NULL, &servicesize); ok(!ret, "Expected failure\n"); + if (!is_printable_ascii_str(displayname) && + GetLastError() == ERROR_SERVICE_DOES_NOT_EXIST) + { + win_skip("GetServiceKeyName() does not support non-ASCII display names: %s\n", displayname); /* Windows 7 */ + CloseServiceHandle(scm_handle); + return; /* All the tests that follow will fail too */ + } + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=63903
Your paranoid android.
=== wvistau64 (32 bit report) ===
advapi32: service.c:2490: Test failed: Got wrong SleepEx result: 0 service.c:2491: Test failed: APC wasn't called service.c:2492: Test failed: APC wasn't called service.c:2501: Test failed: NotifyServiceStatusChangeW failed: 1242 service.c:2509: Test failed: Got wrong SleepEx result: 192