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

Hi,
There are many things I don't understand about my Vista64 box - and this is one of them.
I have both x86 and x64 builds of ActivePerl 5.12.2 (build 1202), and I have this minimal script:
use warnings; use Win32::TieRegistry; my %Registry; use Win32::TieRegistry ( TiedHash => \%Registry ); print "$_\n" for keys %{$Registry->{LMachine}{SOFTWARE}};
I don't understand why that script produces one list of keys when I run it using the x86 build, and a different list of keys when I run it using the x64 build. Some keys appear in both lists, other keys in just one list or the other. Why is that ?

Both perl builds have the same versions of Win32API::Registry (0.30) and Win32::TieRegistry (0.26), and I'm running (as Administrator) both perls in the System32/cmd.exe shell.

Cheers,
Rob

Replies are listed 'Best First'.
Re: Win32::TieRegistry surprises
by BrowserUk (Patriarch) on Sep 24, 2010 at 13:06 UTC

    I think it probably is due to "Registry Virtualization in Windows Vista".

    If particular, for a possible source of the differences seen by 32-bit and 64-bit processes, see the section entitled: "What is Not Virtualized?"


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      ... for a possible source of the differences seen by 32-bit and 64-bit processes, see the section entitled: "What is Not Virtualized?"

      Yes, that seems to fit the bill quite nicely - thanks. Hard to believe that "Microsoft intends to remove this form of virtualization from future versions of the Windows operating system".

      Btw, after looking at this bug report, I did find that opening HKEY_LOCAL_MACHINE for KEY_READ access only (with x64 perl), did allow me access to the key in which I was interested, without having to run as Administrator.

      Cheers,
      Rob