[Win32utils-devel] Tweak to win32-eventlog
djberg96 at gmail.com
Sat Dec 16 10:34:35 EST 2006
On 12/13/06, Daniel Berger <djberg96 at gmail.com> wrote:
> I got a bug report from Greg Holmes where the description wasn't being
> returned properly. At the moment, if there's no event associated with
> the event id, then the description is empty.
> However, it turns out that there can still be associated information
> about the event. So, I propose the following tweak to the
> get_description private method:
> # If FormatMessage() returned 0, but va_list isn't empty,
> # then return the va_list instead.
> if val == 0 && !va_list.empty?
> buf = va_list.join("\n")
> Where 'val' is the result of the FormatMessage() call. I've attached
> the sample backup file he sent me to demonstrate the problem. The patch
> above seems to work fine.
> Please let me know if you have any issues with this approach. If not,
> I'd like to get a release out this weekend.
Actually, I've been looking over the Python evtlogutils stuff, and I
think a better approach is to allow people to get at the string
inserts independently of the full event log message as the Python
module does. So, I'm going to add the string_inserts member to the
EventLogStruct. Sound good?
I also realized that we should probably check the CategoryMessageFile
and ParameterMessageFile instead of only the EventMessageFile in the
Last but not least, I'm getting strange results for the attached
backup event log. If you've got the .NET 2.0 runtime installed,
you'll end up getting, ""The operation completed successfully."
instead of what I would expect, i.e. nothing. Suggestions welcome.
More information about the win32utils-devel