Win32 event logs

djberg96 on 2003-10-13T18:53:01

So, now I'm on to writing an Event Log interface for Ruby. I'm using Perl's Win32::EventLog as a base and, for the most part, the Win32 API has been fairly straightforward.

Until now, that is. Getting log descriptions is one of the more annoying approaches I've ever seen. Rather than simply including this data as part of a struct, they created pointers to data within the struct, which requires pointer arithmetic and loops. Ick.

The Win32::EventLog module source code has been somewhat helpful, but there's a bit too much Perl extension magic at times and I lose track of exactly how certain things are working. To make matters worse, I think the API is atrocious. The original author was clearly a hardcore C programmer, and the API reflects that. The final straw is that I can't even get the damned thing to work using the provided examples, and that's *without* turning 'strict' on.