Changeset 2831 for trunk/src/win32k/dev32/d32init.c
- Timestamp:
- Feb 20, 2000, 12:52:00 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/dev32/d32init.c
r2827 r2831 1 /* $Id: d32init.c,v 1.1 0 2000-02-19 08:40:29 bird Exp $1 /* $Id: d32init.c,v 1.11 2000-02-19 23:51:59 bird Exp $ 2 2 * 3 3 * d32init.c - 32-bits init routines. … … 54 54 55 55 /* extern(s) located in calltab.asm */ 56 extern char callTab[N UMBER_OF_PROCS][MAXSIZE_PROLOG];56 extern char callTab[NBR_OF_KRNLIMPORTS][MAXSIZE_PROLOG]; 57 57 58 58 /* extern(s) located in mytkExecPgm.asm */ … … 342 342 343 343 /** 344 * Verifies the a ProcTab.344 * Verifies the aImportTab. 345 345 * @returns 0 if ok. !0 if not ok. 346 346 * @remark Called from IOCtl. … … 352 352 353 353 /* verify */ 354 for (i = 0; i < N UMBER_OF_PROCS; i++)354 for (i = 0; i < NBR_OF_KRNLIMPORTS; i++) 355 355 { 356 356 /* verify that it is found */ 357 if (!_a ProcTab[i].fFound)357 if (!_aImportTab[i].fFound) 358 358 { 359 359 kprintf(("VerifyProcTab32: procedure no.%d was not found!\n", i)); … … 362 362 363 363 /* verify read/writeable. - FIXME */ 364 if (_a ProcTab[i].ulAddress < 0xffe00000UL)364 if (_aImportTab[i].ulAddress < 0xffe00000UL) 365 365 { 366 366 kprintf(("VerifyProcTab32: procedure no.%d has an invlalid address, %#08x!\n", 367 i, _a ProcTab[i].ulAddress));367 i, _aImportTab[i].ulAddress)); 368 368 return STATUS_DONE | STERR | 2; 369 369 } 370 370 371 switch (_a ProcTab[i].fType)371 switch (_aImportTab[i].fType) 372 372 { 373 373 case EPT_PROC: 374 374 case EPT_PROCIMPORT: 375 375 /* verify known function prolog. */ 376 if ((cb = interpretFunctionProlog((char*)_a ProcTab[i].ulAddress, _aProcTab[i].fType == EPT_PROC))376 if ((cb = interpretFunctionProlog((char*)_aImportTab[i].ulAddress, _aImportTab[i].fType == EPT_PROC)) 377 377 <= 0 && cb + 5 >= MAXSIZE_PROLOG) 378 378 { … … 534 534 * verify proctable 535 535 */ 536 for (i = 0; i < N UMBER_OF_PROCS; i++)537 { 538 if (_a ProcTab[i].fType != EPT_PROC && _aProcTab[i].fType != EPT_PROCIMPORT)536 for (i = 0; i < NBR_OF_KRNLIMPORTS; i++) 537 { 538 if (_aImportTab[i].fType != EPT_PROC && _aImportTab[i].fType != EPT_PROCIMPORT) 539 539 { 540 540 kprintf(("procInit: EPT_VAR is not supported. (procedure no.%d, cb=%d)\n", i, cb)); 541 541 return 1; 542 542 } 543 cb = interpretFunctionProlog((char*)_a ProcTab[i].ulAddress, _aProcTab[i].fType == EPT_PROC);543 cb = interpretFunctionProlog((char*)_aImportTab[i].ulAddress, _aImportTab[i].fType == EPT_PROC); 544 544 if (cb <= 0 || cb + 5 >= MAXSIZE_PROLOG) 545 545 { … … 552 552 * rehook / import 553 553 */ 554 for (i = 0; i < N UMBER_OF_PROCS; i++)555 { 556 switch (_a ProcTab[i].fType)554 for (i = 0; i < NBR_OF_KRNLIMPORTS; i++) 555 { 556 switch (_aImportTab[i].fType) 557 557 { 558 558 case EPT_PROC: 559 559 { 560 cb = interpretFunctionProlog((char*)_a ProcTab[i].ulAddress, TRUE);560 cb = interpretFunctionProlog((char*)_aImportTab[i].ulAddress, TRUE); 561 561 if (cb > 0 && cb + 5 < MAXSIZE_PROLOG) 562 562 { 563 static unsigned auFuncs[N UMBER_OF_PROCS] = /* This table must be updated with the overloading functions. */563 static unsigned auFuncs[NBR_OF_KRNLIMPORTS] = /* This table must be updated with the overloading functions. */ 564 564 { 565 565 (unsigned)myldrRead, … … 580 580 581 581 /* copy function prolog */ 582 memcpy(callTab[i], (void*)_a ProcTab[i].ulAddress, (size_t)cb);582 memcpy(callTab[i], (void*)_aImportTab[i].ulAddress, (size_t)cb); 583 583 584 584 /* jump from calltab to original function */ 585 585 callTab[i][cb] = 0xE9; /* jmp */ 586 *(unsigned*)(void*)&callTab[i][cb+1] = _a ProcTab[i].ulAddress + cb - (unsigned)&callTab[i][cb+5];586 *(unsigned*)(void*)&callTab[i][cb+1] = _aImportTab[i].ulAddress + cb - (unsigned)&callTab[i][cb+5]; 587 587 588 588 589 589 /* jump from original function to my function - an cli(?) could be needed here */ 590 *(char*)_a ProcTab[i].ulAddress = 0xE9; /* jmp */591 *(unsigned*)(_a ProcTab[i].ulAddress + 1) = auFuncs[i] - (_aProcTab[i].ulAddress + 5);590 *(char*)_aImportTab[i].ulAddress = 0xE9; /* jmp */ 591 *(unsigned*)(_aImportTab[i].ulAddress + 1) = auFuncs[i] - (_aImportTab[i].ulAddress + 5); 592 592 } 593 593 else … … 602 602 case EPT_PROCIMPORT: 603 603 { 604 cb = interpretFunctionProlog((char*)_a ProcTab[i].ulAddress, FALSE);604 cb = interpretFunctionProlog((char*)_aImportTab[i].ulAddress, FALSE); 605 605 if (cb > 0 && cb + 5 < MAXSIZE_PROLOG) 606 606 { 607 607 /* jump from calltab to original function */ 608 608 callTab[i][0] = 0xE9; /* jmp */ 609 *(unsigned*)(void*)&callTab[i][1] = _a ProcTab[i].ulAddress - (unsigned)&callTab[i][cb+5];609 *(unsigned*)(void*)&callTab[i][1] = _aImportTab[i].ulAddress - (unsigned)&callTab[i][cb+5]; 610 610 } 611 611 else
Note:
See TracChangeset
for help on using the changeset viewer.