summaryrefslogtreecommitdiff
path: root/lib/win32
diff options
context:
space:
mode:
Diffstat (limited to 'lib/win32')
-rw-r--r--lib/win32/emu.cpp12
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;
}