- Timestamp:
- Jan 22, 2000, 7:21:03 PM (26 years ago)
- Location:
- trunk/src/win32k
- Files:
-
- 3 added
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/Makefile
r1682 r2501 1 1 ################################################################################ 2 # $Id: Makefile,v 1.1 3 1999-11-10 02:51:43bird Exp $2 # $Id: Makefile,v 1.14 2000-01-22 18:20:55 bird Exp $ 3 3 # 4 4 # Copyright 1998-1999 knut st. osmundsen … … 29 29 30 30 31 CFLAGS = -q -Ge -Gs- -Gr+ -Rn -Ss+ -Mp 31 CFLAGS = -q -Ge -Gs- -Gr+ -Rn -Ss+ -Mp -Wall+ppt-ppc-inl-cnv-gnr-vft-gen-uni-ext- 32 32 CFLAGS16 = -c -W4 -Asfw /NTCODE16 /NDDATA16 -G2s -Zp -Zl -nologo -Fo$@ -Fa 33 CPPFLAGS = -q -Ge -Gs- -Gr+ -Rn -Ss+ -Mp -Gx 33 CPPFLAGS = -q -Ge -Gs- -Gr+ -Rn -Ss+ -Mp -Gx -Wall+ppt-ppc-inl-cnv-gnr-vft- 34 34 ASFLAGS = -Sv:ALP -Mb -Li 35 35 LFLAGS = /nologo /MAP /NOI /NOE /NOD /A:16 /MAP /O:$@ … … 94 94 95 95 {dev16}.c{object}.obj: 96 @$(ECHO) compiling : $<96 @$(ECHO) compiling 16bit: $< 97 97 @$(CC16) $(CFLAGS16) $(CDEFINES16) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES16) $< 98 98 99 99 {dev32}.asm{object}.obj: 100 @$(ECHO) assembling: $<100 @$(ECHO) assembling: $< 101 101 @$(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$@ -Fl:$(WIN32KLIST)\$(*B).lst 102 102 {dev32}.c{object}.obj: 103 @$(ECHO) compiling : $<103 @$(ECHO) compiling 32bit: $< 104 104 @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $< 105 105 {dev32}.cpp{object}.obj: 106 @$(ECHO) compiling : $<106 @$(ECHO) compiling 32bit: $< 107 107 @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $< 108 108 109 109 {ldr}.asm{object}.obj: 110 @$(ECHO) assembling: $<110 @$(ECHO) assembling: $< 111 111 @$(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$@ -Fl:$(WIN32KLIST)\$(*B).lst 112 112 {ldr}.c{object}.obj: 113 @$(ECHO) compiling : $<113 @$(ECHO) compiling 32bit: $< 114 114 @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $< 115 115 {ldr}.cpp{object}.obj: 116 @$(ECHO) compiling : $<116 @$(ECHO) compiling 32bit: $< 117 117 @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $< 118 118 119 119 {misc}.asm{object}.obj: 120 @$(ECHO) assembling: $<120 @$(ECHO) assembling: $< 121 121 @$(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$@ -Fl:$(WIN32KLIST)\$(*B).lst 122 122 {misc}.c{object}.obj: 123 @$(ECHO) compiling 32bit: $< 124 @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $< 125 {misc}.cpp{object}.obj: 126 @$(ECHO) compiling 32bit: $< 127 @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $< 128 129 {pe2lx}.c{object}.obj 32bit: 123 130 @$(ECHO) compiling: $< 124 131 @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $< 125 {misc}.cpp{object}.obj:126 @$(ECHO) compiling: $<127 @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<128 129 {pe2lx}.c{object}.obj:130 @$(ECHO) compiling: $<131 @$(CC) -c $(CFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $<132 132 {pe2lx}.cpp{object}.obj: 133 @$(ECHO) compiling: $< 134 @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $< 135 136 {devhlpadd}.asm{object}.obj: 137 @$(ECHO) assembling: $< 138 @$(AS) $(ASFLAGS) $(ADEFINES) $(AINCLUDES) $< -Fo:$@ -Fl:$(WIN32KLIST)\$(*B).lst 133 @$(ECHO) compiling 32bit: $< 134 @$(CC) -c $(CPPFLAGS) $(CDEFINES) -Fa$(WIN32KLIST)\$(*B).s -Fo$@ $(CINCLUDES) $< 139 135 140 136 … … 169 165 object\myldrRead.obj \ 170 166 object\myLDRQAppType.obj \ 167 object\myldrEnum32bitRelRecs.obj \ 171 168 object\pe2lx.obj \ 172 169 object\ModuleBase.obj … … 226 223 libconv $(DDKPATH)\lib\dhcalls.lib $@ 227 224 $(ILIB) /nologo /nobackup /convformat $@; 228 # ilib /nologo /nobackup /convformat $@;229 225 230 226 clib.lib: $(MSCPATH)\lib\clibcep.lib libconv.exe 231 227 libconv $(MSCPATH)\lib\clibcep.lib $@ > nul 232 228 $(ILIB) /nologo /nobackup /convformat $@; 233 # ilib /nologo /nobackup /convformat $@;234 229 235 230 last.lib: object\devlast.obj 236 231 -@del $@ > nul 2> nul 237 232 $(ILIB) /nologo /nobackup $@ $**; 238 # ilib /nologo /nobackup $@ $**;239 233 240 234 libconv.exe: libconv.c -
trunk/src/win32k/dev16/probkrnl.c
r1989 r2501 1 /* $Id: probkrnl.c,v 1. 5 1999-12-06 16:18:25bird Exp $1 /* $Id: probkrnl.c,v 1.6 2000-01-22 18:20:56 bird Exp $ 2 2 * 3 3 * Description: Autoprobes the os2krnl file and os2krnl[*].sym files. … … 20 20 * 6. finished. 21 21 * 22 * Copyright (c) 1998- 1999knut st. osmundsen22 * Copyright (c) 1998-2000 knut st. osmundsen 23 23 * 24 24 * Project Odin Software License can be found in LICENSE.TXT … … 80 80 * kernel data - !only valid during init! 81 81 */ 82 83 /* 84 * aProcTab defines the imported and overloaded OS/2 kernel functions. 85 * IMPORTANT: aProcTab has a sibling array in d32init.c, aulProc, which must 86 * match entry by entry. Adding/removing/shuffling aProcTab, aulProc 87 * has to be updated immediately! 88 */ 82 89 PROCS aProcTab[NUMBER_OF_PROCS] = 83 {/* iFound cchName offObject fType */ 84 /* iObject achName ulAddress */ 85 {FALSE, -1, 8, "_ldrRead", -1, -1, EPT_PROC}, 86 {FALSE, -1, 8, "_ldrOpen", -1, -1, EPT_PROC}, 87 {FALSE, -1, 9, "_ldrClose", -1, -1, EPT_PROC}, 88 {FALSE, -1, 12, "_LDRQAppType", -1, -1, EPT_PROC}, 90 {/* iFound cchName offObject fType */ 91 /* iObject achName ulAddress */ 92 {FALSE, -1, 8, "_ldrRead", -1, -1, EPT_PROC}, /* 0 */ 93 {FALSE, -1, 8, "_ldrOpen", -1, -1, EPT_PROC}, /* 1 */ 94 {FALSE, -1, 9, "_ldrClose", -1, -1, EPT_PROC}, /* 2 */ 95 {FALSE, -1, 12, "_LDRQAppType", -1, -1, EPT_PROC}, /* 3 */ 96 {FALSE, -1, 20, "_ldrEnum32bitRelRecs", -1, -1, EPT_PROC}, /* 4 */ 97 98 {FALSE, -1, 10, "_IOSftOpen", -1, -1, EPT_PROCIMPORT}, /* 5 */ 99 {FALSE, -1, 11, "_IOSftClose", -1, -1, EPT_PROCIMPORT}, /* 6 */ 100 {FALSE, -1, 15, "_IOSftTransPath", -1, -1, EPT_PROCIMPORT}, /* 7 */ 101 {FALSE, -1, 12, "_IOSftReadAt", -1, -1, EPT_PROCIMPORT}, /* 8 */ 102 {FALSE, -1, 13, "_IOSftWriteAt", -1, -1, EPT_PROCIMPORT} /* 9 */ 89 103 }; 90 104 91 unsigned long int ulBuild = 0;92 unsigned short usVerMajor = 0;93 unsigned short usVerMinor = 0;105 unsigned long int ulBuild = 0; 106 unsigned short usVerMajor = 0; 107 unsigned short usVerMinor = 0; 94 108 95 109 … … 97 111 * privat data 98 112 */ 99 static int fQuiet= 0;100 static char szUsrOS2Krnl[50] = {0};101 static char szOS2Krnl[] = {"c:\\os2krnl"};102 103 static char szUsrSym[50] = {0};104 static char *apszSym[] =113 static int fQuiet = 0; 114 static char szUsrOS2Krnl[50] = {0}; 115 static char szOS2Krnl[] = {"c:\\os2krnl"}; 116 117 static char szUsrSym[50] = {0}; 118 static char * apszSym[] = 105 119 { 106 120 {"c:\\os2krnl.sym"}, /* usual for debugkernel */ -
trunk/src/win32k/dev32/d32init.c
r1678 r2501 1 /* $Id: d32init.c,v 1. 4 1999-11-10 01:45:30bird Exp $1 /* $Id: d32init.c,v 1.5 2000-01-22 18:20:57 bird Exp $ 2 2 * 3 3 * d32init.c - 32-bits init routines. … … 19 19 #define INCL_NOPMAPI 20 20 #define LDR_INCL_INITONLY 21 21 22 22 23 /******************************************************************************* … … 43 44 *******************************************************************************/ 44 45 static ULONG readnum(const char *pszNum); 45 static int interpretFunctionProlog(char *p );46 static int interpretFunctionProlog(char *p, BOOL fOverload); 46 47 static int procInit(void); 47 48 48 49 49 50 /* externs located in 16-bit data segement */ 50 extern ULONG _TKSSBase16;51 extern USHORT _R0FlatCS16;52 extern USHORT _R0FlatDS16;51 extern ULONG _TKSSBase16; 52 extern USHORT _R0FlatCS16; 53 extern USHORT _R0FlatDS16; 53 54 54 55 55 56 /* extern(s) located in calltab.asm */ 56 extern char callTab[NUMBER_OF_PROCS][MAXSIZE_PROLOG];57 extern char callTab[NUMBER_OF_PROCS][MAXSIZE_PROLOG]; 57 58 58 59 … … 88 89 while (pszTmp != NULL) 89 90 { 90 charcch;91 int cch; 91 92 pszTmp++; //skip [-/] 92 93 cch = strlen(pszTmp); … … 309 310 if (pszNum[1] == 'x' || pszNum[1] == 'X') 310 311 { 311 ulBase = =16;312 ulBase = 16; 312 313 pszNum += 2; 313 314 } 314 315 else 315 316 { 316 ulBase = =8;317 ulBase = 8; 317 318 i = 1; 318 319 } … … 364 365 } 365 366 366 /* verify known function prolog. (only EPT_PROC) */ 367 if (_aProcTab[i].fType == EPT_PROC) 368 { 369 if ((cb = interpretFunctionProlog((char*)_aProcTab[i].ulAddress)) <= 0 && cb + 5 >= MAXSIZE_PROLOG) 370 { 371 kprintf(("VerifyProcTab32: verify failed for procedure no.%d\n",i)); 372 return STATUS_DONE | STERR | 3; 373 } 374 } 375 else 376 { 377 kprintf(("VerifyProcTab32: only EPT_PROC is implemented\n",i)); 378 return STATUS_DONE | STERR | 4; 367 switch (_aProcTab[i].fType) 368 { 369 case EPT_PROC: 370 case EPT_PROCIMPORT: 371 /* verify known function prolog. */ 372 if ((cb = interpretFunctionProlog((char*)_aProcTab[i].ulAddress, _aProcTab[i].fType == EPT_PROC)) 373 <= 0 && cb + 5 >= MAXSIZE_PROLOG) 374 { 375 kprintf(("VerifyProcTab32: verify failed for procedure no.%d\n",i)); 376 return STATUS_DONE | STERR | 3; 377 } 378 break; 379 380 default: 381 kprintf(("VerifyProcTab32: only EPT_PROC is implemented\n",i)); 382 return STATUS_DONE | STERR | 4; 379 383 } 380 384 } … … 408 412 if (pSMTE != NULL) 409 413 { 410 pOTEBuf->cObjects = pSMTE->smte_objcnt;414 pOTEBuf->cObjects = (unsigned char)pSMTE->smte_objcnt; 411 415 if (pSMTE->smte_objcnt <= MAXKRNLOBJECTS) 412 416 { … … 433 437 kprintf(("GetOTEs32: failed. usRc = %d\n", usRc)); 434 438 435 return usRc | (usRc != 0 ? STATUS_DONE | STERR : STATUS_DONE);439 return (USHORT)(usRc | (usRc != NO_ERROR ? STATUS_DONE | STERR : STATUS_DONE)); 436 440 } 437 441 … … 442 446 * where the jmp instr should be placed. 443 447 * On error it returns 0. 444 * @param p Pointer to prolog. 448 * @param pach Pointer to prolog. 449 * @param fOverload TRUE: Function is to be overloaded. 450 * FALSE: Function is to be imported. 445 451 */ 446 static int interpretFunctionProlog(char *p )452 static int interpretFunctionProlog(char *pach, BOOL fOverload) 447 453 { 448 int length;449 454 int rc; 450 455 … … 459 464 */ 460 465 461 if (p [0] == 0x55 && p[1] == 0x8b)462 { 463 if (p [2] == 0xec)466 if (pach[0] == 0x55 && pach[1] == 0x8b) 467 { 468 if (pach[2] == 0xec) 464 469 rc = 3; 465 470 else … … 472 477 * There will never be any doubt when something goes wrong! 473 478 */ 474 switch(p [rc])479 switch(pach[rc]) 475 480 { 476 481 case 0x33: /* xor (ldrClose, ldrOpen) */ … … 478 483 break; 479 484 case 0x8b: 480 if (p [rc+1] == 0x0d)485 if (pach[rc+1] == 0x0d) 481 486 rc += 6; 482 487 else … … 490 495 break; 491 496 default: 492 kprintf(("interpretFunctionProlog: unknown instruction 0x%x \n", p[rc]));497 kprintf(("interpretFunctionProlog: unknown instruction 0x%x\n", pach[rc])); 493 498 return 0; 494 499 } … … 496 501 } 497 502 else 498 rc = 0; 503 { 504 /* special case for IOSftReadAt and IOSftWriteAt */ 505 if (fOverload == FALSE && pach[0] == 0xB8 && (pach[5] == 0xEB || pach[5] == 0x55)) 506 rc = 5; 507 else 508 rc = 0; 509 } 499 510 500 511 return rc; … … 512 523 int cb; 513 524 514 /* verify */ 525 /* 526 * verify proctable 527 */ 515 528 for (i = 0; i < NUMBER_OF_PROCS; i++) 516 529 { 517 cb = interpretFunctionProlog((char*)_aProcTab[i].ulAddress); 530 if (_aProcTab[i].fType != EPT_PROC && _aProcTab[i].fType != EPT_PROCIMPORT) 531 { 532 kprintf(("procInit: EPT_VAR is not supported. (procedure no.%d, cb=%d)\n", i, cb)); 533 return 1; 534 } 535 cb = interpretFunctionProlog((char*)_aProcTab[i].ulAddress, _aProcTab[i].fType == EPT_PROC); 518 536 if (cb <= 0 || cb + 5 >= MAXSIZE_PROLOG) 519 537 { 520 kprintf((" rehookFunctions: verify failed for procedure no.%d, cb=%d\n", i, cb));538 kprintf(("procInit: verify failed for procedure no.%d, cb=%d\n", i, cb)); 521 539 return 1; 522 540 } 523 541 } 524 542 525 /* rehook */ 543 /* 544 * rehook / import 545 */ 526 546 for (i = 0; i < NUMBER_OF_PROCS; i++) 527 547 { 528 cb = interpretFunctionProlog((char*)_aProcTab[i].ulAddress); 529 if (cb > 0 && cb + 5 < MAXSIZE_PROLOG) 530 { 531 char *pMy; 532 switch (i) 548 switch (_aProcTab[i].fType) 549 { 550 case EPT_PROC: 533 551 { 534 case iLDRREAD: pMy = (char*)myldrRead; break; 535 case iLDROPEN: pMy = (char*)myldrOpen; break; 536 case iLDRCLOSE: pMy = (char*)myldrClose; break; 537 case iLDRQAPPTYPE: pMy = (char*)myLDRQAppType; break; 538 539 default: 540 kprintf(("rehookFunctions: Someone has added function without updating the switch! i=%d\n", i)); 541 Int3(); 542 return 2; 552 cb = interpretFunctionProlog((char*)_aProcTab[i].ulAddress, TRUE); 553 if (cb > 0 && cb + 5 < MAXSIZE_PROLOG) 554 { 555 static unsigned auFuncs[NUMBER_OF_PROCS] = /* This table must be updated with the overloading functions. */ 556 { 557 (unsigned)myldrRead, 558 (unsigned)myldrOpen, 559 (unsigned)myldrClose, 560 (unsigned)myLDRQAppType, 561 (unsigned)myldrEnum32bitRelRecs, 562 0, 563 0, 564 0, 565 0, 566 0, 567 }; 568 569 /* copy function prolog */ 570 memcpy(callTab[i], (void*)_aProcTab[i].ulAddress, (size_t)cb); 571 572 /* jump from calltab to original function */ 573 callTab[i][cb] = 0xE9; /* jmp */ 574 *(unsigned*)(void*)&callTab[i][cb+1] = _aProcTab[i].ulAddress + cb - (unsigned)&callTab[i][cb+5]; 575 576 577 /* jump from original function to my function - an cli(?) could be needed here */ 578 *(char*)_aProcTab[i].ulAddress = 0xE9; /* jmp */ 579 *(unsigned*)(_aProcTab[i].ulAddress + 1) = auFuncs[i] - (_aProcTab[i].ulAddress + 5); 580 } 581 else 582 { /* !fatal! - this could never happen really... */ 583 kprintf(("procInit: FATAL verify failed for procedure no.%d when rehooking it!\n",i)); 584 Int3(); /* ipe - later! */ 585 return 1; 586 } 587 break; 543 588 } 544 589 545 /* copy function prolog */ 546 memcpy(callTab[i], (void*)_aProcTab[i].ulAddress, (size_t)cb); 547 548 /* jump from calltab to original function */ 549 callTab[i][cb] = 0xE9; /* jmp */ 550 *(unsigned*)&callTab[i][cb+1] = _aProcTab[i].ulAddress + cb - (unsigned)&callTab[i][cb+5]; 551 552 /* jump from original function to my function - an cli could be needed here */ 553 *(char*)_aProcTab[i].ulAddress = 0xE9; /* jmp */ 554 *(unsigned*)(_aProcTab[i].ulAddress + 1) = (unsigned)pMy - (_aProcTab[i].ulAddress + 5); 555 } 556 else 557 { 558 /* !fatal! - this could never happen really... */ 559 kprintf(("rehookFunctions: FATAL verify failed for procedure no.%d when rehooking it!\n",i)); 560 Int3(); /* ipe - later! */ 561 return 1; 562 } 563 } 590 case EPT_PROCIMPORT: 591 { 592 cb = interpretFunctionProlog((char*)_aProcTab[i].ulAddress, FALSE); 593 if (cb > 0 && cb + 5 < MAXSIZE_PROLOG) 594 { 595 /* jump from calltab to original function */ 596 callTab[i][0] = 0xE9; /* jmp */ 597 *(unsigned*)(void*)&callTab[i][1] = _aProcTab[i].ulAddress - (unsigned)&callTab[i][cb+5]; 598 } 599 else 600 { /* !fatal! - this could never happen really... */ 601 kprintf(("procInit: FATAL verify failed for procedure no.%d when importing it!\n",i)); 602 Int3(); /* ipe - later! */ 603 return 1; 604 } 605 break; 606 } 607 608 default: 609 kprintf(("procInit: EPT_VAR is not supported. (procedure no.%d, cb=%d)\n", i, cb)); 610 Int3(); /* ipe - later! */ 611 return 1; 612 } /* switch - type */ 613 } /* for */ 564 614 565 615 return NO_ERROR; -
trunk/src/win32k/fastdep.c
r1678 r2501 1 /* $Id: fastdep.c,v 1. 6 1999-11-10 01:45:29bird Exp $1 /* $Id: fastdep.c,v 1.7 2000-01-22 18:20:54 bird Exp $ 2 2 * 3 3 * Fast dependants. (Fast = Quick and Dirty!) … … 97 97 TRUE /* fSrcWhenObj */ 98 98 }; 99 100 if (argc == 1) 101 { 102 syntax(); 103 return -87; 104 } 99 105 100 106 /* look for depend filename option "-d <filename>" */ -
trunk/src/win32k/include/LdrCalls.h
r1678 r2501 1 /* $Id: LdrCalls.h,v 1. 2 1999-11-10 01:45:32bird Exp $1 /* $Id: LdrCalls.h,v 1.3 2000-01-22 18:21:00 bird Exp $ 2 2 * 3 3 * Prototypes for the loader overrided function. … … 24 24 * _ldrClose 25 25 */ 26 extern ULONG LDRCALL _ldrClose(/* retd 0x04 */26 extern ULONG LDRCALL ldrClose( /* retd 0x04 */ 27 27 SFN p1 /* ebp + 0x08 */ 28 28 ); … … 34 34 * _ldrOpen 35 35 */ 36 extern ULONG LDRCALL _ldrOpen(/* retd 0x0c */36 extern ULONG LDRCALL ldrOpen( /* retd 0x0c */ 37 37 PSFN p1, /* ebp + 0x08 */ 38 38 PCHAR p2, /* ebp + 0x0c */ … … 46 46 * _ldrRead 47 47 */ 48 extern ULONG LDRCALL _ldrRead(/* retd 0x18 */48 extern ULONG LDRCALL ldrRead( /* retd 0x18 */ 49 49 SFN p1, /* ebp + 0x08 */ 50 50 ULONG p2, /* ebp + 0x0c */ … … 69 69 * _LDRQAppType 70 70 */ 71 extern ULONG LDRCALL _LDRQAppType(/* retd 0x08 */71 extern ULONG LDRCALL LDRQAppType( /* retd 0x08 */ 72 72 ULONG p1, /* ebp + 0x08 */ 73 73 ULONG p2 /* ebp + 0x0c */ … … 76 76 ULONG LDRCALL myLDRQAppType(ULONG,ULONG); 77 77 78 79 /** 80 * ldrEnum32bitRelRecs 81 * @param pMTE Pointer to MTE for this module. 82 * @param iObject Object index. 0-based! 83 * @param iPageTabl Page index. 0-based! 84 * @param pvPage Pointer to page buffer. 85 * @param ulPageAddress Note! Page is not present. 86 * @param pPTDA 87 * 88 */ 89 extern ULONG LDRCALL ldrEnum32bitRelRecs( /* retd 0x20 */ 90 PMTE pMTE, /* ebp + 0x08 */ 91 ULONG iObject, /* ebp + 0x0c */ 92 ULONG iPageTable, /* ebp + 0x10 */ 93 PVOID pvPage, /* ebp + 0x14 */ 94 ULONG ulPageAddress, /* ebp + 0x18 */ 95 PVOID pvPTDA /* ebp + 0x1c */ 96 ); 97 98 ULONG LDRCALL myldrEnum32bitRelRecs(PMTE, ULONG, ULONG, PVOID, ULONG, PVOID); 78 99 79 100 -
trunk/src/win32k/include/ModuleBase.h
r1678 r2501 1 /* $Id: ModuleBase.h,v 1. 1 1999-11-10 01:45:31bird Exp $1 /* $Id: ModuleBase.h,v 1.2 2000-01-22 18:20:58 bird Exp $ 2 2 * 3 3 * ModuleBase - Declaration of the Basic module class. … … 22 22 #define ERROR_INTERNAL_PROCESSING_ERROR 0x42000002UL 23 23 24 25 /* 26 * Some useful macros. 27 */ 28 #define NOREF(a) (a=a) /* Not referenced parameter warning fix. */ 29 #define ALIGN(a, alignment) (((a) + (alignment - 1UL)) & ~(alignment - 1UL)) 30 /* aligns something, a, up to nearest alignment boundrary- 31 * Note: Aligment must be a 2**n number. */ 24 32 25 33 /* … … 74 82 virtual ULONG init(PCSZ pszFilename); 75 83 virtual ULONG read(ULONG offLXFile, PVOID pvBuffer, ULONG cbToRead, ULONG flFlags, PMTE pMTE) = 0; 84 virtual ULONG applyFixups(PMTE pMTE, ULONG iObject, ULONG iPageTable, PVOID pvPage, 85 ULONG ulPageAddress, PVOID pvPTDA); /*(ldrEnum32bitRelRecs)*/ 76 86 #ifndef RING0 77 87 virtual ULONG writeFile(PCSZ pszLXFilename); -
trunk/src/win32k/include/OS2KIO.h
r2461 r2501 1 /* $Id: OS2KIO.h,v 1. 2 2000-01-17 16:52:25bird Exp $1 /* $Id: OS2KIO.h,v 1.3 2000-01-22 18:20:58 bird Exp $ 2 2 * 3 * OS/2 kernel IO , typedefs and macros.3 * OS/2 kernel IO: prototypes, typedefs and macros. 4 4 * 5 5 * Project Odin Software License can be found in LICENSE.TXT … … 10 10 #define _OS2KIO_h_ 11 11 12 APIRET KRNLCALL IOSftOpen(PSZ pszFilename, 13 ULONG flOpenFlags, /* probably similar to DosOpen */ 14 ULONG fsOpenMode, /* probably similar to DosOpen */ 15 PSFN phFile, 16 PULONG pulsomething); /* EA? */ 17 APIRET KRNLCALL IOSftClose(SFN hFile); 18 APIRET KRNLCALL IOSftTransPath(PSZ pszPath /* IN and OUT? */); 19 APIRET KRNLCALL IOSftReadAt(SFN hFile, 20 PULONG pulActual, 21 PVOID pvBuffer, 22 ULONG flFlags, 23 ULONG cbBuffer); 24 APIRET KRNLCALL IOSftWriteAt(SFN hFile, 25 PULONG pulActual, 26 PVOID pvBuffer, 27 ULONG flFlags, 28 ULONG cbBuffer); 29 /* APIRET KRNLCALL IOSft(1,2,3,4,5); */ 12 13 /** 14 * Opens a given file. 15 * @returns NO_ERROR on success. other on error. 16 * @param pszFilename Pointer to filename. 17 * @param flOpenFlags Open flags. (similar to DosOpen) 18 * @param fsOpenMode Open mode flags. (similar to DosOpen) 19 * @param phFile Pointer to filehandle. 20 * @param pulsomething 16-bit near (?) pointer to a variable - unknown. NULL is allowed. EA? 21 */ 22 APIRET KRNLCALL IOSftOpen( 23 PSZ pszFilename, 24 ULONG flOpenFlags, 25 ULONG fsOpenMode, 26 PSFN phFile, 27 PULONG pulsomething 28 ); 29 30 31 /** 32 * Closes the specified file. 33 * @returns NO_ERROR on success. other on error. 34 * @param hFile File handle - System File Number. 35 */ 36 APIRET KRNLCALL IOSftClose( 37 SFN hFile 38 ); 39 40 41 /** 42 * Probably this function will expand a relative path to a full path. 43 * @returns NO_ERROR on success. other on error. (?) 44 * @param pszPath Pointer to path to expand. Contains the full path upon return. (?) 45 * This buffer should probably be of CCHMAXPATH length. 46 */ 47 APIRET KRNLCALL IOSftTransPath( 48 PSZ pszPath 49 ); 50 51 52 /** 53 * Read at a given offset in the a file. 54 * @returns NO_ERROR on success. other on error. 55 * @param hFile File handle - System File Number. 56 * @param pcbActual Pointer to variable which upon input holds the number 57 * of bytes to read, on output the actual number of bytes read. 58 * @param pvBuffer Pointer to the read buffer. 59 * @param flFlags Read flags? 60 * @param ulOffset File offset to read from. (0=start of file) 61 */ 62 APIRET KRNLCALL IOSftReadAt( 63 SFN hFile, 64 PULONG pcbActual, 65 PVOID pvBuffer, 66 ULONG flFlags, 67 ULONG ulOffset 68 ); 69 70 71 /** 72 * Write at a given offset in the a file. 73 * @returns NO_ERROR on success. other on error. 74 * @param hFile File handle - System File Number. 75 * @param pcbActual Pointer to variable which upon input holds the number 76 * of bytes to write, on output the actual number of bytes write. 77 * @param pvBuffer Pointer to the write buffer. 78 * @param flFlags Read flags? 79 * @param ulOffset File offset to write from. (0=start of file) 80 */ 81 APIRET KRNLCALL IOSftWriteAt( 82 SFN hFile, 83 PULONG pcbActual, 84 PVOID pvBuffer, 85 ULONG flFlags, 86 ULONG ulOffset 87 ); 30 88 31 89 #endif -
trunk/src/win32k/include/avl.h
r1467 r2501 1 /* $Id: avl.h,v 1. 1 1999-10-27 02:02:55bird Exp $1 /* $Id: avl.h,v 1.2 2000-01-22 18:20:59 bird Exp $ 2 2 * 3 3 * AVL-Tree (lookalike) declaration. … … 15 15 #endif 16 16 17 /* 18 * AVL configuration. PRIVATE! 19 */ 20 #define AVL_MAX_HEIGHT 19 /* Up to 2^16 nodes. */ 21 17 22 /** 18 23 * AVL key type … … 25 30 typedef struct _AVLNodeCore 26 31 { 27 unsigned char uchHeight; /* Height of this tree: max(heigth(left), heigth(right)) + 1*/32 AVLKEY Key; /* Key value. */ 28 33 struct _AVLNodeCore * pLeft; /* Pointer to left leaf node. */ 29 34 struct _AVLNodeCore * pRight; /* Pointer to right leaf node. */ 30 AVLKEY Key; /* Key value.*/35 unsigned char uchHeight; /* Height of this tree: max(heigth(left), heigth(right)) + 1 */ 31 36 } AVLNODECORE, *PAVLNODECORE, **PPAVLNODECORE; 32 37 38 /** 39 * AVL Enum data - All members are PRIVATE! Don't touch! 40 */ 41 typedef struct _AVLEnumData 42 { 43 char fFromLeft; 44 char cEntries; 45 char achFlags[AVL_MAX_HEIGHT]; 46 PAVLNODECORE aEntries[AVL_MAX_HEIGHT]; 47 } AVLENUMDATA, *PAVLENUMDATA; 33 48 34 void AVLInsert(PPAVLNODECORE ppTree, PAVLNODECORE pNode); 35 PAVLNODECORE AVLRemove(PPAVLNODECORE ppTree, AVLKEY Key); 36 PAVLNODECORE AVLGet(PPAVLNODECORE ppTree, AVLKEY Key); 37 PAVLNODECORE AVLGetWithAdjecentNodes(PPAVLNODECORE ppTree, AVLKEY Key, PPAVLNODECORE ppLeft, PPAVLNODECORE ppRight); 49 50 /* 51 * callback type 52 */ 53 typedef unsigned ( _PAVLCALLBACK)(PAVLNODECORE, void*); 54 typedef _PAVLCALLBACK *PAVLCALLBACK; 55 56 57 void AVLInsert(PPAVLNODECORE ppTree, PAVLNODECORE pNode); 58 PAVLNODECORE AVLRemove(PPAVLNODECORE ppTree, AVLKEY Key); 59 PAVLNODECORE AVLGet(PPAVLNODECORE ppTree, AVLKEY Key); 60 PAVLNODECORE AVLGetWithParent(PPAVLNODECORE ppTree, PPAVLNODECORE ppParent, AVLKEY Key); 61 PAVLNODECORE AVLGetWithAdjecentNodes(PPAVLNODECORE ppTree, AVLKEY Key, PPAVLNODECORE ppLeft, PPAVLNODECORE ppRight); 62 unsigned AVLDoWithAll(PPAVLNODECORE ppTree, int fFromLeft, PAVLCALLBACK pfnCallBack, void *pvParam); 63 PAVLNODECORE AVLBeginEnumTree(PPAVLNODECORE ppTree, PAVLENUMDATA pEnumData, int fFromLeft); 64 PAVLNODECORE AVLGetNextNode(PAVLENUMDATA pEnumData); 65 PAVLNODECORE AVLGetBestFit(PPAVLNODECORE ppTree, AVLKEY Key, int fAbove); 66 38 67 39 68 -
trunk/src/win32k/include/ldr.h
r1678 r2501 1 /* $Id: ldr.h,v 1. 4 1999-11-10 01:45:32bird Exp $1 /* $Id: ldr.h,v 1.5 2000-01-22 18:20:59 bird Exp $ 2 2 * 3 3 * ldr - loader header file. … … 63 63 } MODULE, *PMODULE; 64 64 65 #define MOD_FLAGS_IN_MTETREE 0x00000010 /* The node is present in the MTE-tree. */66 #define MOD_TYPE_MASK 0x0000000F /* Type mask. */67 #define MOD_TYPE_PE2LX 0x00000001 /* Pe2Lx module. */68 #define MOD_TYPE_ELF2LX 0x00000002 /* Elf2Lx module. */69 #define MOD_TYPE_SCRIPT 0x00000003 /* Script module. */70 #define MOD_TYPE_PE 0x00000004 /* Pe module. */65 #define MOD_FLAGS_IN_MTETREE 0x00000010UL /* The node is present in the MTE-tree. */ 66 #define MOD_TYPE_MASK 0x0000000FUL /* Type mask. */ 67 #define MOD_TYPE_PE2LX 0x00000001UL /* Pe2Lx module. */ 68 #define MOD_TYPE_ELF2LX 0x00000002UL /* Elf2Lx module. */ 69 #define MOD_TYPE_SCRIPT 0x00000003UL /* Script module. */ 70 #define MOD_TYPE_PE 0x00000004UL /* Pe module. */ 71 71 72 72 -
trunk/src/win32k/include/options.h
r1678 r2501 1 /* $Id: options.h,v 1. 4 1999-11-10 01:45:33bird Exp $1 /* $Id: options.h,v 1.5 2000-01-22 18:21:01 bird Exp $ 2 2 * 3 3 * Options. … … 33 33 34 34 /* Set defaults. */ 35 #define SET_OPTIONS_TO_DEFAULT(o) \36 o.fQuiet = FALSE; \37 o.usCom = OUTPUT_COM2; \38 o.fLogging = FALSE; \39 o.fKernel = KF_UNI; \40 o.ulBuild = ~0UL; \41 o.usVerMajor = ~0;\42 o.usVerMinor = ~0;\43 o.fPE = FLAGS_PE_PE2LX; \44 o.ulInfoLevel = INFOLEVEL_QUIET; \45 o.fElf = FALSE; \46 o.fScript = FALSE; \47 o.fNoLoader = FALSE; \48 o.cbHeap = 0x100000; /* 1MB */ \49 o.cbHeapMax = 0x100000; /* 1MB */ \50 o.cbHeapResident = 0x10000; /* 64KB */ \51 o.cbHeapMaxResident = 0x1000; /* 4KB */ \35 #define SET_OPTIONS_TO_DEFAULT(o) \ 36 o.fQuiet = FALSE; \ 37 o.usCom = OUTPUT_COM2; \ 38 o.fLogging = FALSE; \ 39 o.fKernel = KF_UNI; \ 40 o.ulBuild = ~0UL; \ 41 o.usVerMajor = (unsigned short)~0; \ 42 o.usVerMinor = (unsigned short)~0; \ 43 o.fPE = FLAGS_PE_PE2LX; \ 44 o.ulInfoLevel = INFOLEVEL_QUIET; \ 45 o.fElf = FALSE; \ 46 o.fScript = FALSE; \ 47 o.fNoLoader = FALSE; \ 48 o.cbHeap = 0x100000; /* 1MB */ \ 49 o.cbHeapMax = 0x100000; /* 1MB */ \ 50 o.cbHeapResident = 0x10000; /* 64KB */ \ 51 o.cbHeapMaxResident = 0x1000; /* 4KB */ \ 52 52 53 53 -
trunk/src/win32k/include/pe2lx.h
r1678 r2501 1 /* $Id: pe2lx.h,v 1. 6 1999-11-10 01:45:33bird Exp $1 /* $Id: pe2lx.h,v 1.7 2000-01-22 18:21:01 bird Exp $ 2 2 * 3 3 * Pe2Lx class declarations. Ring 0 and Ring 3 … … 66 66 ULONG init(PCSZ pszFilename); 67 67 ULONG read(ULONG offLXFile, PVOID pvBuffer, ULONG cbToRead, ULONG flFlags, PMTE pMTE); 68 ULONG applyFixups(PMTE pMTE, ULONG iObject, ULONG iPageTable, PVOID pvPage, 69 ULONG ulPageAddress, PVOID pvPTDA); /*(ldrEnum32bitRelRecs)*/ 70 68 71 #ifndef RING0 69 72 ULONG writeLxFile(PCSZ pszLXFilename); -
trunk/src/win32k/include/probkrnl.h
r1678 r2501 1 /* $Id: probkrnl.h,v 1. 3 1999-11-10 01:45:33bird Exp $1 /* $Id: probkrnl.h,v 1.4 2000-01-22 18:21:01 bird Exp $ 2 2 * 3 3 * Include file for ProbKrnl. 4 4 * 5 * Copyright (c) 1998- 1999 knut st. osmundsen5 * Copyright (c) 1998-2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no) 6 6 * 7 7 * Project Odin Software License can be found in LICENSE.TXT … … 16 16 * Defined Constants And Macros * 17 17 *******************************************************************************/ 18 #define NUMBER_OF_PROCS 4 /* remeber to sync this with ldr_functions.h and dev32_start.asm */ 19 20 /* indexes into the _ProcTab/ProcTab table */ 21 #define iLDRREAD 0 22 #define iLDROPEN 1 23 #define iLDRCLOSE 2 24 #define iLDRQAPPTYPE 3 25 18 #define NUMBER_OF_PROCS 10 26 19 #define MAX_LENGTH_NAME 32 27 20 28 21 /* entry-point type flag */ 29 #define EPT_PROC 0 /* procedure */ 30 #define EPT_VAR 1 /* variable/non-procedure */ 22 #define EPT_PROC 0 /* procedure - overload procedure*/ 23 #define EPT_PROCIMPORT 1 /* procedure - import only */ 24 #define EPT_VAR 2 /* variable/non-procedure - not implemented yet */ 31 25 32 26 … … 54 48 *******************************************************************************/ 55 49 extern PROCS _aProcTab[NUMBER_OF_PROCS]; /* 'aProcTab' in PrbKrnl.c */ 56 extern unsigned long int _ulBuild; /* 'ulBuild' in PrbKrnl.c */ 57 extern unsigned long int _fInitSuccess; /* 'fInitSuccess' in PrbKrnl.c */ 58 extern unsigned long int _usVerMajor; /* 'usVerMajor' in PrbKrnl.c */ 59 extern unsigned long int _usVerMinor; /* 'usVerMinor' in PrbKrnl.c */ 50 extern unsigned long int _ulBuild; /* 'ulBuild' in PrbKrnl.c */ 51 extern unsigned short int _usVerMajor; /* 'usVerMajor' in PrbKrnl.c */ 52 extern unsigned short int _usVerMinor; /* 'usVerMinor' in PrbKrnl.c */ 60 53 61 54 #ifdef INCL_16 /* 16-bit only */ -
trunk/src/win32k/ldr/ModuleBase.cpp
r1678 r2501 1 /* $Id: ModuleBase.cpp,v 1. 1 1999-11-10 01:45:35bird Exp $1 /* $Id: ModuleBase.cpp,v 1.2 2000-01-22 18:21:01 bird Exp $ 2 2 * 3 3 * ModuleBase - Implementetation. … … 132 132 return NO_ERROR; 133 133 } 134 135 136 137 /** 138 * Applies relocation fixups to a page which is being loaded. 139 * @returns NO_ERROR on success? 140 * error code on error? 141 * @param pMTE Pointer Module Table Entry. 142 * @param iObject Index into the object table. (0-based) 143 * @param iPageTable Index into the page table. (0-based) 144 * @param pvPage Pointer to the page which is being loaded. 145 * @param ulPageAddress Address of page. 146 * @param pvPTDA Pointer to Per Task Data Aera 147 * @remark Stub. 148 */ 149 ULONG ModuleBase::applyFixups(PMTE pMTE, ULONG iObject, ULONG iPageTable, PVOID pvPage, 150 ULONG ulPageAddress, PVOID pvPTDA) 151 { 152 NOREF(pMTE); 153 NOREF(iObject); 154 NOREF(iPageTable); 155 NOREF(pvPage); 156 NOREF(ulPageAddress); 157 NOREF(pvPTDA); 158 return NO_ERROR; 159 } 160 134 161 135 162 -
trunk/src/win32k/ldr/calltab.asm
r1467 r2501 1 ; $Id: calltab.asm,v 1. 2 1999-10-27 02:02:58bird Exp $1 ; $Id: calltab.asm,v 1.3 2000-01-22 18:21:01 bird Exp $ 2 2 ; 3 3 ; callTab - Call back again table - table with entry for each function which is overrided. … … 19 19 ; 20 20 public callTab 21 public __ldrClose@4 22 public __ldrOpen@12 23 public __ldrRead@24 24 public __LDRQAppType@8 25 21 public _ldrClose@4 22 public _ldrOpen@12 23 public _ldrRead@24 24 public _LDRQAppType@8 25 public _ldrEnum32bitRelRecs@24 26 public _IOSftOpen@20 27 public _IOSftClose@4 28 public _IOSftTransPath@4 29 public _IOSftReadAt@20 30 public _IOSftWriteAt@20 26 31 27 32 ; … … 31 36 32 37 38 33 39 CALLTAB segment 34 40 assume cs:CALLTAB, ds:flat, ss:nothing 35 36 41 ; 37 ; must match with the aProcTab array in dev16\ProbKrnl.c 42 ; callTab is an array of evt. function prologs with a jump to the real function. 43 ; Imported and Overrided OS/2 kernel functions are called tru this table. 44 ; 45 ; This array of near procedures are parallel to the aProcTab array in dev16\ProbKrnl.c. 46 ; Remember to update both!. 38 47 ; 39 48 callTab: 40 _ _ldrRead@24 PROC NEAR49 _ldrRead@24 PROC NEAR 41 50 db MAXSIZE_PROLOG dup(0cch) 42 _ _ldrRead@24 ENDP51 _ldrRead@24 ENDP 43 52 44 _ _ldrOpen@12 PROC NEAR53 _ldrOpen@12 PROC NEAR 45 54 db MAXSIZE_PROLOG dup(0cch) 46 _ _ldrOpen@12 ENDP55 _ldrOpen@12 ENDP 47 56 48 _ _ldrClose@4 PROC NEAR57 _ldrClose@4 PROC NEAR 49 58 db MAXSIZE_PROLOG dup(0cch) 50 _ _ldrClose@4 ENDP59 _ldrClose@4 ENDP 51 60 52 _ _LDRQAppType@8 PROC NEAR61 _LDRQAppType@8 PROC NEAR 53 62 db MAXSIZE_PROLOG dup(0cch) 54 _ _LDRQAppType@8 ENDP63 _LDRQAppType@8 ENDP 55 64 56 if 0 57 public __LDRLoadExe 58 __LDRLoadExe PROC NEAR 65 _ldrEnum32bitRelRecs@24 PROC NEAR 59 66 db MAXSIZE_PROLOG dup(0cch) 60 _ _LDRLoadExe END67 _ldrEnum32bitRelRecs@24 ENDP 61 68 62 public __ldrGetResource 63 _ _ldrGetResourcePROC NEAR69 70 _IOSftOpen@20 PROC NEAR 64 71 db MAXSIZE_PROLOG dup(0cch) 65 _ _ldrGetResourceENDP72 _IOSftOpen@20 ENDP 66 73 67 public __ldrOpenNewExe 68 __ldrOpenNewExe PROC NEAR 74 _IOSftClose@4 PROC NEAR 69 75 db MAXSIZE_PROLOG dup(0cch) 70 _ _ldrOpenNewExeENDP76 _IOSftClose@4 ENDP 71 77 72 public __ldrCreateMte 73 __ldrCreateMte PROC NEAR 78 _IOSftTransPath@4 PROC NEAR 74 79 db MAXSIZE_PROLOG dup(0cch) 75 _ _ldrCreateMteENDP80 _IOSftTransPath@4 ENDP 76 81 77 public __ldrGetMte 78 __ldrGetMte PROC NEAR 82 _IOSftReadAt@20 PROC NEAR 79 83 db MAXSIZE_PROLOG dup(0cch) 80 _ _ldrGetMteENDP84 _IOSftReadAt@20 ENDP 81 85 82 endif 86 _IOSftWriteAt@20 PROC NEAR 87 db MAXSIZE_PROLOG dup(0cch) 88 _IOSftWriteAt@20 ENDP 89 83 90 84 91 CALLTAB ENDS -
trunk/src/win32k/ldr/ldr.cpp
r1678 r2501 1 /* $Id: ldr.cpp,v 1. 6 1999-11-10 01:45:36bird Exp $1 /* $Id: ldr.cpp,v 1.7 2000-01-22 18:21:01 bird Exp $ 2 2 * 3 3 * ldr.cpp - Loader helpers. … … 83 83 PMODULE getModuleByMTE(PMTE pMTE) 84 84 { 85 PMODULE pMod = (PMODULE)AVLGet(&pMTERoot, (AVLKEY)pMTE); 86 if (pMod == NULL) 87 { 85 #if 0 86 /* Not 100% sure that this will work correctly! */ 87 PMODULE pMod = (PMODULE)AVLGet(&pMTERoot, (AVLKEY)pMTE); 88 if (pMod == NULL) 89 { 90 #ifdef DEBUG 91 if (pMTE <= (PMTE)0x10000) 92 { 93 kprintf(("getModuleByMTE: invalid pMTE pointer - %#8x\n", pMTE)); 94 return NULL; 95 } 96 #endif 97 pMod = (PMODULE)AVLGet(&pSFNRoot, (AVLKEY)pMTE->mte_sfn); 98 if (pMod != NULL) 99 { 100 pMod->coreMTE.Key = (AVLKEY)pMTE; 101 pMod->fFlags |= MOD_FLAGS_IN_MTETREE; 102 AVLInsert(&pMTERoot, (PAVLNODECORE)((unsigned)pMod + offsetof(MODULE, coreMTE))); 103 } 104 } 105 else 106 pMod = (PMODULE)((unsigned)pMod - offsetof(MODULE, coreMTE)); 107 return pMod; 108 #else 109 /* Use this for the time being. */ 88 110 #ifdef DEBUG 89 if (pMTE <= (PMTE)0x10000)90 {91 kprintf(("getModuleByMTE: invalid pMTE pointer - %#8x\n", pMTE));92 return NULL;93 }111 if (pMTE <= (PMTE)0x10000) 112 { 113 kprintf(("getModuleByMTE: invalid pMTE pointer - %#8x\n", pMTE)); 114 return NULL; 115 } 94 116 #endif 95 pMod = (PMODULE)AVLGet(&pSFNRoot, (AVLKEY)pMTE->mte_sfn); 96 if (pMod != NULL) 97 { 98 pMod->coreMTE.Key = (AVLKEY)pMTE; 99 pMod->fFlags |= MOD_FLAGS_IN_MTETREE; 100 AVLInsert(&pMTERoot, (PAVLNODECORE)((unsigned)pMod + offsetof(MODULE, coreMTE))); 101 } 102 } 103 else 104 pMod = (PMODULE)((unsigned)pMod - offsetof(MODULE, coreMTE)); 105 return pMod; 117 if (GetState(pMTE->mte_sfn) == HSTATE_OUR) 118 return (PMODULE)AVLGet(&pSFNRoot, (AVLKEY)pMTE->mte_sfn); 119 120 return NULL; 121 #endif 106 122 } 107 123 … … 149 165 return ERROR_INVALID_PARAMETER; 150 166 } 151 if ((fFlags & MOD_TYPE_MASK) == 0 || (fFlags & ~MOD_TYPE_MASK) != 0 )167 if ((fFlags & MOD_TYPE_MASK) == 0 || (fFlags & ~MOD_TYPE_MASK) != 0UL) 152 168 { 153 169 kprintf(("addModule: invalid parameter: fFlags = 0x%#8x\n", fFlags)); … … 242 258 { 243 259 int rc = NO_ERROR; 244 int i;245 260 246 261 /* init state table */ -
trunk/src/win32k/ldr/myLDRQAppType.cpp
r1678 r2501 1 /* $Id: myLDRQAppType.cpp,v 1. 2 1999-11-10 01:45:36bird Exp $1 /* $Id: myLDRQAppType.cpp,v 1.3 2000-01-22 18:21:02 bird Exp $ 2 2 * 3 3 * _myLDRQAppType - _LDRQAppType overload. … … 36 36 ULONG LDRCALL myLDRQAppType(ULONG p1, ULONG p2) 37 37 { 38 intrc;38 APIRET rc; 39 39 40 40 kprintf(("_LDRQAppType: entry\n")); 41 41 fQAppType = 1; 42 42 43 rc = _LDRQAppType(p1, p2);43 rc = LDRQAppType(p1, p2); 44 44 45 45 fQAppType = 0; -
trunk/src/win32k/ldr/myldrClose.cpp
r1678 r2501 1 /* $Id: myldrClose.cpp,v 1. 4 1999-11-10 01:45:36bird Exp $1 /* $Id: myldrClose.cpp,v 1.5 2000-01-22 18:21:02 bird Exp $ 2 2 * 3 * myldrClose - _ldrClose3 * myldrClose - ldrClose 4 4 * 5 5 * Copyright (c) 1998-1999 knut st. osmundsen … … 41 41 ULONG LDRCALL myldrClose(SFN hFile) 42 42 { 43 int rc;44 45 43 /* closes handle */ 46 kprintf((" _ldrClose: hFile = %.4x\n", hFile));44 kprintf(("ldrClose: hFile = %.4x\n", hFile)); 47 45 if (GetState(hFile) == HSTATE_OUR) 48 46 { 47 APIRET rc; 48 49 49 #ifdef DEBUG 50 50 PMODULE pMod = getModuleBySFN(hFile); … … 52 52 pMod->Data.pModule->dumpVirtualLxFile(); 53 53 else 54 kprintf((" _ldrClose: getModuleBySFN failed!!!"));54 kprintf(("ldrClose: getModuleBySFN failed!!!")); 55 55 #endif 56 56 57 57 rc = removeModule(hFile); 58 58 if (rc != NO_ERROR) 59 kprintf((" _ldrClose: removeModule retured rc=%d\n", rc));59 kprintf(("ldrClose: removeModule retured rc=%d\n", rc)); 60 60 61 #pragma info(notrd) 61 62 SetState(hFile, HSTATE_UNUSED); 63 #pragma info(restore) 62 64 } 63 65 64 return _ldrClose(hFile);66 return ldrClose(hFile); 65 67 } -
trunk/src/win32k/ldr/myldrOpen.cpp
r1678 r2501 1 /* $Id: myldrOpen.cpp,v 1. 5 1999-11-10 01:45:36bird Exp $1 /* $Id: myldrOpen.cpp,v 1.6 2000-01-22 18:21:02 bird Exp $ 2 2 * 3 * myldrOpen - _ldrOpen.3 * myldrOpen - ldrOpen. 4 4 * 5 5 * Copyright (c) 1998-1999 knut st. osmundsen … … 39 39 40 40 /** 41 * _ldrOpen override.41 * ldrOpen override. 42 42 * @returns Return code. 43 43 * @param phFile Pointer to file handler. Holds filehandle on output. … … 48 48 { 49 49 ULONG rc; 50 int i;51 50 52 rc = _ldrOpen(phFile, pszFilename, param3);51 rc = ldrOpen(phFile, pszFilename, param3); 53 52 54 53 if (rc == NO_ERROR) 55 kprintf((" _ldrOpen: phFile=%#.4x, flags=%#.8x, pszFn=%s\n", *phFile, param3, pszFilename));54 kprintf(("ldrOpen: phFile=%#.4x, flags=%#.8x, pszFn=%s\n", *phFile, param3, pszFilename)); 56 55 57 56 if (rc == NO_ERROR && (options.fElf || options.fPE != FLAGS_PE_NOT || options.fScript)) … … 66 65 * This costs up to two disk reads! 67 66 */ 68 rc = _ldrRead(*phFile, 0UL, pMzHdr, 0UL, sizeof(IMAGE_DOS_HEADER), NULL);67 rc = ldrRead(*phFile, 0UL, pMzHdr, 0UL, sizeof(IMAGE_DOS_HEADER), NULL); 69 68 if (rc == NO_ERROR) 70 69 { … … 77 76 78 77 if (*(PULONG)pach != IMAGE_NT_SIGNATURE) 79 rc = _ldrRead(*phFile, pMzHdr->e_lfanew, pach, 0UL, sizeof(achBuffer), NULL);78 rc = ldrRead(*phFile, pMzHdr->e_lfanew, pach, 0UL, sizeof(achBuffer), NULL); 80 79 81 80 if (rc == NO_ERROR && *(PULONG)pach == IMAGE_NT_SIGNATURE) 82 81 { /* PE signature found */ 83 kprintf((" _ldrOpen: PE executable...\n"));82 kprintf(("ldrOpen: PE executable...\n")); 84 83 if (options.fPE == FLAGS_PE_PE2LX 85 84 || (options.fPE == FLAGS_PE_MIXED … … 96 95 if (rc == NO_ERROR) 97 96 { 98 kprintf((" _ldrOpen: Successfully init of Pe2Lx object.\n"));97 kprintf(("ldrOpen: Successfully init of Pe2Lx object.\n")); 99 98 rc = addModule(*phFile, NULL, MOD_TYPE_PE2LX, pPe2Lx); 100 99 if (rc == NO_ERROR) 100 #pragma info(notrd) 101 101 SetState(*phFile, HSTATE_OUR); 102 #pragma info(restore) 102 103 else 103 kprintf((" _ldrOpen: Failed to add the module. rc=%d\n"));104 kprintf(("ldrOpen: Failed to add the module. rc=%d\n")); 104 105 } 105 106 else 106 kprintf((" _ldrOpen: Failed to init Pe2Lx object. rc=%d\n"));107 kprintf(("ldrOpen: Failed to init Pe2Lx object. rc=%d\n")); 107 108 if (rc != NO_ERROR) 108 109 delete pPe2Lx; 109 110 } 110 111 else 111 kprintf((" _ldrOpen: Failed to allocate Pe2Lx object.\n"));112 kprintf(("ldrOpen: Failed to allocate Pe2Lx object.\n")); 112 113 } 113 114 else 114 115 if (options.fPE == FLAGS_PE_PE || options.fPE == FLAGS_PE_MIXED) 115 116 { /* pe.exe */ 116 kprintf((" _ldrOpen: pe.exe - opening\n"));117 _ldrClose(*phFile);118 rc = _ldrOpen(phFile, "pe.exe", param3); /* path....! problems! */119 kprintf((" _ldrOpen: pe.exe - open returned with rc = %d\n", rc));117 kprintf(("ldrOpen: pe.exe - opening\n")); 118 ldrClose(*phFile); 119 rc = ldrOpen(phFile, "pe.exe", param3); /* path....! problems! */ 120 kprintf(("ldrOpen: pe.exe - open returned with rc = %d\n", rc)); 120 121 return rc; 121 122 } … … 128 129 { 129 130 /* ELF signature found */ 130 kprintf((" _ldrOpen: ELF executable! - not implemented yet!\n"));131 kprintf(("ldrOpen: ELF executable! - not implemented yet!\n")); 131 132 } 132 133 else … … 136 137 char *pszStart = pach+2; 137 138 char *pszEnd; 138 kprintf((" _ldrOpen: unix script?\n"));139 kprintf(("ldrOpen: unix script?\n")); 139 140 140 141 achBuffer[sizeof(achBuffer)-1] = '\0'; /* just to make sure we don't read to much... */ … … 152 153 { 153 154 *pszEnd = '\0'; 154 kprintf((" _ldrOpen: unix script - opening %s\n", pszStart));155 _ldrClose(*phFile);156 rc = _ldrOpen(phFile, pszStart, param3);157 kprintf((" _ldrOpen: unix script - open returned with rc = %d\n", rc));155 kprintf(("ldrOpen: unix script - opening %s\n", pszStart)); 156 ldrClose(*phFile); 157 rc = ldrOpen(phFile, pszStart, param3); 158 kprintf(("ldrOpen: unix script - open returned with rc = %d\n", rc)); 158 159 } 159 160 } 160 161 else 161 kprintf((" _ldrOpen: unix script - unexpected end of line/file. (line: %.10s\n", pach));162 kprintf(("ldrOpen: unix script - unexpected end of line/file. (line: %.10s\n", pach)); 162 163 } 163 164 } … … 165 166 else 166 167 { 167 kprintf((" _ldrOpen: _ldrRead failed with rc=%d when reading DosHdr.\n", rc));168 kprintf(("ldrOpen: ldrRead failed with rc=%d when reading DosHdr.\n", rc)); 168 169 rc = NO_ERROR; 169 170 } -
trunk/src/win32k/ldr/myldrRead.cpp
r1678 r2501 1 /* $Id: myldrRead.cpp,v 1. 5 1999-11-10 01:45:36bird Exp $1 /* $Id: myldrRead.cpp,v 1.6 2000-01-22 18:21:02 bird Exp $ 2 2 * 3 * myldrRead - _ldrRead.3 * myldrRead - ldrRead. 4 4 * 5 5 * Copyright (c) 1998-1999 knut st. osmundsen … … 50 50 { 51 51 PMODULE pMod; 52 kprintf((" _ldrRead+: hF=%+04x off=%+08x pB=%+08x fl=%+08x cb=%+04x pMTE=%+08x\n",hFile,ulOffset,pBuffer,ulFlags,ulBytesToRead,pMTE));52 kprintf(("ldrRead+: hF=%+04x off=%+08x pB=%+08x fl=%+08x cb=%+04x pMTE=%+08x\n",hFile,ulOffset,pBuffer,ulFlags,ulBytesToRead,pMTE)); 53 53 54 54 pMod = getModuleBySFN(hFile); … … 57 57 /* I would love to have a pointer to the MTE */ 58 58 if (pMod->pMTE == NULL && pMTE != NULL) 59 pMod->pMTE = =pMTE;59 pMod->pMTE = pMTE; 60 60 61 61 /* debug */ 62 62 if (ulFlags != 0) 63 kprintf((" _ldrRead: Warning ulFlags = 0x%x (!= 0)\n", ulFlags));63 kprintf(("ldrRead: Warning ulFlags = 0x%x (!= 0)\n", ulFlags)); 64 64 65 65 if ((pMod->fFlags & MOD_TYPE_MASK) == MOD_TYPE_PE2LX) … … 67 67 else 68 68 { 69 kprintf((" _ldrRead: Invalid module type, %#x\n", pMod->fFlags & MOD_TYPE_MASK));69 kprintf(("ldrRead: Invalid module type, %#x\n", pMod->fFlags & MOD_TYPE_MASK)); 70 70 rc = ERROR_READ_FAULT; 71 71 } … … 73 73 } 74 74 else 75 kprintf((" _ldrRead: DON'T PANIC! - but I can't get Node ptr! - This is really an IPE!\n"));75 kprintf(("ldrRead: DON'T PANIC! - but I can't get Node ptr! - This is really an IPE!\n")); 76 76 } 77 77 78 rc = _ldrRead(hFile, ulOffset, pBuffer, ulFlags, ulBytesToRead, pMTE);78 rc = ldrRead(hFile, ulOffset, pBuffer, ulFlags, ulBytesToRead, pMTE); 79 79 80 80 #if 0 81 kprintf((" _ldrRead: hF=%+04x off=%+08x pB=%+08x fl=%+08x cb=%+04x pMTE=%+08x rc=%d\n",81 kprintf(("ldrRead: hF=%+04x off=%+08x pB=%+08x fl=%+08x cb=%+04x pMTE=%+08x rc=%d\n", 82 82 hFile,ulOffset,pBuffer,ulFlags,ulBytesToRead,pMTE,rc)); 83 83 #endif -
trunk/src/win32k/misc/avl.c
r1467 r2501 1 /* $Id: avl.c,v 1. 1 1999-10-27 02:02:59bird Exp $1 /* $Id: avl.c,v 1.2 2000-01-22 18:21:02 bird Exp $ 2 2 * 3 3 * AVL-Tree (lookalike) implementation. … … 14 14 15 15 /* 16 * AVL configuration.17 */18 #define AVL_MAX_HEIGHT 19 /* Up to 2^16 nodes. */19 #define assert20 21 /*22 16 * AVL helper macros. 23 17 */ 24 #define AVL_HEIGHTOF(pNode) (( pNode) != NULL ? pNode->uchHeight : 0UL)18 #define AVL_HEIGHTOF(pNode) ((unsigned char)((pNode) != NULL ? pNode->uchHeight : 0)) 25 19 #define max(a,b) (((a) > (b)) ? (a) : (b)) 26 20 … … 33 27 #include "dev32.h" 34 28 29 #include <builtin.h> 30 #define assert(a) ((a) ? (void)0 : __interrupt(3)) 31 35 32 36 33 /******************************************************************************* … … 45 42 PPAVLNODECORE aEntries[AVL_MAX_HEIGHT]; 46 43 } AVLSTACK, *PAVLSTACK; 44 typedef struct _AVLStack2 45 { 46 unsigned cEntries; 47 PAVLNODECORE aEntries[AVL_MAX_HEIGHT]; 48 char achFlags[AVL_MAX_HEIGHT]; 49 } AVLSTACK2, *PAVLSTACK2; 47 50 48 51 … … 200 203 201 204 /** 202 * Gets node from the tree (does not remove it!)205 * Gets a node from the tree (does not remove it!) 203 206 * @returns Pointer to the node holding the given key. 204 207 * @param ppTree Pointer to the AVL-tree root node pointer. … … 222 225 return pNode; 223 226 } 227 228 229 230 /** 231 * Gets a node from the tree and its parent node (if any) (does not remove any nodes!) 232 * @returns Pointer to the node holding the given key. 233 * @param ppTree Pointer to the AVL-tree root node pointer. 234 * @param ppParent Pointer to a variable which will hold the pointer to the partent node on 235 * return. When no node is found, this will hold the last searched node. 236 * @param Key Key value of the node which is to be found. 237 * @sketch 238 * @status completely implemented. 239 * @author knut st. osmundsen 240 */ 241 PAVLNODECORE AVLGetWithParent(PPAVLNODECORE ppTree, PPAVLNODECORE ppParent, AVLKEY Key) 242 { 243 register PAVLNODECORE pNode = *ppTree; 244 register PAVLNODECORE pParent = NULL; 245 246 while (pNode != NULL && pNode->Key != Key) 247 { 248 pParent = pNode; 249 if (pNode->Key > Key) 250 pNode = pNode->pLeft; 251 else 252 pNode = pNode->pRight; 253 } 254 255 *ppParent = pParent; 256 return pNode; 257 } 258 224 259 225 260 … … 292 327 293 328 return pNode; 329 } 330 331 332 /** 333 * Iterates tru all nodes in the given tree. 334 * @returns 0 on success. Return from callback on failiure. 335 * @param ppTree Pointer to the AVL-tree root node pointer. 336 * @param fFromLeft TRUE: Left to right. 337 * FALSE: Right to left. 338 * @param pfnCallBack Pointer to callback function. 339 * @param pvParam Userparameter passed on to the callback function. 340 * @status completely implemented. 341 * @author knut st. osmundsen 342 */ 343 unsigned AVLDoWithAll(PPAVLNODECORE ppTree, int fFromLeft, PAVLCALLBACK pfnCallBack, void *pvParam) 344 { 345 AVLSTACK2 AVLStack; 346 PAVLNODECORE pNode; 347 unsigned rc; 348 349 if (*ppTree == NULL) 350 return 0; 351 352 AVLStack.cEntries = 1; 353 AVLStack.achFlags[0] = 0; 354 AVLStack.aEntries[0] = *ppTree; 355 356 if (fFromLeft) 357 { /* from left */ 358 while (AVLStack.cEntries > 0) 359 { 360 pNode = AVLStack.aEntries[AVLStack.cEntries - 1]; 361 362 /* left */ 363 if (!AVLStack.achFlags[AVLStack.cEntries - 1]++) 364 { 365 if (pNode->pLeft != NULL) 366 { 367 AVLStack.achFlags[AVLStack.cEntries] = 0; /* 0 first, 1 last */ 368 AVLStack.aEntries[AVLStack.cEntries++] = pNode->pLeft; 369 continue; 370 } 371 } 372 373 /* center */ 374 rc = pfnCallBack(pNode, pvParam); 375 if (rc != 0) 376 return rc; 377 378 /* right */ 379 AVLStack.cEntries--; 380 if (pNode->pRight != NULL) 381 { 382 AVLStack.achFlags[AVLStack.cEntries] = 0; 383 AVLStack.aEntries[AVLStack.cEntries++] = pNode->pRight; 384 } 385 } /* while */ 386 } 387 else 388 { /* from right */ 389 while (AVLStack.cEntries > 0) 390 { 391 pNode = AVLStack.aEntries[AVLStack.cEntries - 1]; 392 393 394 /* right */ 395 if (!AVLStack.achFlags[AVLStack.cEntries - 1]++) 396 { 397 if (pNode->pRight != NULL) 398 { 399 AVLStack.achFlags[AVLStack.cEntries] = 0; /* 0 first, 1 last */ 400 AVLStack.aEntries[AVLStack.cEntries++] = pNode->pRight; 401 continue; 402 } 403 } 404 405 /* center */ 406 rc = pfnCallBack(pNode, pvParam); 407 if (rc != 0) 408 return rc; 409 410 /* left */ 411 AVLStack.cEntries--; 412 if (pNode->pLeft != NULL) 413 { 414 AVLStack.achFlags[AVLStack.cEntries] = 0; 415 AVLStack.aEntries[AVLStack.cEntries++] = pNode->pLeft; 416 } 417 } /* while */ 418 } 419 420 return 0; 421 } 422 423 424 /** 425 * Starts an enumeration of all nodes in the given AVL tree. 426 * @returns Pointer to the first node in the tree. 427 * @param ppTree Pointer to the AVL-tree root node pointer. 428 * @param pEnumData Pointer to enumeration control data. 429 * @param fFromLeft TRUE: Left to right. 430 * FALSE: Right to left. 431 * @status completely implemented. 432 * @author knut st. osmundsen 433 */ 434 PAVLNODECORE AVLBeginEnumTree(PPAVLNODECORE ppTree, PAVLENUMDATA pEnumData, int fFromLeft) 435 { 436 if (*ppTree != NULL) 437 { 438 pEnumData->fFromLeft = fFromLeft; 439 pEnumData->cEntries = 1; 440 pEnumData->aEntries[0] = *ppTree; 441 pEnumData->achFlags[0] = 0; 442 } 443 else 444 pEnumData->cEntries = 0; 445 446 return AVLGetNextNode(pEnumData); 447 } 448 449 450 /** 451 * Get the next node in the tree enumeration. 452 * @returns Pointer to the first node in the tree. 453 * @param pEnumData Pointer to enumeration control data. 454 * @status completely implemented. 455 * @author knut st. osmundsen 456 */ 457 PAVLNODECORE AVLGetNextNode(PAVLENUMDATA pEnumData) 458 { 459 PAVLNODECORE pNode; 460 461 if (pEnumData->fFromLeft) 462 { /* from left */ 463 while (pEnumData->cEntries > 0) 464 { 465 pNode = pEnumData->aEntries[pEnumData->cEntries - 1]; 466 467 /* left */ 468 if (pEnumData->achFlags[pEnumData->cEntries - 1] == 0) 469 { 470 pEnumData->achFlags[pEnumData->cEntries - 1]++; 471 if (pNode->pLeft != NULL) 472 { 473 pEnumData->achFlags[pEnumData->cEntries] = 0; /* 0 left, 1 center, 2 right */ 474 pEnumData->aEntries[pEnumData->cEntries++] = pNode->pLeft; 475 continue; 476 } 477 } 478 479 /* center */ 480 if (pEnumData->achFlags[pEnumData->cEntries - 1] == 1) 481 { 482 pEnumData->achFlags[pEnumData->cEntries - 1]++; 483 return pNode; 484 } 485 486 /* right */ 487 pEnumData->cEntries--; 488 if (pNode->pRight != NULL) 489 { 490 pEnumData->achFlags[pEnumData->cEntries] = 0; 491 pEnumData->aEntries[pEnumData->cEntries++] = pNode->pRight; 492 } 493 } /* while */ 494 } 495 else 496 { /* from right */ 497 while (pEnumData->cEntries > 0) 498 { 499 pNode = pEnumData->aEntries[pEnumData->cEntries - 1]; 500 501 502 /* right */ 503 if (pEnumData->achFlags[pEnumData->cEntries - 1] == 0) 504 { 505 pEnumData->achFlags[pEnumData->cEntries - 1]++; 506 if (pNode->pRight != NULL) 507 { 508 pEnumData->achFlags[pEnumData->cEntries] = 0; /* 0 right, 1 center, 2 left */ 509 pEnumData->aEntries[pEnumData->cEntries++] = pNode->pRight; 510 continue; 511 } 512 } 513 514 /* center */ 515 if (pEnumData->achFlags[pEnumData->cEntries - 1] == 1) 516 { 517 pEnumData->achFlags[pEnumData->cEntries - 1]++; 518 return pNode; 519 } 520 521 /* left */ 522 pEnumData->cEntries--; 523 if (pNode->pLeft != NULL) 524 { 525 pEnumData->achFlags[pEnumData->cEntries] = 0; 526 pEnumData->aEntries[pEnumData->cEntries++] = pNode->pLeft; 527 } 528 } /* while */ 529 } 530 531 return NULL; 532 533 } 534 535 536 537 538 /** 539 * Finds the best fitting node in the tree for the given Key value. 540 * @returns Pointer to the best fitting node found. 541 * @param ppTree Pointer to Pointer to the tree root node. 542 * @param Key The Key of which is to be found a best fitting match for.. 543 * @param fAbove TRUE: Returned node is have the closest key to Key from above. 544 * FALSE: Returned node is have the closest key to Key from below. 545 * @status completely implemented. 546 * @sketch The best fitting node is always located in the searchpath above you. 547 * >= (above): The node where you last turned left. 548 * <= (below): the node where you last turned right. 549 * @author knut st. osmundsen 550 */ 551 PAVLNODECORE AVLGetBestFit(PPAVLNODECORE ppTree, AVLKEY Key, int fAbove) 552 { 553 register PAVLNODECORE pNode = *ppTree; 554 PAVLNODECORE pNodeLast = NULL; 555 556 if (fAbove) 557 { /* pNode->Key >= Key */ 558 while (pNode != NULL && pNode->Key != Key) 559 { 560 if (pNode->Key > Key) 561 { 562 pNodeLast = pNode; 563 pNode = pNode->pLeft; 564 } 565 else 566 pNode = pNode->pRight; 567 } 568 } 569 else 570 { /* pNode->Key <= Key */ 571 while (pNode != NULL && pNode->Key != Key) 572 { 573 if (pNode->Key < Key) 574 { 575 pNodeLast = pNode; 576 pNode = pNode->pRight; 577 } 578 else 579 pNode = pNode->pLeft; 580 } 581 } 582 583 return pNode == NULL ? pNodeLast /* best fit */ : pNode /* perfect match */; 294 584 } 295 585 … … 354 644 PAVLNODECORE pNode = *ppNode; 355 645 PAVLNODECORE pLeftNode = pNode->pLeft; 356 unsigned uLeftHeight = AVL_HEIGHTOF(pLeftNode);646 unsigned char uchLeftHeight = AVL_HEIGHTOF(pLeftNode); 357 647 PAVLNODECORE pRightNode = pNode->pRight; 358 unsigned uRightHeight = AVL_HEIGHTOF(pRightNode);359 360 if (u RightHeight + 1 < uLeftHeight)648 unsigned char uchRightHeight = AVL_HEIGHTOF(pRightNode); 649 650 if (uchRightHeight + 1 < uchLeftHeight) 361 651 { 362 652 PAVLNODECORE pLeftLeftNode = pLeftNode->pLeft; 363 653 PAVLNODECORE pLeftRightNode = pLeftNode->pRight; 364 unsigned uLeftRightHeight = AVL_HEIGHTOF(pLeftRightNode);365 366 if (AVL_HEIGHTOF(pLeftLeftNode) >= u LeftRightHeight)654 unsigned char uchLeftRightHeight = AVL_HEIGHTOF(pLeftRightNode); 655 656 if (AVL_HEIGHTOF(pLeftLeftNode) >= uchLeftRightHeight) 367 657 { 368 658 pNode->pLeft = pLeftRightNode; 369 659 pLeftNode->pRight = pNode; 370 pLeftNode->uchHeight = 1 + (pNode->uchHeight = 1 + uLeftRightHeight);660 pLeftNode->uchHeight = (unsigned char)(1 + (pNode->uchHeight = (unsigned char)(1 + uchLeftRightHeight))); 371 661 *ppNode = pLeftNode; 372 662 } … … 377 667 pLeftRightNode->pLeft = pLeftNode; 378 668 pLeftRightNode->pRight = pNode; 379 pLeftNode->uchHeight = pNode->uchHeight = u LeftRightHeight;380 pLeftRightNode->uchHeight = u LeftHeight;669 pLeftNode->uchHeight = pNode->uchHeight = uchLeftRightHeight; 670 pLeftRightNode->uchHeight = uchLeftHeight; 381 671 *ppNode = pLeftRightNode; 382 672 } 383 673 } 384 else if (u LeftHeight + 1 < uRightHeight)674 else if (uchLeftHeight + 1 < uchRightHeight) 385 675 { 386 676 PAVLNODECORE pRightLeftNode = pRightNode->pLeft; 387 unsigned uRightLeftHeight = AVL_HEIGHTOF(pRightLeftNode);677 unsigned char uchRightLeftHeight = AVL_HEIGHTOF(pRightLeftNode); 388 678 PAVLNODECORE pRightRightNode = pRightNode->pRight; 389 679 390 if (AVL_HEIGHTOF(pRightRightNode) >= u RightLeftHeight)680 if (AVL_HEIGHTOF(pRightRightNode) >= uchRightLeftHeight) 391 681 { 392 682 pNode->pRight = pRightLeftNode; 393 683 pRightNode->pLeft = pNode; 394 pRightNode->uchHeight = 1 + (pNode->uchHeight = 1 + uRightLeftHeight);684 pRightNode->uchHeight = (unsigned char)(1 + (pNode->uchHeight = (unsigned char)(1 + uchRightLeftHeight))); 395 685 *ppNode = pRightNode; 396 686 } … … 401 691 pRightLeftNode->pRight = pRightNode; 402 692 pRightLeftNode->pLeft = pNode; 403 pRightNode->uchHeight = pNode->uchHeight = u RightLeftHeight;404 pRightLeftNode->uchHeight = u RightHeight;693 pRightNode->uchHeight = pNode->uchHeight = uchRightLeftHeight; 694 pRightLeftNode->uchHeight = uchRightHeight; 405 695 *ppNode = pRightLeftNode; 406 696 } … … 408 698 else 409 699 { 410 register unsigned uHeight = max(uLeftHeight, uRightHeight) + 1;411 if (u Height == pNode->uchHeight)700 register unsigned char uchHeight = (unsigned char)(max(uchLeftHeight, uchRightHeight) + 1); 701 if (uchHeight == pNode->uchHeight) 412 702 break; 413 pNode->uchHeight = u Height;703 pNode->uchHeight = uchHeight; 414 704 } 415 705 } -
trunk/src/win32k/misc/vprintf.c
r1683 r2501 1 /* $Id: vprintf.c,v 1. 6 1999-11-10 09:11:28bird Exp $1 /* $Id: vprintf.c,v 1.7 2000-01-22 18:21:03 bird Exp $ 2 2 * 3 3 * vprintf and printf … … 488 488 { 489 489 #ifdef RING0 490 #pragma info(noeff) 490 491 while (!(_inp(options.usCom + 5) & 0x20)); /* Waits for the port to be ready. */ 491 492 _outp(options.usCom, chReturn); /* Put the char. */ 493 #pragma info(restore) 492 494 #else 493 495 DosWrite(1, (void*)&chReturn, 1, &ulWrote); … … 495 497 } 496 498 #ifdef RING0 499 #pragma info(noeff) 497 500 while (!(_inp(options.usCom + 5) & 0x20)); /* Waits for the port to be ready. */ 498 501 _outp(options.usCom, ch); /* Put the char. */ 502 #pragma info(restore) 499 503 Yield(); 500 504 #else … … 528 532 for (ul = 0; ul < cch; ul++) 529 533 { 534 #pragma info(noeff) 530 535 while (!(_inp(options.usCom + 5) & 0x20)); /* Waits for the port to be ready. */ 531 536 _outp(options.usCom, psz[ul]); /* Put the char. */ 537 #pragma info(restore) 532 538 } 533 539 #else … … 541 547 { 542 548 #ifdef RING0 549 #pragma info(noeff) 543 550 while (!(_inp(options.usCom + 5) & 0x20)); /* Waits for the port to be ready. */ 544 551 _outp(options.usCom, chReturn); /* Put the char. */ … … 546 553 _outp(options.usCom, chNewLine); /* Put the char. */ 547 554 cchYield ++; 555 #pragma info(restore) 548 556 #else 549 557 DosWrite(1, (void*)&chReturn, 1, &ul); -
trunk/src/win32k/pe2lx/pe2lx.cpp
r2005 r2501 1 /* $Id: pe2lx.cpp,v 1.1 4 1999-12-07 08:28:42bird Exp $1 /* $Id: pe2lx.cpp,v 1.15 2000-01-22 18:21:03 bird Exp $ 2 2 * 3 3 * Pe2Lx class implementation. Ring 0 and Ring 3 … … 37 37 #define CB2PAGES_SHIFT 12 /* count of bytes to count of pages. shift right value. Note. ALIGN!*/ 38 38 39 40 /*41 * useful macros.42 */43 #define NOREF(a) (a=a) /* Not referenced parameter warning fix. */44 #define ALIGN(a, alignment) (((a) + (alignment - 1UL)) & ~(alignment - 1UL))45 /* aligns something, a, up to nearest alignment boundrary-46 * Note: Aligment must be a 2**n number. */47 39 48 40 /* … … 85 77 * ReadAt: Reads from a file, hFile, at a given offset, ulOffset, into a buffer, pvBuffer, 86 78 * an amount of bytes, cbToRead. 87 * RING0: Map this to _ldrRead with 0UL as flFlags.79 * RING0: Map this to ldrRead with 0UL as flFlags. 88 80 * RING3: Implementes this function as a static function, ReadAt. 89 81 * ReadAtF: Same as ReadAt but two extra parameters; an additional flag and a pointer to an MTE. 90 82 * Used in the read method. 91 * RING0: Map directly to _ldrRead.83 * RING0: Map directly to ldrRead. 92 84 * RING3: Map to ReadAt, ignoring the two extra parameters. 93 85 */ 94 86 #ifdef RING0 95 87 #define ReadAt(hFile, ulOffset, pvBuffer, cbToRead) \ 96 _ldrRead(hFile, ulOffset, pvBuffer, 0UL, cbToRead, NULL)88 ldrRead(hFile, ulOffset, pvBuffer, 0UL, cbToRead, NULL) 97 89 #define ReadAtF(hFile, ulOffset, pvBuffer, cbToRead, flFlags, pMTE) \ 98 _ldrRead(hFile, ulOffset, pvBuffer, flFlags, cbToRead, pMTE)90 ldrRead(hFile, ulOffset, pvBuffer, flFlags, cbToRead, pMTE) 99 91 #else 100 92 #define ReadAtF(hFile, ulOffset, pvBuffer, cbToRead, flFlags, pMTE) \ … … 123 115 #include "OS2Krnl.h" /* kernel structs. (SFN) */ 124 116 #ifdef RING0 125 #include "ldrCalls.h" /* _ldr* calls. (_ldrRead) */117 #include "ldrCalls.h" /* ldr* calls. (ldrRead) */ 126 118 #endif 127 119 #include "modulebase.h" /* ModuleBase class definitions, ++. */ … … 723 715 * @param pvBuffer Pointer to buffer where data is to be put. 724 716 * @param cbToRead Bytes to be read. 725 * @param flFlag Flags which was spesified to the _ldrRead call.726 * @parma pMTE Pointer to MTE which was specified to the _ldrRead call.717 * @param flFlag Flags which was spesified to the ldrRead call. 718 * @parma pMTE Pointer to MTE which was specified to the ldrRead call. 727 719 * @return NO_ERROR if successful something else if not. 728 720 * @status completely implmented; tested. … … 1018 1010 1019 1011 1012 /** 1013 * Applies relocation fixups to a page which is being loaded. 1014 * @returns NO_ERROR on success? 1015 * error code on error? 1016 * @param pMTE Pointer Module Table Entry. 1017 * @param iObject Index into the object table. (0-based) 1018 * @param iPageTable Index into the page table. (0-based) 1019 * @param pvPage Pointer to the page which is being loaded. 1020 * @param ulPageAddress Address of page. 1021 * @param pvPTDA Pointer to Per Task Data Aera 1022 * 1023 * @sketch Find RVA. 1024 */ 1025 ULONG Pe2Lx::applyFixups(PMTE pMTE, ULONG iObject, ULONG iPageTable, PVOID pvPage, 1026 ULONG ulPageAddress, PVOID pvPTDA) 1027 { 1028 ULONG ulRVA; 1029 1030 NOREF(ulRVA); 1031 1032 NOREF(pMTE); 1033 NOREF(iObject); 1034 NOREF(iPageTable); 1035 NOREF(pvPage); 1036 NOREF(ulPageAddress); 1037 NOREF(pvPTDA); 1038 1039 return NO_ERROR; 1040 } 1041 1042 1043 1020 1044 #ifndef RING0 1021 1045 /**
Note:
See TracChangeset
for help on using the changeset viewer.