Changeset 4164 for trunk/src/win32k/ldr/myldrRead.cpp
- Timestamp:
- Sep 2, 2000, 11:08:23 PM (25 years ago)
- 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:02bird Exp $1 /* $Id: myldrRead.cpp,v 1.7 2000-09-02 21:08:10 bird Exp $ 2 2 * 3 3 * myldrRead - ldrRead. 4 4 * 5 * Copyright (c) 1998- 1999 knut st. osmundsen5 * Copyright (c) 1998-2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no) 6 6 * 7 7 * Project Odin Software License can be found in LICENSE.TXT … … 23 23 #include <stdlib.h> 24 24 25 #include "devSegDf.h" /* Win32k segment definitions. */ 25 26 #include "log.h" 27 #include "avl.h" 26 28 #include "dev32.h" 27 29 #include <peexe.h> 28 30 #include <exe386.h> 29 31 #include "OS2Krnl.h" 32 #include "ldrCalls.h" 33 #include "ldr.h" 30 34 #include "ModuleBase.h" 31 35 #include "pe2lx.h" 32 #include "avl.h"33 #include "ldrCalls.h"34 #include "ldr.h"35 36 36 37 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 */ 37 58 ULONG LDRCALL myldrRead( 38 SFNhFile,39 ULONGulOffset,40 PVOID pBuffer,41 ULONG ulFlags,42 ULONG ulBytesToRead,43 PMTEpMTE44 59 SFN hFile, 60 ULONG ulOffset, 61 PVOID pvBuffer, 62 ULONG fpBuffer, 63 ULONG cbToRead, 64 PMTE pMTE 65 ) 45 66 { 46 67 ULONG rc; … … 50 71 { 51 72 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)); 53 75 54 76 pMod = getModuleBySFN(hFile); … … 59 81 pMod->pMTE = pMTE; 60 82 61 /* debug */62 if (ulFlags != 0)63 kprintf(("ldrRead: Warning ulFlags = 0x%x (!= 0)\n", ulFlags));64 65 83 if ((pMod->fFlags & MOD_TYPE_MASK) == MOD_TYPE_PE2LX) 66 rc = pMod->Data.pModule->read(ulOffset, p Buffer, ulBytesToRead, ulFlags, pMTE);84 rc = pMod->Data.pModule->read(ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE); 67 85 else 68 86 { 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)); 70 88 rc = ERROR_READ_FAULT; 71 89 } 72 return rc;73 90 } 74 91 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 } 76 96 } 77 78 rc = ldrRead(hFile, ulOffset, pBuffer, ulFlags, ulBytesToRead, pMTE); 79 97 else 98 { 99 rc = ldrRead(hFile, ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE); 100 } 80 101 #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)); 83 104 #endif 84 105
Note:
See TracChangeset
for help on using the changeset viewer.