Changeset 4778


Ignore:
Timestamp:
Dec 11, 2000, 7:30:59 AM (24 years ago)
Author:
bird
Message:

Added support for global modules (ie. DLLs) with extention diffrent from
.DLL.

Location:
trunk/src/win32k/ldr
Files:
2 edited

Legend:

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

    r4239 r4778  
    1 /* $Id: myldrOpen.cpp,v 1.12 2000-09-12 04:40:57 bird Exp $
     1/* $Id: myldrOpen.cpp,v 1.13 2000-12-11 06:30:59 bird Exp $
    22 *
    33 * myldrOpen - ldrOpen.
     
    7575                                        /* When the maximum depth has been reached    */
    7676                                        /* we'll not intercept loading any longer!    */
    77     ULONG rc;                           /* Return value. */
     77    ULONG   rc;                         /* Return value. */
    7878
    7979    /** @sketch
    80      * Try open the file (that's why this function is called anyway)
     80     * Try open the file (that's why this function is called)
     81     *   Apply Extention fix if this is requested.
    8182     */
    82     rc = ldrOpen(phFile, pszFilename, pfl);
     83    if (fldrOpenExtentionFix)
     84    {
     85        int cchFilename = strlen(pszFilename);
     86        pszFilename[cchFilename - 4] = '\0';
     87        rc = ldrOpen(phFile, pszFilename, pfl);
     88        if (rc != NO_ERROR)
     89        {
     90            pszFilename[cchFilename - 4] = '.';
     91            rc = ldrOpen(phFile, pszFilename, pfl);
     92        }
     93    }
     94    else
     95        rc = ldrOpen(phFile, pszFilename, pfl);
     96
    8397    if (rc == NO_ERROR)
    8498        kprintf(("myldrOpen-%d:  phFile=%#.4x, flags=%#.8x, pszFn=%s\n", cNesting, *phFile, pfl, pszFilename));
     
    771785 *
    772786 * @status    completly implemented.
    773  * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     787 * @author    knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    774788 * @remark    Implementation note:
    775789 *  The arguments convention is as follows:
     
    899913 * @param     pszExecName   Pointer to new executable name.
    900914 * @status    completly implemented.
    901  * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     915 * @author    knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    902916 * @remark    .
    903917 */
     
    941955 * @param     pfl           Some flags set by ldrOpen.
    942956 * @sketch    stub
    943  * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     957 * @author    knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    944958 * @remark
    945959 */
  • TabularUnified trunk/src/win32k/ldr/myldrOpenPath.cpp

    r4307 r4778  
    1 /* $Id: myldrOpenPath.cpp,v 1.3 2000-09-22 09:22:40 bird Exp $
     1/* $Id: myldrOpenPath.cpp,v 1.4 2000-12-11 06:30:59 bird Exp $
    22 *
    33 * myldrOpenPath - ldrOpenPath used to open executables we'll override
    44 * this to altern the search path for DLLs.
    55 *
    6  * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     6 * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    77 *
    88 * Project Odin Software License can be found in LICENSE.TXT
     
    3737#include "ldr.h"
    3838#include "ModuleBase.h"
    39 
     39#include "options.h"
    4040
    4141
     
    9191{
    9292
    93     APIRET rc;
     93    APIRET  rc;
    9494
    9595    #ifdef DEBUG
     
    122122    else
    123123        setLdrStateLoadingUnsupported();
     124
     125
     126    /*
     127     * Check if we're to apply the extention fix in myldrOpen.
     128     * The required conditions are:
     129     *      1. Global class. (ie. DLL)
     130     *      2. Name must include a dot.
     131     *      3. The extention must not be .DLL.
     132     */
     133    fldrOpenExtentionFix =      isDllFixesEnabled()
     134                            &&  plv->lv_class == CLASS_GLOBAL
     135                            &&  memchr(pachFilename, '.', cchFilename)
     136                            &&  (   cchFilename < 4
     137                                 || memcmp(pachFilename + cchFilename - 4, ".DLL", 4));
    124138
    125139    /*
     
    189203    setLdrStateClearLoadingType();
    190204
     205    /*
     206     * Clear the extention fix flag.
     207     */
     208    fldrOpenExtentionFix = FALSE;
     209
    191210    return rc;
    192211}
Note: See TracChangeset for help on using the changeset viewer.