[Bug 39240] advapi32:service fails in some non-English locales

wine-bugs at winehq.org wine-bugs at winehq.org
Wed Mar 15 12:53:01 CDT 2017


https://bugs.winehq.org/show_bug.cgi?id=39240

--- Comment #1 from François Gouget <fgouget at codeweavers.com> ---
I have investigated this a bit on the French and Spanish locales of my Windows
7 Ultimate VM.

There are really two failures that cause all the others:

* On line ~382 in test_create_delete_svc()
        ret = GetServiceDisplayNameA(scm_handle, spooler, display,
&display_size);
...
            svc_handle1 = CreateServiceA(scm_handle, servicename, display, 0,
SERVICE_WIN32_OWN_PROCESS,
                                         SERVICE_DISABLED, 0, pathname, NULL,
NULL, NULL, NULL, NULL);

* On line ~872 in test_get_servicekeyname()
    GetServiceDisplayNameA(scm_handle, spooler, displayname, &displaysize);
...
    ret = GetServiceKeyNameA(scm_handle, displayname, NULL, &servicesize);

In both cases we query the display name and try to use that to create or query
a service. The thing is that the returned display name depends on the locale:
* English  : Print Spooler
* Japanese : Print Spooler
* French   : Spouleur dimpression   (there's a weird apostrophe in there)
* Spanish  : Cola de impresión
* German   : Druckwarteschlange

Modifying the test to use the unlocalized string, "Print Spooler", fixes it. I
suspect that in most locales, such as Japanese, they did not bother localizing
that string, hence why the test works in most locales.

There also the fact that Windows 7 Ultimate can be configured for any locale.
For instance in the registry the DisplayName key for the Spooler service is set
to:

    @%systemroot%\system32\spoolsv.exe,-1

In older Windows versions the localization was often hardcoded. So for instance
it's possible that in a German Windows XP using "Druckwarteschlange" would
work. However I don't have access to such a configuration.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.


More information about the wine-bugs mailing list