Changeset 31752 in vbox
- Timestamp:
- Aug 18, 2010 11:25:40 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp
r31720 r31752 1181 1181 VBoxGuestWaitEventInfo *pInfo, size_t *pcbDataReturned, bool fInterruptible) 1182 1182 { 1183 const uint32_t fReqEvents = pInfo->u32EventMaskIn;1184 uint32_t fResEvents;1185 int iEvent;1186 int rc;1187 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;1188 PVBOXGUESTWAIT pWait;1183 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 1184 const uint32_t fReqEvents = pInfo->u32EventMaskIn; 1185 uint32_t fResEvents; 1186 int iEvent; 1187 PVBOXGUESTWAIT pWait; 1188 int rc; 1189 1189 1190 1190 pInfo->u32EventFlagsOut = 0; … … 1364 1364 VMMDevRequestHeader *pReqHdr, size_t cbData, size_t *pcbDataReturned) 1365 1365 { 1366 int rc; 1367 VMMDevRequestHeader *pReqCopy; 1368 1366 1369 /* 1367 1370 * Validate the header and request size. … … 1370 1373 const uint32_t cbReq = pReqHdr->size; 1371 1374 const uint32_t cbMinSize = vmmdevGetRequestSize(enmType); 1372 int rc;1373 VMMDevRequestHeader *pReqCopy;1374 1375 1375 1376 Log(("VBoxGuestCommonIOCtl: VMMREQUEST type %d\n", pReqHdr->requestType)); … … 1609 1610 if (i >= RT_ELEMENTS(pSession->aHGCMClientIds)) 1610 1611 { 1611 static unsigned s_cErrors = 0;1612 static unsigned s_cErrors = 0; 1612 1613 VBoxGuestHGCMDisconnectInfo Info; 1613 1614 … … 1634 1635 * Validate the client id and invalidate its entry while we're in the call. 1635 1636 */ 1636 const uint32_t u32ClientId = pInfo->u32ClientID; 1637 unsigned i; 1638 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 1639 int rc; 1640 1637 int rc; 1638 const uint32_t u32ClientId = pInfo->u32ClientID; 1639 unsigned i; 1640 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 1641 1641 RTSpinlockAcquireNoInts(pDevExt->SessionSpinlock, &Tmp); 1642 1642 for (i = 0; i < RT_ELEMENTS(pSession->aHGCMClientIds); i++) … … 1685 1685 size_t cbExtra, size_t cbData, size_t *pcbDataReturned) 1686 1686 { 1687 size_t cbActual;1688 const uint32_t u32ClientId = pInfo->u32ClientID;1689 u nsigned i;1690 int rc;1691 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER;1692 uint32_t fFlags;1687 const uint32_t u32ClientId = pInfo->u32ClientID; 1688 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 1689 uint32_t fFlags; 1690 size_t cbActual; 1691 unsigned i; 1692 int rc; 1693 1693 1694 1694 /* … … 1784 1784 static int VBoxGuestCommonIOCtl_HGCMClipboardReConnect(PVBOXGUESTDEVEXT pDevExt, uint32_t *pu32ClientId, size_t *pcbDataReturned) 1785 1785 { 1786 int rc;1787 VBoxGuestHGCMConnectInfo Info;1786 int rc; 1787 VBoxGuestHGCMConnectInfo CnInfo; 1788 1788 1789 1789 Log(("VBoxGuestCommonIOCtl: CLIPBOARD_CONNECT: Current u32ClientId=%RX32\n", pDevExt->u32ClipboardClientId)); … … 1794 1794 if (pDevExt->u32ClipboardClientId != 0) 1795 1795 { 1796 VBoxGuestHGCMDisconnectInfo Info;1797 Info.result = VERR_WRONG_ORDER;1798 Info.u32ClientID = pDevExt->u32ClipboardClientId;1799 rc = VbglR0HGCMInternalDisconnect(& Info, VBoxGuestHGCMAsyncWaitCallback, pDevExt, RT_INDEFINITE_WAIT);1796 VBoxGuestHGCMDisconnectInfo DiInfo; 1797 DiInfo.result = VERR_WRONG_ORDER; 1798 DiInfo.u32ClientID = pDevExt->u32ClipboardClientId; 1799 rc = VbglR0HGCMInternalDisconnect(&DiInfo, VBoxGuestHGCMAsyncWaitCallback, pDevExt, RT_INDEFINITE_WAIT); 1800 1800 if (RT_SUCCESS(rc)) 1801 1801 { … … 1803 1803 return rc; 1804 1804 } 1805 if (RT_FAILURE((int32_t) Info.result))1806 { 1807 Log(("VBoxGuestCommonIOCtl: CLIPBOARD_CONNECT: failed to disconnect old client. Info.result=%Rrc\n", rc));1808 return Info.result;1805 if (RT_FAILURE((int32_t)DiInfo.result)) 1806 { 1807 Log(("VBoxGuestCommonIOCtl: CLIPBOARD_CONNECT: failed to disconnect old client. DiInfo.result=%Rrc\n", DiInfo.result)); 1808 return DiInfo.result; 1809 1809 } 1810 1810 pDevExt->u32ClipboardClientId = 0; … … 1814 1814 * Try connect. 1815 1815 */ 1816 Info.Loc.type = VMMDevHGCMLoc_LocalHost_Existing;1817 strcpy( Info.Loc.u.host.achName, "VBoxSharedClipboard");1818 Info.u32ClientID = 0;1819 Info.result = VERR_WRONG_ORDER;1820 1821 rc = VbglR0HGCMInternalConnect(& Info, VBoxGuestHGCMAsyncWaitCallback, pDevExt, RT_INDEFINITE_WAIT);1816 CnInfo.Loc.type = VMMDevHGCMLoc_LocalHost_Existing; 1817 strcpy(CnInfo.Loc.u.host.achName, "VBoxSharedClipboard"); 1818 CnInfo.u32ClientID = 0; 1819 CnInfo.result = VERR_WRONG_ORDER; 1820 1821 rc = VbglR0HGCMInternalConnect(&CnInfo, VBoxGuestHGCMAsyncWaitCallback, pDevExt, RT_INDEFINITE_WAIT); 1822 1822 if (RT_FAILURE(rc)) 1823 1823 { … … 1825 1825 return rc; 1826 1826 } 1827 if (RT_FAILURE( Info.result))1827 if (RT_FAILURE(CnInfo.result)) 1828 1828 { 1829 1829 LogRel(("VBoxGuestCommonIOCtl: CLIPBOARD_CONNECT: VbglHGCMConnected -> rc=%Rrc\n", rc)); … … 1831 1831 } 1832 1832 1833 Log(("VBoxGuestCommonIOCtl: CLIPBOARD_CONNECT: connected successfully u32ClientId=%RX32\n", Info.u32ClientID));1834 1835 pDevExt->u32ClipboardClientId = Info.u32ClientID;1836 *pu32ClientId = Info.u32ClientID;1833 Log(("VBoxGuestCommonIOCtl: CLIPBOARD_CONNECT: connected successfully u32ClientId=%RX32\n", CnInfo.u32ClientID)); 1834 1835 pDevExt->u32ClipboardClientId = CnInfo.u32ClientID; 1836 *pu32ClientId = CnInfo.u32ClientID; 1837 1837 if (pcbDataReturned) 1838 1838 *pcbDataReturned = sizeof(uint32_t); … … 2003 2003 { 2004 2004 int rc; 2005 2006 2005 Log(("VBoxGuestCommonIOCtl: iFunction=%#x pDevExt=%p pSession=%p pvData=%p cbData=%zu\n", 2007 2006 iFunction, pDevExt, pSession, pvData, cbData));
Note:
See TracChangeset
for help on using the changeset viewer.