diff options
author | Chris Wilson <chris+github@qwirx.com> | 2015-12-24 16:03:14 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2015-12-24 16:03:14 +0000 |
commit | 10816862330aac6305229ea2e71d171b908ae0b9 (patch) | |
tree | dd4f8c4db312049830f7ddef52acee90715e6bb1 /lib/win32/emu.cpp | |
parent | 284252ccd65d45c31c7005777227b89096ea01ac (diff) |
Improve error message when we fail to register our custom Event Source on Windows.
Diffstat (limited to 'lib/win32/emu.cpp')
-rw-r--r-- | lib/win32/emu.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/win32/emu.cpp b/lib/win32/emu.cpp index 12d6a8b9..1479c8b4 100644 --- a/lib/win32/emu.cpp +++ b/lib/win32/emu.cpp @@ -1340,10 +1340,16 @@ BOOL AddEventSource winerrno = RegCreateKeyEx(HKEY_LOCAL_MACHINE, regkey.c_str(), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hk, &dwDisp); - if (winerrno != ERROR_SUCCESS) + if (winerrno == ERROR_ACCESS_DENIED) { - ::syslog(LOG_ERR, "Failed to create the registry key: %s", - GetErrorMessage(winerrno).c_str()); + ::syslog(LOG_ERR, "Failed to create the registry key: access denied. You must " + "be an Administrator to register new event sources in %s", regkey.c_str()); + return FALSE; + } + else if (winerrno != ERROR_SUCCESS) + { + ::syslog(LOG_ERR, "Failed to create the registry key: %s: %s", + GetErrorMessage(winerrno).c_str(), regkey.c_str()); return FALSE; } |