[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-win32-porters
Subject:    Re: Win32::EventLog::GetMessageText failure (errors in EventLog.xs)
From:       Gurusamy Sarathy <gsar () ActiveState ! com>
Date:       2002-09-23 15:48:59
[Download RAW message or body]

On Mon, 23 Sep 2002 11:06:52 +0200, "Patrice M.I. Parmentier" wrote:
>Concern: Win32::EventLog module.
>
>
>       A. The BUG
>
>*Symptom: I have noticed that Win32::EventLog::GetMessageText sometimes 
>fails to retrieve the message. Actually, I noticed that the function 
>fails when some strings of the eventlog record have the '%%<n>' form (eg 
>these are parameters that must be retrieved inside ParameterMessageFile's).
>
>*Cause: so I took the C code definition of GetEventLogText out of 
>EventLog.xs and tried to figure out what happened. The problem is that 
>on line 670 (for simple chars), a message dll is unloaded:
>
>FreeLibrary(dll);
>
>The dll value is not set NULL after that, while it should be!

As mentioned in the followup to the original report in RT, I have
added this fix for the next release of libwin32.  Thanks.

>       B. Another problem
>
>Looking at the EventLog.xs code, I noticed that the functions look for 
>messages only in "Application", "Security" and "System" logs. IMHO, this 
>is too limitative, since they are new standard logs on XP (eg "Directory 
>Service", "DNS Server" and "File Replication Service" (not sure of the 
>lowercase/uppercase characters)), and because users/applications can 
>create their own log. As the list of logs is easily available with a 
>simple query on the registry, I think it would be great if the 
>Win32::EventLog module looked at all the logs.
>
>Actually, I think that GetEventLogText should take a additional 
>parameter, namely the name of the log, which can be found in the 
>{Source} value of the Win32::EventLog blessed object (! It is different 
>from the {Source} value retrieved by the Win32::EventLog::Read function 
>!). Indeed, to this name corresponds the registry subkey 
>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\<name_log>. 
>So taking <name_log> as a parameter has 2 advantages:
>1. It allows to retrieve a message in any log (eg different from 
>"Application", "System" or "Security").
>2. There is no more need to iterate over each subkey of 
>...\Services\EventLog since this subkey is known.
>
>The drawback is that the GetMessageText arguments should be modified 
>either: - to take an additional parameter, or - to be a "method" of a 
>blessed Win32::EventLog object.

An (optional) additional parameter sounds fine.  Patch welcome.

>PS: While the C EVENTLOG record has the TimeWritten field, the 
>corresponding field of the Perl hash is Timewritten, with  a lowercase "w".

I guess not much can be done about this due to backward compatibility. :(


Sarathy
gsar@ActiveState.com
_______________________________________________
Perl-Win32-Porters mailing list
Perl-Win32-Porters@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic