diff options
Diffstat (limited to 'src/VBox/HostServices/DragAndDrop')
| -rw-r--r-- | src/VBox/HostServices/DragAndDrop/dndmanager.cpp | 13 | ||||
| -rw-r--r-- | src/VBox/HostServices/DragAndDrop/service.cpp | 8 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/VBox/HostServices/DragAndDrop/dndmanager.cpp b/src/VBox/HostServices/DragAndDrop/dndmanager.cpp index 8512ca4f..5766a8e9 100644 --- a/src/VBox/HostServices/DragAndDrop/dndmanager.cpp +++ b/src/VBox/HostServices/DragAndDrop/dndmanager.cpp @@ -513,10 +513,13 @@ int DnDHGSendDataMessage::progressCallback(size_t cbDone, void *pvUser) pSelf->m_cbTransfered += cbDone; /* Advance progress info */ - if (pSelf->m_pfnProgressCallback) - return pSelf->m_pfnProgressCallback(100.0 / pSelf->m_cbAll * pSelf->m_cbTransfered, DragAndDropSvc::DND_PROGRESS_RUNNING, pSelf->m_pvProgressUser); - else - return VINF_SUCCESS; + int rc = VINF_SUCCESS; + if ( pSelf->m_pfnProgressCallback + && pSelf->m_cbAll) + rc = pSelf->m_pfnProgressCallback((uint64_t)pSelf->m_cbTransfered * 100 / pSelf->m_cbAll, + DragAndDropSvc::DND_PROGRESS_RUNNING, pSelf->m_pvProgressUser); + + return rc; } /****************************************************************************** @@ -739,7 +742,7 @@ int DnDManager::nextMessage(uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM paPa clear(); /* Create a new cancel message to inform the guest. */ m_pCurMsg = new DnDHGCancelMessage(); - m_pfnProgressCallback(100.0, DragAndDropSvc::DND_PROGRESS_CANCELLED, m_pvProgressUser); + m_pfnProgressCallback(100, DragAndDropSvc::DND_PROGRESS_CANCELLED, m_pvProgressUser); } DO(("next msg: %d %d %Rrc\n", uMsg, cParms, rc)); diff --git a/src/VBox/HostServices/DragAndDrop/service.cpp b/src/VBox/HostServices/DragAndDrop/service.cpp index 1bb87451..54c50256 100644 --- a/src/VBox/HostServices/DragAndDrop/service.cpp +++ b/src/VBox/HostServices/DragAndDrop/service.cpp @@ -138,15 +138,17 @@ int DragAndDropService::clientConnect(uint32_t u32ClientID, void *pvClient) int DragAndDropService::clientDisconnect(uint32_t u32ClientID, void *pvClient) { /* Remove all waiters with this clientId. */ - while (!m_clientQueue.isEmpty()) + for (size_t i = 0; i < m_clientQueue.size(); ) { - HGCM::Client *pClient = m_clientQueue.first(); + HGCM::Client *pClient = m_clientQueue.at(i); if (pClient->clientId() == u32ClientID) { m_pHelpers->pfnCallComplete(pClient->handle(), VERR_INTERRUPTED); - m_clientQueue.removeFirst(); + m_clientQueue.removeAt(i); delete pClient; } + else + i++; } return VINF_SUCCESS; |
