comparison src/if_ole.cpp @ 2443:499bff609a86 vim73

Possibly make OLE work on Windows 64 bit. (untested)
author Bram Moolenaar <bram@vim.org>
date Sat, 31 Jul 2010 14:45:05 +0200
parents a0cce15dd2a9
children 943280505f72
comparison
equal deleted inserted replaced
2442:14f01499dd16 2443:499bff609a86
48 #ifdef __MINGW32__ 48 #ifdef __MINGW32__
49 WINOLEAUTAPI UnRegisterTypeLib(REFGUID libID, WORD wVerMajor, 49 WINOLEAUTAPI UnRegisterTypeLib(REFGUID libID, WORD wVerMajor,
50 WORD wVerMinor, LCID lcid, SYSKIND syskind); 50 WORD wVerMinor, LCID lcid, SYSKIND syskind);
51 #endif 51 #endif
52 52
53 /*
54 * Modern way of creating registry entries, also works on 64 bit windows when
55 * compiled as a 32 bit program.
56 */
57 # ifndef KEY_WOW64_64KEY
58 # define KEY_WOW64_64KEY 0x0100
59 # endif
60
53 /***************************************************************************** 61 /*****************************************************************************
54 1. Internal definitions for this file 62 1. Internal definitions for this file
55 *****************************************************************************/ 63 *****************************************************************************/
56 64
57 class CVim; 65 class CVim;
155 HKEY hKey; 163 HKEY hKey;
156 164
157 // Check we can write to the registry. 165 // Check we can write to the registry.
158 // RegCreateKeyEx succeeds even if key exists. W.Briscoe W2K 20021011 166 // RegCreateKeyEx succeeds even if key exists. W.Briscoe W2K 20021011
159 if (RegCreateKeyEx(HKEY_CLASSES_ROOT, MYVIPROGID, 0, NULL, 167 if (RegCreateKeyEx(HKEY_CLASSES_ROOT, MYVIPROGID, 0, NULL,
160 REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, NULL)) 168 REG_OPTION_NON_VOLATILE,
169 KEY_WOW64_64KEY | KEY_ALL_ACCESS, NULL, &hKey, NULL))
161 { 170 {
162 delete me; 171 delete me;
163 return NULL; // Unable to write to registry. Quietly fail. 172 return NULL; // Unable to write to registry. Quietly fail.
164 } 173 }
165 RegCloseKey(hKey); 174 RegCloseKey(hKey);
690 699
691 // Create and open key and subkey. 700 // Create and open key and subkey.
692 long result = RegCreateKeyEx(HKEY_CLASSES_ROOT, 701 long result = RegCreateKeyEx(HKEY_CLASSES_ROOT,
693 buffer, 702 buffer,
694 0, NULL, REG_OPTION_NON_VOLATILE, 703 0, NULL, REG_OPTION_NON_VOLATILE,
695 KEY_ALL_ACCESS, NULL, 704 KEY_WOW64_64KEY | KEY_ALL_ACCESS, NULL,
696 &hKey, NULL); 705 &hKey, NULL);
697 if (result != ERROR_SUCCESS) 706 if (result != ERROR_SUCCESS)
698 return; 707 return;
699 708
700 // Set the value 709 // Set the value