summaryrefslogtreecommitdiff
path: root/src/log
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2009-03-19 11:23:44 +0100
committerAndreas Baumann <abaumann@yahoo.com>2009-03-19 11:23:44 +0100
commit02c0ec4727710a679bd2f436a6fe67b707a22c84 (patch)
tree19f26cf4d0cd659dc13d68f6352f7b4537fd0eba /src/log
parent59218203a248a958ad5cb281507dbd7ad3255334 (diff)
downloadwolfbones-02c0ec4727710a679bd2f436a6fe67b707a22c84.tar.gz
wolfbones-02c0ec4727710a679bd2f436a6fe67b707a22c84.tar.bz2
big logger cleanup on Windows, local testmsg.dll for log test
Diffstat (limited to 'src/log')
-rw-r--r--src/log/log.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/log/log.c b/src/log/log.c
index 9aad099..6b7e9a5 100644
--- a/src/log/log.c
+++ b/src/log/log.c
@@ -406,7 +406,7 @@ static void registry_set_word( HKEY h, TCHAR *name, DWORD value ) {
RegSetValueEx( h, name, 0, REG_DWORD, (LPBYTE)&value, sizeof( DWORD ) );
}
-static void register_event_source( const char *log, const char *source ) {
+static void register_event_source( const char *log, const char *source, const char *path_to_dll ) {
char key[256];
HKEY h = 0;
DWORD disposition;
@@ -418,8 +418,8 @@ static void register_event_source( const char *log, const char *source ) {
/* make sure not to have hard-coded pathes here, otherwise remote
* event logging will not work! */
- registry_set_expandable_string( h, "EventMessageFile", "%SystemRoot%\\System32\\wolfmsg.dll" );
- registry_set_expandable_string( h, "CategoryMessageFile", "%SystemRoot%\\System32\\wolfmsg.dll" );
+ registry_set_expandable_string( h, "EventMessageFile", (char *)path_to_dll );
+ registry_set_expandable_string( h, "CategoryMessageFile", (char *)path_to_dll );
registry_set_word( h, "TypesSupported", (DWORD)7 );
registry_set_word( h, "CategoryCount", (DWORD)2 );
RegCloseKey( h );
@@ -491,6 +491,7 @@ static PSID get_current_sid( void ) {
void wolf_log_openlogtoeventlog( const char *server,
const char *log,
const char *source,
+ const char *path_to_dll,
wolf_log_level_t level ) {
eventlog_server = server;
eventlog_log = log;
@@ -501,7 +502,7 @@ void wolf_log_openlogtoeventlog( const char *server,
* message DLL, how many categories we define and what types
* of events we are supporting
*/
- register_event_source( log, source );
+ register_event_source( log, source, path_to_dll );
/* for logging the user of the process into the event log */
sid = get_current_sid( );