- Timestamp:
- Jul 10, 2001, 7:18:04 AM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/dev32/d32init.c
r6219 r6278 1 /* $Id: d32init.c,v 1.4 0 2001-07-08 02:56:27bird Exp $1 /* $Id: d32init.c,v 1.41 2001-07-10 05:18:04 bird Exp $ 2 2 * 3 3 * d32init.c - 32-bits init routines. … … 18 18 #define OVERLOAD32_ENTRY 0x14 19 19 #define IMPORT16_ENTRY 0x08 20 #define IMPORTH16_ENTRY 0x08 20 21 #define IMPORT32_ENTRY 0x08 21 22 #define VARIMPORT_ENTRY 0x10 … … 514 515 USHORT usRc; 515 516 516 /* VerifyImpor Tab32 is called before the initroutine! */517 /* VerifyImportTab32 is called before the initroutine! */ 517 518 pulTKSSBase32 = (PULONG)_TKSSBase16; 518 519 … … 834 835 (pach[0] == 0x0f && pach[1] == 0xb7 && pach[2] == 0xe4 && !fOverload) /* the next prolog */ 835 836 || 836 (pach[0] == 0xe8 && pach[5] == 0x9d && !fOverload) /* the last prolog */ 837 (pach[0] == 0xe8 && pach[5] == 0x9d && !fOverload) /* the next prolog */ 838 /* push ebx 839 * push edi 840 * push imm32 841 */ 842 || (pach[0] == 0x53 && pach[1] == 0x57 && pach[2] == 0x68 && !fOverload) 843 /* push ebx 844 * push edi 845 * push esi 846 * mov /r 847 */ 848 || (pach[0] == 0x53 && pach[1] == 0xe8 && !fOverload) 849 /* push ebx 850 * push edi 851 * push esi 852 * mov /r 853 */ 854 || (pach[0] == 0x53 && pach[1] == 0x57 && pach[2] == 0x56 && pach[3] == 0x8b && !fOverload) 855 /* pop eax 856 * push imm8 857 * push eax 858 * jmp imm32 859 */ 860 || (pach[0] == 0x58 && pach[1] == 0x6a && pach[3] == 0x50 && pach[4] == 0xe9 && !fOverload) 861 /* push imm32 862 * call imm32 863 */ 864 || (pach[0] == 0x68 && pach[5] == 0xe8 && !fOverload) 837 865 ) 838 866 { … … 874 902 break; 875 903 876 /* simple one byte instructions */ 877 case 0x50: /* push ax */ 878 case 0x51: /* push cx */ 879 case 0x52: /* push dx */ 880 case 0x53: /* push bx */ 881 case 0x54: /* push sp */ 882 case 0x55: /* push bp */ 883 case 0x56: /* push si */ 884 case 0x57: /* push di */ 904 /* simple one byte instructions e*/ 905 case 0x50: /* push eax */ 906 case 0x51: /* push ecx */ 907 case 0x52: /* push edx */ 908 case 0x53: /* push ebx */ 909 case 0x54: /* push esp */ 910 case 0x55: /* push ebp */ 911 case 0x56: /* push esi */ 912 case 0x57: /* push edi */ 913 case 0x58: /* pop eax */ 914 case 0x59: /* pop ecx */ 915 case 0x5a: /* pop edx */ 916 case 0x5b: /* pop ebx */ 885 917 case 0x06: /* push es */ 886 918 case 0x0e: /* push cs */ … … 917 949 case 0xbe: /* mov esi, imm32 */ 918 950 case 0xbf: /* mov edi, imm32 */ 951 case 0xe9: /* jmp rel32 */ 919 952 case 0x2d: /* sub eax, imm32 */ 920 953 case 0x35: /* xor eax, imm32 */ … … 1013 1046 else 1014 1047 { 1015 kprintf(("interpretFunctionProlog32: unknown prolog start. 0x%x 0x%x 0x%x 0x%x 0x%x \n",1016 pach[0], pach[1], pach[2], pach[3], pach[4] ));1048 kprintf(("interpretFunctionProlog32: unknown prolog start. 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n", 1049 pach[0], pach[1], pach[2], pach[3], pach[4], pach[5])); 1017 1050 cb = 0; 1018 1051 } … … 1181 1214 break; 1182 1215 1216 case 0x9a: /* call ptr16:16 */ 1217 cb += cb2 = 4; 1218 pach += cb2; 1219 break; 1183 1220 1184 1221 default: … … 1273 1310 #endif 1274 1311 1275 switch (aImportTab[i].fType & ~(EPT_BIT_MASK | EPT_NOT_REQ | EPT_WRAPPED ))1312 switch (aImportTab[i].fType & ~(EPT_BIT_MASK | EPT_NOT_REQ | EPT_WRAPPED | EPT_PROCIMPORTH)) 1276 1313 { 1277 1314 case EPT_PROC: … … 1552 1589 1553 1590 /* 1591 * 16-bit imported hybrid procedure. 1592 * This is called by issuing a far call to the 16-bit calltab entry. 1593 */ 1594 case EPT_PROCIMPORTH16: 1595 { 1596 cb = interpretFunctionProlog16((char*)aImportTab[i].ulAddress, FALSE); 1597 aImportTab[i].cbProlog = (char)cb; 1598 if (cb > 0) /* Since no prolog part is copied to the function table, it's ok as long as the prolog has been recognzied. */ 1599 { 1600 /* 1601 * Create far jump from calltab to original function. 1602 * 0xEA <four byte target address> <two byte target selector> 1603 */ 1604 pchCTEntry16[0] = 0xEA; /* jmp far ptr */ 1605 *(unsigned short*)(void*)&pchCTEntry16[1] = aImportTab[i].offObject; 1606 *(unsigned short*)(void*)&pchCTEntry16[3] = aImportTab[i].usSel; 1607 } 1608 else 1609 { /* !fatal! - this should never really happen... */ 1610 kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when importing it!\n", i)); 1611 Int3(); /* ipe - later! */ 1612 x86RestoreWriteProtect(flWP); 1613 return ERROR_D32_IPE | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG; 1614 } 1615 pchCTEntry16 += IMPORTH16_ENTRY; 1616 break; 1617 } 1618 1619 1620 /* 1554 1621 * 16/32-bit importe variable. 1555 1622 * This is used by accessing the 32-bit flat address in the callTab.
Note:
See TracChangeset
for help on using the changeset viewer.