Changeset 77387 in vbox
- Timestamp:
- Feb 20, 2019 2:20:19 PM (6 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/GuestFileImpl.h
r76562 r77387 70 70 int i_waitForStatusChange(GuestWaitEvent *pEvent, uint32_t uTimeoutMS, FileStatus_T *pFileStatus, int *pGuestRc); 71 71 int i_waitForWrite(GuestWaitEvent *pEvent, uint32_t uTimeoutMS, uint32_t *pcbWritten); 72 int i_writeData(uint32_t uTimeoutMS, void *pvData, uint32_t cbData, uint32_t *pcbWritten);73 int i_writeDataAt(uint64_t uOffset, uint32_t uTimeoutMS, void *pvData, uint32_t cbData, uint32_t *pcbWritten);72 int i_writeData(uint32_t uTimeoutMS, const void *pvData, uint32_t cbData, uint32_t *pcbWritten); 73 int i_writeDataAt(uint64_t uOffset, uint32_t uTimeoutMS, const void *pvData, uint32_t cbData, uint32_t *pcbWritten); 74 74 /** @} */ 75 75 -
trunk/src/VBox/Main/src-client/GuestFileImpl.cpp
r77386 r77387 1132 1132 } 1133 1133 1134 int GuestFile::i_writeData(uint32_t uTimeoutMS, void *pvData, uint32_t cbData,1134 int GuestFile::i_writeData(uint32_t uTimeoutMS, const void *pvData, uint32_t cbData, 1135 1135 uint32_t *pcbWritten) 1136 1136 { … … 1168 1168 HGCMSvcSetU32(&paParms[i++], mObjectID /* File handle */); 1169 1169 HGCMSvcSetU32(&paParms[i++], cbData /* Size (in bytes) to write */); 1170 HGCMSvcSetPv (&paParms[i++], pvData, cbData);1170 HGCMSvcSetPv (&paParms[i++], unconst(pvData), cbData); 1171 1171 1172 1172 alock.release(); /* Drop write lock before sending. */ … … 1196 1196 1197 1197 int GuestFile::i_writeDataAt(uint64_t uOffset, uint32_t uTimeoutMS, 1198 void *pvData, uint32_t cbData, uint32_t *pcbWritten)1198 const void *pvData, uint32_t cbData, uint32_t *pcbWritten) 1199 1199 { 1200 1200 AssertPtrReturn(pvData, VERR_INVALID_POINTER); … … 1232 1232 HGCMSvcSetU64(&paParms[i++], uOffset /* Offset where to starting writing */); 1233 1233 HGCMSvcSetU32(&paParms[i++], cbData /* Size (in bytes) to write */); 1234 HGCMSvcSetPv (&paParms[i++], pvData, cbData);1234 HGCMSvcSetPv (&paParms[i++], unconst(pvData), cbData); 1235 1235 1236 1236 alock.release(); /* Drop write lock before sending. */ … … 1487 1487 HRESULT hr = S_OK; 1488 1488 1489 uint32_t cbData = (uint32_t)aData.size();1490 void *pvData = cbData > 0? (void *)&aData.front(): NULL;1489 const uint32_t cbData = (uint32_t)aData.size(); 1490 const void *pvData = (void *)&aData.front(); 1491 1491 int vrc = i_writeData(aTimeoutMS, pvData, cbData, (uint32_t*)aWritten); 1492 1492 if (RT_FAILURE(vrc)) … … 1510 1510 HRESULT hr = S_OK; 1511 1511 1512 uint32_t cbData = (uint32_t)aData.size();1513 void *pvData = cbData > 0? (void *)&aData.front(): NULL;1512 const uint32_t cbData = (uint32_t)aData.size(); 1513 const void *pvData = (void *)&aData.front(); 1514 1514 int vrc = i_writeData(aTimeoutMS, pvData, cbData, (uint32_t*)aWritten); 1515 1515 if (RT_FAILURE(vrc))
Note:
See TracChangeset
for help on using the changeset viewer.