djberg96 has asked for the wisdom of the Perl Monks concerning the following question:

ActiveState Perl 5.8 (latest)
Windows 2000

I'm trying to get event source information. Specifically, I want to get a list of available event categories. Here's a sample of what I've got so far and it's output:

use strict; use Win32::TieRegistry; my $key = "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services"; $key .= "\\EventLog\\Application\\MSDTC"; my $vals = $Registry->{$key} or die "Can't find the Windows tips: $^E +\n"; foreach my $k (keys %$vals){ if($k =~ /CategoryCount/){ print "$k => ", hex($vals->{$k}), "\n"; } else{ print "$k => $vals->{$k}\n"; } }
And it's output:

EventMessageFile => C:\WINNT\System32\MSDTCPRX.DLL TypesSupported => 0x00000007 CategoryMessageFile => C:\WINNT\System32\MSDTCPRX.DLL CategoryCount => 18

This is all well and good. I can see that there are 18 categories for the MSDTC app, and I can see the corresponding DLL file.

Now, my question is - how do I get the actual category names out of 'C:\WINNT\System32\MSDTCPRX.DLL'? Is this possible with Win32::TieRegistry (or another Win32 module)? Any and all help much appreciated. Regards, Dan

Replies are listed 'Best First'.
Re: Win32::TieRegistry and DLL information
by PodMaster (Abbot) on Nov 09, 2003 at 07:26 UTC
    Now, my question is - how do I get the actual category names out of 'C:\WINNT\System32\MSDTCPRX.DLL'? Is this possible with Win32::TieRegistry (or another Win32 module)? Any and all help much appreciated. Regards, Dan
    If the data is in the registry, then you get it out of the registry. If it's not, you find out where it is, and get it out (it's up to you to research this). Modules of interest are Win32::API, ?Win32::File::VersionInfo.... Win32::

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.