Changeset 37019 in vbox for trunk/src/VBox/Additions
- Timestamp:
- May 10, 2011 8:20:35 AM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 71634
- Location:
- trunk/src/VBox/Additions/common
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibAdditions.cpp
r37016 r37019 39 39 * Fallback for vbglR3GetAdditionsVersion. 40 40 */ 41 static int vbglR3GetAdditionsCompileTimeVersion(char **ppszVer, char **ppszRev) 42 { 41 static int vbglR3GetAdditionsCompileTimeVersion(char **ppszVer, char **ppszVerEx, char **ppszRev) 42 { 43 /* Raw version string: major.minor.build. */ 43 44 if (ppszVer) 44 45 { 45 46 *ppszVer = RTStrDup(VBOX_VERSION_STRING_RAW); 46 47 if (!*ppszVer) 48 return VERR_NO_STR_MEMORY; 49 } 50 51 /* Extended version string: major.minor.build (+ vendor [suffix(es)]). */ 52 if (ppszVerEx) 53 { 54 *ppszVerEx = RTStrDup(VBOX_VERSION_STRING); 55 if (!*ppszVerEx) 47 56 return VERR_NO_STR_MEMORY; 48 57 } … … 169 178 * 170 179 * @returns IPRT status value 171 * @param ppszVer Receives pointer of allocated version string. NULL is 180 * @param ppszVer Receives pointer of allocated raw version string 181 * (major.minor.build). NULL is accepted. The returned 182 * pointer must be freed using RTStrFree().* 183 * @param ppszVerEx Receives pointer of allocated full version string 184 * (raw version + vendor suffix(es)). NULL is 172 185 * accepted. The returned pointer must be freed using 173 186 * RTStrFree(). … … 176 189 * RTStrFree(). 177 190 */ 178 VBGLR3DECL(int) VbglR3GetAdditionsVersion(char **ppszVer, char **ppsz Rev)191 VBGLR3DECL(int) VbglR3GetAdditionsVersion(char **ppszVer, char **ppszVerEx, char **ppszRev) 179 192 { 180 193 #ifdef RT_OS_WINDOWS … … 210 223 rc = VERR_NO_MEMORY; 211 224 } 225 if (ppszVerEx) 226 { 227 dwSize = 32; /* Reset */ 228 pszTmp = (char*)RTMemAlloc(dwSize); 229 if (pszTmp) 230 { 231 l = RegQueryValueEx(hKey, "VersionEx", NULL, &dwType, (BYTE*)(LPCTSTR)pszTmp, &dwSize); 232 if (l == ERROR_SUCCESS) 233 { 234 if (dwType == REG_SZ) 235 rc = RTStrDupEx(ppszVerEx, pszTmp); 236 else 237 rc = VERR_INVALID_PARAMETER; 238 } 239 else 240 { 241 rc = RTErrConvertFromWin32(l); 242 } 243 RTMemFree(pszTmp); 244 } 245 else 246 rc = VERR_NO_MEMORY; 247 } 212 248 /* Revision. */ 213 249 if (ppszRev) … … 248 284 * into this binary. 249 285 */ 250 rc = vbglR3GetAdditionsCompileTimeVersion(ppszVer, ppsz Rev);286 rc = vbglR3GetAdditionsCompileTimeVersion(ppszVer, ppszVerEx, ppszRev); 251 287 } 252 288 return rc; … … 256 292 * On non-Windows platforms just return the compile-time version string. 257 293 */ 258 return vbglR3GetAdditionsCompileTimeVersion(ppszVer, ppsz Rev);294 return vbglR3GetAdditionsCompileTimeVersion(ppszVer, ppszVerEx, ppszRev); 259 295 #endif /* !RT_OS_WINDOWS */ 260 296 } -
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibHostVersion.cpp
r28800 r37019 129 129 if (RT_SUCCESS(rc)) 130 130 { 131 rc = VbglR3GetAdditionsVersion(ppszGuestVersion, NULL /* Revision not needed here */); 131 rc = VbglR3GetAdditionsVersion(ppszGuestVersion, NULL /* Extended version not needed here */, 132 NULL /* Revision not needed here */); 132 133 if (RT_FAILURE(rc)) 133 134 LogFlow(("Could not read VBox guest version! rc = %Rrc\n", rc)); -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp
r36249 r37019 190 190 */ 191 191 char *pszAddVer; 192 char *pszAddVerEx; 192 193 char *pszAddRev; 193 rc = VbglR3GetAdditionsVersion(&pszAddVer, &pszAdd Rev);194 rc = VbglR3GetAdditionsVersion(&pszAddVer, &pszAddVerEx, &pszAddRev); 194 195 VBoxServiceWritePropF(g_uVMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/Version", 195 196 "%s", RT_FAILURE(rc) ? "" : pszAddVer); 197 VBoxServiceWritePropF(g_uVMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/VersionEx", 198 "%s", RT_FAILURE(rc) ? "" : pszAddVerEx); 196 199 VBoxServiceWritePropF(g_uVMInfoGuestPropSvcClientID, "/VirtualBox/GuestAdd/Revision", 197 200 "%s", RT_FAILURE(rc) ? "" : pszAddRev); … … 199 202 { 200 203 RTStrFree(pszAddVer); 204 RTStrFree(pszAddVerEx); 201 205 RTStrFree(pszAddRev); 202 206 }
Note:
See TracChangeset
for help on using the changeset viewer.