VirtualBox

Ignore:
Timestamp:
Oct 19, 2009 8:49:10 AM (15 years ago)
Author:
vboxsync
Message:

VBoxClient/VBoxTray/VBgl: Reverted last check-ins to redo D-BUS movement.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxTray/helpers.cpp

    r23835 r23845  
    256256    return 0;
    257257}
     258
     259/** @todo move this in guest lib, also used in a similar way in VBoxService */
     260int getAdditionsVersion(char *pszVer, size_t cbSizeVer, char *pszRev, size_t cbSizeRev)
     261{
     262    HKEY hKey;
     263    int rc;
     264
     265    /* Check the new path first. */
     266    rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Sun\\VirtualBox Guest Additions", 0, KEY_READ, &hKey);
     267#ifdef RT_ARCH_AMD64
     268    if (rc != ERROR_SUCCESS)
     269    {
     270        /* Check Wow6432Node (for new entries). */
     271        rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Sun\\VirtualBox Guest Additions", 0, KEY_READ, &hKey);
     272    }
     273#endif
     274
     275    /* Still no luck? Then try the old xVM paths ... */
     276    if (RT_FAILURE(rc))
     277    {
     278        rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Sun\\xVM VirtualBox Guest Additions", 0, KEY_READ, &hKey);
     279#ifdef RT_ARCH_AMD64
     280        if (rc != ERROR_SUCCESS)
     281        {
     282            /* Check Wow6432Node (for new entries). */
     283            rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wow6432Node\\Sun\\xVM VirtualBox Guest Additions", 0, KEY_READ, &hKey);
     284        }
     285#endif
     286    }
     287
     288    /* Did we get something worth looking at? */
     289    if (RT_SUCCESS(rc))
     290    {
     291        DWORD dwSize;
     292        DWORD dwType;
     293
     294        /* Revision. */
     295        dwSize = cbSizeRev;
     296        rc = RegQueryValueEx(hKey, "Revision", NULL, &dwType, (BYTE*)(LPCTSTR)pszRev, &dwSize);
     297        /* Version. */
     298        dwSize = cbSizeVer;
     299        rc = RegQueryValueEx(hKey, "Version", NULL, &dwType, (BYTE*)(LPCTSTR)pszVer, &dwSize);
     300    }
     301
     302    if (NULL != hKey)
     303        RegCloseKey(hKey);
     304
     305    return rc;
     306}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette