Changeset 38856 in vbox
- Timestamp:
- Sep 23, 2011 7:43:00 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxGuest.h
r38855 r38856 350 350 /** Get the pointer to the first HGCM parameter in a 32-bit request. */ 351 351 # 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))356 352 357 353 #endif /* VBOX_WITH_HGCM */ -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp
r38855 r38856 713 713 pDevExt->u32MousePosChangedSeq = 0; 714 714 pDevExt->SessionSpinlock = NIL_RTSPINLOCK; 715 pDevExt->u32ClipboardClientId = 0;716 715 pDevExt->MemBalloon.hMtx = NIL_RTSEMFASTMUTEX; 717 716 pDevExt->MemBalloon.cChunks = 0; … … 1827 1826 } 1828 1827 1829 1830 /**1831 * @returns VBox status code. Unlike the other HGCM IOCtls this will combine1832 * 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. Can1837 * be NULL.1838 */1839 static 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 }1897 1828 1898 1829 #endif /* VBOX_WITH_HGCM */ … … 2419 2350 rc = VBoxGuestCommonIOCtl_HGCMDisconnect(pDevExt, pSession, (VBoxGuestHGCMDisconnectInfo *)pvData, pcbDataReturned); 2420 2351 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;2426 2352 #endif /* VBOX_WITH_HGCM */ 2427 2353 -
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h
r38855 r38856 145 145 /** Spinlock various items in the VBOXGUESTSESSION. */ 146 146 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;151 147 #ifdef VBOX_WITH_VRDP_SESSION_HANDLING 152 148 BOOL fVRDPEnabled;
Note:
See TracChangeset
for help on using the changeset viewer.