[Bug 52895] New: advapi32:service - EnumServicesStatusA() does not support UTF-8 on Windows?

WineHQ Bugzilla wine-bugs at winehq.org
Tue Apr 26 09:05:42 CDT 2022


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

            Bug ID: 52895
           Summary: advapi32:service - EnumServicesStatusA() does not
                    support UTF-8 on Windows?
           Product: Wine
           Version: unspecified
          Hardware: x86-64
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: advapi32
          Assignee: wine-bugs at winehq.org
          Reporter: fgouget at codeweavers.com

advapi32:service fails on Windows with a UTF-8 codepage:

service.c:1283: Test failed: Expected success, got error 8
service.c:1285: Test failed: Expected some returned services
service.c:1312: Test failed: Expected the needed buffer size for this one
service
service.c:1313: Test failed: Expected fewer services to be returned
service.c:1314: Test failed: Expected ERROR_MORE_DATA, got 1783
service.c:1326: Test failed: Expected the needed buffer size for this one
service
service.c:1327: Test failed: Expected fewer services to be returned
service.c:1328: Test failed: Expected a resume handle
service.c:1329: Test failed: Expected ERROR_MORE_DATA, got 1783
service.c:1340: Test failed: Expected success, got error 8
service.c:1342: Test failed: Expected 559038737 services to be returned
service.c:1610: Test failed: Expected success, got error 8
service.c:1627: Test failed: Expected the needed buffer size
service.c:1628: Test failed: Expected fewer services to be returned
service.c:1629: Test failed: Expected ERROR_MORE_DATA, got 1783
service.c:1641: Test failed: Expected the needed buffer size
service.c:1642: Test failed: Expected fewer services to be returned
service.c:1643: Test failed: Expected a resume handle
service.c:1644: Test failed: Expected ERROR_MORE_DATA, got 1783
service.c:1655: Test failed: Expected success, got error 8
service.c:1657: Test failed: Expected 559038737 services to be returned
service.c:1702: Test failed: Expected success 8

https://test.winehq.org/data/patterns.html#advapi32:service

The first failure is an ERROR_NOT_ENOUGH_MEMORY in this call:

    services = HeapAlloc(GetProcessHeap(), 0, needed);
    bufsize = needed;
    needed = 0xdeadbeef;
    returned = 0xdeadbeef;
    SetLastError(0xdeadbeef);
    ret = EnumServicesStatusA(scm_handle, SERVICE_WIN32, SERVICE_STATE_ALL,
                              services, bufsize, &needed, &returned, NULL);

Where needed was calculated from a previous call (30890 in my case). So the
buffer should be big enough but EnumServicesStatusA() fails anyway. I tried
increasing the buffer size to the max 256KB but EnumServicesStatusA() still
complains about insufficient memory which does not make sense.

Later, when given a resume handle, the tests return RPC_X_BAD_STUB_DATA (1783)
instead of ERROR_MORE_DATA (234).

So this looks like the underlying RPC code that accesses the service control
manager is buggy and does not support UTF-8. So win_skip() the whole thing on
the first failure? Move the resume test with the RPC_X_BAD_STUB_DATA first and
skip if that fails?

-- 
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