summaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/Makefile.W326
-rw-r--r--src/log/log.c9
2 files changed, 9 insertions, 6 deletions
diff --git a/src/Makefile.W32 b/src/Makefile.W32
index 4ab65e6..1685859 100644
--- a/src/Makefile.W32
+++ b/src/Makefile.W32
@@ -15,7 +15,8 @@ LIBRARIES = \
PORT_OBJS = \
port\string.obj \
port\stdio.obj \
- port\time.obj
+ port\time.obj \
+ port\snprintf.obj
LOG_OBJS = \
log\log.obj
@@ -40,7 +41,8 @@ log\wolfmsg.res: log\wolfmsg.rc
local_all:
local_clean:
- @-erase $(LIBRARIES) log\wolfmsg.h 2>NUL
+ @-erase $(LIBRARIES) 2>NUL
+ @-erase log\MSG*.bin log\wolfmsg.rc log\wolfmsg.h log\wolfmsg.res 2>NUL
local_distclean:
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( );