Changeset 23856 in vbox
- Timestamp:
- Oct 19, 2009 11:57:22 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 53624
- Location:
- trunk
- Files:
-
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxGuestLib.h
r23845 r23856 404 404 VBGLR3DECL(int) VbglR3SetGuestCaps(uint32_t fOr, uint32_t fNot); 405 405 VBGLR3DECL(int) VbglR3WaitEvent(uint32_t fMask, uint32_t cMillies, uint32_t *pfEvents); 406 VBGLR3DECL(int) VbglR3GetAdditionsVersion(char **ppszVer, char **ppszRev); 406 407 /** @} */ 407 408 … … 471 472 VBGLR3DECL(int) VbglR3GuestPropWait(uint32_t u32ClientId, const char *pszPatterns, void *pvBuf, uint32_t cbBuf, uint64_t u64Timestamp, uint32_t cMillies, char ** ppszName, char **ppszValue, uint64_t *pu64Timestamp, char **ppszFlags, uint32_t *pcbBufActual); 472 473 /** @} */ 474 475 /** @name Host version handling 476 * @{ */ 477 VBGLR3DECL(int) VbglR3HostVersionCompare(const char *pszVer1, const char *pszVer2); 478 VBGLR3DECL(bool) VbglR3HostVersionCheckForUpdate(char **ppszHostVersion, char **ppszGuestVersion); 479 VBGLR3DECL(int) VbglR3HostVersionStore(const char* pszVer); 480 /** @} */ 473 481 # endif /* VBOX_WITH_GUEST_PROPS defined */ 474 482 -
trunk/src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk
r23845 r23856 86 86 VBoxGuestR3LibDaemonize.cpp \ 87 87 VBoxGuestR3LibGR.cpp \ 88 $(if $(VBOX_WITH_GUEST_PROPS),VBoxGuestR3LibGuestProp.cpp,) \ 88 $(if $(VBOX_WITH_GUEST_PROPS), \ 89 VBoxGuestR3LibGuestProp.cpp \ 90 VBoxGuestR3LibHostVersion.cpp,) \ 89 91 VBoxGuestR3LibMouse.cpp \ 90 92 VBoxGuestR3LibMisc.cpp \ … … 96 98 VBoxGuestR3Lib.cpp \ 97 99 VBoxGuestR3LibGR.cpp \ 98 $(if $(VBOX_WITH_GUEST_PROPS),VBoxGuestR3LibGuestProp.cpp,) \ 100 $(if $(VBOX_WITH_GUEST_PROPS), \ 101 VBoxGuestR3LibGuestProp.cpp \ 102 VBoxGuestR3LibHostVersion.cpp,) \ 99 103 VBoxGuestR3LibMisc.cpp \ 100 104 VBoxGuestR3LibTime.cpp -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp
r23845 r23856 26 26 #include <iprt/mem.h> 27 27 #include <VBox/log.h> 28 29 28 #include "VBGLR3Internal.h" 30 29 … … 194 193 } 195 194 195 196 /** @todo Docs */ 197 VBGLR3DECL(int) VbglR3GetAdditionsVersion(char **ppszVer, char **ppszRev) 198 { 199 int rc; 200 #ifdef RT_OS_WINDOWS 201 HKEY hKey; 202 LONG r; 203 204 /* Check the new path first. */ 205 r = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Sun\\VirtualBox Guest Additions", 0, KEY_READ, &hKey); 206 #ifdef RT_ARCH_AMD64 207 if (r != ERROR_SUCCESS) 208 { 209 /* Check Wow6432Node (for new entries). */ 210 r = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Sun\\VirtualBox Guest Additions", 0, KEY_READ, &hKey); 211 } 212 #endif 213 214 /* Still no luck? Then try the old xVM paths ... */ 215 if (FAILED(r)) 216 { 217 r = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Sun\\xVM VirtualBox Guest Additions", 0, KEY_READ, &hKey); 218 #ifdef RT_ARCH_AMD64 219 if (r != ERROR_SUCCESS) 220 { 221 /* Check Wow6432Node (for new entries). */ 222 r = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Sun\\xVM VirtualBox Guest Additions", 0, KEY_READ, &hKey); 223 } 224 #endif 225 } 226 227 /* Did we get something worth looking at? */ 228 if (SUCCEEDED(r)) 229 { 230 /* Version. */ 231 DWORD dwType; 232 DWORD dwSize = 32; 233 char *pszVer = (char*)RTMemAlloc(dwSize); 234 if (pszVer) 235 { 236 if (ERROR_SUCCESS == RegQueryValueEx(hKey, "Version", NULL, &dwType, (BYTE*)(LPCTSTR)pszVer, &dwSize)) 237 *ppszVer = pszVer; 238 } 239 /* Revision. */ 240 if (ppszRev) 241 { 242 dwSize = 32; 243 char *pszRev = (char*)RTMemAlloc(dwSize); 244 if (ERROR_SUCCESS == RegQueryValueEx(hKey, "Revision", NULL, &dwType, (BYTE*)(LPCTSTR)pszRev, &dwSize)) 245 *ppszRev = pszRev; 246 } 247 } 248 rc = RTErrConvertFromWin32(r); 249 250 if (NULL != hKey) 251 RegCloseKey(hKey); 252 #else 253 #endif /* RT_OS_WINDOWS */ 254 return rc; 255 }
Note:
See TracChangeset
for help on using the changeset viewer.