Ignore:
Timestamp:
Jul 17, 2000, 12:43:41 AM (25 years ago)
Author:
bird
Message:

Checkin of current code in the Grace brance for backup purpose.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GRACE/src/win32k/ldr/myldrRead.cpp

    r2501 r3834  
    1 /* $Id: myldrRead.cpp,v 1.6 2000-01-22 18:21:02 bird Exp $
     1/* $Id: myldrRead.cpp,v 1.6.4.1 2000-07-16 22:43:38 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
     
    2424
    2525#include "log.h"
     26#include "avl.h"
    2627#include "dev32.h"
    2728#include <peexe.h>
    2829#include <exe386.h>
    2930#include "OS2Krnl.h"
     31#include "ldrCalls.h"
     32#include "ldr.h"
    3033#include "ModuleBase.h"
    3134#include "pe2lx.h"
    32 #include "avl.h"
    33 #include "ldrCalls.h"
    34 #include "ldr.h"
    3535
    3636
     37/**
     38 * Overloads ldrRead.
     39 * @returns   OS/2 return code.
     40 * @param     hFile     Filehandle to read from.
     41 * @param     pvBuffer  Buffer to read into.
     42 * @param     fpBuffer  This is not flags as I first though, but probably a far 16-bit pointer
     43 *                      to the buffer.
     44 * @param     cbToRead  Count of bytes to read.
     45 * @param     pMTE
     46 * @sketch    IF it's our module THEN
     47 *                Get module pointer. (complain if this failes and backout to ldrRead.)
     48 *                Currently - verify that it's a Pe2Lx module. (complain and fail if not.)
     49 *                Invoke the read method of the module do the requested read operation.
     50 *                Save pMTE if present and not save allready.
     51 *            ENDIF
     52 *            - backout or not our module -
     53 *            forward request to the original ldrRead.
     54 * @status    Completely implemented.
     55 * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     56 */
    3757ULONG LDRCALL myldrRead(
    38                        SFN hFile,
    39                        ULONG ulOffset,
    40                        PVOID pBuffer,
    41                        ULONG ulFlags ,
    42                        ULONG ulBytesToRead,
    43                        PMTE pMTE
    44                        )
     58    SFN    hFile,
     59    ULONG  ulOffset,
     60    PVOID   pvBuffer,
     61    ULONG   fpBuffer,
     62    ULONG   cbToRead,
     63    PMTE    pMTE
     64    )
    4565{
    4666    ULONG   rc;
     
    5070    {
    5171        PMODULE pMod;
    52         kprintf(("ldrRead+: hF=%+04x off=%+08x pB=%+08x fl=%+08x cb=%+04x pMTE=%+08x\n",hFile,ulOffset,pBuffer,ulFlags,ulBytesToRead,pMTE));
     72        kprintf(("myldrRead: hF=%+04x off=%+08x pB=%+08x fp=%+08x cb=%+04x pMTE=%+08x\n",
     73                 hFile, ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE));
    5374
    5475        pMod = getModuleBySFN(hFile);
     
    5980                pMod->pMTE = pMTE;
    6081
    61             /* debug */
    62             if (ulFlags != 0)
    63                 kprintf(("ldrRead: Warning ulFlags = 0x%x (!= 0)\n", ulFlags));
    64 
    6582            if ((pMod->fFlags & MOD_TYPE_MASK) == MOD_TYPE_PE2LX)
    66                 rc = pMod->Data.pModule->read(ulOffset, pBuffer, ulBytesToRead, ulFlags, pMTE);
     83                rc = pMod->Data.pModule->read(ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE);
    6784            else
    6885            {
    69                 kprintf(("ldrRead: Invalid module type, %#x\n", pMod->fFlags & MOD_TYPE_MASK));
     86                kprintf(("myldrRead: Invalid module type, %#x\n", pMod->fFlags & MOD_TYPE_MASK));
    7087                rc = ERROR_READ_FAULT;
    7188            }
    72             return rc;
    7389        }
    7490        else
    75             kprintf(("ldrRead:  DON'T PANIC! - but I can't get Node ptr! - This is really an IPE!\n"));
     91        {
     92            kprintf(("myldrRead:  DON'T PANIC! - but I can't get Node ptr! - This is really an IPE!\n"));
     93            rc = ERROR_READ_FAULT;
     94        }
    7695    }
    77 
    78     rc = ldrRead(hFile, ulOffset, pBuffer, ulFlags, ulBytesToRead, pMTE);
    79 
     96    else
     97    {
     98        rc = ldrRead(hFile, ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE);
     99    }
    80100    #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));
     101    kprintf(("myldrRead:  hF=%+04x off=%+08x pB=%+08x fp=%+08x cb=%+04x pMTE=%+08x rc=%d\n",
     102             hFile, ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE, rc));
    83103    #endif
    84104
Note: See TracChangeset for help on using the changeset viewer.