-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
In EventLogChannel::setUpRegistry(), the code tries to find PocoFoundation.dll (or PocoFoundationd.dll) and add the path to registry key. But in 64bit environment, the dll is named "PocoFoundation64.dll/PocoFoundation64d.dll", and the code fails to find the library because name doesn't match.
void EventLogChannel::setUpRegistry() const
{
std::string key = "SYSTEM\\CurrentControlSet\\Services\\EventLog\\";
key.append(_logFile);
key.append("\\");
key.append(_name);
HKEY hKey;
DWORD disp;
#if defined(POCO_WIN32_UTF8)
std::wstring ukey;
UnicodeConverter::toUTF16(key, ukey);
DWORD rc = RegCreateKeyExW(HKEY_LOCAL_MACHINE, ukey.c_str(), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &disp);
#else
DWORD rc = RegCreateKeyEx(HKEY_LOCAL_MACHINE, key.c_str(), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &disp);
#endif
if (rc != ERROR_SUCCESS) return;
if (disp == REG_CREATED_NEW_KEY)
{
#if defined(POCO_WIN32_UTF8)
std::wstring path;
#if defined(POCO_DLL)
#if defined(_DEBUG)
path = findLibrary(L"PocoFoundationd.dll");
#else
path = findLibrary(L"PocoFoundation.dll");
#endif
#endif
if (path.empty())
path = findLibrary(L"PocoMsg.dll");
#else
std::string path;
#if defined(POCO_DLL)
#if defined(_DEBUG)
path = findLibrary("PocoFoundationd.dll");
#else
path = findLibrary("PocoFoundation.dll");
#endif
#endif
if (path.empty())
path = findLibrary("PocoMsg.dll");
#endif
if (!path.empty())
{
...
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels