[Win32utils-devel] [Fwd: [win32utils-help][6822] Eventlog problem]

Park Heesob phasis at nownuri.net
Sat Jan 7 00:47:40 EST 2006


Hi,
----- Original Message ----- 
From: "Daniel Berger" <djberg96 at gmail.com>
To: "Development and ideas for win32utils projects" 
<win32utils-devel at rubyforge.org>
Sent: Thursday, January 05, 2006 11:53 PM
Subject: [Win32utils-devel] [Fwd: [win32utils-help][6822] Eventlog problem]


> Dang, I thought we solved this.
>
> Any ideas?
>
It seems another bug.
I cannot reproduce same problem.
Could you send me a crashed event log backup file?

> PS - I realized after reading this I forgot to bump the version number
> for 0.3.3 - I've uploaded a new zip file with the correct version number.
>
BTW, I found a bug in open_backup method.
It often raised segmentation fault when reading backup event log file.
The eventlog_open_backup function in eventlog.c should be modified like 
this:
============================================
static VALUE eventlog_open_backup(int argc, VALUE* argv, VALUE klass){
  TCHAR* lpFileName;
   TCHAR* lpSourceName;
   TCHAR* lpUNCServerName;
   VALUE v_file_name, v_source_name, v_server_name, self;
   ELS* ptr;

   self = eventlog_allocate(klass);
   Data_Get_Struct(self, ELS, ptr);
   rb_scan_args(argc, argv, "12", &v_file_name, &v_source_name, 
&v_server_name);
   lpFileName = TEXT(StringValuePtr(v_file_name));
   if(NIL_P(v_source_name))
      v_source_name = rb_str_new2("Application");

   lpSourceName = TEXT(StringValuePtr(v_source_name));
   if(NIL_P(v_server_name))
      lpUNCServerName = NULL;
   else
      lpUNCServerName = TEXT(StringValuePtr(v_server_name));
   ptr->hEventLog = OpenBackupEventLog(
      lpUNCServerName,
      lpFileName
   );
   if(!ptr->hEventLog){
      sprintf(error, "OpenBackupEventLog() call failed: %s",
            ErrorDescription(GetLastError()));
      rb_raise(rb_eArgError,error);
   }

   rb_iv_set(self, "@file", v_file_name);
   rb_iv_set(self, "@source", v_source_name);
   rb_iv_set(self, "@server", v_server_name);

   return self;
}
===================================================================

Regards,
Park Heesob








More information about the win32utils-devel mailing list