Changeset 1678 for trunk/src/win32k/pe2lx
- Timestamp:
- Nov 10, 1999, 2:45:38 AM (26 years ago)
- Location:
- trunk/src/win32k/pe2lx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/pe2lx/makefile
r1467 r1678 1 1 ############################################################################## 2 # $Id: makefile,v 1. 5 1999-10-27 02:03:01bird Exp $2 # $Id: makefile,v 1.6 1999-11-10 01:45:37 bird Exp $ 3 3 # 4 4 # PD-Win32 API … … 18 18 WIN32K_INCLUDE = $(WIN32KBASE)\include 19 19 WIN32K_MISC = $(WIN32KBASE)\misc 20 WIN32K_LDR = $(WIN32KBASE)\ldr 20 21 OBJEXT = pe_obj 21 22 … … 55 56 @$(CXX) $(CXXFLAGS) -c -Fa$(PE2LXLIST)\$(@B).asm -Fo$@ $< 56 57 58 {$(WIN32K_LDR)}.cpp{$(PE2LXOBJ)}.$(OBJEXT): 59 @echo compiling: $(@B).cpp 60 @$(CXX) $(CXXFLAGS) -c -Fa$(PE2LXLIST)\$(@B).asm -Fo$@ $< 61 57 62 .cpp{$(PE2LXOBJ)}.$(OBJEXT): 58 63 @echo compiling: $(@B).cpp … … 71 76 @$(CXX) $(CXXFLAGS) -c -Fa$(PE2LXLIST)\$(@B).asm -Fo$(PE2LXOBJ)\$(@B).$(OBJEXT) $< 72 77 78 {$(WIN32K_LDR)}.cpp.obj: 79 @echo compiling: $(@B).cpp 80 @$(CXX) $(CXXFLAGS) -c -Fa$(PE2LXLIST)\$(@B).asm -Fo$(PE2LXOBJ)\$(@B).$(OBJEXT) $< 81 73 82 .cpp.obj: 74 83 @echo compiling: $(@B).cpp … … 81 90 TARGET = pe2lx 82 91 83 OBJS = $(PE2LXOBJ)\pe2lx.$(OBJEXT) \ 84 $(PE2LXOBJ)\pe2lxmain.$(OBJEXT) \ 85 $(PE2LXOBJ)\malloc.$(OBJEXT) \ 86 $(PE2LXOBJ)\new.$(OBJEXT) \ 87 $(PE2LXOBJ)\stricmp.$(OBJEXT) \ 92 OBJS = $(PE2LXOBJ)\pe2lx.$(OBJEXT) \ 93 $(PE2LXOBJ)\pe2lxmain.$(OBJEXT) \ 94 $(PE2LXOBJ)\modulebase.$(OBJEXT) \ 95 $(PE2LXOBJ)\malloc.$(OBJEXT) \ 96 $(PE2LXOBJ)\new.$(OBJEXT) \ 97 $(PE2LXOBJ)\stricmp.$(OBJEXT) \ 88 98 $(PE2LXOBJ)\vprintf.$(OBJEXT) 89 # $(PE2LXOBJ)\vsprintf.$(OBJEXT)90 99 91 100 … … 121 130 $(WIN32K_INCLUDE)\OS2Krnl.h 122 131 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 123 140 $(PE2LXOBJ)\malloc.$(OBJEXT): \ 124 141 $(WIN32K_MISC)\malloc.c \ … … 139 156 $(WIN32K_MISC)\stricmp.c 140 157 158 -
trunk/src/win32k/pe2lx/pe2lx.cpp
r1535 r1678 1 /* $Id: pe2lx.cpp,v 1. 6 1999-10-31 23:57:09bird Exp $1 /* $Id: pe2lx.cpp,v 1.7 1999-11-10 01:45:37 bird Exp $ 2 2 * 3 3 * Pe2Lx class implementation. Ring 0 and Ring 3 … … 21 21 #else /*RING3*/ 22 22 #define INCL_DOSFILEMGR /* RING3: DOS File api. */ 23 #define INCL_DOSPROCESS /* RING3: DosSleep. */ 23 24 #endif 24 25 … … 124 125 #include "ldrCalls.h" /* _ldr* calls. (_ldrRead) */ 125 126 #endif 127 #include "modulebase.h" /* ModuleBase class definitions, ++. */ 126 128 #include "pe2lx.h" /* Pe2Lx class definitions, ++. */ 127 129 #include <versionos2.h> /* Pe2Lx version. */ … … 188 190 { /* Win32 Module name Odin32 Module name*/ 189 191 {"NETAPI32", "WNETAP32"}, 192 {"OLE32", "OLE32OS2"}, 190 193 {NULL, NULL} /* end-of-list entry */ 191 194 }; 192 193 194 /**195 * Current output message detail level; default: Pe2Lx::Info, -W3.196 */197 ULONG Pe2Lx::ulInfoLevel = Pe2Lx::Info;198 199 195 200 196 … … 244 240 */ 245 241 Pe2Lx::Pe2Lx(SFN hFile) : 246 #ifdef DEBUG 247 fInitTime(TRUE), 248 #endif 249 hFile(hFile), pszFilename(NULL), pszModuleName(NULL), 242 ModuleBase(hFile), 250 243 fAllInOneObject(FALSE), paObjects(NULL), cObjects(0), cObjectsAllocated(0), 251 244 paObjTab(NULL), paObjPageTab(NULL), … … 281 274 Pe2Lx::~Pe2Lx() 282 275 { 283 if (pszFilename != NULL)284 {285 free(pszFilename);286 pszFilename = NULL;287 }288 if (pszModuleName != NULL)289 {290 free(pszModuleName);291 pszModuleName = NULL;292 }293 276 if (paObjects != NULL) 294 277 { … … 398 381 PIMAGE_DOS_HEADER pMzHdr; 399 382 int i, j; 400 PCSZ psz;401 383 PIMAGE_SECTION_HEADER paSections; /* Pointer to section headers */ 402 384 … … 412 394 413 395 /* 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; 429 399 430 400 /* 1.Read the from the start of the file, expect a MZ header. */ … … 1124 1094 1125 1095 /** 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 THEN1131 * BEGIN1132 * IF no extention THEN1133 * compare directly with modulename1134 * ELSE1135 * compare input filename with the object filename without path.1136 * END1137 * ELSE1138 * compare input filename with the object filename1139 * return TRUE if equal : FALSE if not.1140 * @status partially implemented.1141 * @author knut st. osmundsen1142 */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 else1150 { /* extention */1151 PCSZ psz = strchr(this->pszFilename, '\\');1152 if ((psz = strchr(this->pszFilename, '/')) == NULL)1153 psz = this->pszFilename;1154 else1155 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 /**1166 1096 * Gets the size of the virtual LX-file. 1167 1097 * @returns Size of the virtual LX-file in bytes. … … 4066 3996 4067 3997 /** 4068 * Output function for Pe2Lx.4069 * @param pszFormat Pointer to format string.4070 * @status completely implemented; tested.4071 * @author knut st. osmundsen4072 */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 /**4087 3998 * Constructor. 4088 3999 * @param hFile Filehandle. -
trunk/src/win32k/pe2lx/pe2lxmain.cpp
r1467 r1678 1 /* $Id: pe2lxmain.cpp,v 1. 3 1999-10-27 02:03:01bird Exp $1 /* $Id: pe2lxmain.cpp,v 1.4 1999-11-10 01:45:38 bird Exp $ 2 2 * 3 3 * Pe2Lx main program. (Ring 3 only!) 4 4 * 5 5 * Copyright (c) 1999 knut st. osmundsen 6 * 7 * Project Odin Software License can be found in LICENSE.TXT 6 8 * 7 9 */ … … 28 30 #include <stdlib.h> 29 31 #include "OS2Krnl.h" 32 #include "modulebase.h" 30 33 #include "pe2lx.h" 31 34 #include <stdio.h> … … 92 95 switch (*psz) 93 96 { 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; 99 102 } 100 103 }
Note:
See TracChangeset
for help on using the changeset viewer.