1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-27092 Windows - services that have non-ASCII characters do not work with activeCodePage=UTF8

CreateServiceA, OpenServiceA, and couple of other functions do not work
correctly with non-ASCII character, in the special case where application
has defined activeCodePage=UTF8.

Workaround by redefining affected ANSI functions to own wrapper, which
works by converting narrow(ANSI) to wide, then calling wide function.

Deprecate original ANSI service functions, via declspec, so that we can catch
their use.
This commit is contained in:
Vladislav Vaintroub
2021-11-19 14:03:51 +01:00
committed by Sergei Golubchik
parent 99e5ae3b1a
commit ea0a5cb0a4
8 changed files with 201 additions and 12 deletions

View File

@@ -30,6 +30,7 @@
#include <sddl.h>
struct IUnknown;
#include <shlwapi.h>
#include <winservice.h>
#include <string>
@@ -916,7 +917,7 @@ end:
auto sc_manager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
if (sc_manager)
{
auto sc_handle= OpenServiceA(sc_manager,opt_service, DELETE);
auto sc_handle= OpenService(sc_manager,opt_service, DELETE);
if (sc_handle)
{
DeleteService(sc_handle);