Changeset 59844 in vbox for trunk/src/VBox/Additions/WINNT/VBoxTray
- Timestamp:
- Feb 26, 2016 10:58:05 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnD.cpp
r58307 r59844 5 5 6 6 /* 7 * Copyright (C) 2013-201 5Oracle Corporation7 * Copyright (C) 2013-2016 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 799 799 */ 800 800 size_t cFormatsSup = this->lstFmtSup.size(); 801 size_tcFormatsActive = 0;801 ULONG cFormatsActive = 0; 802 802 803 803 LPFORMATETC pFormatEtc = new FORMATETC[cFormatsSup]; … … 1220 1220 uAllActions = uDefAction; 1221 1221 1222 rc= VbglR3DnDGHSendAckPending(&mDnDCtx,1223 uDefAction, uAllActions,1224 strFormats.c_str(), strFormats.length() + 1 /* Include termination */);1225 if (RT_FAILURE(rc ))1222 int rc2 = VbglR3DnDGHSendAckPending(&mDnDCtx, 1223 uDefAction, uAllActions, 1224 strFormats.c_str(), strFormats.length() + 1 /* Include termination */); 1225 if (RT_FAILURE(rc2)) 1226 1226 { 1227 1227 char szMsg[256]; /* Sizes according to MSDN. */ … … 1233 1233 "Please enable Guest to Host or Bidirectional drag and drop mode " 1234 1234 "or re-install the VirtualBox Guest Additions."); 1235 switch (rc )1235 switch (rc2) 1236 1236 { 1237 1237 case VERR_ACCESS_DENIED: 1238 { 1238 1239 rc = hlpShowBalloonTip(g_hInstance, g_hwndToolWindow, ID_TRAYICON, 1239 1240 szMsg, szTitle, … … 1241 1242 AssertRC(rc); 1242 1243 break; 1244 } 1243 1245 1244 1246 default: 1245 1247 break; 1246 1248 } 1249 1250 LogRel2(("DnD: Host refuses drag and drop operation from guest: %Rrc\n", rc2)); 1251 reset(); 1247 1252 } 1248 1253 } … … 1269 1274 { 1270 1275 AssertPtrReturn(pszFormat, VERR_INVALID_POINTER); 1271 AssertReturn(cbFormat, VERR_INVALID_PARAMETER);1276 AssertReturn(cbFormat, VERR_INVALID_PARAMETER); 1272 1277 1273 1278 LogFlowThisFunc(("mMode=%ld, mState=%ld, pDropTarget=0x%p, pszFormat=%s, uDefAction=0x%x\n", … … 1279 1284 { 1280 1285 AssertPtr(pDropTarget); 1281 rc = pDropTarget->WaitForDrop( 30 * 1000 /* Timeout in ms*/);1286 rc = pDropTarget->WaitForDrop(5 * 1000 /* 5s timeout */); 1282 1287 1283 1288 reset(); … … 1293 1298 { 1294 1299 /** @todo Respect uDefAction. */ 1295 void *pvData = pDropTarget->DataMutableRaw(); 1296 AssertPtr(pvData); 1300 void *pvData = pDropTarget->DataMutableRaw(); 1297 1301 uint32_t cbData = pDropTarget->DataSize(); 1298 Assert(cbData); 1299 1300 rc = VbglR3DnDGHSendData(&mDnDCtx, pszFormat, pvData, cbData); 1301 LogFlowFunc(("Sent pvData=0x%p, cbData=%RU32, rc=%Rrc\n", pvData, cbData, rc)); 1302 1303 if ( pvData 1304 && cbData) 1305 { 1306 rc = VbglR3DnDGHSendData(&mDnDCtx, pszFormat, pvData, cbData); 1307 LogFlowFunc(("Sent pvData=0x%p, cbData=%RU32, rc=%Rrc\n", pvData, cbData, rc)); 1308 } 1309 else 1310 rc = VERR_NO_DATA; 1302 1311 } 1303 1312 } 1304 1313 else 1305 1314 rc = VERR_WRONG_ORDER; 1315 1316 if (RT_FAILURE(rc)) 1317 { 1318 /* 1319 * If an error occurred or the guest is in a wrong DnD mode, 1320 * send an error to the host in any case so that the host does 1321 * not wait for the data it expects from the guest. 1322 */ 1323 int rc2 = VbglR3DnDGHSendError(&mDnDCtx, rc); 1324 AssertRC(rc2); 1325 } 1306 1326 1307 1327 LogFlowFuncLeaveRC(rc); … … 1499 1519 int VBoxDnDWnd::mouseRelease(void) 1500 1520 { 1501 #ifdef DEBUG_andy 1502 LogFlowFunc(("\n")); 1503 #endif 1521 LogFlowFuncEnter(); 1522 1504 1523 int rc; 1505 1524 … … 1786 1805 } 1787 1806 else 1788 LogFlowFunc(("Processing event failed with rc=%Rrc\n", rc)); 1807 LogRel(("DnD: Processing proxy window event %RU32 on screen %RU32 failed with %Rrc\n", 1808 pEvent->Event.uType, pEvent->Event.uScreenId, rc)); 1789 1809 } 1790 1810 else if (rc == VERR_INTERRUPTED) /* Disconnected from service. */ 1791 1811 { 1792 Log FlowFunc(("Posting quit message...\n"));1812 LogRel(("DnD: Received quit message, shutting down ...\n")); 1793 1813 pWnd->PostMessage(WM_QUIT, 0 /* wParm */, 0 /* lParm */); 1794 1814 rc = VINF_SUCCESS; 1795 1815 } 1796 else 1816 1817 if (RT_FAILURE(rc)) 1797 1818 { 1798 1819 LogFlowFunc(("Processing next message failed with rc=%Rrc\n", rc)); … … 1809 1830 } 1810 1831 1832 /* Make sure our proxy window is hidden when an error occured to 1833 * not block the guest's UI. */ 1834 pWnd->hide(); 1835 1811 1836 int rc2 = VbglR3DnDGHSendError(&pCtx->cmdCtx, rc); 1812 AssertRC(rc2); 1837 if (RT_FAILURE(rc2)) 1838 { 1839 /* Ignore the following errors reported back from the host. */ 1840 if ( rc2 != VERR_NOT_SUPPORTED 1841 && rc2 != VERR_NOT_IMPLEMENTED) 1842 { 1843 LogRel(("DnD: Could not report error %Rrc back to host: %Rrc\n", rc, rc2)); 1844 } 1845 } 1813 1846 } 1814 1847 … … 1826 1859 } 1827 1860 1828 LogFlowFunc(("Shutting down ...\n"));1829 1830 1861 VbglR3DnDDisconnect(&pCtx->cmdCtx); 1862 1863 LogRel(("DnD: Ended\n")); 1831 1864 1832 1865 LogFlowFuncLeaveRC(rc);
Note:
See TracChangeset
for help on using the changeset viewer.