ok i can write w/ this code:
invoke RegCreateKeyEx,HKEY_LOCAL_MACHINE,addr subkeyname,NULL,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,addr pKey,addr Disp
invoke RegSetValueEx,pKey,addr stringvalue,NULL,REG_SZ, addr newp1,sizeof stringvalue
invoke RegCloseKey,pKey
but when calling this, it retuns a null string and i dont know why:
invoke RegCreateKeyEx,HKEY_LOCAL_MACHINE,addr subkeyname,NULL,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,addr pKey,addr Disp
invoke RegQueryValueEx,pKey,addr stringvalue,NULL,REG_SZ,addr regtext,addr Temp
invoke RegCloseKey,pKey
Anyone??? Any help would be most apreciated! thanx.
-bradIf it fails under NT/win2k, I would say it's the bad habit of using KEY_ALL_ACCESS flag. Lots of code I see use that key: maybe it's convenient: just specify the highest access right key and forget it. That's a sloppy practice. In the case of RegCreateKeyEx, it fires back. Why? Even if you're admin, Windows doesn't allow you to create a key under HKEY_LOCAL_MACHINE and HKEY_USERS. Look up that warning in your win32 api reference. Normally KEY_READ+KEY_WRITE is sufficient.