vbox的更動 68500 路徑 trunk/src/VBox/HostDrivers
- 時間撮記:
- 2017-8-22 上午10:16:26 (7 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/drv/VBoxNetLwf-win.cpp
r68112 r68500 1396 1396 return NULL; 1397 1397 } 1398 const ULONG cbAlignmentMask = sizeof(USHORT) - 1; /* Microsoft LB/FO provider expects packets to be aligned at word boundary. */ 1399 ULONG cbAlignedFrame = (pSG->cbTotal + cbAlignmentMask) & ~cbAlignmentMask; 1400 Assert(cbAlignedFrame >= pSG->cbTotal); 1401 Assert(cbFrame >= cbAlignedFrame); 1398 1402 NET_BUFFER *pBuffer = NET_BUFFER_LIST_FIRST_NB(pBufList); 1399 NDIS_STATUS Status = NdisRetreatNetBufferDataStart(pBuffer, pSG->cbTotal, 0 /** @todo DataBackfill */, NULL);1403 NDIS_STATUS Status = NdisRetreatNetBufferDataStart(pBuffer, cbAlignedFrame, 0 /** @todo DataBackfill */, NULL); 1400 1404 if (Status == NDIS_STATUS_SUCCESS) 1401 1405 { … … 1408 1412 pDst += pSG->aSegs[i].cb; 1409 1413 } 1414 if (cbAlignedFrame > pSG->cbTotal) 1415 { 1416 Log4(("vboxNetLwfWinSGtoNB: padding %d-byte packet with %d zero bytes", pSG->cbTotal, cbAlignedFrame - pSG->cbTotal)); 1417 NdisZeroMemory(pDst, cbAlignedFrame - pSG->cbTotal); 1418 } 1410 1419 Log4(("vboxNetLwfWinSGtoNB: allocated NBL+NB 0x%p\n", pBufList)); 1411 1420 pBufList->SourceHandle = pModule->hFilter; … … 1414 1423 { 1415 1424 LogError(("vboxNetLwfWinSGtoNB: failed to obtain the buffer pointer (size=%u)\n", pSG->cbTotal)); 1416 NdisAdvanceNetBufferDataStart(pBuffer, pSG->cbTotal, false, NULL); /** @todo why bother? */1425 NdisAdvanceNetBufferDataStart(pBuffer, cbAlignedFrame, false, NULL); /** @todo why bother? */ 1417 1426 NdisFreeNetBufferList(pBufList); 1418 1427 pBufList = NULL;
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器