WORD wVerMinor, LCID lcid, SYSKIND syskind);
#endif
+/*
+ * Modern way of creating registry entries, also works on 64 bit windows when
+ * compiled as a 32 bit program.
+ */
+# ifndef KEY_WOW64_64KEY
+# define KEY_WOW64_64KEY 0x0100
+# endif
+
/*****************************************************************************
1. Internal definitions for this file
*****************************************************************************/
// Check we can write to the registry.
// RegCreateKeyEx succeeds even if key exists. W.Briscoe W2K 20021011
if (RegCreateKeyEx(HKEY_CLASSES_ROOT, MYVIPROGID, 0, NULL,
- REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, NULL))
+ REG_OPTION_NON_VOLATILE,
+ KEY_WOW64_64KEY | KEY_ALL_ACCESS, NULL, &hKey, NULL))
{
delete me;
return NULL; // Unable to write to registry. Quietly fail.
long result = RegCreateKeyEx(HKEY_CLASSES_ROOT,
buffer,
0, NULL, REG_OPTION_NON_VOLATILE,
- KEY_ALL_ACCESS, NULL,
+ KEY_WOW64_64KEY | KEY_ALL_ACCESS, NULL,
&hKey, NULL);
if (result != ERROR_SUCCESS)
return;