8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-02-02 10:00:38 +01:00

@aafemt suggestion : removed obsolete code, more clear error handling.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Vlad Khorsun 2023-06-18 15:12:02 +03:00
parent b868d9eb53
commit 01c227855a

View File

@ -321,20 +321,15 @@ int WINAPI WinMain(HINSTANCE hThisInst, HINSTANCE /*hPrevInst*/, LPSTR lpszArgs,
{NULL, NULL}
};
// BRS There is a error in MinGW (3.1.0) headers
// the parameter of StartServiceCtrlDispatcher is declared const in msvc headers
#if defined(MINGW)
if (!StartServiceCtrlDispatcher(const_cast<SERVICE_TABLE_ENTRY*>(service_table)))
{
#else
if (!StartServiceCtrlDispatcher(service_table))
{
#endif
const DWORD err = GetLastError();
if (err == ERROR_FAILED_SERVICE_CONTROLLER_CONNECT) {
if (err == ERROR_FAILED_SERVICE_CONTROLLER_CONNECT || err == ERROR_CALL_NOT_IMPLEMENTED)
{
server_flag |= SRVR_non_service;
}
else if (err != ERROR_CALL_NOT_IMPLEMENTED) {
else
{
CNTL_shutdown_service("StartServiceCtrlDispatcher failed");
}
}