Here's the correct translation and a working example:
Code: Select all
Let>HKEY_LOCAL_MACHINE=-2147483646
Let>HKEY_CURRENT_USER=-2147483647
Let>KEY_READ=131097
Let>KEY_QUERY_VALUE=1
Let>KEY_WOW64_64KEY=256
Let>flags={%KEY_QUERY_VALUE% OR %KEY_READ% OR %KEY_WOW64_64KEY%}
Let>key=Software\Microsoft\Windows NT\CurrentVersion
LibFunc>advapi32,RegOpenKeyExA,result,HKEY_LOCAL_MACHINE,key,0,flags,ref:0
Let>hkey=result_5
Let>RRF_RT_ANY=65535
Let>buffer_SIZE=255
LibFunc>advapi32,RegGetValueA,result,hkey,,ProductId,RRF_RT_ANY,type,str:buffer,ref:255
MessageModal>ProductId: %result_6%
LibFunc>advapi32,RegCloseKey,result,hkey
Change the key and value accordingly. The above gets "ProductId" from the 64 bit registry of Windows Vista/7.
Of course if you use RegOpenKeyEx yourself then you must then continue to use LibFunc and the registry API functions to get the data - you can't use RegOpenKeyEx and then use the native registry functions. Note that in future we'll implement the ability to make the native registry functions retrieve from the 64 bit registry.