Ignore:
Timestamp:
Sep 2, 2000, 11:08:23 PM (25 years ago)
Author:
bird
Message:

Merged in the Grace branch. New Win32k!

File:
1 edited

Legend:

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

    r2926 r4164  
    1 /* $Id: ModuleBase.cpp,v 1.3 2000-02-27 02:17:06 bird Exp $
     1/* $Id: ModuleBase.cpp,v 1.4 2000-09-02 21:08:06 bird Exp $
    22 *
    33 * ModuleBase - Implementetation.
     
    1212*   Defined Constants And Macros                                               *
    1313*******************************************************************************/
    14 #define INCL_DOSERRORS                      /* DOS Error codes. */
     14#define INCL_DOSERRORS                  /* DOS Error codes. */
    1515#ifdef RING0
    16     #define INCL_NOAPI                      /* RING0: No apis. */
     16    #define INCL_NOAPI                  /* RING0: No apis. */
    1717#else /*RING3*/
    18     #define INCL_DOSFILEMGR                 /* RING3: DOS File api. */
     18    #define INCL_DOSFILEMGR             /* RING3: DOS File api. */
    1919#endif
    2020
     
    2323*   Header Files                                                               *
    2424*******************************************************************************/
    25 #include <os2.h>                            /* OS/2 header file. */
    26 
    27 #include "malloc.h"                         /* win32k malloc. Not C library! */
    28 
    29 #include <string.h>                         /* C library string.h. */
    30 #include <stdarg.h>                         /* C library stdarg.h. */
    31 
    32 #include "vprintf.h"                        /* win32k printf and vprintf. Not C library! */
    33 #include "dev32.h"                          /* 32-Bit part of the device driver. (SSToDS) */
    34 #include "OS2Krnl.h"                        /* kernel structs.  (SFN) */
    35 #include "modulebase.h"                     /* ModuleBase class definitions, ++. */
     25#include <os2.h>                        /* OS/2 header file. */
     26
     27#include "devSegDf.h"                   /* Win32k segment definitions. */
     28#include "malloc.h"                     /* Win32k malloc. Not C library! */
     29
     30#include <string.h>                     /* C library string.h. */
     31#include <stdarg.h>                     /* C library stdarg.h. */
     32
     33#include "vprintf.h"                    /* win32k printf and vprintf. Not C library! */
     34#include "dev32.h"                      /* 32-Bit part of the device driver. (SSToDS) */
     35#include "OS2Krnl.h"                    /* kernel structs.  (SFN) */
     36#include "ldrCalls.h"                   /* ldrOpenPath and ldrlv_t. */
     37#include "modulebase.h"                 /* ModuleBase class definitions, ++. */
    3638
    3739
     
    159161}
    160162
     163
     164/**
     165 * openPath - opens file eventually searching loader specific paths.
     166 *
     167 * This base implementation simply calls ldrOpenPath.
     168 * This method is only called for DLLs. DosLoadModule and Imports.
     169 *
     170 * @returns   OS2 return code.
     171 *            pLdrLv->lv_sfn  is set to filename handle.
     172 * @param     pachFilename  Pointer to filename. Not zero terminated!
     173 * @param     cchFilename   Filename length.
     174 * @param     pLdrLv        Loader local variables? (Struct from KERNEL.SDF)
     175 * @param     pful          Pointer to flags which are passed on to ldrOpen.
     176 * @sketch
     177 * This is roughly what the original ldrOpenPath does:
     178 *      if !CLASS_GLOBAL or miniifs then
     179 *          ldrOpen(pachModName)
     180 *      else
     181 *          loop until no more libpath elements
     182 *              get next libpath element and add it to the modname.
     183 *              try open the modname
     184 *              if successfull then break the loop.
     185 *          endloop
     186 *      endif
     187 */
     188ULONG  ModuleBase::openPath(PCHAR pachFilename, USHORT cchFilename, ldrlv_t *pLdrLv, PULONG pful) /* (ldrOpenPath) */
     189{
     190    #ifdef RING0
     191    printf("ModuleBase::openPath:\n");
     192    return ldrOpenPath(pachFilename, cchFilename, pLdrLv, pful);
     193    #else
     194    NOREF(pachFilename);
     195    NOREF(cchFilename);
     196    NOREF(pLdrLv);
     197    NOREF(pful);
     198    return ERROR_NOT_SUPPORTED;
     199    #endif
     200}
    161201
    162202
     
    232272
    233273/**
     274 * Gets the fullpath filename.
     275 * @returns     Const ("Readonly") pointer to the filename.
     276 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
     277 */
     278PCSZ ModuleBase::getFilename()
     279{
     280    return pszFilename;
     281}
     282
     283
     284/**
     285 * Gets the modulename.
     286 * @returns     Const ("Readonly") pointer to the module name.
     287 * @author      knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
     288 * @remark      Modulename is filename without path and extention.
     289 */
     290PCSZ ModuleBase::getModuleName()
     291{
     292    return pszModuleName;
     293}
     294
     295
     296/**
    234297 * Output function for Modules.
    235298 * @param     pszFormat    Pointer to format string.
     
    273336        rc = DosRead(hFile, pvBuffer, cbToRead, &cbRead);
    274337    else
    275         printErr(("DosSetFilePtr(hfile, %#8x(%d),..) failed with rc = %d.",
     338        printErr(("DosSetFilePtr(hfile, %#8x(%d),..) failed with rc = %d.\n",
    276339                  ulOffset, ulOffset, rc));
    277340
Note: See TracChangeset for help on using the changeset viewer.