markloman Posted April 20, 2006 Share Posted April 20, 2006 (edited) I am building x64-Bit support for my AntiSpyware tool Hitman Pro. I stumbled upon a problem with RegEnumKey. Under X86 it runs fine but when I run it under X64 I only get the first subkey (tested with the latest AutoIt beta, version 3.1.1.119). Below an example from the AutoIt documentation:X86: (HKCR\Installer\Products)For $i= 1 to 10 $var = RegEnumKey("HKCR\Installer\Products", $i) If @error <> 0 then ExitLoop MsgBox(4096, "SubKey #" & $i & " under HKCR\Installer\Products: ", $var) NextRunning on X64: (HKCR64\Installer\Products)For $i= 1 to 10 $var = RegEnumKey("HKCR64\Installer\Products", $i) If @error <> 0 then ExitLoop MsgBox(4096, "SubKey #" & $i & " under HKCR64\Installer\Products: ", $var) NextThere are at least 20 subkeys unders the keyname. After the first instance, RegEnumKey returns -1: unable to retrieve requested subkey (key instance out of range).Anyone here who can help? Edited April 20, 2006 by markloman Link to comment Share on other sites More sharing options...
jpm Posted April 20, 2006 Share Posted April 20, 2006 I reproduce your problem but I will need sometime to fix it as I have very small access to machine running 64-bit windows edition. Stay tune Link to comment Share on other sites More sharing options...
jpm Posted April 24, 2006 Share Posted April 24, 2006 I don't know if I can do more than don't use the HKCR64\Installer\Products but use the HKLM64\Software\Classes\Installer\Products. I read the MSDN doc and it seems that some keys as HKCR64 cannot be enumerated correctly from a 32-bit process as AutoIt is. For me it is a kind of Windows bug but as HKCR64 is an alias of HKLM64\Software\Classes use the direct key. Tell me if it works in your case. Link to comment Share on other sites More sharing options...
markloman Posted May 15, 2006 Author Share Posted May 15, 2006 I don't know if I can do more than don't use the HKCR64\Installer\Products but use the HKLM64\Software\Classes\Installer\Products.I read the MSDN doc and it seems that some keys as HKCR64 cannot be enumerated correctly from a 32-bit process as AutoIt is.For me it is a kind of Windows bug but as HKCR64 is an alias of HKLM64\Software\Classes use the direct key.Tell me if it works in your case. I have changed the code from HKCR64\... to HKLM64\SOFTWARE\Classes\... and it works! Thanks-a-million! Regards, Mark Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now