[5086] | 1 | /* $Id: myldrEnum32bitRelRecs.cpp,v 1.5 2001-02-10 11:11:46 bird Exp $
|
---|
[2509] | 2 | *
|
---|
| 3 | * myldrEnum32bitRelRecs - ldrEnum32bitRelRecs
|
---|
| 4 | *
|
---|
[4787] | 5 | * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
|
---|
[2509] | 6 | *
|
---|
| 7 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
| 8 | *
|
---|
| 9 | */
|
---|
| 10 |
|
---|
| 11 | /*******************************************************************************
|
---|
| 12 | * Defined Constants And Macros *
|
---|
| 13 | *******************************************************************************/
|
---|
| 14 | #define INCL_DOSERRORS
|
---|
| 15 | #define INCL_NOPMAPI
|
---|
[5086] | 16 | #define INCL_OS2KRNL_LDR
|
---|
[2509] | 17 |
|
---|
| 18 |
|
---|
| 19 | /*******************************************************************************
|
---|
| 20 | * Header Files *
|
---|
| 21 | *******************************************************************************/
|
---|
| 22 | #include <os2.h>
|
---|
| 23 |
|
---|
| 24 | #include <memory.h>
|
---|
| 25 | #include <stdlib.h>
|
---|
| 26 |
|
---|
[4164] | 27 | #include "devSegDf.h" /* Win32k segment definitions. */
|
---|
| 28 | #include "avl.h"
|
---|
[2509] | 29 | #include "log.h"
|
---|
| 30 | #include <peexe.h>
|
---|
| 31 | #include <exe386.h>
|
---|
| 32 | #include "OS2Krnl.h"
|
---|
| 33 | #include "ldr.h"
|
---|
[4164] | 34 | #include "ModuleBase.h"
|
---|
[2509] | 35 |
|
---|
| 36 |
|
---|
| 37 | /**
|
---|
| 38 | * Applies relocation fixups to a page which is being loaded.
|
---|
| 39 | * @returns NO_ERROR on success?
|
---|
| 40 | * error code on error?
|
---|
| 41 | * @param pMTE Pointer Module Table Entry.
|
---|
| 42 | * @param iObject Index into the object table. (0-based)
|
---|
| 43 | * @param iPageTable Index into the page table. (0-based)
|
---|
| 44 | * @param pvPage Pointer to the page which is being loaded.
|
---|
| 45 | * @param ulPageAddress Address of page.
|
---|
| 46 | * @param pvPTDA Pointer to Per Task Data Aera
|
---|
| 47 | *
|
---|
| 48 | * @sketch Check if one of our handles.
|
---|
| 49 | */
|
---|
| 50 | ULONG LDRCALL myldrEnum32bitRelRecs(
|
---|
| 51 | PMTE pMTE,
|
---|
| 52 | ULONG iObject,
|
---|
| 53 | ULONG iPageTable,
|
---|
| 54 | PVOID pvPage,
|
---|
| 55 | ULONG ulPageAddress,
|
---|
| 56 | PVOID pvPTDA
|
---|
| 57 | )
|
---|
| 58 | {
|
---|
| 59 | PMODULE pMod;
|
---|
| 60 |
|
---|
| 61 | pMod = getModuleByMTE(pMTE);
|
---|
| 62 | if (pMod != NULL)
|
---|
| 63 | {
|
---|
| 64 | APIRET rc;
|
---|
[2537] | 65 | #if 1
|
---|
[4164] | 66 | kprintf(("myldrEnum32BitRelRecs: pMTE=0x%08x iObject=0x%02x iPageTable=0x%03x pvPage=0x%08x\n"
|
---|
[2537] | 67 | " ulPageAddress=0x%08x pvPTDA=0x%08x\n",
|
---|
| 68 | pMTE, iObject, iPageTable, pvPage, ulPageAddress, pvPTDA
|
---|
| 69 | ));
|
---|
| 70 | #endif
|
---|
[2509] | 71 | rc = pMod->Data.pModule->applyFixups(pMTE, iObject, iPageTable, pvPage, ulPageAddress, pvPTDA);
|
---|
| 72 | if (rc != NO_ERROR)
|
---|
| 73 | return rc;
|
---|
| 74 | }
|
---|
| 75 |
|
---|
| 76 | return ldrEnum32bitRelRecs(pMTE, iObject, iPageTable, pvPage, ulPageAddress, pvPTDA);
|
---|
| 77 | }
|
---|