summaryrefslogtreecommitdiff
path: root/src/if_ole.cpp
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2010-07-31 14:45:05 +0200
committerBram Moolenaar <Bram@vim.org>2010-07-31 14:45:05 +0200
commit460fbaca72c042c53abe7bb13e916b8b3484caba (patch)
tree7e51657f058a582942182c5d0639fbcc5cfd0879 /src/if_ole.cpp
parent8408a9ad9b6d0b75e892ef3acec317fe7ea24667 (diff)
downloadvim-git-460fbaca72c042c53abe7bb13e916b8b3484caba.tar.gz
Possibly make OLE work on Windows 64 bit. (untested)
Diffstat (limited to 'src/if_ole.cpp')
-rw-r--r--src/if_ole.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/if_ole.cpp b/src/if_ole.cpp
index 1e5eee65a..1f73705b1 100644
--- a/src/if_ole.cpp
+++ b/src/if_ole.cpp
@@ -50,6 +50,14 @@ WINOLEAUTAPI UnRegisterTypeLib(REFGUID libID, WORD wVerMajor,
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
*****************************************************************************/
@@ -157,7 +165,8 @@ CVim *CVim::Create(int *pbDoRestart)
// 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.
@@ -692,7 +701,7 @@ static void SetKeyAndValue(const char *key, const char *subkey, const char *valu
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;