VirtualBox

Changeset 38855 in vbox


Ignore:
Timestamp:
Sep 23, 2011 7:31:35 PM (13 years ago)
Author:
vboxsync
Message:

Additions/common/VBoxGuest: reverted r73865, r73862, r73808, r73807, r73805 and r73801 to simplify backporting

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VBoxGuest.h

    r38655 r38855  
    350350/** Get the pointer to the first HGCM parameter in a 32-bit request.  */
    351351# define VBOXGUEST_HGCM_CALL_PARMS32(a)           ( (HGCMFunctionParameter32 *)((uint8_t *)(a) + sizeof(VBoxGuestHGCMCallInfo)) )
     352
     353/** IOCTL to VBoxGuest to make a connect to the clipboard service.
     354 * @todo Seems this is no longer is use. Try remove it. */
     355# define VBOXGUEST_IOCTL_CLIPBOARD_CONNECT        VBOXGUEST_IOCTL_CODE_(19, sizeof(uint32_t))
    352356
    353357#endif /* VBOX_WITH_HGCM */
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp

    r38807 r38855  
    713713    pDevExt->u32MousePosChangedSeq = 0;
    714714    pDevExt->SessionSpinlock = NIL_RTSPINLOCK;
     715    pDevExt->u32ClipboardClientId = 0;
    715716    pDevExt->MemBalloon.hMtx = NIL_RTSEMFASTMUTEX;
    716717    pDevExt->MemBalloon.cChunks = 0;
     
    18261827}
    18271828
     1829
     1830/**
     1831 * @returns VBox status code. Unlike the other HGCM IOCtls this will combine
     1832 *          the VbglHGCMConnect/Disconnect return code with the Info.result.
     1833 *
     1834 * @param   pDevExt             The device extension.
     1835 * @param   pu32ClientId        The client id.
     1836 * @param   pcbDataReturned     Where to store the amount of returned data. Can
     1837 *                              be NULL.
     1838 */
     1839static int VBoxGuestCommonIOCtl_HGCMClipboardReConnect(PVBOXGUESTDEVEXT pDevExt, uint32_t *pu32ClientId, size_t *pcbDataReturned)
     1840{
     1841    int                         rc;
     1842    VBoxGuestHGCMConnectInfo    CnInfo;
     1843
     1844    Log(("VBoxGuestCommonIOCtl: CLIPBOARD_CONNECT: Current u32ClientId=%RX32\n", pDevExt->u32ClipboardClientId));
     1845
     1846    /*
     1847     * If there is an old client, try disconnect it first.
     1848     */
     1849    if (pDevExt->u32ClipboardClientId != 0)
     1850    {
     1851        VBoxGuestHGCMDisconnectInfo DiInfo;
     1852        DiInfo.result = VERR_WRONG_ORDER;
     1853        DiInfo.u32ClientID = pDevExt->u32ClipboardClientId;
     1854        rc = VbglR0HGCMInternalDisconnect(&DiInfo, VBoxGuestHGCMAsyncWaitCallback, pDevExt, RT_INDEFINITE_WAIT);
     1855        if (RT_SUCCESS(rc))
     1856        {
     1857            LogRel(("VBoxGuestCommonIOCtl: CLIPBOARD_CONNECT: failed to disconnect old client. VbglHGCMDisconnect -> rc=%Rrc\n", rc));
     1858            return rc;
     1859        }
     1860        if (RT_FAILURE((int32_t)DiInfo.result))
     1861        {
     1862            Log(("VBoxGuestCommonIOCtl: CLIPBOARD_CONNECT: failed to disconnect old client. DiInfo.result=%Rrc\n", DiInfo.result));
     1863            return DiInfo.result;
     1864        }
     1865        pDevExt->u32ClipboardClientId = 0;
     1866    }
     1867
     1868    /*
     1869     * Try connect.
     1870     */
     1871    CnInfo.Loc.type = VMMDevHGCMLoc_LocalHost_Existing;
     1872    strcpy(CnInfo.Loc.u.host.achName, "VBoxSharedClipboard");
     1873    CnInfo.u32ClientID = 0;
     1874    CnInfo.result = VERR_WRONG_ORDER;
     1875
     1876    rc = VbglR0HGCMInternalConnect(&CnInfo, VBoxGuestHGCMAsyncWaitCallback, pDevExt, RT_INDEFINITE_WAIT);
     1877    if (RT_FAILURE(rc))
     1878    {
     1879        LogRel(("VBoxGuestCommonIOCtl: CLIPBOARD_CONNECT: VbglHGCMConnected -> rc=%Rrc\n", rc));
     1880        return rc;
     1881    }
     1882    if (RT_FAILURE(CnInfo.result))
     1883    {
     1884        LogRel(("VBoxGuestCommonIOCtl: CLIPBOARD_CONNECT: VbglHGCMConnected -> rc=%Rrc\n", rc));
     1885        return rc;
     1886    }
     1887
     1888    Log(("VBoxGuestCommonIOCtl: CLIPBOARD_CONNECT: connected successfully u32ClientId=%RX32\n", CnInfo.u32ClientID));
     1889
     1890    pDevExt->u32ClipboardClientId = CnInfo.u32ClientID;
     1891    *pu32ClientId = CnInfo.u32ClientID;
     1892    if (pcbDataReturned)
     1893        *pcbDataReturned = sizeof(uint32_t);
     1894
     1895    return VINF_SUCCESS;
     1896}
    18281897
    18291898#endif /* VBOX_WITH_HGCM */
     
    23502419                rc = VBoxGuestCommonIOCtl_HGCMDisconnect(pDevExt, pSession, (VBoxGuestHGCMDisconnectInfo *)pvData, pcbDataReturned);
    23512420                break;
     2421
     2422            case VBOXGUEST_IOCTL_CLIPBOARD_CONNECT:
     2423                CHECKRET_MIN_SIZE("CLIPBOARD_CONNECT", sizeof(uint32_t));
     2424                rc = VBoxGuestCommonIOCtl_HGCMClipboardReConnect(pDevExt, (uint32_t *)pvData, pcbDataReturned);
     2425                break;
    23522426#endif /* VBOX_WITH_HGCM */
    23532427
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h

    r38668 r38855  
    145145    /** Spinlock various items in the VBOXGUESTSESSION. */
    146146    RTSPINLOCK                  SessionSpinlock;
     147
     148    /** The current clipboard client ID, 0 if no client.
     149     * For implementing the VBOXGUEST_IOCTL_CLIPBOARD_CONNECT interface. */
     150    uint32_t                    u32ClipboardClientId;
    147151#ifdef VBOX_WITH_VRDP_SESSION_HANDLING
    148152    BOOL                        fVRDPEnabled;
     
    167171     *          following it (to grow into and align the struct size).
    168172     */
    169 #ifdef VBOXGUEST_USE_DEFERRED_WAKE_UP
    170     uint8_t abAlignment1[HC_ARCH_BITS == 32 ? 144 : 60];
    171 #else
    172     uint8_t abAlignment1[HC_ARCH_BITS == 32 ? 88 : 12];
    173 #endif
     173    uint8_t abAlignment1[HC_ARCH_BITS == 32 ? 20 : 0];
    174174
    175175    /** Windows part. */
     
    186186typedef VBOXGUESTDEVEXT *PVBOXGUESTDEVEXT;
    187187
    188 #ifdef VBOXGUEST_USE_DEFERRED_WAKE_UP
    189 AssertCompileMemberOffset(VBOXGUESTDEVEXT, win, 384);
    190 #else
    191 AssertCompileMemberOffset(VBOXGUESTDEVEXT, win, 320);
    192 #endif
    193 AssertCompileMemberAlignment(VBOXGUESTDEVEXT, win, 64);
     188AssertCompileMemberSizeAlignment(VBOXGUESTDEVEXT, win, 64);
    194189
    195190/**
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