- SF# 3559325: Util Windows broken in non-Unicode

- port of rev. 1918 from 1.4.4 branch (fixed SF# 3519474)
- update VS 2010 Util projects with JSON
This commit is contained in:
Aleksandar Fabijanic
2012-08-19 01:42:38 +00:00
parent d8bbcc08a7
commit 47aadf0681
18 changed files with 344 additions and 309 deletions

View File

@@ -134,7 +134,7 @@ void WinService::registerService(const std::string& path, const std::string& dis
upath.c_str(),
NULL, NULL, NULL, NULL, NULL);
#else
_svcHandle = CreateService(
_svcHandle = CreateServiceA(
_scmHandle,
_name.c_str(),
displayName.c_str(),
@@ -296,7 +296,7 @@ bool WinService::tryOpen() const
Poco::UnicodeConverter::toUTF16(_name, uname);
_svcHandle = OpenServiceW(_scmHandle, uname.c_str(), SERVICE_ALL_ACCESS);
#else
_svcHandle = OpenService(_scmHandle, _name.c_str(), SERVICE_ALL_ACCESS);
_svcHandle = OpenServiceA(_scmHandle, _name.c_str(), SERVICE_ALL_ACCESS);
#endif
}
return _svcHandle != 0;
@@ -325,7 +325,7 @@ POCO_LPQUERY_SERVICE_CONFIG WinService::config() const
#if defined(POCO_WIN32_UTF8)
while (!QueryServiceConfigW(_svcHandle, pSvcConfig, size, &bytesNeeded))
#else
while (!QueryServiceConfig(_svcHandle, pSvcConfig, size, &bytesNeeded))
while (!QueryServiceConfigA(_svcHandle, pSvcConfig, size, &bytesNeeded))
#endif
{
if (GetLastError() == ERROR_INSUFFICIENT_BUFFER)