Ignore:
Timestamp:
Nov 10, 1999, 2:45:38 AM (26 years ago)
Author:
bird
Message:

Some bugsfixes - Yield is disabled.
Added parameters.
Correcte moduleheaders.
Introduced a new base class for virtual lx modules + some elf sketches.

Location:
trunk/src/win32k/pe2lx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/pe2lx/makefile

    r1467 r1678  
    11##############################################################################
    2 # $Id: makefile,v 1.5 1999-10-27 02:03:01 bird Exp $
     2# $Id: makefile,v 1.6 1999-11-10 01:45:37 bird Exp $
    33#
    44# PD-Win32 API
     
    1818WIN32K_INCLUDE  = $(WIN32KBASE)\include
    1919WIN32K_MISC     = $(WIN32KBASE)\misc
     20WIN32K_LDR      = $(WIN32KBASE)\ldr
    2021OBJEXT = pe_obj
    2122
     
    5556    @$(CXX) $(CXXFLAGS) -c -Fa$(PE2LXLIST)\$(@B).asm -Fo$@ $<
    5657
     58{$(WIN32K_LDR)}.cpp{$(PE2LXOBJ)}.$(OBJEXT):
     59    @echo compiling: $(@B).cpp
     60    @$(CXX) $(CXXFLAGS) -c -Fa$(PE2LXLIST)\$(@B).asm -Fo$@ $<
     61
    5762.cpp{$(PE2LXOBJ)}.$(OBJEXT):
    5863    @echo compiling: $(@B).cpp
     
    7176    @$(CXX) $(CXXFLAGS) -c -Fa$(PE2LXLIST)\$(@B).asm -Fo$(PE2LXOBJ)\$(@B).$(OBJEXT) $<
    7277
     78{$(WIN32K_LDR)}.cpp.obj:
     79    @echo compiling: $(@B).cpp
     80    @$(CXX) $(CXXFLAGS) -c -Fa$(PE2LXLIST)\$(@B).asm -Fo$(PE2LXOBJ)\$(@B).$(OBJEXT) $<
     81
    7382.cpp.obj:
    7483    @echo compiling: $(@B).cpp
     
    8190TARGET   = pe2lx
    8291
    83 OBJS     =  $(PE2LXOBJ)\pe2lx.$(OBJEXT)         \
    84             $(PE2LXOBJ)\pe2lxmain.$(OBJEXT)     \
    85             $(PE2LXOBJ)\malloc.$(OBJEXT)        \
    86             $(PE2LXOBJ)\new.$(OBJEXT)           \
    87             $(PE2LXOBJ)\stricmp.$(OBJEXT)       \
     92OBJS     =  $(PE2LXOBJ)\pe2lx.$(OBJEXT)      \
     93            $(PE2LXOBJ)\pe2lxmain.$(OBJEXT)  \
     94            $(PE2LXOBJ)\modulebase.$(OBJEXT) \
     95            $(PE2LXOBJ)\malloc.$(OBJEXT)     \
     96            $(PE2LXOBJ)\new.$(OBJEXT)        \
     97            $(PE2LXOBJ)\stricmp.$(OBJEXT)    \
    8898            $(PE2LXOBJ)\vprintf.$(OBJEXT)
    89 #            $(PE2LXOBJ)\vsprintf.$(OBJEXT)
    9099
    91100
     
    121130    $(WIN32K_INCLUDE)\OS2Krnl.h
    122131
     132$(PE2LXOBJ)\ModuleBase.$(OBJEXT): \
     133    $(WIN32K_LDR)\ModuleBase.cpp \
     134    $(WIN32K_INCLUDE)\malloc.h \
     135    $(WIN32K_INCLUDE)\vprintf.h \
     136    $(WIN32K_INCLUDE)\dev32.h \
     137    $(WIN32K_INCLUDE)\OS2Krnl.h \
     138    $(WIN32K_INCLUDE)\modulebase.h
     139
    123140$(PE2LXOBJ)\malloc.$(OBJEXT): \
    124141    $(WIN32K_MISC)\malloc.c \
     
    139156    $(WIN32K_MISC)\stricmp.c
    140157
     158
  • trunk/src/win32k/pe2lx/pe2lx.cpp

    r1535 r1678  
    1 /* $Id: pe2lx.cpp,v 1.6 1999-10-31 23:57:09 bird Exp $
     1/* $Id: pe2lx.cpp,v 1.7 1999-11-10 01:45:37 bird Exp $
    22 *
    33 * Pe2Lx class implementation. Ring 0 and Ring 3
     
    2121#else /*RING3*/
    2222    #define INCL_DOSFILEMGR                 /* RING3: DOS File api. */
     23    #define INCL_DOSPROCESS                 /* RING3: DosSleep. */
    2324#endif
    2425
     
    124125    #include "ldrCalls.h"                   /* _ldr* calls. (_ldrRead) */
    125126#endif
     127#include "modulebase.h"                     /* ModuleBase class definitions, ++. */
    126128#include "pe2lx.h"                          /* Pe2Lx class definitions, ++. */
    127129#include <versionos2.h>                     /* Pe2Lx version. */
     
    188190{   /* Win32 Module name                   Odin32 Module name*/
    189191    {"NETAPI32",                           "WNETAP32"},
     192    {"OLE32",                              "OLE32OS2"},
    190193    {NULL,                                 NULL} /* end-of-list entry */
    191194};
    192 
    193 
    194 /**
    195  * Current output message detail level; default: Pe2Lx::Info, -W3.
    196  */
    197 ULONG Pe2Lx::ulInfoLevel = Pe2Lx::Info;
    198 
    199195
    200196
     
    244240 */
    245241Pe2Lx::Pe2Lx(SFN hFile) :
    246 #ifdef DEBUG
    247     fInitTime(TRUE),
    248 #endif
    249     hFile(hFile), pszFilename(NULL), pszModuleName(NULL),
     242    ModuleBase(hFile),
    250243    fAllInOneObject(FALSE), paObjects(NULL), cObjects(0), cObjectsAllocated(0),
    251244    paObjTab(NULL), paObjPageTab(NULL),
     
    281274Pe2Lx::~Pe2Lx()
    282275{
    283     if (pszFilename != NULL)
    284     {
    285         free(pszFilename);
    286         pszFilename = NULL;
    287     }
    288     if (pszModuleName != NULL)
    289     {
    290         free(pszModuleName);
    291         pszModuleName = NULL;
    292     }
    293276    if (paObjects != NULL)
    294277    {
     
    398381    PIMAGE_DOS_HEADER       pMzHdr;
    399382    int                     i, j;
    400     PCSZ                    psz;
    401383    PIMAGE_SECTION_HEADER   paSections;     /* Pointer to section headers */
    402384
     
    412394
    413395    /* 0.pszFilename & pszModuleName. */
    414     this->pszFilename = (char*)malloc(strlen(pszFilename) + 1);
    415     if (this->pszFilename == NULL)
    416         return ERROR_NOT_ENOUGH_MEMORY;
    417     strcpy(this->pszFilename, pszFilename);
    418 
    419     if ((psz = strrchr(pszFilename, '\\') + 1) == (PCHAR)1)
    420             if ((psz = strrchr(pszFilename, '/') + 1) == (PCHAR)1)
    421                 psz = pszFilename;
    422     pszModuleName = strchr(psz, '.');
    423     i = pszModuleName != NULL ? pszModuleName - psz : strlen(psz);
    424     pszModuleName = (PSZ)malloc(i + 1);
    425     if (pszModuleName == NULL)
    426         return ERROR_NOT_ENOUGH_MEMORY;
    427     strncpy(pszModuleName, psz, i);
    428     pszModuleName[i] = '\0';
     396    rc = ModuleBase::init(pszFilename);
     397    if (rc != NO_ERROR)
     398        return rc;
    429399
    430400    /* 1.Read the from the start of the file, expect a MZ header. */
     
    11241094
    11251095/**
    1126  * Asks if pszFilename is the name of this module.
    1127  * @returns   TRUE : pszFilename is the name of this module.
    1128  *            FALSE: pszfilename is not this module.
    1129  * @param     pszFilename  Filename. (Probably allways a qualified name in RING0)
    1130  * @sketch    IF filename without path THEN
    1131  *            BEGIN
    1132  *                IF no extention THEN
    1133  *                    compare directly with modulename
    1134  *                ELSE
    1135  *                    compare input filename with the object filename without path.
    1136  *            END
    1137  *            ELSE
    1138  *                compare input filename with the object filename
    1139  *            return TRUE if equal : FALSE if not.
    1140  * @status    partially implemented.
    1141  * @author    knut st. osmundsen
    1142  */
    1143 BOOL Pe2Lx::queryIsModuleName(PCSZ pszFilename)
    1144 {
    1145     if (strchr(pszFilename, '\\') == NULL && strchr(pszFilename,'/') == NULL)
    1146     {   /* use module name - no extention */
    1147         if (strchr(pszFilename, '.') == NULL)
    1148             return stricmp(pszFilename, pszModuleName) == 0;
    1149         else
    1150         {   /* extention */
    1151             PCSZ psz = strchr(this->pszFilename, '\\');
    1152             if ((psz = strchr(this->pszFilename, '/')) == NULL)
    1153                  psz = this->pszFilename;
    1154             else
    1155                 psz++; /* skip '\\' or '/' */
    1156             return stricmp(pszFilename, psz) == 0;
    1157         }
    1158     }
    1159 
    1160     /* TODO: relative name vs fullname. */
    1161     return stricmp(pszFilename, this->pszFilename) == 0;
    1162 }
    1163 
    1164 
    1165 /**
    11661096 * Gets the size of the virtual LX-file.
    11671097 * @returns   Size of the virtual LX-file in bytes.
     
    40663996
    40673997/**
    4068  * Output function for Pe2Lx.
    4069  * @param     pszFormat    Pointer to format string.
    4070  * @status    completely implemented; tested.
    4071  * @author    knut st. osmundsen
    4072  */
    4073 VOID Pe2Lx::printf(PCSZ pszFormat, ...)
    4074 {
    4075     va_list arguments;
    4076 
    4077     if (ulInfoLevel <= Pe2Lx::ulInfoLevel)
    4078     {
    4079         va_start(arguments, pszFormat);
    4080         vprintf(pszFormat, arguments);
    4081         va_end(arguments);
    4082     }
    4083 }
    4084 
    4085 
    4086 /**
    40873998 * Constructor.
    40883999 * @param     hFile      Filehandle.
  • trunk/src/win32k/pe2lx/pe2lxmain.cpp

    r1467 r1678  
    1 /* $Id: pe2lxmain.cpp,v 1.3 1999-10-27 02:03:01 bird Exp $
     1/* $Id: pe2lxmain.cpp,v 1.4 1999-11-10 01:45:38 bird Exp $
    22 *
    33 * Pe2Lx main program. (Ring 3 only!)
    44 *
    55 * Copyright (c) 1999 knut st. osmundsen
     6 *
     7 * Project Odin Software License can be found in LICENSE.TXT
    68 *
    79 */
     
    2830#include <stdlib.h>
    2931#include "OS2Krnl.h"
     32#include "modulebase.h"
    3033#include "pe2lx.h"
    3134#include <stdio.h>
     
    9295                        switch (*psz)
    9396                        {
    94                             case '0': Pe2Lx::ulInfoLevel = Pe2Lx::Quiet; break;
    95                             case '1': Pe2Lx::ulInfoLevel = Pe2Lx::Error; break;
    96                             case '2': Pe2Lx::ulInfoLevel = Pe2Lx::Warning; break;
    97                             case '3': Pe2Lx::ulInfoLevel = Pe2Lx::Info; break;
    98                             case '4': Pe2Lx::ulInfoLevel = Pe2Lx::InfoAll; break;
     97                            case '0': ModuleBase::ulInfoLevel = ModuleBase::Quiet; break;
     98                            case '1': ModuleBase::ulInfoLevel = ModuleBase::Error; break;
     99                            case '2': ModuleBase::ulInfoLevel = ModuleBase::Warning; break;
     100                            case '3': ModuleBase::ulInfoLevel = ModuleBase::Info; break;
     101                            case '4': ModuleBase::ulInfoLevel = ModuleBase::InfoAll; break;
    99102                        }
    100103                    }
Note: See TracChangeset for help on using the changeset viewer.