Changeset 3834 for branches/GRACE/src/win32k/ldr/myldrRead.cpp
- Timestamp:
- Jul 17, 2000, 12:43:41 AM (25 years ago)
- 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:02bird Exp $1 /* $Id: myldrRead.cpp,v 1.6.4.1 2000-07-16 22:43:38 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 … … 24 24 25 25 #include "log.h" 26 #include "avl.h" 26 27 #include "dev32.h" 27 28 #include <peexe.h> 28 29 #include <exe386.h> 29 30 #include "OS2Krnl.h" 31 #include "ldrCalls.h" 32 #include "ldr.h" 30 33 #include "ModuleBase.h" 31 34 #include "pe2lx.h" 32 #include "avl.h"33 #include "ldrCalls.h"34 #include "ldr.h"35 35 36 36 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 */ 37 57 ULONG LDRCALL myldrRead( 38 SFNhFile,39 ULONGulOffset,40 PVOID pBuffer,41 ULONG ulFlags,42 ULONG ulBytesToRead,43 PMTEpMTE44 58 SFN hFile, 59 ULONG ulOffset, 60 PVOID pvBuffer, 61 ULONG fpBuffer, 62 ULONG cbToRead, 63 PMTE pMTE 64 ) 45 65 { 46 66 ULONG rc; … … 50 70 { 51 71 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)); 53 74 54 75 pMod = getModuleBySFN(hFile); … … 59 80 pMod->pMTE = pMTE; 60 81 61 /* debug */62 if (ulFlags != 0)63 kprintf(("ldrRead: Warning ulFlags = 0x%x (!= 0)\n", ulFlags));64 65 82 if ((pMod->fFlags & MOD_TYPE_MASK) == MOD_TYPE_PE2LX) 66 rc = pMod->Data.pModule->read(ulOffset, p Buffer, ulBytesToRead, ulFlags, pMTE);83 rc = pMod->Data.pModule->read(ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE); 67 84 else 68 85 { 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)); 70 87 rc = ERROR_READ_FAULT; 71 88 } 72 return rc;73 89 } 74 90 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 } 76 95 } 77 78 rc = ldrRead(hFile, ulOffset, pBuffer, ulFlags, ulBytesToRead, pMTE); 79 96 else 97 { 98 rc = ldrRead(hFile, ulOffset, pvBuffer, fpBuffer, cbToRead, pMTE); 99 } 80 100 #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)); 83 103 #endif 84 104
Note:
See TracChangeset
for help on using the changeset viewer.