RegKeyWrite will not create a key under HKLM in Windows 7 64 bit. Using HKLM64 does not work either. 
Funny, RegKeyWrite will create keys under HKCU without use of the "64" in windows 7 64 bit 
 
RegKeyRead will read from HKLM64 keys and sub keys.  
Does anybody know the game rules here. I would like to know the definitive rule / answer. 
Thanks