VirtualBox

Changeset 76785 in vbox for trunk/src/VBox/HostDrivers


Ignore:
Timestamp:
Jan 11, 2019 5:35:01 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128117
Message:

Fix for bugref:9328

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp

    r76553 r76785  
    15721572            if (RT_SUCCESS(rc))
    15731573            {
    1574                 PSUPDRVNTERRORINFO  pCur;
     1574                PSUPDRVNTERRORINFO pMatch = NULL;
     1575                PSUPDRVNTERRORINFO pCur;
    15751576                RTListForEach(&g_ErrorInfoHead, pCur, SUPDRVNTERRORINFO, ListEntry)
    15761577                {
    15771578                    if (   pCur->hProcessId == hCurProcessId
    15781579                        && pCur->hThreadId  == hCurThreadId)
     1580                    {
     1581                        pMatch = pCur;
    15791582                        break;
     1583                    }
    15801584                }
    15811585
     
    15841588                 * If so, check the destination buffer and copy the data into it.
    15851589                 */
    1586                 if (   pCur
    1587                     && pStack->Parameters.Read.ByteOffset.QuadPart < pCur->cchErrorInfo
     1590                if (   pMatch
     1591                    && pStack->Parameters.Read.ByteOffset.QuadPart < pMatch->cchErrorInfo
    15881592                    && pStack->Parameters.Read.ByteOffset.QuadPart >= 0)
    15891593                {
     
    15921596                    {
    15931597                        uint32_t offRead  = (uint32_t)pStack->Parameters.Read.ByteOffset.QuadPart;
    1594                         uint32_t cbToRead = pCur->cchErrorInfo - offRead;
     1598                        uint32_t cbToRead = pMatch->cchErrorInfo - offRead;
    15951599                        if (cbToRead < pStack->Parameters.Read.Length)
    15961600                            RT_BZERO((uint8_t *)pvDstBuf + cbToRead, pStack->Parameters.Read.Length - cbToRead);
    15971601                        else
    15981602                            cbToRead = pStack->Parameters.Read.Length;
    1599                         memcpy(pvDstBuf, &pCur->szErrorInfo[offRead], cbToRead);
     1603                        memcpy(pvDstBuf, &pMatch->szErrorInfo[offRead], cbToRead);
    16001604                        pIrp->IoStatus.Information = cbToRead;
    16011605
     
    16081612                 * End of file. Free the info.
    16091613                 */
    1610                 else if (pCur)
     1614                else if (pMatch)
    16111615                {
    1612                     RTListNodeRemove(&pCur->ListEntry);
    1613                     RTMemFree(pCur);
     1616                    RTListNodeRemove(&pMatch->ListEntry);
     1617                    RTMemFree(pMatch);
    16141618                    rcNt = STATUS_END_OF_FILE;
    16151619                }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette