PDA

View Full Version : 64 vs 32 registry entry



NewsArchive
08-13-2015, 02:19 AM
I have this statement in a SB script:

Registry Value (REG_SZ) "HKLM\Software\PDS\PDSMED\InstallFolder" = %
_SB_INSTALLDIR%

on my 64-bit os the value goes to:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\PDS\PDSMED

What will the registry key be on a 32-bit OS?

Tony Tetley

NewsArchive
08-13-2015, 02:23 AM
Hi Tony,

> Registry Value (REG_SZ) "HKLM\Software\PDS\PDSMED\InstallFolder" = %
> _SB_INSTALLDIR%
>
> on my 64-bit os the value goes to:
>
> HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\PDS\PDSMED
>
> What will the registry key be on a 32-bit OS?

It should be:

HKLM\Software\PDS\PDSMED

Under 64bit OS, data from 32bit programs is virtualized, so it goes into
the Wow6432Node. I _think_ there is a way in SB to make the 32bit
installer write directly to 64bit nodes, but I'm not 100% sure.

Best regards,

--
Arnor Baldvinsson
Icetips Alta LLC

NewsArchive
08-13-2015, 02:24 AM
> HKLM\Software\PDS\PDSMED
>
>

Thanks Arnor, that is what I thought but wanted to verify.

No need to force anything, just need have my program check
for both scenarios.

Cheers,
Tony

NewsArchive
08-13-2015, 02:25 AM
Tony,

> > HKLM\Software\PDS\PDSMED
> >
> >
>
> Thanks Arnor, that is what I thought but wanted to verify.
>
> No need to force anything, just need have my program check
> for both scenarios.

Unless I missed a meeting<g> you don't need to check anything other
than HKLM\Software\PDS\PDSMED. The OS knows where to look based on the
bitness of the program looking at the key.

--
Lee White

RPM Report Viewer.: http://www.cwaddons.com/products/rpm/
RPM Review........: http://www.clarionmag.com/cmag/v11/v11n06rpm.html
Report Faxing.....: http://www.cwaddons.com/products/afe/
---Enroll Today---: http://CWaddons.com

Creative Reporting: http://www.CreativeReporting.com

Product Release & Update Notices
http://twitter.com/DeveloperPLUS

Windows 8 brings us "The Oval, Bumper Car, Roller Coaster of Wait!"
And, now, Windows 10 brings us "The Inch Worm, Bumper Car of Wait!"


The life of a Clarion Developer: https://youtu.be/ozitqabi6UM

NewsArchive
08-13-2015, 02:25 AM
Yep.

I think you'll find that a 32-bit program CAN'T read the 64-bit values
anyway... so no need to worry one's pretty l'il head ;-)

jf

NewsArchive
08-13-2015, 02:29 AM
Hi Jane,

> I think you'll find that a 32-bit program CAN'T read the 64-bit values
> anyway... so no need to worry one's pretty l'il head ;-)

Sure it can:) My registry class can read 64bit values just fine. When
you call RegOpenKeyEx you can specify KEY_WOW64_32KEY or KEY_WOW64_64KEY
to specify which key set to open in the samDesired parameter. See
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724897%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
and
https://msdn.microsoft.com/en-us/library/windows/desktop/ms724878(v=vs.85).aspx

KEY_WOW64_32KEY (0x0200)
Indicates that an application on 64-bit Windows should operate on the
32-bit registry view. This flag is ignored by 32-bit Windows. For more
information, see Accessing an Alternate Registry View.
This flag must be combined using the OR operator with the other flags in
this table that either query or access registry values.
Windows 2000: This flag is not supported.

KEY_WOW64_64KEY (0x0100)
Indicates that an application on 64-bit Windows should operate on the
64-bit registry view. This flag is ignored by 32-bit Windows. For more
information, see Accessing an Alternate Registry View.
This flag must be combined using the OR operator with the other flags in
this table that either query or access registry values.
Windows 2000: This flag is not supported.

One of my customers needed to update keys shared by a 64bit software so
we did some digging:)

Best regards,

--
Arnor Baldvinsson - Icetips Alta LLC

NewsArchive
08-13-2015, 02:45 AM
Nice! Thanks for the links!

But from the standpoint of typical program usage, Clarion's getreg and
putreg stuff automatically goes to the 32-bit areas as it's supposed to.


jf

NewsArchive
08-13-2015, 02:46 AM
Hi Jane,

> Nice! Thanks for the links!
>
> But from the standpoint of typical program usage, Clarion's getreg and
> putreg stuff automatically goes to the 32-bit areas as it's supposed to.

Yes, they will go to the Wow... on 64bit OS.

Best regards,

--
Arnor Baldvinsson - Icetips Alta LLC

NewsArchive
08-13-2015, 02:46 AM
Tony,

You always use HKLM\Software\PDS\PDSMED (and never hard-code "Wow6432Node").

By default, the SB installer reads/writes the 32-bit registry branch. To
access 64-bit resources, switch the installer into 64-bit mode using the
"Set x64 Mode..." script function. Then it reads/writes the 64-bit registry
branch.

BTW, you should only write to the 64-bit registry branch if your own
application is a native 64-bit program.

Friedrich

NewsArchive
08-13-2015, 10:57 AM
> Unless I missed a meeting<g> you don't need to check anything other
> than HKLM\Software\PDS\PDSMED. The OS knows where to look based on the
> bitness of the program looking at the key.
>
>

Lee, I think you must have made all of the meetings <g>.


Thanks to all that replied, just using HKLM\Software\PDS\PDSMED
works correctly on the 64-bit os. Seems I always try to make
things harder than they are.

Tony

NewsArchive
08-14-2015, 02:07 AM
Tony,

> Seems I always try to make things harder than they are.

That happens when you live on the bleed-to-death edge instead of just
the bleeding edge!<g>

Lee White

NewsArchive
08-14-2015, 02:11 AM
Too easy<g>

>Seems I always try to make
>things harder than they are.

Jeff Slarve
www.jssoftware.com
www.twitter.com/jslarve
I'll search help files & Google for you.

Grammar troll's, are the worse.