puploki has asked for the wisdom of the Perl Monks concerning the following question:
The background to this is that I want to do some low-level poking of the Windows registry on 64bit Windows (it's related to the WOW64 registry reflection nonsense).
I'm going to use Win32API::Registry to return the handle to a key, which I'll then use with Win32::API to call RegQueryReflectionKey() which is exposed through AdvApi32.dll.
So, I thought I'd start small and write up a few lines to make sure Win32API::Registry works as I think it should:
use strict; use warnings; use Win32API::Registry 0.22 qw ( :ALL ); my $sSubKey = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlog +on\\DefaultDomainName\\"; my $ohSubKey; RegOpenKeyEx( HKEY_LOCAL_MACHINE, $sSubKey, 0, KEY_READ, $ohSubKey ) o +r die regLastError(); print "$ohSubKey\n";
When I run this, it dies with the error:
The system cannot find the file specified at xx.pl line 12.
So, my question is this, am I doing something wrong? If I use regmon from sysinternals it shows that the Perl process is querying and opening the key (and the key certainly exists) - so why is it breaking and not returning a handle?
CPAN says the latest version of 0.23, but I can only find 0.22 even with all the extra PPM registries I have added in... Incidentally, Win32::TieRegistry works just fine, which I think is just a wrapper around Win32API::Registry.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32API::Registry Troubles (same)
by tye (Sage) on Nov 16, 2005 at 14:56 UTC | |
by puploki (Hermit) on Nov 16, 2005 at 15:09 UTC | |
|
Re: Win32API::Registry Troubles
by holli (Abbot) on Nov 16, 2005 at 13:53 UTC | |
by puploki (Hermit) on Nov 16, 2005 at 13:59 UTC |