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:
committed by
Sergei Golubchik
parent
99e5ae3b1a
commit
ea0a5cb0a4
@@ -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);
|
||||
|
Reference in New Issue
Block a user