Commit graph

7 commits

Author SHA1 Message Date
Nayuta Yanagisawa
cbf9d8a8d5 Merge 10.7 into 10.8 2022-04-13 17:52:27 +09:00
Vladislav Vaintroub
5a4a37076d MDEV-10183 implement service_manager_extend_timeout on Windows
The implementation calls SetServiceStatus() with updated
SERVICE_STATUS::dwHint and SERVICE_STATUS::dwCheckpoint
2022-04-11 07:49:43 +02:00
Vladislav Vaintroub
ea0a5cb0a4 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.
2021-12-15 19:13:57 +01:00
Vladislav Vaintroub
0102732686 Revert "MDEV-26713 Windows - improve utf8 support for command line tools"
This reverts commit several commits pushed by mistake.
2021-11-19 09:46:57 +01:00
Vladislav Vaintroub
2dcb823631 MDEV-26713 Windows- UTF8 encoding in the installer
Workaround Windows' bug in services "ANSI" when process ANSI codepage is
UTF8.
They turn out to work unlike any other API .

Expected behavior : strings  be converted from GetACP() to Unicode,
and "wide" function would be then called.

Actual current behavior :
it seems to handle strings as-if they would be encoded in system-default
ACP, rather than process-specific GetACP()

Fix: redefine the OpenService,CreateService and ChangeServiceConfig
and do ANSI-Wide conversion outselves.

Tell compiler to deprecate some ANSI service functions.

xxx
2021-11-18 17:25:40 +01:00
Vladislav Vaintroub
bc64a03c3a Windows - Fix CMAKE_INTERPROCEDURAL_OPTIMIZATION build with MSVC
If IPO is enabled, MSVC compiles with /GL  which is not
compatible with cmake's WINDOWS_EXPORT_ALL_SYMBOLS.

Since server.dll can't autoexport symbols from /GL compiled objects,
IPO must be disabled for dbug, string,mysys, and sql targets (in case we
build "plugin" DLLs that need server.dll's symbols)
2021-05-09 23:51:18 +02:00
Vladislav Vaintroub
9701759b3d MDEV-23043 Refactor Windows service handling
Removed the existing nt_service classes - they provide little
abstraction, and only obscure a relatively simple service handling.
This replaces by similar code inspired by MS docs samples.

Service handling is now moved into winmain.cc, which contains
the main() function for Windows.

winmain provides reporting callbacks, which should be used by external code
,to report transitions from starting to running to shutting down to stopped.

Removed a  do-nothing ServiceMain thread, and the
non-working service "pause/continue".  Removed a lot of #ifdef __WIN__
code from mysqld.cc
2020-07-04 18:24:40 +02:00