Changeset 57469 in vbox for trunk/src/VBox
- Timestamp:
- Aug 20, 2015 9:07:56 AM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 102237
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/GuestDnDPrivate.h
r57221 r57469 107 107 } 108 108 109 int Init(size_t cbBuf = _64K) 110 { 111 Reset(); 112 113 pvScratchBuf = RTMemAlloc(cbBuf); 114 if (!pvScratchBuf) 115 return VERR_NO_MEMORY; 116 117 cbScratchBuf = cbBuf; 118 return VINF_SUCCESS; 119 } 120 121 void *const GetBufferMutable(void) { return pvScratchBuf; } 122 123 size_t GetBufferSize(void) { return cbScratchBuf; } 124 109 125 void Reset(void) 110 126 { … … 129 145 /** Current object to receive. */ 130 146 DnDURIObject objURI; 147 148 protected: 149 131 150 /** Pointer to an optional scratch buffer to use for 132 151 * doing the actual chunk transfers. */ -
trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
r57358 r57469 912 912 uint32_t cbRead = 0; 913 913 914 int rc = pObject->Read(pCtx->mURI. pvScratchBuf, pCtx->mURI.cbScratchBuf, &cbRead);914 int rc = pObject->Read(pCtx->mURI.GetBufferMutable(), pCtx->mURI.GetBufferSize(), &cbRead); 915 915 if (RT_SUCCESS(rc)) 916 916 { … … 919 919 if (mDataBase.mProtocolVersion <= 1) 920 920 { 921 pMsg->setNextPointer(pCtx->mURI. pvScratchBuf, cbRead);/* pvData */922 pMsg->setNextUInt32(cbRead); /* cbData */923 pMsg->setNextUInt32(pObject->GetMode()); /* fMode */921 pMsg->setNextPointer(pCtx->mURI.GetBufferMutable(), cbRead); /* pvData */ 922 pMsg->setNextUInt32(cbRead); /* cbData */ 923 pMsg->setNextUInt32(pObject->GetMode()); /* fMode */ 924 924 } 925 925 else 926 926 { 927 pMsg->setNextPointer(pCtx->mURI. pvScratchBuf, cbRead); /* pvData */928 pMsg->setNextUInt32(cbRead); /* cbData */927 pMsg->setNextPointer(pCtx->mURI.GetBufferMutable(), cbRead); /* pvData */ 928 pMsg->setNextUInt32(cbRead); /* cbData */ 929 929 } 930 930 … … 1117 1117 } 1118 1118 1119 void *pvBuf = RTMemAlloc(mData.mcbBlockSize);1120 if (!pvBuf)1121 return VERR_NO_MEMORY;1122 1123 int rc;1124 1125 1119 #define REGISTER_CALLBACK(x) \ 1126 1120 rc = pCtx->mpResp->setCallback(x, i_sendURIDataCallback, pCtx); \ … … 1133 1127 AssertRC(rc2); \ 1134 1128 } 1129 1130 int rc = pCtx->mURI.Init(mData.mcbBlockSize); 1131 if (RT_FAILURE(rc)) 1132 return rc; 1135 1133 1136 1134 rc = pCtx->mCallback.Reset(); … … 1153 1151 { 1154 1152 /* 1155 * Set our scratch buffer.1156 */1157 pCtx->mURI.pvScratchBuf = pvBuf;1158 pCtx->mURI.cbScratchBuf = mData.mcbBlockSize;1159 1160 /*1161 1153 * Extract URI list from byte data. 1162 1154 */ … … 1172 1164 URI_DATA_IS_VALID_BREAK(!lstURIOrg.isEmpty()); 1173 1165 1174 rc = lstURI.AppendURIPathsFromList(lstURIOrg, 0 /* fFlags */); 1166 uint32_t fFlags = DNDURILIST_FLAGS_KEEP_OPEN; 1167 1168 rc = lstURI.AppendURIPathsFromList(lstURIOrg, fFlags); 1175 1169 if (RT_SUCCESS(rc)) 1176 1170 LogFlowFunc(("URI root objects: %zu, total bytes (raw data to transfer): %zu\n", … … 1244 1238 } 1245 1239 1246 /* Destroy temporary scratch buffer. */1247 if (pvBuf)1248 RTMemFree(pvBuf);1249 1250 1240 #undef URI_DATA_IS_VALID_BREAK 1251 1241 … … 1259 1249 1260 1250 DnDURIList &lstURI = pCtx->mURI.lstURI; 1261 1262 int rc;1263 1251 1264 1252 uint64_t cbTotal = pCtx->mData.cbToProcess; … … 1292 1280 fMode, pCurObj->GetSize(), 1293 1281 RTFS_IS_DIRECTORY(fMode), RTFS_IS_FILE(fMode))); 1294 1282 int rc; 1295 1283 if (RTFS_IS_DIRECTORY(fMode)) 1296 1284 {
Note:
See TracChangeset
for help on using the changeset viewer.