Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Wolfgang Riedmann" Newsgroups: comp.lang.clipper.visual-objects Subject: Re: Registry HKLM not accessible as expected Date: Wed, 7 Mar 2018 15:26:52 +0100 Lines: 67 Message-ID: References: X-Trace: individual.net ciHuhz4wDfuplhriA2WXiwfoSZGkA3Q64veiD4pbclKycRHc8= Cancel-Lock: sha1:r2sZyE/jROFP/hvo1oX8OVinr8s= User-Agent: XanaNews/1.18.1.6 Xref: csiph.com comp.lang.clipper.visual-objects:11464 Hi Dick, HKLM is writable only with elevated rights. If you need to write machine-wide values without administrative rights, you need other ways, maybe a configuration file in the c:\ProgramData. If you need code to elevate rights: I can give you something (but in X#). Wolfgang D.J.W. van Kooten wrote: > We used to store registry values to HKCU which was in many cases not > ideal. I changed this to HKLM all over my program and found no entries > there (even on my own Pc) ; instead the values are written in 2 > locations > > Computer\HKEY_USERS\S-1-5-21-3025325910-2195600122-3119758833-1001_Cla > sses\VirtualStore\MACHINE\SOFTWARE\WOW6432Node\(etc) > > where I wanted HKLM\SOFTWARE\(etc). > > I have 2 questions: > > 1 How can I prevent that the system uses "Virtiual Store"? See the > function as we use below. > > 2 I know that WOW6432Node is used for 32 bits apps in a 64 bit > environment. DO I need to check on this on writing to the registry or > will Windows automatically take care of that? > > And can it differ depending on someone's pc in a network? > > Basically this is the code we use: > > li_Error := RegCreateKeyEx( ; > SELF:hKeyP, ; // hKeyP > AS PTR > String2Psz( s_Full_SubKey ), ; // lpSubKey > AS PSZ > 0, ; // Reserved > AS DWORD > String2Psz( SELF:s_Class ), ; // lpClass > AS PSZ > REG_OPTION_NON_VOLATILE, ; // > dwOptions AS DWORD > KEY_SET_VALUE + KEY_CREATE_SUB_KEY, ; // > samDesired AS DWORD > 0, ; // > lpSecurityAttributes AS _winSECURITY_ATTRIBUTES > @dw_KeyHandle, ; // > phkResult AS PTR > @dw_Disposition ; // > lpdwDisposition AS DWORD PTR > ) // AS LONG > PASCAL:ADVAPI32.RegCreateKeyExA#130 > > > > Dick --