Ignore:
Timestamp:
Sep 2, 2000, 11:08:23 PM (25 years ago)
Author:
bird
Message:

Merged in the Grace branch. New Win32k!

File:
1 edited

Legend:

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

    r2501 r4164  
    1 /* $Id: myldrRead.cpp,v 1.6 2000-01-22 18:21:02 bird Exp $
     1/* $Id: myldrRead.cpp,v 1.7 2000-09-02 21:08:10 bird Exp $
    22 *
    33 * myldrRead - ldrRead.
    44 *
    5  * Copyright (c) 1998-1999 knut st. osmundsen
     5 * Copyright (c) 1998-2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    66 *
    77 * Project Odin Software License can be found in LICENSE.TXT
     
    2323#include <stdlib.h>
    2424
     25#include "devSegDf.h"                   /* Win32k segment definitions. */
    2526#include "log.h"
     27#include "avl.h"
    2628#include "dev32.h"
    2729#include <peexe.h>
    2830#include <exe386.h>
    2931#include "OS2Krnl.h"
     32#include "ldrCalls.h"
     33#include "ldr.h"
    3034#include "ModuleBase.h"
    3135#include "pe2lx.h"
    32 #include "avl.h"
    33 #include "ldrCalls.h"
    34 #include "ldr.h"
    3536
    3637
     38/**
     39 * Overloads ldrRead.
     40 * @returns   OS/2 return code.
     41 * @param     hFile     Filehandle to read from.
     42 * @param     pvBuffer  Buffer to read into.
     43 * @param     fpBuffer  This is not flags as I first though, but probably a far 16-bit pointer
     44 *                      to the buffer.
     45 * @param     cbToRead  Count of bytes to read.
     46 * @param     pMTE
     47 * @sketch    IF it's our module THEN
     48 *                Get module pointer. (complain if this failes and backout to ldrRead.)
     49 *                Currently - verify that it's a Pe2Lx module. (complain and fail if not.)
     50 *                Invoke the read method of the module do the requested read operation.
     51 *                Save pMTE if present and not save allready.
     52 *            ENDIF
     53 *            - backout or not our module -
     54 *            forward request to the original ldrRead.
     55 * @status    Completely implemented.
     56 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     57 */
    3758ULONG LDRCALL myldrRead(
    38                        SFN hFile,
    39                        ULONG ulOffset,
    40                        PVOID pBuffer,
    41                        ULONG ulFlags ,
    42                        ULONG ulBytesToRead,
    43                        PMTE pMTE
    44                        )
     59    SFN    hFile,
     60    ULONG  ulOffset,
     61    PVOID   pvBuffer,
     62    ULONG   fpBuffer,
     63    ULONG   cbToRead,
     64    PMTE    pMTE
     65    )
    4566{
    4667    ULONG   rc;
     
    5071    {
    5172        PMODULE pMod;
    52         kprintf(("ldrRead+: hF=%+04x off=%+08x pB=%+08x fl=%+08x cb=%+04x pMTE=%+08x\n",hFile,ulOffset,pBuffer,ulFlags,ulBytesToRead,pMTE));
     73        kprintf(("myldrRead: hF=%+04x off=%+08x pB=%+08x fp=%+08x cb=%+04x pMTE=%+08x\n",
     74                 hFile, ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE));
    5375
    5476        pMod = getModuleBySFN(hFile);
     
    5981                pMod->pMTE = pMTE;
    6082
    61             /* debug */
    62             if (ulFlags != 0)
    63                 kprintf(("ldrRead: Warning ulFlags = 0x%x (!= 0)\n", ulFlags));
    64 
    6583            if ((pMod->fFlags & MOD_TYPE_MASK) == MOD_TYPE_PE2LX)
    66                 rc = pMod->Data.pModule->read(ulOffset, pBuffer, ulBytesToRead, ulFlags, pMTE);
     84                rc = pMod->Data.pModule->read(ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE);
    6785            else
    6886            {
    69                 kprintf(("ldrRead: Invalid module type, %#x\n", pMod->fFlags & MOD_TYPE_MASK));
     87                kprintf(("myldrRead: Invalid module type, %#x\n", pMod->fFlags & MOD_TYPE_MASK));
    7088                rc = ERROR_READ_FAULT;
    7189            }
    72             return rc;
    7390        }
    7491        else
    75             kprintf(("ldrRead:  DON'T PANIC! - but I can't get Node ptr! - This is really an IPE!\n"));
     92        {
     93            kprintf(("myldrRead:  DON'T PANIC! - but I can't get Node ptr! - This is really an IPE!\n"));
     94            rc = ERROR_READ_FAULT;
     95        }
    7696    }
    77 
    78     rc = ldrRead(hFile, ulOffset, pBuffer, ulFlags, ulBytesToRead, pMTE);
    79 
     97    else
     98    {
     99        rc = ldrRead(hFile, ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE);
     100    }
    80101    #if 0
    81     kprintf(("ldrRead:  hF=%+04x off=%+08x pB=%+08x fl=%+08x cb=%+04x pMTE=%+08x rc=%d\n",
    82              hFile,ulOffset,pBuffer,ulFlags,ulBytesToRead,pMTE,rc));
     102    kprintf(("myldrRead:  hF=%+04x off=%+08x pB=%+08x fp=%+08x cb=%+04x pMTE=%+08x rc=%d\n",
     103             hFile, ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE, rc));
    83104    #endif
    84105
Note: See TracChangeset for help on using the changeset viewer.