VirtualBox

Changeset 70061 in vbox


Ignore:
Timestamp:
Dec 11, 2017 3:26:46 PM (7 years ago)
Author:
vboxsync
Message:

GuestPropertySvc.h: Working on making it usable from C (VBoxGuest, ++)

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/HostServices/GuestPropertySvc.h

    r70060 r70061  
    290290#define GUESTPROPHOSTCALLBACKDATA_MAGIC     UINT32_C(0x69c87a78)
    291291
    292 /** Everything defined in this file lives in this namespace. */
    293 namespace guestProp {
    294 
    295292/**
    296293 * HGCM parameter structures.  Packing is explicitly defined as this is a wire format.
    297294 */
    298295/** The guest is requesting the value of a property */
    299 typedef struct _GetProperty
     296typedef struct GuestPropMsgGetProperty
    300297{
    301298    VBGLIOCHGCMCALL hdr;
     
    329326     */
    330327    HGCMFunctionParameter size;
    331 } GetProperty;
    332 AssertCompileSize(GetProperty, 40 + 4 * (ARCH_BITS == 64 ? 16 : 12));
     328} GuestPropMsgGetProperty;
     329AssertCompileSize(GuestPropMsgGetProperty, 40 + 4 * (ARCH_BITS == 64 ? 16 : 12));
    333330
    334331/** The guest is requesting to change a property */
    335 typedef struct _SetProperty
     332typedef struct GuestPropMsgSetProperty
    336333{
    337334    VBGLIOCHGCMCALL hdr;
     
    360357     */
    361358    HGCMFunctionParameter flags;
    362 } SetProperty;
    363 AssertCompileSize(SetProperty, 40 + 3 * (ARCH_BITS == 64 ? 16 : 12));
     359} GuestPropMsgSetProperty;
     360AssertCompileSize(GuestPropMsgSetProperty, 40 + 3 * (ARCH_BITS == 64 ? 16 : 12));
    364361
    365362/** The guest is requesting to change the value of a property */
    366 typedef struct _SetPropertyValue
     363typedef struct GuestPropMsgSetPropertyValue
    367364{
    368365    VBGLIOCHGCMCALL hdr;
     
    383380     */
    384381    HGCMFunctionParameter value;
    385 } SetPropertyValue;
    386 AssertCompileSize(SetPropertyValue, 40 + 2 * (ARCH_BITS == 64 ? 16 : 12));
     382} GuestPropMsgSetPropertyValue;
     383AssertCompileSize(GuestPropMsgSetPropertyValue, 40 + 2 * (ARCH_BITS == 64 ? 16 : 12));
    387384
    388385/** The guest is requesting to remove a property */
    389 typedef struct _DelProperty
     386typedef struct GuestPropMsgDelProperty
    390387{
    391388    VBGLIOCHGCMCALL hdr;
     
    398395     */
    399396    HGCMFunctionParameter name;
    400 } DelProperty;
    401 AssertCompileSize(DelProperty, 40 + 1 * (ARCH_BITS == 64 ? 16 : 12));
     397} GuestPropMsgDelProperty;
     398AssertCompileSize(GuestPropMsgDelProperty, 40 + 1 * (ARCH_BITS == 64 ? 16 : 12));
    402399
    403400/** The guest is requesting to enumerate properties */
    404 typedef struct _EnumProperties
     401typedef struct GuestPropMsgEnumProperties
    405402{
    406403    VBGLIOCHGCMCALL hdr;
     
    429426     */
    430427    HGCMFunctionParameter size;
    431 } EnumProperties;
    432 AssertCompileSize(EnumProperties, 40 + 3 * (ARCH_BITS == 64 ? 16 : 12));
     428} GuestPropMsgEnumProperties;
     429AssertCompileSize(GuestPropMsgEnumProperties, 40 + 3 * (ARCH_BITS == 64 ? 16 : 12));
    433430
    434431/**
     
    453450 * the outgoing timestamp from the previous call.
    454451 */
    455 typedef struct _GetNotification
     452typedef struct GuestPropMsgGetNotification
    456453{
    457454    VBGLIOCHGCMCALL hdr;
     
    489486     */
    490487    HGCMFunctionParameter size;
    491 } GetNotification;
    492 AssertCompileSize(GetNotification, 40 + 4 * (ARCH_BITS == 64 ? 16 : 12));
    493 
    494 } /* namespace guestProp */
     488} GuestPropMsgGetNotification;
     489AssertCompileSize(GuestPropMsgGetNotification, 40 + 4 * (ARCH_BITS == 64 ? 16 : 12));
     490
    495491
    496492#endif  /* !___VBox_HostService_GuestPropertySvc_h */
  • trunk/src/VBox/Additions/common/VBoxControl/VBoxControl.cpp

    r70058 r70061  
    11581158static RTEXITCODE getGuestProperty(int argc, char **argv)
    11591159{
    1160     using namespace guestProp;
    1161 
    11621160    bool fVerbose = false;
    11631161    if (   argc == 2
     
    14321430static RTEXITCODE waitGuestProperty(int argc, char **argv)
    14331431{
    1434     using namespace guestProp;
    1435 
    14361432    /*
    14371433     * Handle arguments
  • trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibGuestProp.cpp

    r70058 r70061  
    117117};
    118118
    119 using namespace guestProp;
     119
    120120
    121121/**
     
    164164    if (pszValue != NULL)
    165165    {
    166         SetProperty Msg;
     166        GuestPropMsgSetProperty Msg;
    167167        VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, GUEST_PROP_FN_SET_PROP_VALUE, 3);
    168168        VbglHGCMParmPtrSetString(&Msg.name,  pszName);
     
    173173    else
    174174    {
    175         DelProperty Msg;
     175        GuestPropMsgDelProperty Msg;
    176176        VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, GUEST_PROP_FN_DEL_PROP, 1);
    177177        VbglHGCMParmPtrSetString(&Msg.name, pszName);
     
    201201    if (pszValue != NULL)
    202202    {
    203         SetPropertyValue Msg;
     203        GuestPropMsgSetPropertyValue Msg;
    204204        VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, GUEST_PROP_FN_SET_PROP_VALUE, 2);
    205205        VbglHGCMParmPtrSetString(&Msg.name, pszName);
     
    209209    else
    210210    {
    211         DelProperty Msg;
     211        GuestPropMsgDelProperty Msg;
    212212        VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, GUEST_PROP_FN_DEL_PROP, 1);
    213213        VbglHGCMParmPtrSetString(&Msg.name, pszName);
     
    297297     * Create the GET_PROP message and call the host.
    298298     */
    299     GetProperty Msg;
     299    GuestPropMsgGetProperty Msg;
    300300    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, GUEST_PROP_FN_GET_PROP, 4);
    301301    VbglHGCMParmPtrSetString(&Msg.name, pszName);
     
    492492                                       uint32_t *pcbBufActual)
    493493{
    494     EnumProperties Msg;
     494    GuestPropMsgEnumProperties Msg;
    495495    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, GUEST_PROP_FN_ENUM_PROPS, 3);
    496496
     
    757757    AssertPtrReturn(pszName,  VERR_INVALID_POINTER);
    758758
    759     DelProperty Msg;
     759    GuestPropMsgDelProperty Msg;
    760760    VBGL_HGCM_HDR_INIT(&Msg.hdr, idClient, GUEST_PROP_FN_DEL_PROP, 1);
    761761    VbglHGCMParmPtrSetString(&Msg.name, pszName);
     
    859859     * Create the GET_NOTIFICATION message and call the host.
    860860     */
    861     GetNotification Msg;
     861    GuestPropMsgGetNotification Msg;
    862862    VBGL_HGCM_HDR_INIT_TIMED(&Msg.hdr, idClient, GUEST_PROP_FN_GET_NOTIFICATION, 4, cMillies);
    863863
  • trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibVideo.cpp

    r70058 r70061  
    314314{
    315315#if defined(VBOX_WITH_GUEST_PROPS)
    316     using namespace guestProp;
    317 
    318316    int rc;
    319317    HGCMCLIENTID idClient = 0;
     
    374372{
    375373#ifdef VBOX_WITH_GUEST_PROPS
    376     using namespace guestProp;
    377 
    378374    unsigned cHighestScreen = 0;
    379375    int rc = VbglR3VideoModeGetHighestSavedScreen(&cHighestScreen);
     
    457453{
    458454#ifdef VBOX_WITH_GUEST_PROPS
    459     using namespace guestProp;
    460 
    461455    /*
    462456     * First we retrieve the video mode which is saved as a string in the
  • trunk/src/VBox/Additions/linux/lightdm-greeter/vbox-greeter.cpp

    r70058 r70061  
    9999#include <VBox/log.h>
    100100#ifdef VBOX_WITH_GUEST_PROPS
    101  #include <VBox/HostServices/GuestPropertySvc.h>
    102  using namespace guestProp;
     101# include <VBox/HostServices/GuestPropertySvc.h>
    103102#endif
    104103
  • trunk/src/VBox/HostServices/GuestProperties/testcase/tstGuestPropSvc.cpp

    r70058 r70061  
    3131static RTTEST g_hTest = NIL_RTTEST;
    3232
    33 using namespace guestProp;
    34 
     33
     34/*********************************************************************************************************************************
     35*   Internal Functions                                                                                                           *
     36*********************************************************************************************************************************/
    3537extern "C" DECLCALLBACK(DECLEXPORT(int)) VBoxHGCMSvcLoad (VBOXHGCMSVCFNTABLE *ptable);
     38
    3639
    3740/** Simple call handle structure for the guest call completion callback */
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r70058 r70061  
    17581758                                                     uint32_t cbParms)
    17591759{
    1760     using namespace guestProp;
    1761 
    17621760    Assert(u32Function == 0); NOREF(u32Function);
    17631761
     
    18031801    AssertReturn(m_pVMMDev, E_FAIL);
    18041802
    1805     using namespace guestProp;
    1806 
    18071803    VBOXHGCMSVCPARM parm[3];
    1808 
    18091804    parm[0].type = VBOX_HGCM_SVC_PARM_PTR;
    18101805    parm[0].u.pointer.addr = (void*)aPatterns.c_str();
     
    59355930
    59365931    HRESULT rc = E_UNEXPECTED;
    5937     using namespace guestProp;
    5938 
    59395932    try
    59405933    {
     
    60126005     * ptrVM, so there is no need to hold a lock of this */
    60136006
    6014     using namespace guestProp;
    6015 
    60166007    VBOXHGCMSVCPARM parm[3];
    60176008
     
    60626053     * ptrVM, so there is no need to hold a lock of this */
    60636054
    6064     using namespace guestProp;
    6065 
    60666055    VBOXHGCMSVCPARM parm[1];
    6067 
    60686056    parm[0].type = VBOX_HGCM_SVC_PARM_PTR;
    60696057    parm[0].u.pointer.addr = (void*)aName.c_str();
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r70058 r70061  
    61296129
    61306130#ifdef VBOX_WITH_GUEST_PROPS_RDONLY_GUEST
    6131         rc = configSetGlobalPropertyFlags(pConsole->m_pVMMDev, guestProp::RDONLYGUEST);
     6131        rc = configSetGlobalPropertyFlags(pConsole->m_pVMMDev, GUEST_PROP_F_RDONLYGUEST);
    61326132        AssertRCReturn(rc, rc);
    61336133#endif
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r70058 r70061  
    56475647                                               com::Utf8Str &aFlags) const
    56485648{
    5649     using namespace guestProp;
    5650 
    56515649    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     5650
    56525651    HWData::GuestPropertyMap::const_iterator it = mHWData->mGuestProperties.find(aName);
    5653 
    56545652    if (it != mHWData->mGuestProperties.end())
    56555653    {
     
    57425740                                             const com::Utf8Str &aFlags, bool fDelete)
    57435741{
    5744     using namespace guestProp;
    5745 
    57465742    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    5747     HRESULT rc = S_OK;
    5748 
    5749     rc = i_checkStateDependency(MutableOrSavedStateDep);
     5743    HRESULT rc = i_checkStateDependency(MutableOrSavedStateDep);
    57505744    if (FAILED(rc)) return rc;
    57515745
     
    58995893                                                     std::vector<com::Utf8Str> &aFlags)
    59005894{
    5901     using namespace guestProp;
    5902 
    59035895    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    59045896    Utf8Str strPatterns(aPatterns);
    5905 
    5906     HWData::GuestPropertyMap propMap;
    59075897
    59085898    /*
    59095899     * Look for matching patterns and build up a list.
    59105900     */
     5901    HWData::GuestPropertyMap propMap;
    59115902    for (HWData::GuestPropertyMap::const_iterator
    59125903         it = mHWData->mGuestProperties.begin();
     
    1352413515
    1352513516#ifdef VBOX_WITH_GUEST_PROPS
    13526     using namespace guestProp;
    13527 
    1352813517    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    1352913518
     
    1353413523    aFlags.resize(cEntries);
    1353513524
    13536     size_t  i = 0;
     13525    size_t i = 0;
    1353713526    for (HWData::GuestPropertyMap::const_iterator
    1353813527         it = mHWData->mGuestProperties.begin();
     
    1356813557
    1356913558#ifdef VBOX_WITH_GUEST_PROPS
    13570     using namespace guestProp;
    13571 
    1357213559    try
    1357313560    {
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