VirtualBox

Changeset 46196 in vbox for trunk/src


Ignore:
Timestamp:
May 21, 2013 5:06:17 PM (12 years ago)
Author:
vboxsync
Message:

VBoxGuest/VBoxTray: allow enabling caps acquisition mode w/o acquiring caps

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

Legend:

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

    r45902 r46196  
    127127/*static int vboxTrayGlMsgShowBalloonMsg(WPARAM lParam, LPARAM wParam);*/
    128128
     129static int VBoxAcquireGuestCaps(uint32_t fOr, uint32_t fNot, bool fCfg);
    129130
    130131/*******************************************************************************
     
    845846            }
    846847
     848            rc = VBoxAcquireGuestCaps(VMMDEV_GUEST_SUPPORTS_SEAMLESS | VMMDEV_GUEST_SUPPORTS_GRAPHICS, 0, true);
     849            if (!RT_SUCCESS(rc))
     850            {
     851                WARN(("VBoxAcquireGuestCaps cfg failed rc %d, ignoring..\n", rc));
     852            }
     853
    847854            rc = vboxTraySetupSeamless();
    848855            if (RT_SUCCESS(rc))
     
    14261433 * otherwise Acquisition mechanism will treat us as different client and will not propagate necessary requests
    14271434 * */
    1428 static int VBoxAcquireGuestCaps(uint32_t fOr, uint32_t fNot)
     1435static int VBoxAcquireGuestCaps(uint32_t fOr, uint32_t fNot, bool fCfg)
    14291436{
    14301437    DWORD cbReturned = 0;
    14311438    VBoxGuestCapsAquire Info;
     1439    Info.enmFlags = fCfg ? VBOXGUESTCAPSACQUIRE_FLAGS_CONFIG_ACQUIRE_MODE : VBOXGUESTCAPSACQUIRE_FLAGS_NONE;
    14321440    Info.rc = VERR_NOT_IMPLEMENTED;
    14331441    Info.u32OrMask = fOr;
     
    15711579{
    15721580    VBOXCAPS *pConsole = &gVBoxCaps;
    1573     int rc = VBoxAcquireGuestCaps(0, VMMDEV_GUEST_SUPPORTS_SEAMLESS | VMMDEV_GUEST_SUPPORTS_GRAPHICS);
     1581    int rc = VBoxAcquireGuestCaps(0, VMMDEV_GUEST_SUPPORTS_SEAMLESS | VMMDEV_GUEST_SUPPORTS_GRAPHICS, false);
    15741582    if (!RT_SUCCESS(rc))
    15751583    {
     
    16271635            continue;
    16281636
    1629         int rc = VBoxAcquireGuestCaps(pCap->fCap, 0);
     1637        int rc = VBoxAcquireGuestCaps(pCap->fCap, 0, false);
    16301638        if (RT_SUCCESS(rc))
    16311639        {
     
    16621670    if (pCap->enmAcState == VBOXCAPS_ENTRY_ACSTATE_ACQUIRED)
    16631671    {
    1664         int rc = VBoxAcquireGuestCaps(0, pCap->fCap);
     1672        int rc = VBoxAcquireGuestCaps(0, pCap->fCap, false);
    16651673        AssertRC(rc);
    16661674    }
     
    16831691
    16841692    vboxCapsEntryAcStateSet(pCap, VBOXCAPS_ENTRY_ACSTATE_ACQUIRING);
    1685     int rc = VBoxAcquireGuestCaps(pCap->fCap, 0);
     1693    int rc = VBoxAcquireGuestCaps(pCap->fCap, 0, false);
    16861694    if (RT_SUCCESS(rc))
    16871695    {
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp

    r45811 r46196  
    7171static int VBoxGuestCommonIOCtl_SetMouseStatus(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession, uint32_t fFeatures);
    7272
    73 static int VBoxGuestCommonGuestCapsAcquire(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession, uint32_t fOrMask, uint32_t fNotMask);
     73static int VBoxGuestCommonGuestCapsAcquire(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession, uint32_t fOrMask, uint32_t fNotMask, VBOXGUESTCAPSACQUIRE_FLAGS enmFlags);
    7474
    7575#define VBOXGUEST_ACQUIRE_STYLE_EVENTS (VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST | VMMDEV_EVENT_SEAMLESS_MODE_CHANGE_REQUEST)
     
    10501050         pSession, pSession->Process, (int)pSession->Process, (uintptr_t)pSession->R0Process)); /** @todo %RTr0proc */
    10511051
    1052     VBoxGuestCommonGuestCapsAcquire(pDevExt, pSession, 0, UINT32_MAX);
     1052    VBoxGuestCommonGuestCapsAcquire(pDevExt, pSession, 0, UINT32_MAX, VBOXGUESTCAPSACQUIRE_FLAGS_NONE);
    10531053
    10541054    VBoxGuestCommonIOCtl_CancelAllWaitEvents(pDevExt, pSession);
     
    25402540}
    25412541
    2542 static int VBoxGuestCommonGuestCapsAcquire(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession, uint32_t fOrMask, uint32_t fNotMask)
     2542static int VBoxGuestCommonGuestCapsAcquire(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession, uint32_t fOrMask, uint32_t fNotMask, VBOXGUESTCAPSACQUIRE_FLAGS enmFlags)
    25432543{
    25442544    uint32_t fSetCaps = 0;
     2545
     2546    if (!VBoxGuestCommonGuestCapsValidateValues(fOrMask))
     2547    {
     2548        LogRel(("invalid fOrMask 0x%x\n", fOrMask));
     2549        return VERR_INVALID_PARAMETER;
     2550    }
     2551
     2552    if (enmFlags != VBOXGUESTCAPSACQUIRE_FLAGS_CONFIG_ACQUIRE_MODE
     2553            && enmFlags != VBOXGUESTCAPSACQUIRE_FLAGS_NONE)
     2554    {
     2555        LogRel(("invalid enmFlags %d\n", enmFlags));
     2556        return VERR_INVALID_PARAMETER;
     2557    }
    25452558    if (!VBoxGuestCommonGuestCapsModeSet(pDevExt, fOrMask, true, &fSetCaps))
    25462559    {
    2547         Assert(0);
    25482560        LogRel(("calling caps acquire for set caps %d\n", fOrMask));
    25492561        return VERR_INVALID_STATE;
    25502562    }
    25512563
    2552     if (!VBoxGuestCommonGuestCapsValidateValues(fOrMask))
    2553         return VERR_INVALID_PARAMETER;
     2564    if (enmFlags & VBOXGUESTCAPSACQUIRE_FLAGS_CONFIG_ACQUIRE_MODE)
     2565    {
     2566        Log(("Configured Acquire caps: 0x%x\n", fOrMask));
     2567        return VINF_SUCCESS;
     2568    }
    25542569
    25552570    /* the fNotMask no need to have all values valid,
     
    26302645static int VBoxGuestCommonIOCTL_GuestCapsAcquire(PVBOXGUESTDEVEXT pDevExt, PVBOXGUESTSESSION pSession, VBoxGuestCapsAquire *pAcquire)
    26312646{
    2632     int rc = VBoxGuestCommonGuestCapsAcquire(pDevExt, pSession, pAcquire->u32OrMask, pAcquire->u32NotMask);
     2647    int rc = VBoxGuestCommonGuestCapsAcquire(pDevExt, pSession, pAcquire->u32OrMask, pAcquire->u32NotMask, pAcquire->enmFlags);
    26332648    if (!RT_SUCCESS(rc))
    26342649        LogRel(("VBoxGuestCommonGuestCapsAcquire: failed rc %d\n", rc));
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