Changes between Version 1 and Version 2 of Ticket #76, comment 11


Ignore:
Timestamp:
Feb 2, 2020, 4:45:40 PM (5 years ago)
Author:
erdmann

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #76, comment 11

    v1 v2  
    22VBOXFSFind.cpp, "FillFindBuf": I recommend to move the thunking calls for peaop->fGEAList and peaop->fFEAList into GetEmptyEAS itself and remove them from anywhere else. That is much more understandable and less error prone.
    33
    4 It is also incorrect to thunk these two pointers and copy them back into the EAOP return structure. These pointers HAVE to remain 16:16 far pointers in the returned kernel structure.
     4It is also incorrect to thunk these two pointers and copy them back into the EAOP return structure as is done here:
     5
     6{{{
     7    if (level == FIL_QUERYEASFROMLIST || level == FIL_QUERYEASFROMLISTL)
     8    {
     9        KernCopyIn(&eaop, pbData, sizeof (EAOP));
     10        pFeal = (PFEALIST)RTMemAlloc(MIN_EA_SIZE);
     11       
     12        if (! pFeal)
     13        {
     14            hrc = ERROR_NOT_ENOUGH_MEMORY;
     15            goto FILLFINDBUFEXIT;
     16        }
     17
     18        eaop.fpFEAList = pFeal;
     19        eaop.fpGEAList = (PGEALIST)KernSelToFlat((ULONG)eaop.fpGEAList);
     20    }
     21
     22    memset(pbData, 0, cbData);
     23
     24    if (level == FIL_QUERYEASFROMLIST || level == FIL_QUERYEASFROMLISTL)
     25    {
     26        KernCopyOut(pbData, &eaop, sizeof(EAOP));
     27        pbData += sizeof(EAOP);
     28        cbData -= sizeof(EAOP);
     29}}}
     30
     31These pointers HAVE to remain 16:16 far pointers in the returned kernel structure.
    532In fact the EAOP structure has to remain completely UNCHANGED in the return buffer.