Ignore:
Timestamp:
Jan 22, 2000, 7:21:03 PM (26 years ago)
Author:
bird
Message:

Temporary backup checkin.

File:
1 edited

Legend:

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

    r1678 r2501  
    1 /* $Id: myldrOpen.cpp,v 1.5 1999-11-10 01:45:36 bird Exp $
     1/* $Id: myldrOpen.cpp,v 1.6 2000-01-22 18:21:02 bird Exp $
    22 *
    3  * myldrOpen - _ldrOpen.
     3 * myldrOpen - ldrOpen.
    44 *
    55 * Copyright (c) 1998-1999 knut st. osmundsen
     
    3939
    4040/**
    41  * _ldrOpen override.
     41 * ldrOpen override.
    4242 * @returns   Return code.
    4343 * @param     phFile       Pointer to file handler. Holds filehandle on output.
     
    4848{
    4949    ULONG rc;
    50     int i;
    5150
    52     rc = _ldrOpen(phFile, pszFilename, param3);
     51    rc = ldrOpen(phFile, pszFilename, param3);
    5352
    5453    if (rc == NO_ERROR)
    55         kprintf(("_ldrOpen:  phFile=%#.4x, flags=%#.8x, pszFn=%s\n", *phFile, param3, pszFilename));
     54        kprintf(("ldrOpen:  phFile=%#.4x, flags=%#.8x, pszFn=%s\n", *phFile, param3, pszFilename));
    5655
    5756    if (rc == NO_ERROR && (options.fElf || options.fPE != FLAGS_PE_NOT || options.fScript))
     
    6665         * This costs up to two disk reads!
    6766         */
    68         rc = _ldrRead(*phFile, 0UL, pMzHdr, 0UL, sizeof(IMAGE_DOS_HEADER), NULL);
     67        rc = ldrRead(*phFile, 0UL, pMzHdr, 0UL, sizeof(IMAGE_DOS_HEADER), NULL);
    6968        if (rc == NO_ERROR)
    7069        {
     
    7776
    7877                if (*(PULONG)pach != IMAGE_NT_SIGNATURE)
    79                     rc = _ldrRead(*phFile, pMzHdr->e_lfanew, pach, 0UL, sizeof(achBuffer), NULL);
     78                    rc = ldrRead(*phFile, pMzHdr->e_lfanew, pach, 0UL, sizeof(achBuffer), NULL);
    8079
    8180                if (rc == NO_ERROR && *(PULONG)pach == IMAGE_NT_SIGNATURE)
    8281                {   /* PE signature found */
    83                     kprintf(("_ldrOpen: PE executable...\n"));
     82                    kprintf(("ldrOpen: PE executable...\n"));
    8483                    if (options.fPE == FLAGS_PE_PE2LX
    8584                        || (options.fPE == FLAGS_PE_MIXED
     
    9695                            if (rc == NO_ERROR)
    9796                            {
    98                                 kprintf(("_ldrOpen: Successfully init of Pe2Lx object.\n"));
     97                                kprintf(("ldrOpen: Successfully init of Pe2Lx object.\n"));
    9998                                rc = addModule(*phFile, NULL, MOD_TYPE_PE2LX, pPe2Lx);
    10099                                if (rc == NO_ERROR)
     100                                    #pragma info(notrd)
    101101                                    SetState(*phFile, HSTATE_OUR);
     102                                    #pragma info(restore)
    102103                                else
    103                                     kprintf(("_ldrOpen: Failed to add the module. rc=%d\n"));
     104                                    kprintf(("ldrOpen: Failed to add the module. rc=%d\n"));
    104105                            }
    105106                            else
    106                                 kprintf(("_ldrOpen: Failed to init Pe2Lx object. rc=%d\n"));
     107                                kprintf(("ldrOpen: Failed to init Pe2Lx object. rc=%d\n"));
    107108                            if (rc != NO_ERROR)
    108109                                delete pPe2Lx;
    109110                        }
    110111                        else
    111                             kprintf(("_ldrOpen: Failed to allocate Pe2Lx object.\n"));
     112                            kprintf(("ldrOpen: Failed to allocate Pe2Lx object.\n"));
    112113                    }
    113114                    else
    114115                        if (options.fPE == FLAGS_PE_PE || options.fPE == FLAGS_PE_MIXED)
    115116                        {   /* pe.exe */
    116                             kprintf(("_ldrOpen: pe.exe - opening\n"));
    117                             _ldrClose(*phFile);
    118                             rc = _ldrOpen(phFile, "pe.exe", param3);  /* path....! problems! */
    119                             kprintf(("_ldrOpen: pe.exe - open returned with rc = %d\n", rc));
     117                            kprintf(("ldrOpen: pe.exe - opening\n"));
     118                            ldrClose(*phFile);
     119                            rc = ldrOpen(phFile, "pe.exe", param3);  /* path....! problems! */
     120                            kprintf(("ldrOpen: pe.exe - open returned with rc = %d\n", rc));
    120121                            return rc;
    121122                        }
     
    128129                {
    129130                    /* ELF signature found */
    130                     kprintf(("_ldrOpen: ELF executable! - not implemented yet!\n"));
     131                    kprintf(("ldrOpen: ELF executable! - not implemented yet!\n"));
    131132                }
    132133                else
     
    136137                        char *pszStart = pach+2;
    137138                        char *pszEnd;
    138                         kprintf(("_ldrOpen: unix script?\n"));
     139                        kprintf(("ldrOpen: unix script?\n"));
    139140
    140141                        achBuffer[sizeof(achBuffer)-1] = '\0'; /* just to make sure we don't read to much... */
     
    152153                            {
    153154                                *pszEnd = '\0';
    154                                 kprintf(("_ldrOpen: unix script - opening %s\n", pszStart));
    155                                 _ldrClose(*phFile);
    156                                 rc = _ldrOpen(phFile, pszStart, param3);
    157                                 kprintf(("_ldrOpen: unix script - open returned with rc = %d\n", rc));
     155                                kprintf(("ldrOpen: unix script - opening %s\n", pszStart));
     156                                ldrClose(*phFile);
     157                                rc = ldrOpen(phFile, pszStart, param3);
     158                                kprintf(("ldrOpen: unix script - open returned with rc = %d\n", rc));
    158159                            }
    159160                        }
    160161                        else
    161                             kprintf(("_ldrOpen: unix script - unexpected end of line/file. (line: %.10s\n", pach));
     162                            kprintf(("ldrOpen: unix script - unexpected end of line/file. (line: %.10s\n", pach));
    162163                    }
    163164            }
     
    165166        else
    166167        {
    167             kprintf(("_ldrOpen: _ldrRead failed with rc=%d when reading DosHdr.\n", rc));
     168            kprintf(("ldrOpen: ldrRead failed with rc=%d when reading DosHdr.\n", rc));
    168169            rc = NO_ERROR;
    169170        }
Note: See TracChangeset for help on using the changeset viewer.