Ignore:
Timestamp:
Oct 27, 1999, 4:03:01 AM (26 years ago)
Author:
bird
Message:

Corrections to make win32k work.
(And now it does work, at least at my test machine...)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/ldr/myldrRead.cpp

    r1276 r1467  
    1 /* $Id: myldrRead.cpp,v 1.3 1999-10-14 02:36:08 bird Exp $
     1/* $Id: myldrRead.cpp,v 1.4 1999-10-27 02:02:58 bird Exp $
    22 *
    33 * myldrRead - _ldrRead.
     
    2727#include "OS2Krnl.h"
    2828#include "pe2lx.h"
     29#include "avl.h"
    2930#include "ldrCalls.h"
    3031#include "ldr.h"
     
    4546    if (GetState(hFile) == HSTATE_OUR)
    4647    {
    47         PPENODE pNode;
     48        PMODULE pMod;
     49        kprintf(("_ldrRead+: hF=%+04x off=%+08x pB=%+08x fl=%+08x cb=%+04x pMTE=%+08x\n",hFile,ulOffset,pBuffer,ulFlags,ulBytesToRead,pMTE));
    4850
    49         pNode = getNodePtr(hFile);
    50         if (pNode != NULL)
     51        pMod = getModuleBySFN(hFile);
     52        if (pMod != NULL)
    5153        {
    5254            /* I would love to have a pointer to the MTE */
    53             if (pNode->pMTE == NULL && pMTE != NULL)
    54                 pNode->pMTE == pMTE;
     55            if (pMod->pMTE == NULL && pMTE != NULL)
     56                pMod->pMTE == pMTE;
    5557
    5658            /* debug */
     
    5860                kprintf(("_ldrRead: Warning ulFlags = 0x%x (!= 0)\n", ulFlags));
    5961
    60             rc = pNode->pPe2Lx->read(ulOffset, pBuffer, ulBytesToRead, ulFlags, pMTE);
     62            if ((pMod->fFlags & MOD_TYPE_MASK) == MOD_TYPE_PE2LX)
     63                rc = pMod->Data.pPe2Lx->read(ulOffset, pBuffer, ulBytesToRead, ulFlags, pMTE);
     64            else
     65            {
     66                kprintf(("_ldrRead: Invalid module type, %#x\n", pMod->fFlags & MOD_TYPE_MASK));
     67                rc = ERROR_READ_FAULT;
     68            }
    6169            return rc;
    6270        }
     
    6775    rc = _ldrRead(hFile, ulOffset, pBuffer, ulFlags, ulBytesToRead, pMTE);
    6876
    69 //  kprintf(("_ldrRead:  hF=%+04x off=%+08x pB=%+08x fl=%+08x cb=%+04x pMTE=%+08x rc=%d\n",hFile,ulOffset,pBuffer,ulFlags,ulBytesToRead,pMTE,rc));
     77    #if 0
     78    kprintf(("_ldrRead:  hF=%+04x off=%+08x pB=%+08x fl=%+08x cb=%+04x pMTE=%+08x rc=%d\n",
     79             hFile,ulOffset,pBuffer,ulFlags,ulBytesToRead,pMTE,rc));
     80    #endif
    7081
    7182    return rc;
Note: See TracChangeset for help on using the changeset viewer.