VirtualBox

Changeset 24664 in vbox for trunk/src


Ignore:
Timestamp:
Nov 14, 2009 11:55:35 PM (15 years ago)
Author:
vboxsync
Message:

ConsoleImpl.cpp: Fussing over the guest property code. (no fixes yet)

File:
1 edited

Legend:

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

    r24618 r24664  
    507507
    508508#ifdef VBOX_WITH_GUEST_PROPS
     509
    509510bool Console::enabledGuestPropertiesVRDP(void)
    510511{
     
    607608    return;
    608609}
     610
    609611#endif /* VBOX_WITH_GUEST_PROPS */
    610612
     
    11621164
    11631165#ifdef VBOX_WITH_GUEST_PROPS
     1166
    11641167// static
    11651168DECLCALLBACK(int)
    1166 Console::doGuestPropNotification(void *pvExtension, uint32_t,
     1169Console::doGuestPropNotification(void *pvExtension, uint32_t u32Function,
    11671170                                 void *pvParms, uint32_t cbParms)
    11681171{
    11691172    using namespace guestProp;
    11701173
    1171 //     LogFlowFunc(("pvExtension=%p, pvParms=%p, cbParms=%u\n", pvExtension, pvParms, cbParms));
    1172     int rc = VINF_SUCCESS;
    1173     /* No locking, as this is purely a notification which does not make any
    1174      * changes to the object state. */
    1175     PHOSTCALLBACKDATA pCBData = reinterpret_cast<PHOSTCALLBACKDATA>(pvParms);
     1174    Assert(u32Function == 0); NOREF(u32Function);
     1175
     1176    /*
     1177     * No locking, as this is purely a notification which does not make any
     1178     * changes to the object state.
     1179     */
     1180    PHOSTCALLBACKDATA   pCBData = reinterpret_cast<PHOSTCALLBACKDATA>(pvParms);
    11761181    AssertReturn(sizeof(HOSTCALLBACKDATA) == cbParms, VERR_INVALID_PARAMETER);
    11771182    AssertReturn(HOSTCALLBACKMAGIC == pCBData->u32Magic, VERR_INVALID_PARAMETER);
    1178     ComObjPtr<Console> pConsole = reinterpret_cast<Console *>(pvExtension);
    1179 //     LogFlowFunc(("pCBData->pcszName=%s, pCBData->pcszValue=%s, pCBData->pcszFlags=%s\n", pCBData->pcszName, pCBData->pcszValue, pCBData->pcszFlags));
     1183    Log5(("Console::doGuestPropNotification: pCBData={.pcszName=%s, .pcszValue=%s, .pcszFlags=%s}\n",
     1184          pCBData->pcszName, pCBData->pcszValue, pCBData->pcszFlags));
     1185
     1186    int  rc;
    11801187    Bstr name(pCBData->pcszName);
    11811188    Bstr value(pCBData->pcszValue);
    11821189    Bstr flags(pCBData->pcszFlags);
    1183     if (   name.isNull()
    1184         || (value.isNull() && (pCBData->pcszValue != NULL))
    1185         || (flags.isNull() && (pCBData->pcszFlags != NULL))
     1190    if (   !name.isNull()
     1191        && (!value.isNull() || pCBData->pcszValue == NULL)
     1192        && (!flags.isNull() || pCBData->pcszFlags == NULL)
    11861193       )
     1194    {
     1195        ComObjPtr<Console> ptrConsole = reinterpret_cast<Console *>(pvExtension);
     1196        HRESULT hrc = ptrConsole->mControl->PushGuestProperty(name,
     1197                                                              value,
     1198                                                              pCBData->u64Timestamp,
     1199                                                              flags);
     1200        if (SUCCEEDED(hrc))
     1201            rc = VINF_SUCCESS;
     1202        else
     1203        {
     1204            LogFunc(("Console::doGuestPropNotification: hrc=%Rhrc pCBData={.pcszName=%s, .pcszValue=%s, .pcszFlags=%s}\n",
     1205                     pCBData->pcszName, pCBData->pcszValue, pCBData->pcszFlags));
     1206            rc = Global::vboxStatusCodeFromCOM(hrc);
     1207        }
     1208    }
     1209    else
    11871210        rc = VERR_NO_MEMORY;
    1188     else
    1189     {
    1190         HRESULT hrc = pConsole->mControl->PushGuestProperty(name, value,
    1191                                                             pCBData->u64Timestamp,
    1192                                                             flags);
    1193         if (FAILED(hrc))
    1194         {
    1195 //             LogFunc(("pConsole->mControl->PushGuestProperty failed, hrc=0x%x\n", hrc));
    1196 //             LogFunc(("pCBData->pcszName=%s\n", pCBData->pcszName));
    1197 //             LogFunc(("pCBData->pcszValue=%s\n", pCBData->pcszValue));
    1198 //             LogFunc(("pCBData->pcszFlags=%s\n", pCBData->pcszFlags));
    1199             rc = Global::vboxStatusCodeFromCOM(hrc);
    1200         }
    1201     }
    1202 //     LogFlowFunc(("rc=%Rrc\n", rc));
    12031211    return rc;
    12041212}
     
    13001308    return S_OK;
    13011309}
    1302 #endif
     1310
     1311#endif /* VBOX_WITH_GUEST_PROPS */
    13031312
    13041313
     
    38973906#ifndef VBOX_WITH_GUEST_PROPS
    38983907    ReturnComNotImplemented();
    3899 #else
     3908#else  /* VBOX_WITH_GUEST_PROPS */
    39003909    if (!VALID_PTR(aName))
    39013910        return E_INVALIDARG;
     
    39743983#ifndef VBOX_WITH_GUEST_PROPS
    39753984    ReturnComNotImplemented();
    3976 #else
     3985#else /* VBOX_WITH_GUEST_PROPS */
    39773986    if (!VALID_PTR(aName))
    39783987        return E_INVALIDARG;
     
    40504059#ifndef VBOX_WITH_GUEST_PROPS
    40514060    ReturnComNotImplemented();
    4052 #else
     4061#else /* VBOX_WITH_GUEST_PROPS */
    40534062    if (!VALID_PTR(aPatterns) && (aPatterns != NULL))
    40544063        return E_POINTER;
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