VirtualBox

Changeset 21916 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jul 31, 2009 3:18:36 PM (15 years ago)
Author:
vboxsync
Message:

Main/GuestProperties: create guest properties for the VBox version and SVN revision at startup time

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleImpl2.cpp

    r21878 r21916  
    2929#include "ConsoleImpl.h"
    3030#include "DisplayImpl.h"
     31#include "Version.h"
    3132#include "VMMDev.h"
    3233
     
    18691870
    18701871            pConsole->mVMMDev->hgcmHostCall ("VBoxGuestPropSvc", guestProp::SET_PROPS_HOST, 4, &parms[0]);
     1872
     1873            /* Set the VBox version string as a guest property */
     1874            parms[0].type = VBOX_HGCM_SVC_PARM_PTR;
     1875            parms[0].u.pointer.addr = (void *)"/VirtualBox/HostInfo/VBoxVer";
     1876            parms[0].u.pointer.size = sizeof("/VirtualBox/HostInfo/VBoxVer");
     1877            parms[1].type = VBOX_HGCM_SVC_PARM_PTR;
     1878            parms[1].u.pointer.addr = (void *)VBOX_VERSION_STRING;
     1879            parms[1].u.pointer.size = sizeof(VBOX_VERSION_STRING);
     1880            parms[2].type = VBOX_HGCM_SVC_PARM_PTR;
     1881            parms[2].u.pointer.addr = (void *)"TRANSIENT, RDONLYGUEST";
     1882            parms[2].u.pointer.size = sizeof("TRANSIENT, RDONLYGUEST");
     1883            pConsole->mVMMDev->hgcmHostCall ("VBoxGuestPropSvc", guestProp::SET_PROP_HOST, 3, &parms[0]);
     1884
     1885            /* Set the VBox SVN revision as a guest property */
     1886            parms[0].type = VBOX_HGCM_SVC_PARM_PTR;
     1887            parms[0].u.pointer.addr = (void *)"/VirtualBox/HostInfo/VBoxRev";
     1888            parms[0].u.pointer.size = sizeof("/VirtualBox/HostInfo/VBoxRev");
     1889            parms[1].type = VBOX_HGCM_SVC_PARM_PTR;
     1890            parms[1].u.pointer.addr = (void *)VBoxSVNRevString();
     1891            parms[1].u.pointer.size = strlen(VBoxSVNRevString()) + 1;
     1892            parms[2].type = VBOX_HGCM_SVC_PARM_PTR;
     1893            parms[2].u.pointer.addr = (void *)"TRANSIENT, RDONLYGUEST";
     1894            parms[2].u.pointer.size = sizeof("TRANSIENT, RDONLYGUEST");
     1895            pConsole->mVMMDev->hgcmHostCall ("VBoxGuestPropSvc", guestProp::SET_PROP_HOST, 3, &parms[0]);
    18711896
    18721897            /* Register the host notification callback */
  • trunk/src/VBox/Main/Version.cpp

    r14772 r21916  
    2525
    2626/**
    27  * This function is implemented in a separate file to speed up the
     27 * These functions are implemented in a separate file to speed up the
    2828 * compilation if only the SVN revision changed.
    2929 */
     
    3333    return VBOX_SVN_REV;
    3434}
     35
     36const char *VBoxSVNRevString ()
     37{
     38    return RT_XSTR(VBOX_SVN_REV);
     39}
    3540/* vi: set tabstop=4 shiftwidth=4 expandtab: */
  • trunk/src/VBox/Main/include/Version.h

    r14949 r21916  
    2323
    2424/**
    25  * Return the SVN revision as number.
     25 * Return the SVN revision as a number.
    2626 */
    2727unsigned long VBoxSVNRev ();
    2828
     29/**
     30 * Return the SVN revision as a string.
     31 */
     32const char *VBoxSVNRevString ();
     33
    2934#endif
    3035/* vi: set tabstop=4 shiftwidth=4 expandtab: */
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