cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
achal009
Level 4

64 bit OS

pROBLEM:

My APPLICATION IS 32 BIT.
I tend to install it on 64 bit OS.

I want to read the 64 bit registry and not 32 bit equivalent of 64 bit on 64 bit OS.


i.e;

can I read the key under "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft"

and not under


"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft".

If I give the function "RegDBGetKeyValueEx" with path as "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft" it still automatically tends to search inside "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft".

I want to read the key under "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft" how can I do that.
Labels (1)
0 Kudos
(3) Replies
datamine
Level 6

Before you call RegDBGetKeyValueEx, include the line:

REGDB_OPTIONS = REGDB_OPTIONS | REGDB_OPTION_WOW64_64KEY;

This will cause all subsequent registry operations to access the 64-bit section. When you're finished, use:

REGDB_OPTIONS = REGDB_OPTIONS & ~REGDB_OPTION_WOW64_64KEY;

to revert to 32-bit.

HTH
0 Kudos
achal009
Level 4

Thanks for the reply.
But this gives me a compile error I am using IS9 which is quite old. I guess I need to upgrade to new version.

Thanks a ton for the reply.

I also found another method:

// start
Disable (WOW64FSREDIRECTION);

my code

Enable (WOW64FSREDIRECTION);

// end

but for this too I need to have IS 11 and above.

thanks
0 Kudos
achal009
Level 4

datamine the solution u provided works perfectly fine in IS2009 thanks
0 Kudos