- Timestamp:
- Nov 10, 1999, 2:45:38 AM (26 years ago)
- Location:
- trunk/src/win32k
- Files:
-
- 5 added
- 45 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/Makefile
r1479 r1678 1 1 ################################################################################ 2 # $Id: Makefile,v 1.1 1 1999-10-27 15:14:15bird Exp $2 # $Id: Makefile,v 1.12 1999-11-10 01:45:29 bird Exp $ 3 3 # 4 4 # Copyright 1998-1999 knut st. osmundsen 5 # 6 # Project Odin Software License can be found in LICENSE.TXT 5 7 # 6 8 ################################################################################ … … 66 68 # COMPILER/ASSEMBLER INCLUDEPATHS 67 69 ################################################################################ 68 CINCLUDES = -I$(WIN32KBASE)\include 69 -I$(TOOLKIT)\h 70 -I$(VACPATH)\include 71 -I$(DDKPATH)\h 72 -I$(DDKPATH)\src\dev\dasd\diskh 73 -I. 74 -I$(PDWIN32_INCLUDE) 70 CINCLUDES = -I$(WIN32KBASE)\include \ 71 -I$(TOOLKIT)\h \ 72 -I$(VACPATH)\include \ 73 -I$(DDKPATH)\h \ 74 -I$(DDKPATH)\src\dev\dasd\diskh \ 75 -I. \ 76 -I$(PDWIN32_INCLUDE) \ 75 77 -I$(PDWIN32_INCLUDE)\win 76 78 77 CINCLUDES16= -I$(WIN32KBASE)\include 78 -I. 79 -I$(DDKPATH)\h 80 -I$(MSCPATH)\include 79 CINCLUDES16= -I$(WIN32KBASE)\include \ 80 -I. \ 81 -I$(DDKPATH)\h \ 82 -I$(MSCPATH)\include \ 81 83 -I$(PDWIN32_INCLUDE) 82 84 83 85 84 AINCLUDES = -Fdi:$(WIN32KBASE)\include 86 AINCLUDES = -Fdi:$(WIN32KBASE)\include \ 85 87 -Fdi:$(DDKPATH)\inc 86 88 … … 149 151 # OBJECTS and LIBRARIES - Don't mess with the order or objects and libraries! 150 152 ################################################################################ 151 OBJS = object\devfirst.obj \ 152 object\d16strat.obj \ 153 object\d32hlp.obj \ 154 object\d32globals.obj \ 155 object\asmutils.obj \ 156 object\calltab.obj \ 157 object\malloc.obj \ 158 object\new.obj \ 159 object\stricmp.obj \ 160 object\yield.obj \ 161 object\vsprintf.obj \ 162 object\vprintf.obj \ 163 object\avl.obj \ 164 object\ldr.obj \ 165 object\myldrClose.obj \ 166 object\myldrOpen.obj \ 167 object\myldrRead.obj \ 168 object\myLDRQAppType.obj \ 169 object\pe2lx.obj 170 171 # not used 172 # object\cout.obj 173 174 OBJSINIT = \ 175 object\d16init.obj \ 176 object\d32init.obj \ 153 OBJS = object\devfirst.obj \ 154 object\d16strat.obj \ 155 object\d32hlp.obj \ 156 object\d32globals.obj \ 157 object\asmutils.obj \ 158 object\calltab.obj \ 159 object\malloc.obj \ 160 object\new.obj \ 161 object\stricmp.obj \ 162 object\yield.obj \ 163 object\vsprintf.obj \ 164 object\vprintf.obj \ 165 object\avl.obj \ 166 object\ldr.obj \ 167 object\myldrClose.obj \ 168 object\myldrOpen.obj \ 169 object\myldrRead.obj \ 170 object\myLDRQAppType.obj \ 171 object\pe2lx.obj \ 172 object\ModuleBase.obj 173 174 175 OBJSINIT = \ 176 object\d16init.obj \ 177 object\d32init.obj \ 177 178 object\probkrnl.obj 178 179 179 LIBS = 180 LIBS = \ 180 181 !if "$(CCENV)" == "VAC36" 181 $(VACPATH)\lib\cpprni36.lib 182 $(VACPATH)\lib\cpprni36.lib \ 182 183 !else 183 $(VACPATH)\lib\cppon30.lib 184 $(VACPATH)\lib\cppon30.lib \ 184 185 !endif 185 186 $(DDKPATH)\lib\os2286.lib -
trunk/src/win32k/configure.cmd
r909 r1678 1 /* $Id: configure.cmd,v 1. 2 1999-09-12 00:26:27bird Exp $1 /* $Id: configure.cmd,v 1.3 1999-11-10 01:45:29 bird Exp $ 2 2 * 3 3 * Configuration script. … … 5 5 * 6 6 * Copyright (c) 1999 knut st. osmundsen 7 * 8 * Project Odin Software License can be found in LICENSE.TXT 7 9 * 8 10 */ … … 23 25 if (stream(sIncFile, 'c', 'open write' ) <> '') then do 24 26 call lineout sIncFile, '################################################################################' 25 call lineout sIncFile, '#' 26 call lineout sIncFile, '# Copyright (c) 1998-1999 knut st. osmundsen' 27 call lineout sIncFile, '#' 27 call lineout sIncFile, '# Generated by configure.cmd' 28 28 call lineout sIncFile, '################################################################################'; 29 29 call lineout sIncFile, '' -
trunk/src/win32k/dev16/d16init.c
r1535 r1678 1 /* $Id: d16init.c,v 1. 3 1999-10-31 23:57:00 bird Exp $1 /* $Id: d16init.c,v 1.4 1999-11-10 01:45:30 bird Exp $ 2 2 * 3 3 * d16init - init routines for both drivers. … … 7 7 * 8 8 * Copyright (c) 1999 knut st. osmundsen 9 * 10 * Project Odin Software License can be found in LICENSE.TXT 9 11 * 10 12 */ -
trunk/src/win32k/dev16/d16strat.c
r1467 r1678 1 /* $Id: d16strat.c,v 1. 2 1999-10-27 02:02:53bird Exp $1 /* $Id: d16strat.c,v 1.3 1999-11-10 01:45:30 bird Exp $ 2 2 * 3 3 * d16strat.c - 16-bit strategy routine, device headers, device_helper (ptr) … … 5 5 * 6 6 * Copyright (c) 1999 knut st. osmundsen 7 * 8 * Project Odin Software License can be found in LICENSE.TXT 7 9 * 8 10 */ -
trunk/src/win32k/dev16/probkrnl.c
r1535 r1678 1 /* $Id: probkrnl.c,v 1. 3 1999-10-31 23:57:01bird Exp $1 /* $Id: probkrnl.c,v 1.4 1999-11-10 01:45:30 bird Exp $ 2 2 * 3 3 * Description: Autoprobes the os2krnl file and os2krnl[*].sym files. … … 22 22 * Copyright (c) 1998-1999 knut st. osmundsen 23 23 * 24 * Project Odin Software License can be found in LICENSE.TXT 25 * 24 26 */ 25 27 -
trunk/src/win32k/dev32/d32globals.c
r1467 r1678 1 /* $Id: d32globals.c,v 1. 2 1999-10-27 02:02:53bird Exp $1 /* $Id: d32globals.c,v 1.3 1999-11-10 01:45:30 bird Exp $ 2 2 * 3 3 * d32globals - global data (32-bit) 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 */ -
trunk/src/win32k/dev32/d32init.c
r1535 r1678 1 /* $Id: d32init.c,v 1. 3 1999-10-31 23:57:02bird Exp $1 /* $Id: d32init.c,v 1.4 1999-11-10 01:45:30 bird Exp $ 2 2 * 3 3 * d32init.c - 32-bits init routines. 4 4 * 5 5 * Copyright (c) 1998-1999 knut st. osmundsen 6 * 7 * Project Odin Software License can be found in LICENSE.TXT 6 8 * 7 9 */ … … 40 42 * Internal Functions * 41 43 *******************************************************************************/ 42 static int interpretFunctionProlog(char *p); 43 static int procInit(void); 44 static ULONG readnum(const char *pszNum); 45 static int interpretFunctionProlog(char *p); 46 static int procInit(void); 44 47 45 48 … … 70 73 USHORT _loadds _Far32 _Pascal R0Init32(RP32INIT *pRpInit) 71 74 { 72 char *pszTmp2; 73 char *pszTmp; 75 char *pszTmp2; 76 char *pszTmp; 77 ULONG ul; 74 78 75 79 pulTKSSBase32 = (PULONG)_TKSSBase16; … … 114 118 break; 115 119 120 case 'h': 121 case 'H': /* Heap options */ 122 pszTmp2 = strpbrk(pszTmp, ":=/- "); 123 if (pszTmp2 != NULL && (int)(pszTmp2-pszTmp) < cch-1 124 && (*pszTmp2 == ':' || *pszTmp2 == '=')) 125 { 126 ul = readnum(pszTmp2 + 1); 127 if (ul > 0x1000UL && ul < 0x2000000UL) /* 4KB < ul < 32MB */ 128 { 129 if (strnicmp(pszTmp, "heapm", 5) == 0) 130 options.cbHeapMax = ul; 131 else 132 options.cbHeap = ul; 133 } 134 } 135 break; 136 116 137 case 'l': 117 138 case 'L': /* -L[..]<:|=| >[<Y..|E..| > | <N..|D..>] */ … … 133 154 case 'P': /* PE */ 134 155 pszTmp2 = strpbrk(pszTmp, ":=/- "); 135 if (pszTmp2 != NULL && (*pszTmp == ':' || *pszTmp == '=')) 156 if (pszTmp2 != NULL && (int)(pszTmp2-pszTmp) < cch-1 157 && (*pszTmp2 == ':' || *pszTmp2 == '=')) 136 158 { 137 159 pszTmp++; … … 156 178 break; 157 179 180 case 'r': 181 case 'R': /* ResHeap options */ 182 pszTmp2 = strpbrk(pszTmp, ":=/- "); 183 if (pszTmp2 != NULL && (int)(pszTmp2-pszTmp) < cch-1 184 && (*pszTmp2 == ':' || *pszTmp2 == '=')) 185 { 186 ul = readnum(pszTmp2 + 1); 187 if (ul > 0x1000UL && ul < 0x700000UL) /* 4KB < ul < 7MB */ 188 { 189 if (strnicmp(pszTmp, "resheapm", 8) == 0) 190 options.cbHeapMaxResident = ul; 191 else 192 options.cbHeapResident = ul; 193 } 194 } 195 break; 196 158 197 case 's': 159 case 'S': /* SMP kernel */ 160 options.fKernel = KF_SMP; 198 case 'S': /* Sym:<filename> or Script:<Yes|No> or Smp */ 199 /* SMP kernel */ 200 if (pszTmp[1] == 'm' || pszTmp[1] == 'M') 201 options.fKernel = KF_SMP; 202 else 203 { 204 if (pszTmp[1] == 'c' || pszTmp[1] == 'C') 205 { 206 pszTmp2 = strpbrk(pszTmp, ":=/- "); 207 options.fScript = pszTmp2 != NULL && (int)(pszTmp2-pszTmp) < cch-1 208 && (*pszTmp2 == ':' || *pszTmp2 == '=') 209 && (pszTmp2[1] == 'Y' || pszTmp2[1] == 'y'); 210 } 211 } 212 break; 213 214 case 'u': 215 case 'U': /* UNI kernel */ 216 options.fKernel = KF_UNI; 161 217 break; 162 218 … … 166 222 break; 167 223 168 case 'u': 169 case 'U': /* UNI kernel */ 170 options.fKernel = KF_SMP; 171 break; 224 case 'w': 225 case 'W': 226 if (pszTmp[1] >= '0' && pszTmp[1] <= '4') 227 options.ulInfoLevel = pszTmp[1] - '0'; 228 else 229 { 230 pszTmp2 = strpbrk(pszTmp, ":=/- "); 231 if (pszTmp2 != NULL && (int)(pszTmp2-pszTmp) < cch-1 232 && (*pszTmp2 == ':' || *pszTmp2 == '=') 233 && pszTmp2[1] >= '0' && pszTmp2[1] <= '4' 234 ) 235 options.ulInfoLevel = pszTmp2[1] - '0'; 236 } 237 break; 238 172 239 } 173 240 pszTmp = strpbrk(pszTmp, "-/"); 174 241 } 242 243 /* heap min/max corrections */ 244 if (options.cbHeap > options.cbHeapMax) 245 options.cbHeapMax = options.cbHeap; 246 if (options.cbHeapResident > options.cbHeapMaxResident) 247 options.cbHeapMaxResident = options.cbHeapResident; 175 248 176 249 /* Transfer version and build number from 16-bit probkrnl.c */ … … 179 252 options.usVerMinor = _usVerMinor; 180 253 181 /* log option summary */254 /* log option summary - FIXME */ 182 255 kprintf(("Options - Summary\n")); 183 256 kprintf(("\tKernel: ver%d.%d build %d type %s\n", … … 217 290 218 291 return STATUS_DONE; 292 } 293 294 295 /** 296 * Reads a number (unsigned long integer) for a string. 297 * @returns number read, ~0UL on error / no number read. 298 * @param pszNum Pointer to the string containing the number. 299 * @status competely implemented. 300 * @author knut st. osmundsen 301 */ 302 static ULONG readnum(const char *pszNum) 303 { 304 ULONG ulRet = 0; 305 ULONG ulBase = 10; 306 int i = 0; 307 308 if (*pszNum == '0') 309 if (pszNum[1] == 'x' || pszNum[1] == 'X') 310 { 311 ulBase == 16; 312 pszNum += 2; 313 } 314 else 315 { 316 ulBase == 8; 317 i = 1; 318 } 319 320 /* read digits */ 321 while (ulBase == 16 ? (pszNum[i] >= '0' && pszNum[i] <= '9') || (pszNum[i] >= 'a' && pszNum[i] <= 'f') || (pszNum[i] >= 'A' && pszNum[i] <= 'F') 322 : (pszNum[i] >= '0' && pszNum[i] <= (ulBase == 10 ? '9' : '7')) 323 ) 324 { 325 ulRet *= ulBase; 326 if (ulBase <= 10) 327 ulRet += pszNum[i] - '0'; 328 else 329 ulRet += pszNum[i] - (pszNum[i] >= 'A' ? 'A' - 10 : (pszNum[i] >= 'a' ? 'a' + 9 : '0')); 330 331 i++; 332 } 333 334 return i > 0 ? ulRet : ~0UL; 219 335 } 220 336 -
trunk/src/win32k/fastdep.c
r1329 r1678 1 /* 1 /* $Id: fastdep.c,v 1.6 1999-11-10 01:45:29 bird Exp $ 2 * 2 3 * Fast dependants. (Fast = Quick and Dirty!) 3 4 * 4 5 * Copyright (c) 1999 knut st. osmundsen 6 * 7 * Project Odin Software License can be found in LICENSE.TXT 5 8 * 6 9 */ -
trunk/src/win32k/include/LdrCalls.h
r847 r1678 1 /* $Id: LdrCalls.h,v 1. 1 1999-09-06 02:19:58bird Exp $1 /* $Id: LdrCalls.h,v 1.2 1999-11-10 01:45:32 bird Exp $ 2 2 * 3 3 * Prototypes for the loader overrided function. 4 4 * 5 5 * Copyright (c) 1998-1999 knut st. osmundsen 6 * 7 * Project Odin Software License can be found in LICENSE.TXT 6 8 * 7 9 */ -
trunk/src/win32k/include/OS2Krnl.h
r1467 r1678 1 /* $Id: OS2Krnl.h,v 1. 2 1999-10-27 02:02:55bird Exp $1 /* $Id: OS2Krnl.h,v 1.3 1999-11-10 01:45:31 bird Exp $ 2 2 * 3 3 * OS/2 kernel structures, typedefs and macros. 4 * 5 * Project Odin Software License can be found in LICENSE.TXT 4 6 * 5 7 */ -
trunk/src/win32k/include/asmutils.h
r1467 r1678 1 /* $Id: asmutils.h,v 1. 2 1999-10-27 02:02:55bird Exp $1 /* $Id: asmutils.h,v 1.3 1999-11-10 01:45:32 bird Exp $ 2 2 * 3 3 * Assembly utilities. 4 4 * 5 5 * Copyright (c) 1998-1999 knut st. osmundsen 6 * 7 * Project Odin Software License can be found in LICENSE.TXT 6 8 * 7 9 */ -
trunk/src/win32k/include/cout.h
r1467 r1678 1 /* $Id: cout.h,v 1. 2 1999-10-27 02:02:55bird Exp $1 /* $Id: cout.h,v 1.3 1999-11-10 01:45:32 bird Exp $ 2 2 * 3 3 * cout - cout replacement. 4 4 * 5 5 * Copyright (c) 1998-1999 knut st. osmundsen 6 * 7 * Project Odin Software License can be found in LICENSE.TXT 6 8 * 7 9 */ -
trunk/src/win32k/include/dev16.h
r1467 r1678 1 /* $Id: dev16.h,v 1. 2 1999-10-27 02:02:56bird Exp $1 /* $Id: dev16.h,v 1.3 1999-11-10 01:45:32 bird Exp $ 2 2 * dev16 - 16-bit specific. Should not be used in 32-bit C/C++. 3 3 * 4 4 * Copyright (c) 1999 knut st. osmundsen 5 * 6 * Project Odin Software License can be found in LICENSE.TXT 5 7 * 6 8 */ -
trunk/src/win32k/include/dev32.h
r1467 r1678 1 /* $Id: dev32.h,v 1. 3 1999-10-27 02:02:56bird Exp $1 /* $Id: dev32.h,v 1.4 1999-11-10 01:45:32 bird Exp $ 2 2 * 3 3 * dev32 - header file for 32-bit part of the driver. 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 */ -
trunk/src/win32k/include/dev32hlp.h
r1535 r1678 1 /* $Id: dev32hlp.h,v 1. 2 1999-10-31 23:57:03bird Exp $1 /* $Id: dev32hlp.h,v 1.3 1999-11-10 01:45:32 bird Exp $ 2 2 * 3 3 * Dev32Hlp - 32-bit Device helpers. 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 */ -
trunk/src/win32k/include/devSegDf.inc
r1467 r1678 1 ; $Id: devSegDf.inc,v 1. 2 1999-10-27 02:02:56bird Exp $1 ; $Id: devSegDf.inc,v 1.3 1999-11-10 01:45:32 bird Exp $ 2 2 ; 3 3 ; Segment definitions for win32k.sys. 4 4 ; 5 5 ; Copyright (c) 1998-1999 knut st. osmundsen 6 ; 7 ; Project Odin Software License can be found in LICENSE.TXT 6 8 ; 7 9 -
trunk/src/win32k/include/elf.h
r1270 r1678 1 /* $Id: elf.h,v 1. 1 1999-10-14 01:17:55bird Exp $1 /* $Id: elf.h,v 1.2 1999-11-10 01:45:32 bird Exp $ 2 2 * 3 3 * ELF stuff. 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 */ -
trunk/src/win32k/include/ldr.h
r1467 r1678 1 /* $Id: ldr.h,v 1. 3 1999-10-27 02:02:56bird Exp $1 /* $Id: ldr.h,v 1.4 1999-11-10 01:45:32 bird Exp $ 2 2 * 3 3 * ldr - loader header file. 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 */ … … 45 47 union 46 48 { 49 ModuleBase *pModule; /* Pointer to a Pe2Lx object. (Win32 executables) */ 50 #if defined(_PE2LX_H_) 47 51 Pe2Lx * pPe2Lx; /* Pointer to a Pe2Lx object. (Win32 executables) */ 48 #if 0 52 #endif 53 #if defined(_ELF2LX_H_) 49 54 Elf2Lx * pElf2Lx; /* Pointer to a Elf2Lx object. (ELF executables) */ 55 #endif 56 #if defined(_SCRIPT_H_) 50 57 Script * pScript; /* Pointer to a Script object. (Shell scripts) */ 58 #endif 59 #if defined(_PE_H_) 51 60 Pe * pPe; /* Pointer to a Pe object. (Ring3 loader) */ 52 61 #endif 53 void * pv;54 62 } Data; /* Pointer to data. Currently it's allways a Pe2Lx object! */ 55 63 } MODULE, *PMODULE; … … 70 78 PMODULE getModuleByFilename(PCSZ pszFilename); 71 79 72 ULONG addModule(SFN hFile, PMTE pMTE, ULONG fFlags, void *pData);80 ULONG addModule(SFN hFile, PMTE pMTE, ULONG fFlags, ModuleBase *pModObj); 73 81 ULONG removeModule(SFN hFile); 74 82 -
trunk/src/win32k/include/malloc.h
r1535 r1678 1 /* $Id: malloc.h,v 1. 4 1999-10-31 23:57:04bird Exp $1 /* $Id: malloc.h,v 1.5 1999-11-10 01:45:32 bird Exp $ 2 2 * 3 3 * Heap. … … 7 7 * 8 8 * Copyright (c) 1999 knut st. osmundsen 9 * 10 * Project Odin Software License can be found in LICENSE.TXT 9 11 * 10 12 */ -
trunk/src/win32k/include/new.h
r1269 r1678 1 /* $Id: new.h,v 1. 2 1999-10-14 01:16:50bird Exp $1 /* $Id: new.h,v 1.3 1999-11-10 01:45:32 bird Exp $ 2 2 * 3 3 * new - new and delete operators. 4 4 * 5 5 * Copyright (c) 1998-1999 knut st. osmundsen 6 * 7 * Project Odin Software License can be found in LICENSE.TXT 6 8 * 7 9 */ -
trunk/src/win32k/include/omf.h
r847 r1678 1 /* $Id: omf.h,v 1. 1 1999-09-06 02:19:59bird Exp $ */1 /* $Id: omf.h,v 1.2 1999-11-10 01:45:33 bird Exp $ */ 2 2 /* 3 3 * OMF stuff 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 */ -
trunk/src/win32k/include/options.h
r1535 r1678 1 /* $Id: options.h,v 1. 3 1999-10-31 23:57:04bird Exp $1 /* $Id: options.h,v 1.4 1999-11-10 01:45:33 bird Exp $ 2 2 * 3 3 * Options. … … 46 46 o.fScript = FALSE; \ 47 47 o.fNoLoader = FALSE; \ 48 o.cbHeap = 0x100000; /* 1MB */ 48 o.cbHeap = 0x100000; /* 1MB */ \ 49 o.cbHeapMax = 0x100000; /* 1MB */ \ 50 o.cbHeapResident = 0x10000; /* 64KB */ \ 51 o.cbHeapMaxResident = 0x1000; /* 4KB */ \ 49 52 50 53 … … 83 86 /** @cat Options affecting the heap. */ 84 87 ULONG cbHeap; /* Initial heapsize. */ 85 #if 086 88 ULONG cbHeapMax; /* Maximum heapsize. */ 87 89 ULONG cbHeapResident; /* Initial residentheapsize. */ 88 90 ULONG cbHeapMaxResident; /* Maxiumem residentheapsize. */ 89 #endif90 91 }; 91 92 -
trunk/src/win32k/include/pe2lx.h
r1467 r1678 1 /* $Id: pe2lx.h,v 1. 5 1999-10-27 02:02:57bird Exp $1 /* $Id: pe2lx.h,v 1.6 1999-11-10 01:45:33 bird Exp $ 2 2 * 3 3 * Pe2Lx class declarations. Ring 0 and Ring 3 … … 18 18 *******************************************************************************/ 19 19 /* 20 * Misc21 */22 #define PAGESIZE 0x100023 24 /*25 20 * BufferedRVAReader config 26 21 */ 27 22 #define BUFFEREDRVAREADER_BUFFERSIZE PAGESIZE /* reader code assumes this size... */ 28 29 30 /*31 * Error definitions (used in addition to them in bseerr.h)32 */33 #define ERROR_FAILED_TO_ADD_OBJECT 0x42000000UL34 #define ERROR_INITMETHOD_NOT_INITTIME 0x42000001UL35 #define ERROR_INTERNAL_PROCESSING_ERROR 0x42000002UL36 37 38 /*39 * Output macros.40 * Macros: option infolevel41 * printIPE -W1 Error42 * printErr -W1 Error43 * printWar -W2 Warning44 * printInf -W3 Info45 * printInfA -W4 InfoAll46 */47 #define printIPE(a) (Pe2Lx::ulInfoLevel >= Pe2Lx::Error ? \48 Pe2Lx::printf("\nerror(%d:"__FUNCTION__"): !Internal Processing Error!\n\t", __LINE__), \49 Pe2Lx::printf a, \50 Pe2Lx::printf("\n") \51 : (void)0,(void)0,(void)0 )52 #define printErr(a) (Pe2Lx::ulInfoLevel >= Pe2Lx::Error ? \53 Pe2Lx::printf("error(%d:"__FUNCTION__"): ", __LINE__), \54 Pe2Lx::printf a \55 : (void)0,(void)0 )56 #define printWar(a) (Pe2Lx::ulInfoLevel >= Pe2Lx::Warning ? \57 Pe2Lx::printf("warning("__FUNCTION__"): "), \58 Pe2Lx::printf a \59 : (void)0,(void)0 )60 #define printInf(a) (Pe2Lx::ulInfoLevel >= Pe2Lx::Info ? \61 Pe2Lx::printf a : (void)0 )62 #define printInfA(a)(Pe2Lx::ulInfoLevel >= Pe2Lx::InfoAll ? \63 Pe2Lx::printf a : (void)0 )64 23 65 24 … … 97 56 * @approval knut st. osmundsen 98 57 */ 99 class Pe2Lx 58 class Pe2Lx : public ModuleBase 100 59 { 101 60 public: … … 112 71 113 72 /** @cat public Helper methods */ 114 BOOL queryIsModuleName(PCSZ pszFilename);115 73 ULONG querySizeOfLxFile(); 116 74 VOID dumpVirtualLxFile(); 117 118 75 119 76 private: … … 165 122 static VOID dumpSectionHeader(PIMAGE_SECTION_HEADER pSection); 166 123 167 /** @cat static print method */168 public:169 static VOID printf(PCSZ pszFormat, ...);170 171 124 private: 172 125 /** @cat private data members - allways present. */ 173 #ifdef DEBUG174 BOOL fInitTime; /* init time indicator (debug) */175 #endif176 SFN hFile; /* filehandle */177 PSZ pszFilename; /* fullpath */178 PSZ pszModuleName; /* filename without extention. */179 126 BOOL fAllInOneObject; /* The All-in-object fix will be or is applied. */ 180 127 PLXOBJECT paObjects; /* Pointer to object array. */ … … 241 188 ULONG flFlags; /* equivalent object flags */ 242 189 } paSecChars2Flags[]; 243 244 public:245 static ULONG ulInfoLevel; /* Current output message detail level. */246 enum {Quiet, Error, Warning, Info, InfoAll}; /* Output message detail levels. */247 190 }; 248 191 -
trunk/src/win32k/include/probkrnl.h
r1467 r1678 1 /* $Id: probkrnl.h,v 1. 2 1999-10-27 02:02:57bird Exp $1 /* $Id: probkrnl.h,v 1.3 1999-11-10 01:45:33 bird Exp $ 2 2 * 3 3 * Include file for ProbKrnl. 4 4 * 5 5 * Copyright (c) 1998-1999 knut st. osmundsen 6 * 7 * Project Odin Software License can be found in LICENSE.TXT 6 8 * 7 9 */ -
trunk/src/win32k/include/sprintf.h
r847 r1678 1 /* $Id: sprintf.h,v 1. 1 1999-09-06 02:19:59bird Exp $1 /* $Id: sprintf.h,v 1.2 1999-11-10 01:45:33 bird Exp $ 2 2 * 3 3 * sprintf/vsprintf header file. 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 */ -
trunk/src/win32k/include/sym.h
r847 r1678 1 /* $Id: sym.h,v 1. 1 1999-09-06 02:19:59bird Exp $1 /* $Id: sym.h,v 1.2 1999-11-10 01:45:34 bird Exp $ 2 2 * 3 3 * Sym-file definitions and structs. 4 * 5 * Project Odin Software License can be found in LICENSE.TXT 4 6 * 5 7 */ -
trunk/src/win32k/include/types.h
r847 r1678 1 /* $Id: types.h,v 1. 1 1999-09-06 02:20:00bird Exp $1 /* $Id: types.h,v 1.2 1999-11-10 01:45:34 bird Exp $ 2 2 * 3 3 * Common typedeclarations. 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 */ -
trunk/src/win32k/include/vprintf.h
r1270 r1678 1 /* $Id: vprintf.h,v 1. 1 1999-10-14 01:17:56bird Exp $1 /* $Id: vprintf.h,v 1.2 1999-11-10 01:45:34 bird Exp $ 2 2 * 3 3 * printf/vprintf header file. 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 */ … … 24 26 int printf(const char *pszFormat, ...); 25 27 int vprintf(const char *pszFormat, va_list args); 28 int vprintf2(const char *pszFormat, va_list args); 26 29 27 30 /* -
trunk/src/win32k/include/yield.h
r1535 r1678 1 /* $Id: yield.h,v 1. 2 1999-10-31 23:57:05bird Exp $1 /* $Id: yield.h,v 1.3 1999-11-10 01:45:34 bird Exp $ 2 2 * 3 3 * Yield - conversion may take some time. So it is necessary to … … 5 5 * 6 6 * Copyright (c) 1998-1999 knut st. osmundsen 7 * 8 * Project Odin Software License can be found in LICENSE.TXT 7 9 * 8 10 */ … … 18 20 BOOL Yield(void); 19 21 #else 20 #define Yield() FALSE22 #define Yield() (DosSleep(0) == NO_ERROR) 21 23 #endif 22 24 -
trunk/src/win32k/ldr/ldr.cpp
r1535 r1678 1 /* $Id: ldr.cpp,v 1. 5 1999-10-31 23:57:05bird Exp $1 /* $Id: ldr.cpp,v 1.6 1999-11-10 01:45:36 bird Exp $ 2 2 * 3 3 * ldr.cpp - Loader helpers. 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 */ … … 29 31 #include <exe386.h> 30 32 #include "OS2Krnl.h" 33 #include "ModuleBase.h" 31 34 #include "pe2lx.h" 32 35 #include "avl.h" … … 125 128 * @param pMTE Pointer to MTE. NULL is valid. 126 129 * @param fFlags Type flags for the fFlags field in the node. 127 * @param p vData Pointer to data.130 * @param pModObj Pointer to module object. 128 131 * @sketch DEBUG: check that the module doesn't exists and parameter check. 129 132 * (try) Allocate a new node. (return errorcode on failure) … … 135 138 * @author knut st. osmundsen 136 139 */ 137 ULONG addModule(SFN hFile, PMTE pMTE, ULONG fFlags, void *pvData)140 ULONG addModule(SFN hFile, PMTE pMTE, ULONG fFlags, ModuleBase *pModObj) 138 141 { 139 142 PMODULE pMod; … … 166 169 pMod->pMTE = pMTE; 167 170 pMod->fFlags = fFlags; 168 pMod->Data.p v = pvData;171 pMod->Data.pModule = pModObj; 169 172 170 173 /* insert the module node into the tree(s) */ … … 248 251 pMTERoot = NULL; 249 252 250 /* Pe2Lxlogging. */251 Pe2Lx::ulInfoLevel = options.ulInfoLevel;253 /* ModuleBase logging. */ 254 ModuleBase::ulInfoLevel = options.ulInfoLevel; 252 255 253 256 return rc; -
trunk/src/win32k/ldr/myLDRQAppType.cpp
r847 r1678 1 /* $Id: myLDRQAppType.cpp,v 1. 1 1999-09-06 02:20:01bird Exp $1 /* $Id: myLDRQAppType.cpp,v 1.2 1999-11-10 01:45:36 bird Exp $ 2 2 * 3 3 * _myLDRQAppType - _LDRQAppType overload. 4 4 * 5 5 * Copyright (c) 1998-1999 knut St. osmundsen 6 * 7 * Project Odin Software License can be found in LICENSE.TXT 6 8 * 7 9 */ -
trunk/src/win32k/ldr/myldrClose.cpp
r1467 r1678 1 /* $Id: myldrClose.cpp,v 1. 3 1999-10-27 02:02:58bird Exp $1 /* $Id: myldrClose.cpp,v 1.4 1999-11-10 01:45:36 bird Exp $ 2 2 * 3 3 * myldrClose - _ldrClose 4 4 * 5 5 * Copyright (c) 1998-1999 knut st. osmundsen 6 * 7 * Project Odin Software License can be found in LICENSE.TXT 6 8 * 7 9 */ … … 25 27 #include <exe386.h> 26 28 #include "OS2Krnl.h" 27 #include "pe2lx.h"28 29 #include "avl.h" 30 #include "ModuleBase.h" 29 31 #include "ldr.h" 30 32 #include "ldrCalls.h" … … 45 47 if (GetState(hFile) == HSTATE_OUR) 46 48 { 49 #ifdef DEBUG 50 PMODULE pMod = getModuleBySFN(hFile); 51 if (pMod != NULL) 52 pMod->Data.pModule->dumpVirtualLxFile(); 53 else 54 kprintf(("_ldrClose: getModuleBySFN failed!!!")); 55 #endif 56 47 57 rc = removeModule(hFile); 48 58 if (rc != NO_ERROR) -
trunk/src/win32k/ldr/myldrOpen.cpp
r1535 r1678 1 /* $Id: myldrOpen.cpp,v 1. 4 1999-10-31 23:57:06 bird Exp $1 /* $Id: myldrOpen.cpp,v 1.5 1999-11-10 01:45:36 bird Exp $ 2 2 * 3 3 * myldrOpen - _ldrOpen. 4 4 * 5 5 * Copyright (c) 1998-1999 knut st. osmundsen 6 * 7 * Project Odin Software License can be found in LICENSE.TXT 6 8 * 7 9 */ … … 27 29 #include <exe386.h> 28 30 #include "OS2Krnl.h" 31 #include "ModuleBase.h" 29 32 #include "pe2lx.h" 30 33 #include "elf.h" … … 128 131 } 129 132 else 130 if (*pach == '#' )133 if (*pach == '#' && pach[1] == '!') 131 134 { 132 135 /* unix styled script...? Must be more than 64 bytes long? No options. firstline < 64 bytes. */ 133 char *pszStart = pach+ 1;136 char *pszStart = pach+2; 134 137 char *pszEnd; 135 138 kprintf(("_ldrOpen: unix script?\n")); … … 142 145 if (*pszStart != '\0' && *pszStart != '\r' && *pszStart != '\n') 143 146 { /* find end-of-word */ 147 pszEnd = pszStart + 1; 144 148 while (*pszEnd != '\0' && *pszEnd != '\n' && *pszEnd != '\r' 145 149 && *pszEnd != '\t' && *pszEnd != ' ') 146 150 pszEnd++; 147 *pszEnd = '\0';148 151 if (*pszEnd != '\0') 149 152 { 153 *pszEnd = '\0'; 150 154 kprintf(("_ldrOpen: unix script - opening %s\n", pszStart)); 151 155 _ldrClose(*phFile); -
trunk/src/win32k/ldr/myldrRead.cpp
r1467 r1678 1 /* $Id: myldrRead.cpp,v 1. 4 1999-10-27 02:02:58bird Exp $1 /* $Id: myldrRead.cpp,v 1.5 1999-11-10 01:45:36 bird Exp $ 2 2 * 3 3 * myldrRead - _ldrRead. 4 4 * 5 5 * Copyright (c) 1998-1999 knut st. osmundsen 6 * 7 * Project Odin Software License can be found in LICENSE.TXT 6 8 * 7 9 */ … … 26 28 #include <exe386.h> 27 29 #include "OS2Krnl.h" 30 #include "ModuleBase.h" 28 31 #include "pe2lx.h" 29 32 #include "avl.h" … … 61 64 62 65 if ((pMod->fFlags & MOD_TYPE_MASK) == MOD_TYPE_PE2LX) 63 rc = pMod->Data.p Pe2Lx->read(ulOffset, pBuffer, ulBytesToRead, ulFlags, pMTE);66 rc = pMod->Data.pModule->read(ulOffset, pBuffer, ulBytesToRead, ulFlags, pMTE); 64 67 else 65 68 { -
trunk/src/win32k/libconv.c
r886 r1678 1 /* $Id: libconv.c,v 1. 1 1999-09-08 20:50:02 bird Exp $ */2 /*1 /* $Id: libconv.c,v 1.2 1999-11-10 01:45:29 bird Exp $ 2 * 3 3 * Very simple OMF/LIB dumper. 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 */ -
trunk/src/win32k/misc/malloc.c
r1536 r1678 1 /* $Id: malloc.c,v 1. 4 1999-11-01 09:28:58bird Exp $1 /* $Id: malloc.c,v 1.5 1999-11-10 01:45:36 bird Exp $ 2 2 * 3 3 * Heap. … … 7 7 * 8 8 * Copyright (c) 1999 knut st. osmundsen 9 * 10 * Project Odin Software License can be found in LICENSE.TXT 9 11 * 10 12 */ -
trunk/src/win32k/misc/new.cpp
r1271 r1678 1 /* $Id: new.cpp,v 1. 2 1999-10-14 01:19:21bird Exp $1 /* $Id: new.cpp,v 1.3 1999-11-10 01:45:37 bird Exp $ 2 2 * 3 3 * new - new and delete operators. 4 4 * 5 5 * Copyright (c) 1998-1999 knut st. osmundsen 6 * 7 * Project Odin Software License can be found in LICENSE.TXT 6 8 * 7 9 */ -
trunk/src/win32k/misc/stricmp.c
r1271 r1678 1 /* $Id: stricmp.c,v 1. 2 1999-10-14 01:19:21bird Exp $1 /* $Id: stricmp.c,v 1.3 1999-11-10 01:45:37 bird Exp $ 2 2 * 3 3 * stricmp - Case insensitive string compare. 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 */ -
trunk/src/win32k/misc/vprintf.c
r1536 r1678 1 /* $Id: vprintf.c,v 1. 4 1999-11-01 09:28:59bird Exp $1 /* $Id: vprintf.c,v 1.5 1999-11-10 01:45:37 bird Exp $ 2 2 * 3 3 * vprintf and printf 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 */ … … 22 24 #define NTSF_BLANK 0x0040 23 25 24 #define INCL_NOAPI 26 27 #ifdef RING0 28 #define INCL_NOAPI 29 #else 30 #define INCL_DOSPROCESS 31 #define INCL_DOSERRORS 32 #endif 25 33 26 34 /******************************************************************************* … … 205 213 206 214 207 #pragma info(notrd)208 215 /** 209 216 * Partial vprintf implementation. 217 * This function checks the fLogging flag, and will therefore only write if logging is enabled. 210 218 * @returns number of 211 * @param pszBuffer Output buffer.212 219 * @param pszFormat Format string. 213 220 * @param args Argument list. … … 215 222 int vprintf(const char *pszFormat, va_list args) 216 223 { 217 #ifdef RING0 218 if (!options.fLogging) 219 return 0; 220 #else 224 if (!options.fLogging) 225 return 0; 226 return vprintf2(pszFormat, args); 227 } 228 229 #pragma info(notrd) 230 /** 231 * Partial vprintf implementation. 232 * This function don't check the fLogging flag, and will therefore allways write. 233 * @returns number of 234 * @param pszFormat Format string. 235 * @param args Argument list. 236 */ 237 int vprintf2(const char *pszFormat, va_list args) 238 { 239 #ifndef RING0 221 240 int cch = 0; 222 241 #endif … … 413 432 va_list arguments; 414 433 415 #ifdef RING0416 if (!options.fLogging)417 return 0;418 #endif419 420 434 va_start(arguments, pszFormat); 421 435 cch = vprintf(pszFormat, arguments); … … 432 446 va_list arguments; 433 447 434 #ifdef RING0435 if (!options.fLogging)436 return 0;437 #endif438 439 448 va_start(arguments, pszFormat); 440 449 cch = vprintf(pszFormat, arguments); … … 449 458 int cch; 450 459 va_list arguments; 451 452 #ifdef RING0453 if (!options.fLogging)454 return 0;455 #endif456 460 457 461 va_start(arguments, pszFormat); -
trunk/src/win32k/misc/vsprintf.c
r1467 r1678 1 /* $Id: vsprintf.c,v 1. 3 1999-10-27 02:03:00bird Exp $1 /* $Id: vsprintf.c,v 1.4 1999-11-10 01:45:37 bird Exp $ 2 2 * 3 3 * vsprintf and sprintf 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 */ -
trunk/src/win32k/misc/yield.c
r1535 r1678 1 /* $Id: yield.c,v 1. 3 1999-10-31 23:57:08bird Exp $1 /* $Id: yield.c,v 1.4 1999-11-10 01:45:37 bird Exp $ 2 2 * 3 3 * Yield - conversion may take some time. So it is necessary to … … 5 5 * 6 6 * Copyright (c) 1998-1999 knut st. osmundsen 7 * 8 * Project Odin Software License can be found in LICENSE.TXT 7 9 * 8 10 */ … … 29 31 BOOL Yield(void) 30 32 { 33 #if 0 /* Don't work on SMP and may cause trouble with logging at all machines... */ 31 34 PBYTE pfbYield; 32 35 … … 37 40 return TRUE; 38 41 } 39 42 #endif 40 43 return FALSE; 41 44 } -
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 } -
trunk/src/win32k/win32k.def
r1467 r1678 2 2 ; Copyright 1998 knut st. osmundsen 3 3 ; Definition file for Win32k 4 ; Project Odin Software License can be found in LICENSE.TXT 4 5 ;****************************************************************************** 5 6 PHYSICAL DEVICE WIN32K
Note:
See TracChangeset
for help on using the changeset viewer.