Changeset 23845 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Oct 19, 2009 8:49:10 AM (15 years ago)
- Location:
- trunk/src/VBox/Additions/common/VBoxGuestLib
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/Makefile.kmk
r23839 r23845 86 86 VBoxGuestR3LibDaemonize.cpp \ 87 87 VBoxGuestR3LibGR.cpp \ 88 $(if $(VBOX_WITH_GUEST_PROPS), \ 89 VBoxGuestR3LibGuestProp.cpp \ 90 VBoxGuestR3LibHostVersion.cpp,) \ 88 $(if $(VBOX_WITH_GUEST_PROPS),VBoxGuestR3LibGuestProp.cpp,) \ 91 89 VBoxGuestR3LibMouse.cpp \ 92 90 VBoxGuestR3LibMisc.cpp \ … … 98 96 VBoxGuestR3Lib.cpp \ 99 97 VBoxGuestR3LibGR.cpp \ 100 $(if $(VBOX_WITH_GUEST_PROPS), \ 101 VBoxGuestR3LibGuestProp.cpp \ 102 VBoxGuestR3LibHostVersion.cpp,) \ 98 $(if $(VBOX_WITH_GUEST_PROPS),VBoxGuestR3LibGuestProp.cpp,) \ 103 99 VBoxGuestR3LibMisc.cpp \ 104 100 VBoxGuestR3LibTime.cpp -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibMisc.cpp
r23843 r23845 26 26 #include <iprt/mem.h> 27 27 #include <VBox/log.h> 28 28 29 #include "VBGLR3Internal.h" 29 30 … … 193 194 } 194 195 195 196 /** @todo Docs */197 VBGLR3DECL(int) VbglR3GetAdditionsVersion(char **ppszVer, char **ppszRev)198 {199 int rc;200 #ifdef RT_OS_WINDOWS201 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_AMD64207 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 # endif213 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_AMD64219 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 # endif225 }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 #else253 rc = VERR_NOT_IMPLEMENTED;254 #endif /* RT_OS_WINDOWS */255 return rc;256 }
Note:
See TracChangeset
for help on using the changeset viewer.