VirtualBox

Changeset 10094 in vbox


Ignore:
Timestamp:
Jul 2, 2008 11:23:06 AM (17 years ago)
Author:
vboxsync
Message:

Additions/WINNT: VBoxControl guest property fixes, and ifdef correctly

Location:
trunk/src/VBox/Additions/WINNT/VBoxControl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxControl/Makefile.kmk

    r10008 r10094  
    3434
    3535# VBoxControl.cpp uses VBOX_SVN_REV.
    36 VBoxControl.cpp_DEFS += VBOX_SVN_REV=$(VBOX_SVN_REV) VBOX_HGCM
     36VBoxControl.cpp_DEFS += VBOX_SVN_REV=$(VBOX_SVN_REV)
    3737VBoxControl.cpp_DEPS = $(VBOX_SVN_REV_KMK)
     38VBoxControl_DEFS     += \
     39        $(if $(VBOX_WITH_INFO_SVC),VBOX_WITH_INFO_SVC VBOX_HGCM,)
    3840
    3941include $(KBUILD_PATH)/subfooter.kmk
  • trunk/src/VBox/Additions/WINNT/VBoxControl/VBoxControl.cpp

    r10008 r10094  
    783783
    784784
     785#ifdef VBOX_WITH_INFO_SVC
    785786/**
    786787 * Open the VirtualBox guest device.
     
    919920        rc = Msg.hdr.result;
    920921    uint32_t cbActual;
    921     if (RT_SUCCESS(rc))
    922         rc = VbglHGCMParmUInt32Get(&Msg.size, &cbActual);
    923     if (RT_SUCCESS(rc))
    924     {
    925         if (pcbActual != NULL)
    926             *pcbActual = cbActual;
    927         if (cbActual > cbValue)
    928             rc = VINF_BUFFER_OVERFLOW;
     922    if (RT_SUCCESS(rc) || (VERR_BUFFER_OVERFLOW == rc))
     923    {
     924        int rc2 = VbglHGCMParmUInt32Get(&Msg.size, &cbActual);
     925        if (RT_SUCCESS(rc2))
     926        {
     927            if (pcbActual != NULL)
     928                *pcbActual = cbActual;
     929        }
    929930        else
    930             rc = Msg.hdr.result;
    931         if ((cbValue > 0) && (0 == cbActual))  /* No such property */
    932             pszValue[0] = 0;
    933            
     931            rc = rc2;
    934932    }
    935933    return rc;
     
    10371035        rc = hgcmInfoSvcGetProp(hDevice, u32ClientID, argv[0], szValue,
    10381036                                sizeof(szValue), NULL);
    1039         if (!RT_SUCCESS(rc))
     1037        if (!RT_SUCCESS(rc) && (rc != VERR_NOT_FOUND))
    10401038            printf("Failed to retrieve the property value, RT error %d\n", rc);
    10411039    }
    1042     if (RT_SUCCESS(rc))
    1043     {
    1044         if (strlen(szValue) > 0)
     1040    if (RT_SUCCESS(rc) || (VERR_NOT_FOUND == rc))
     1041    {
     1042        if (RT_SUCCESS(rc))
    10451043            printf("Value: %s\n", szValue);
    10461044        else
     
    10971095    return rc;
    10981096}
     1097#endif  /* VBOX_WITH_INFO_SVC */
    10991098
    11001099
     
    11441143        handleSetVideoMode(argc - 2, &argv[2]);
    11451144    }
     1145#ifdef VBOX_WITH_INFO_SVC
    11461146    else if (stricmp(argv[1], "getguestproperty") == 0)
    11471147    {
     
    11531153        handleSetGuestProperty(argc - 2, &argv[2]);
    11541154    }
     1155#endif  /* VBOX_WITH_INFO_SVC */
    11551156    else
    11561157    {
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