[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r5318 - trunk/softHSM/src/lib

Rickard Bellgrim rickard at opendnssec.org
Tue Jul 12 11:16:42 CEST 2011


Author: rb
Date: 2011-07-12 11:16:42 +0200 (Tue, 12 Jul 2011)
New Revision: 5318

Modified:
   trunk/softHSM/src/lib/log.cpp
Log:
Now you will get text in the event log


Modified: trunk/softHSM/src/lib/log.cpp
===================================================================
--- trunk/softHSM/src/lib/log.cpp	2011-07-12 06:48:29 UTC (rev 5317)
+++ trunk/softHSM/src/lib/log.cpp	2011-07-12 09:16:42 UTC (rev 5318)
@@ -49,8 +49,10 @@
   HANDLE hEventLog = OpenEventLog(NULL, "Application");
   if(hEventLog) {
     char msg[1024];
+    char* msgs[1];
     snprintf(msg, sizeof(msg), "SoftHSM: %s: %s", functionName, text);
-    ReportEvent(hEventLog, EVENTLOG_ERROR_TYPE, 0, 0, NULL, 1, 0, (LPCSTR*)msg, NULL);
+    msgs[0] = msg;
+    ReportEvent(hEventLog, EVENTLOG_ERROR_TYPE, 0, 0, NULL, 1, 0, (const char **)msgs, NULL);
     CloseEventLog(hEventLog);
   }
 #endif
@@ -63,8 +65,10 @@
   HANDLE hEventLog = OpenEventLog(NULL, "Application");
   if(hEventLog) {
     char msg[1024];
+    char* msgs[1];
     snprintf(msg, sizeof(msg), "SoftHSM: %s: %s", functionName, text);
-    ReportEvent(hEventLog, EVENTLOG_WARNING_TYPE, 0, 0, NULL, 1, 0, (LPCSTR*)msg, NULL);
+    msgs[0] = msg;
+    ReportEvent(hEventLog, EVENTLOG_WARNING_TYPE, 0, 0, NULL, 1, 0, (const char **)msgs, NULL);
     CloseEventLog(hEventLog);
   }
 #endif
@@ -77,8 +81,10 @@
   HANDLE hEventLog = OpenEventLog(NULL, "Application");
   if(hEventLog) {
     char msg[1024];
+    char* msgs[1];
     snprintf(msg, sizeof(msg), "SoftHSM: %s: %s", functionName, text);
-    ReportEvent(hEventLog, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (LPCSTR*)msg, NULL);
+    msgs[0] = msg;
+    ReportEvent(hEventLog, EVENTLOG_INFORMATION_TYPE, 0, 0, NULL, 1, 0, (const char **)msgs, NULL);
     CloseEventLog(hEventLog);
   }
 #endif




More information about the Opendnssec-commits mailing list