Changeset 4010 for branches/GRACE/src
- Timestamp:
- Aug 14, 2000, 10:57:07 AM (25 years ago)
- Location:
- branches/GRACE/src/win32k
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GRACE/src/win32k/Makefile
r4005 r4010 1 1 ################################################################################ 2 # $Id: Makefile,v 1.43.4. 2 2000-08-13 09:23:54bird Exp $2 # $Id: Makefile,v 1.43.4.3 2000-08-14 08:57:02 bird Exp $ 3 3 # 4 4 # Win32k makefile. … … 659 659 dev32\*.c* pe2lx\*.c* k32\*.c* lib\*.c elf2lx\*.c* test\*.c* \ 660 660 $(WIN32KINCLUDE)\*.h 661 $(PDWIN32_TOOLS)\fastdep -a+ -objobj_tst -o$$(WIN32KOBJ) $(CINCLUDES) misc\*.c* ldr\*.c* \ 662 dev32\*.c* pe2lx\*.c* k32\*.c* lib\*.c elf2lx\*.c* test\*.c* 661 663 $(PDWIN32_TOOLS)\fastdep -a+ -o$$(WIN32KOBJ) $(CINCLUDES16) dev16\*.c* 662 664 $(PDWIN32_TOOLS)\fastdep -a+ -o$$(WIN32KOBJ) -I$(WIN32KINCLUDE) \ -
branches/GRACE/src/win32k/dev16/d16init.c
r4005 r4010 1 /* $Id: d16init.c,v 1.6.4. 2 2000-08-13 09:23:56bird Exp $1 /* $Id: d16init.c,v 1.6.4.3 2000-08-14 08:57:03 bird Exp $ 2 2 * 3 3 * d16init - init routines for both drivers. … … 249 249 if (TKSSBase16 != 0) 250 250 return NO_ERROR; 251 /* 251 252 _asm { 252 253 int 3; 253 254 } 255 */ 254 256 255 257 /* First we're to get the DosTable2 stuff. */ -
branches/GRACE/src/win32k/dev16/probkrnl.c
r4005 r4010 1 /* $Id: probkrnl.c,v 1.20.4. 2 2000-08-13 09:23:57bird Exp $1 /* $Id: probkrnl.c,v 1.20.4.3 2000-08-14 08:57:03 bird Exp $ 2 2 * 3 3 * Description: Autoprobes the os2krnl file and os2krnl[*].sym files. … … 69 69 #include "log.h" 70 70 #include "options.h" 71 71 #include "errors.h" 72 72 73 73 /******************************************************************************* … … 196 196 {ERROR_PROB_SYM_SEG_DEF_READ, "Sym: Failed to read a segment definition."}, 197 197 {ERROR_PROB_SYM_IMPORTS_NOTFOUND, "Sym: All the imports wasn't found."}, 198 {ERROR_PROB_SYM_V_PROC_NOT_FND, "Sym: Verify failed: Procedure not found."}, 199 {ERROR_PROB_SYM_V_OBJ_OR_ADDR, "Sym: Verify failed: Invalid object or address."}, 200 {ERROR_PROB_SYM_V_ADDRESS, "Sym: Verify failed: Invalid address."}, 201 {ERROR_PROB_SYM_V_PROLOG, "Sym: Verify failed: Invalid prolog."}, 202 {ERROR_PROB_SYM_V_NOT_IMPL, "Sym: Verify failed: Not implemented."}, 198 203 199 204 {ERROR_PROB_SYMDB_KRNL_NOT_FOUND, "SymDB: Kernel was not found."} … … 204 209 */ 205 210 #ifdef R3TST 206 USHORT usFakeVerMajor = 20;207 USHORT usFakeVerMinor = 45;211 USHORT usFakeVerMajor = 0; 212 USHORT usFakeVerMinor = 0; 208 213 #ifdef R3TST 209 214 static ach[11] = {0}; /* works around compiler/linker bug */ … … 642 647 rc = DosDevIOCtl("", "", D16_IOCTL_VERIFYIMPORTTAB, D16_IOCTL_CAT, hDev0); 643 648 DosClose(hDev0); 649 if (rc >= ERROR_D32_VERIFYIMPORTTAB_FIRST && rc < ERROR_D32_VERIFYIMPORTTAB_LAST) 650 rc += ERROR_PROB_SYM_VERIFY_FIRST - ERROR_D32_VERIFYIMPORTTAB_FIRST; 644 651 } 645 652 … … 1048 1055 printf16("0x%08lx%s", aImportTab[i].ulAddress, (i % 2) == 0 ? "" : "\n"); 1049 1056 else 1050 printf16("failed!%s", (i % 2) == 0 ? " " : "\n");1057 printf16("failed!%s", (i % 2) == 0 ? " " : "\n"); 1051 1058 } 1052 1059 if (i % 2) printf16("\n"); … … 1146 1153 options.usVerMinor = pGIS->uchMinorVersion; 1147 1154 #else 1155 if (usFakeVerMajor == 0) 1156 { 1157 usFakeVerMajor = pGIS->uchMajorVersion; 1158 usFakeVerMinor = pGIS->uchMinorVersion; 1159 } 1148 1160 options.usVerMajor = usFakeVerMajor; 1149 1161 options.usVerMinor = usFakeVerMinor; … … 1194 1206 ) 1195 1207 { 1208 #ifndef R3TST 1196 1209 /* search on disk */ 1197 1210 i = 0; … … 1200 1213 ) 1201 1214 i++; 1215 #endif 1202 1216 } 1203 1217 } … … 1646 1660 int i; 1647 1661 1648 printf16("/* $Id: probkrnl.c,v 1.20.4. 2 2000-08-13 09:23:57bird Exp $\n"1662 printf16("/* $Id: probkrnl.c,v 1.20.4.3 2000-08-14 08:57:03 bird Exp $\n" 1649 1663 "*\n" 1650 1664 "* Autogenerated kernel symbol database.\n" -
branches/GRACE/src/win32k/dev32/d32init.c
r3834 r4010 1 /* $Id: d32init.c,v 1.19.4. 1 2000-07-16 22:42:03bird Exp $1 /* $Id: d32init.c,v 1.19.4.2 2000-08-14 08:57:04 bird Exp $ 2 2 * 3 3 * d32init.c - 32-bits init routines. … … 44 44 #include "ldrCalls.h" 45 45 #include "macros.h" 46 #include "errors.h" 46 47 47 48 #ifdef R3TST … … 471 472 for (i = 0; i < 2 && pKrnlInfo->ulBuild == 0; i++) 472 473 { 473 #ifndef R3TST474 474 const char *psz = (const char*)pKrnlOTE[i].ote_base; 475 475 const char *pszEnd = psz + pKrnlOTE[i].ote_size - 50; /* Last possible search position. */ 476 #else477 extern const char *pszInternalRevision; /* defined in win32ktst.c */478 const char *psz = pszInternalRevision;479 const char *pszEnd = psz + 3;480 #endif481 476 482 477 while (psz < pszEnd) … … 524 519 525 520 /* Check if its a debug kernel (look for DEBUG at start of object 3-5) */ 526 #ifndef R3TST527 521 j = 3; 528 522 while (j < 5) … … 541 535 j++; 542 536 } 543 #else544 NOREF(j);545 #endif546 537 547 538 /* Display info */ … … 598 589 || ((bModRM & 0xc0) == 0 && (bModRM & 0x07) == 5)) /* ex. mov ebp,[0ff231234h] */ 599 590 { /* 32-bit displacement */ 600 return 5 ;591 return 5 + ((bModRM & 0x7) == 0x4); // + SIB 601 592 } 602 593 else if ((bModRM & 0xc0) == 0x40) /* ex. mov ecx,[esi]+4fh */ 603 594 { /* 8-bit displacement */ 604 return 2 ;595 return 2 + ((bModRM & 0x7) == 0x4); // + SIB 605 596 } 606 597 /* no displacement (only /r byte) */ … … 670 661 * push ebp 671 662 * or 663 * mov ecx, r/m32 664 * or 665 * jmp dword 666 * or 667 * sub esp, imm8 668 * or 672 669 * mov eax, msoff32 673 670 * 674 671 */ 675 if ((pach[0] == 0x55 && (pach[1] == 0x8b || pach[1] == 0xa1)) /* t wo first prologs */672 if ((pach[0] == 0x55 && (pach[1] == 0x8b || pach[1] == 0xa1)) /* the two first prologs */ 676 673 || 677 (pach[0] == 0xB8 && (pach[5] == 0xEB || pach[5] == 0x55 ) && !fOverload) /* two next prologs */ 674 (pach[0] == 0xB8 && (pach[5] == 0xEB || pach[5] == 0x55) && !fOverload) /* the two next prologs */ 675 || 676 (pach[0] == 0x8B && !fOverload) /* the next prolog */ 677 || 678 (pach[0] == 0xFF && !fOverload) /* the next prolog */ 679 || 680 (pach[0] == 0x83 && !fOverload) /* the next prolog */ 678 681 || 679 682 (pach[0] == 0xa1 && !fOverload) /* last prolog */ … … 762 765 case 0x8b: /* mov /r */ 763 766 case 0x8d: /* lea /r */ 764 if ((pach[1] & 0x7) == 4 && (pach[1] & 0xc0) != 0xc0) /* invalid instruction!?! */765 return -1;766 767 cb += cb2 = ModR_M_32bit(pach[1]); 767 768 pach += cb2; … … 801 802 break; 802 803 804 /* 805 * jmp /digit 806 */ 807 case 0xff: 808 cb += cb2 = 4 + ModR_M_32bit(pach[1]); /* 4 is the size of the imm32 */ 809 pach += cb2; 810 break; 811 803 812 default: 804 813 kprintf(("interpretFunctionProlog32: unknown instruction 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2])); … … 811 820 else 812 821 { 813 kprintf(("interpretFunctionProlog32: unknown prolog start. 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2])); 822 kprintf(("interpretFunctionProlog32: unknown prolog start. 0x%x 0x%x 0x%x 0x%x 0x%x\n", 823 pach[0], pach[1], pach[2], pach[3], pach[4])); 814 824 cb = 0; 815 825 } … … 947 957 else 948 958 { 949 kprintf(("interpretFunctionProlog 32: unknown instruction (-3) 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));959 kprintf(("interpretFunctionProlog16: unknown instruction (-3) 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2])); 950 960 return -3; 951 961 } … … 986 996 pulTKSSBase32 = (PULONG)_TKSSBase16; 987 997 988 #ifdef R3TST989 R3TstFixImportTab();990 #endif991 992 998 /* Check that pKrnlOTE is set */ 993 999 usRc = GetKernelInfo32(NULL); … … 1014 1020 } 1015 1021 1016 #ifndef R3TST1017 1022 /* Verify read/writeable. */ 1018 1023 if (_aImportTab[i].iObject >= pKrnlSMTE->smte_objcnt /* object index valid? */ … … 1032 1037 1033 1038 1034 1039 #ifndef R3TST 1035 1040 if (_aImportTab[i].ulAddress < 0xffe00000UL) 1036 1041 { … … 1039 1044 return STATUS_DONE | STERR | ERROR_D32_INVALID_ADDRESS; 1040 1045 } 1041 #endif1046 #endif 1042 1047 1043 1048 switch (_aImportTab[i].fType & ~EPT_BIT_MASK) … … 1066 1071 if (cb <= 0 || cb + cbmin >= MAXSIZE_PROLOG) 1067 1072 { /* failed, too small or too large. */ 1068 kprintf(("VerifyImportTab32: verify failed for procedure no.%d (c d=%d)\n", i, cb));1073 kprintf(("VerifyImportTab32: verify failed for procedure no.%d (cb=%d)\n", i, cb)); 1069 1074 return STATUS_DONE | STERR | ERROR_D32_TOO_INVALID_PROLOG; 1070 1075 } … … 1200 1205 else 1201 1206 { /* !fatal! - this could never happen really... */ 1202 kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when rehooking it!\n", i));1207 kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when rehooking it!\n", i)); 1203 1208 Int3(); /* ipe - later! */ 1204 1209 return ERROR_D32_VERIFY_FAILED; … … 1245 1250 else 1246 1251 { /* !fatal! - this could never happen really... */ 1247 kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when rehooking it!\n", i));1252 kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when rehooking it!\n", i)); 1248 1253 Int3(); /* ipe - later! */ 1249 1254 return ERROR_D32_VERIFY_FAILED; … … 1273 1278 else 1274 1279 { /* !fatal! - this should never really happen... */ 1275 kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when importing it!\n", i));1280 kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when importing it!\n", i)); 1276 1281 Int3(); /* ipe - later! */ 1277 1282 return ERROR_D32_VERIFY_FAILED; … … 1301 1306 else 1302 1307 { /* !fatal! - this should never really happen... */ 1303 kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when importing it!\n", i));1308 kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when importing it!\n", i)); 1304 1309 Int3(); /* ipe - later! */ 1305 1310 return ERROR_D32_VERIFY_FAILED; … … 1350 1355 static MTE KrnlMTE; 1351 1356 static SMTE KrnlSMTE; 1352 static OTE aKrnlOTE[17];1353 1354 extern int cObjectsFake; /* defined in win32ktst.c */1355 1357 1356 1358 KrnlMTE.mte_swapmte = &KrnlSMTE; 1357 1359 KrnlSMTE.smte_objtab = &aKrnlOTE[0]; 1358 1360 KrnlSMTE.smte_objcnt = cObjectsFake; 1359 1360 aKrnlOTE[0].ote_size = 0x00000FB4;1361 aKrnlOTE[0].ote_base = 0xffe10000;1362 aKrnlOTE[0].ote_flags = 0x80001063;1363 aKrnlOTE[0].ote_pagemap = 1;1364 aKrnlOTE[0].ote_mapsize = 1;1365 aKrnlOTE[0].ote_sel = 0;1366 aKrnlOTE[0].ote_hob = 0;1367 1368 aKrnlOTE[1].ote_size = 0x0000A7CD;1369 aKrnlOTE[1].ote_base = 0xffe20000;1370 aKrnlOTE[1].ote_flags = 0x80001063;1371 aKrnlOTE[1].ote_pagemap = 0x00000002;1372 aKrnlOTE[1].ote_mapsize = 0x0000000B;1373 aKrnlOTE[1].ote_sel = 0x0;1374 aKrnlOTE[1].ote_hob = 0x0;1375 1376 aKrnlOTE[2].ote_size = 0x000084C9;1377 aKrnlOTE[2].ote_base = 0xffe30000;1378 aKrnlOTE[2].ote_flags = 0x80001045;1379 aKrnlOTE[2].ote_pagemap = 0x0000000D;1380 aKrnlOTE[2].ote_mapsize = 0x00000009;1381 aKrnlOTE[2].ote_sel = 0x0;1382 aKrnlOTE[2].ote_hob = 0x0;1383 1384 aKrnlOTE[3].ote_size = 0x00010000;1385 aKrnlOTE[3].ote_base = 0xffe40000;1386 aKrnlOTE[3].ote_flags = 0x800090A3;1387 aKrnlOTE[3].ote_pagemap = 0x00000016;1388 aKrnlOTE[3].ote_mapsize = 0x00000010;1389 aKrnlOTE[3].ote_sel = 0x0;1390 aKrnlOTE[3].ote_hob = 0x0;1391 1392 aKrnlOTE[4].ote_size = 0x00002A80;1393 aKrnlOTE[4].ote_base = 0xffe50000;1394 aKrnlOTE[4].ote_flags = 0x80009023;1395 aKrnlOTE[4].ote_pagemap = 0x00000026;1396 aKrnlOTE[4].ote_mapsize = 0x00000003;1397 aKrnlOTE[4].ote_sel = 0x0;1398 aKrnlOTE[4].ote_hob = 0x0;1399 1400 aKrnlOTE[5].ote_size = 0x00005734;1401 aKrnlOTE[5].ote_base = 0xffe60000;1402 aKrnlOTE[5].ote_flags = 0x80001023;1403 aKrnlOTE[5].ote_pagemap = 0x00000029;1404 aKrnlOTE[5].ote_mapsize = 0x00000003;1405 aKrnlOTE[5].ote_sel = 0x0;1406 aKrnlOTE[5].ote_hob = 0x0;1407 1408 aKrnlOTE[6].ote_size = 0x00002833;1409 aKrnlOTE[6].ote_base = 0xffe70000;1410 aKrnlOTE[6].ote_flags = 0x80001015;1411 aKrnlOTE[6].ote_pagemap = 0x0000002C;1412 aKrnlOTE[6].ote_mapsize = 0x00000003;1413 aKrnlOTE[6].ote_sel = 0x0;1414 aKrnlOTE[6].ote_hob = 0x0;1415 1416 aKrnlOTE[7].ote_size = 0x000001B0;1417 aKrnlOTE[7].ote_base = 0xffe80000;1418 aKrnlOTE[7].ote_flags = 0x80002213;1419 aKrnlOTE[7].ote_pagemap = 0x0000002F;1420 aKrnlOTE[7].ote_mapsize = 0x00000001;1421 aKrnlOTE[7].ote_sel = 0x0;1422 aKrnlOTE[7].ote_hob = 0x0;1423 1424 aKrnlOTE[8].ote_size = 0x000027CC;1425 aKrnlOTE[8].ote_base = 0xffe90000;1426 aKrnlOTE[8].ote_flags = 0x80002013;1427 aKrnlOTE[8].ote_pagemap = 0x00000030;1428 aKrnlOTE[8].ote_mapsize = 0x00000003;1429 aKrnlOTE[8].ote_sel = 0x0;1430 aKrnlOTE[8].ote_hob = 0x0;1431 1432 aKrnlOTE[9].ote_size = 0x0000FDA8;1433 aKrnlOTE[9].ote_base = 0xffeA0000;1434 aKrnlOTE[9].ote_flags = 0x80002033;1435 aKrnlOTE[9].ote_pagemap = 0x00000033;1436 aKrnlOTE[9].ote_mapsize = 0x0000000D;1437 aKrnlOTE[9].ote_sel = 0x0;1438 aKrnlOTE[9].ote_hob = 0x0;1439 1440 aKrnlOTE[10].ote_size = 0x0000ECD6;1441 aKrnlOTE[10].ote_base = 0xffeB0000;1442 aKrnlOTE[10].ote_flags = 0x80001015;1443 aKrnlOTE[10].ote_pagemap = 0x00000040;1444 aKrnlOTE[10].ote_mapsize = 0x0000000F;1445 aKrnlOTE[10].ote_sel = 0x0;1446 aKrnlOTE[10].ote_hob = 0x0;1447 1448 aKrnlOTE[11].ote_size = 0x0000EAF4;1449 aKrnlOTE[11].ote_base = 0xffeC0000;1450 aKrnlOTE[11].ote_flags = 0x80001015;1451 aKrnlOTE[11].ote_pagemap = 0x0000004F;1452 aKrnlOTE[11].ote_mapsize = 0x0000000F;1453 aKrnlOTE[11].ote_sel = 0x0;1454 aKrnlOTE[11].ote_hob = 0x0;1455 1456 aKrnlOTE[12].ote_size = 0x0000D900;1457 aKrnlOTE[12].ote_base = 0xffeD0000;1458 aKrnlOTE[12].ote_flags = 0x80001015;1459 aKrnlOTE[12].ote_pagemap = 0x0000005E;1460 aKrnlOTE[12].ote_mapsize = 0x0000000E;1461 aKrnlOTE[12].ote_sel = 0x0;1462 aKrnlOTE[12].ote_hob = 0x0;1463 1464 aKrnlOTE[13].ote_size = 0x0000D6DC;1465 aKrnlOTE[13].ote_base = 0xffeE0000;1466 aKrnlOTE[13].ote_flags = 0x80001015;1467 aKrnlOTE[13].ote_pagemap = 0x0000006C;1468 aKrnlOTE[13].ote_mapsize = 0x0000000E;1469 aKrnlOTE[13].ote_sel = 0x0;1470 aKrnlOTE[13].ote_hob = 0x0;1471 1472 aKrnlOTE[14].ote_size = 0x000B684B;1473 aKrnlOTE[14].ote_base = 0xffeF0000;1474 aKrnlOTE[14].ote_flags = 0x80002015;1475 aKrnlOTE[14].ote_pagemap = 0x0000007A;1476 aKrnlOTE[14].ote_mapsize = 0x000000B7;1477 aKrnlOTE[14].ote_sel = 0x0;1478 aKrnlOTE[14].ote_hob = 0x0;1479 1480 aKrnlOTE[15].ote_size = 0x000B684B;1481 aKrnlOTE[15].ote_base = 0xffeF0000;1482 aKrnlOTE[15].ote_flags = 0x80002015;1483 aKrnlOTE[15].ote_pagemap = 0x0000007A;1484 aKrnlOTE[15].ote_mapsize = 0x000000B7;1485 aKrnlOTE[15].ote_sel = 0x0;1486 aKrnlOTE[15].ote_hob = 0x0;1487 1488 aKrnlOTE[16].ote_size = 0x000B684B;1489 aKrnlOTE[16].ote_base = 0xffeF0000;1490 aKrnlOTE[16].ote_flags = 0x80002015;1491 aKrnlOTE[16].ote_pagemap = 0x0000007A;1492 aKrnlOTE[16].ote_mapsize = 0x000000B7;1493 aKrnlOTE[16].ote_sel = 0x0;1494 aKrnlOTE[16].ote_hob = 0x0;1495 1361 1496 1362 return &KrnlMTE; -
branches/GRACE/src/win32k/include/probkrnl.h
r3834 r4010 1 /* $Id: probkrnl.h,v 1.13.4. 1 2000-07-16 22:43:33bird Exp $1 /* $Id: probkrnl.h,v 1.13.4.2 2000-08-14 08:57:07 bird Exp $ 2 2 * 3 3 * Include file for ProbKrnl. … … 48 48 #define TYPE_W4 0x02 /* Warp4 fp13 and above. */ 49 49 #endif 50 51 /*52 * Probkrnl error codes. (They all begin with ERROR_PROB_.)53 *54 * NOTE! ERROR_PROB_KRNL_* < ERROR_PROB_SYM_* < ERROR_PROB_SYMDB_*55 */56 #define ERROR_PROB_BASE 1000057 #define ERROR_PROB_KRNL_FIRST ERROR_PROB_KRNL_OPEN_FAILED58 #define ERROR_PROB_KRNL_LAST ERROR_PROB_KRNL_OTE_READ59 #define ERROR_PROB_KRNL_OPEN_FAILED (ERROR_PROB_BASE + 0)60 #define ERROR_PROB_KRNL_SEEK_SIZE (ERROR_PROB_BASE + 2)61 #define ERROR_PROB_KRNL_SEEK_FIRST (ERROR_PROB_BASE + 3)62 #define ERROR_PROB_KRNL_READ_FIRST (ERROR_PROB_BASE + 4)63 #define ERROR_PROB_KRNL_READ_NEXT (ERROR_PROB_BASE + 5)64 #define ERROR_PROB_KRNL_TAG_NOT_FOUND (ERROR_PROB_BASE + 6)65 #define ERROR_PROB_KRNL_INV_SIGANTURE (ERROR_PROB_BASE + 7)66 #define ERROR_PROB_KRNL_INV_BUILD_NBR (ERROR_PROB_BASE + 8)67 #define ERROR_PROB_KRNL_BUILD_VERSION (ERROR_PROB_BASE + 9)68 #define ERROR_PROB_KRNL_MZ_SEEK (ERROR_PROB_BASE + 10)69 #define ERROR_PROB_KRNL_MZ_READ (ERROR_PROB_BASE + 11)70 #define ERROR_PROB_KRNL_NEOFF_INVALID (ERROR_PROB_BASE + 12)71 #define ERROR_PROB_KRNL_NEOFF_SEEK (ERROR_PROB_BASE + 13)72 #define ERROR_PROB_KRNL_LX_READ (ERROR_PROB_BASE + 14)73 #define ERROR_PROB_KRNL_LX_SIGNATURE (ERROR_PROB_BASE + 15)74 #define ERROR_PROB_KRNL_OBJECT_CNT (ERROR_PROB_BASE + 16)75 #define ERROR_PROB_KRNL_OBJECT_CNR_10 (ERROR_PROB_BASE + 17)76 #define ERROR_PROB_KRNL_OTE_SEEK (ERROR_PROB_BASE + 18)77 #define ERROR_PROB_KRNL_OTE_READ (ERROR_PROB_BASE + 19)78 #define ERROR_PROB_KRNL_OTE_SIZE_MIS (ERROR_PROB_BASE + 20)79 80 #define ERROR_PROB_SYM_FIRST ERROR_PROB_SYM_FILE_NOT_FOUND81 #define ERROR_PROB_SYM_LAST ERROR_PROB_SYM_IMPORTS_NOTFOUND82 #define ERROR_PROB_SYM_FILE_NOT_FOUND (ERROR_PROB_BASE + 30)83 #define ERROR_PROB_SYM_READERROR (ERROR_PROB_BASE + 31)84 #define ERROR_PROB_SYM_INVALID_MOD_NAME (ERROR_PROB_BASE + 32)85 #define ERROR_PROB_SYM_SEGS_NE_OBJS (ERROR_PROB_BASE + 33)86 #define ERROR_PROB_SYM_SEG_DEF_SEEK (ERROR_PROB_BASE + 34)87 #define ERROR_PROB_SYM_SEG_DEF_READ (ERROR_PROB_BASE + 35)88 /* - reserved for future errors - *89 #define ERROR_PROB_SYM_ (ERROR_PROB_BASE + 36)90 #define ERROR_PROB_SYM_ (ERROR_PROB_BASE + 37)91 #define ERROR_PROB_SYM_ (ERROR_PROB_BASE + 38) */92 #define ERROR_PROB_SYM_IMPORTS_NOTFOUND (ERROR_PROB_BASE + 39)93 94 #define ERROR_PROB_SYMDB_KRNL_NOT_FOUND (ERROR_PROB_BASE + 40)95 96 50 97 51 -
branches/GRACE/src/win32k/include/test.h
r3829 r4010 1 /* $Id: test.h,v 1.1 2000-07-16 22:17:13bird Exp $1 /* $Id: test.h,v 1.1.4.1 2000-08-14 08:57:07 bird Exp $ 2 2 * 3 3 * Definitions and declarations for test moduls. … … 113 113 114 114 #ifdef INCL_16 115 extern USHORT usFakeVerMajor;/* define in probkrnl.c */116 extern USHORT usFakeVerMinor;/* define in probkrnl.c */115 extern USHORT usFakeVerMajor; /* define in probkrnl.c */ 116 extern USHORT usFakeVerMinor; /* define in probkrnl.c */ 117 117 #else 118 extern USHORT _usFakeVerMajor;119 extern USHORT _usFakeVerMinor;118 extern USHORT _usFakeVerMajor; 119 extern USHORT _usFakeVerMinor; 120 120 #endif 121 121 122 extern const char *pszInternalRevision; /* defined in win32ktst.c */ 122 #ifdef _OS2Krnl_h_ 123 extern int cObjectsFake; /* defined in win32ktst.c */ 124 extern OTE aKrnlOTE[24]; /* defined in win32ktst.c */ 125 #endif 123 126 124 127 #ifdef __cplusplus -
branches/GRACE/src/win32k/test/win32ktst.c
r3984 r4010 1 /* $Id: win32ktst.c,v 1.1.4. 1 2000-08-11 02:22:35bird Exp $1 /* $Id: win32ktst.c,v 1.1.4.2 2000-08-14 08:57:07 bird Exp $ 2 2 * 3 3 * Win32k test module. … … 26 26 (PVOID)( ( (((unsigned)(flataddr) << 3) & 0xfff80000) | (SEL_LDT_RPL3 << 16) ) | ((unsigned)(flataddr) & 0xffff) ) 27 27 28 #define DWORD ULONG 29 #define WORD USHORT 30 28 31 /******************************************************************************* 29 32 * Internal Functions * 30 33 *******************************************************************************/ 31 34 #include <os2.h> 35 #include <exe386.h> 32 36 33 37 #include "malloc.h" … … 133 137 */ 134 138 135 136 139 /******************************************************************************* 137 * Internal Functions*140 * Structures and Typedefs * 138 141 *******************************************************************************/ 139 void syntax(void); 140 void workersinit(void); 141 void initRPInit(RP32INIT *pRpInit, char *pszInitArgs); 142 int tests(int iTest, int argc, char **argv); 143 int TestCase1(void); 144 int TestCase2(void); 145 int TestCase3(void); 146 int TestCase4(void); 147 int TestCase5(void); 148 int CompareOptions(struct options *pOpt); 149 int TestCaseExeLoad1(void); 142 #ifndef QS_MTE 143 /* From OS/2 Toolkit v4.5 (BSEDOS.H) */ 144 145 /* Global Record structure 146 * Holds all global system information. Placed first in user buffer 147 */ 148 typedef struct qsGrec_s { /* qsGrec */ 149 ULONG cThrds; 150 ULONG c32SSem; 151 ULONG cMFTNodes; 152 }qsGrec_t; 153 154 /* 155 * System wide MTE information 156 * ________________________________ 157 * | pNextRec |----| 158 * |-------------------------------| | 159 * | hmte | | 160 * |-------------------------------| | 161 * | ctImpMod | | 162 * |-------------------------------| | 163 * | ctObj | | 164 * |-------------------------------| | 165 * | pObjInfo |----|----------| 166 * |-------------------------------| | | 167 * | pName |----|----| | 168 * |-------------------------------| | | | 169 * | imported module handles | | | | 170 * | . | | | | 171 * | . | | | | 172 * | . | | | | 173 * |-------------------------------| <--|----| | 174 * | "pathname" | | | 175 * |-------------------------------| <--|----------| 176 * | Object records | | 177 * | (if requested) | | 178 * |_______________________________| | 179 * <----- 180 * NOTE that if the level bit is set to QS_MTE, the base Lib record will be followed 181 * by a series of object records (qsLObj_t); one for each object of the 182 * module. 183 */ 184 185 typedef struct qsLObjrec_s { /* qsLOrec */ 186 ULONG oaddr; /* object address */ 187 ULONG osize; /* object size */ 188 ULONG oflags; /* object flags */ 189 } qsLObjrec_t; 190 191 typedef struct qsLrec_s { /* qsLrec */ 192 void FAR *pNextRec; /* pointer to next record in buffer */ 193 USHORT hmte; /* handle for this mte */ 194 USHORT fFlat; /* true if 32 bit module */ 195 ULONG ctImpMod; /* # of imported modules in table */ 196 ULONG ctObj; /* # of objects in module (mte_objcnt)*/ 197 qsLObjrec_t FAR *pObjInfo; /* pointer to per object info if any */ 198 UCHAR FAR *pName; /* -> name string following struc */ 199 } qsLrec_t; 200 201 202 203 /* Pointer Record Structure 204 * This structure is the first in the user buffer. 205 * It contains pointers to heads of record types that are loaded 206 * into the buffer. 207 */ 208 209 typedef struct qsPtrRec_s { /* qsPRec */ 210 qsGrec_t *pGlobalRec; 211 void *pProcRec; /* ptr to head of process records */ 212 void *p16SemRec; /* ptr to head of 16 bit sem recds */ 213 void *p32SemRec; /* ptr to head of 32 bit sem recds */ 214 void *pMemRec; /* ptr to head of shared mem recs */ 215 qsLrec_t *pLibRec; /* ptr to head of mte records */ 216 void *pShrMemRec; /* ptr to head of shared mem records */ 217 void *pFSRec; /* ptr to head of file sys records */ 218 } qsPtrRec_t; 219 220 #endif 150 221 151 222 … … 156 227 const char * pszInternalRevision = "\r\nInternal revision 14.040_W4"; 157 228 int cObjectsFake = 14; 158 229 OTE aKrnlOTE[24]; 230 231 232 /******************************************************************************* 233 * External Functions * 234 *******************************************************************************/ 235 #ifndef QS_MTE 236 /* from OS/2 Toolkit v4.5 */ 237 238 APIRET APIENTRY DosQuerySysState(ULONG EntityList, ULONG EntityLevel, PID pid, 239 TID tid, PVOID pDataBuf, ULONG cbBuf); 240 #define QS_MTE 0x0004 241 #endif 242 243 /******************************************************************************* 244 * Internal Functions * 245 *******************************************************************************/ 246 void syntax(void); 247 int kernelInit(int iTest, int argc, char **argv); 248 void workersinit(void); 249 void initRPInit(RP32INIT *pRpInit, char *pszInitArgs); 250 int tests(int iTest, int argc, char **argv); 251 int TestCase1(int argc, char **argv); 252 int TestCase2(void); 253 int TestCase3(void); 254 int TestCase4(void); 255 int TestCase5(void); 256 int TestCase6(void); 257 int CompareOptions(struct options *pOpt); 258 int TestCaseExeLoad2(void); 159 259 160 260 … … 188 288 workersinit(); 189 289 290 /* 291 * Init Kernel 292 */ 293 if (!kernelInit(iTest, argc, argv)) 294 return -2; 190 295 191 296 /* … … 227 332 } 228 333 334 335 /** 336 * test case 1: Load the specified kernel 337 * other cases: Load running kernel. 338 * @returns Success indicator. (true/false) 339 * @param iTest Testcase number. 340 * @param argc main argc 341 * @param argv main argv 342 * @status completely implemented. 343 * @author knut st. osmundsen (knut.stange.osmundsen@pmsc.no) 344 */ 345 int kernelInit(int iTest, int argc, char **argv) 346 { 347 static char achBuffer[1024*256]; 348 char szError[256]; 349 HMODULE hmod = NULLHANDLE; 350 int rc; 351 char szName[CCHMAXPATH]; 352 char * pszSrcName; 353 char * pszTmp; 354 ULONG ulAction; 355 HFILE hFile; 356 struct e32_exe* pe32 = (struct e32_exe*)(void*)&achBuffer[0]; 357 qsPtrRec_t * pPtrRec = (qsPtrRec_t*)(void*)&achBuffer[0]; 358 qsLrec_t * pLrec; 359 int i; 360 FILESTATUS3 fsts3; 361 362 /* 363 * If not testcase 1, use the running kernel. 364 */ 365 if (iTest != 1) 366 { 367 ULONG ulBootDrv = 3; 368 pszSrcName = "c:\\os2krnl"; 369 DosQuerySysInfo(QSV_BOOT_DRIVE, QSV_BOOT_DRIVE, SSToDS(&ulBootDrv), sizeof(ulBootDrv)); 370 pszSrcName[0] = (char)(ulBootDrv + 'a' - 1); 371 } 372 else 373 { 374 if (argc < 3) 375 { 376 printf("Missing parameter!\n"); 377 return FALSE; 378 } 379 pszSrcName = argv[2]; 380 } 381 382 /* 383 * Make a temporary copy of the kernel. 384 */ 385 if (DosScanEnv("TMP", &pszTmp) != NO_ERROR || pszTmp == NULL) 386 { 387 printf("Environment variable TMP is not set.\n"); 388 return FALSE; 389 } 390 strcpy(szName, pszTmp); 391 if (szName[strlen(pszTmp) - 1] != '\\' && szName[strlen(pszTmp) - 1] != '/') 392 strcat(szName, "\\"); 393 strcat(szName, "os2krnl"); 394 rc = DosCopy(pszSrcName, szName, DCPY_EXISTING); 395 if (rc != NO_ERROR) 396 { 397 printf("Failed to copy %s to %s.\n", pszSrcName, szName); 398 return FALSE; 399 } 400 if (DosQueryPathInfo(szName, FIL_STANDARD, &fsts3, sizeof(fsts3)) != NO_ERROR 401 || !(fsts3.attrFile = FILE_ARCHIVED) 402 || DosSetPathInfo(szName, FIL_STANDARD, &fsts3, sizeof(fsts3), 0) != NO_ERROR 403 ) 404 { 405 printf("Failed to set attributes for %s.\n", szName); 406 return FALSE; 407 } 408 409 /* 410 * Patch the kernel. 411 * Remove the entrypoint. 412 */ 413 ulAction = 0; 414 rc = DosOpen(szName, &hFile, &ulAction, 0, FILE_NORMAL, 415 OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS, 416 OPEN_SHARE_DENYNONE | OPEN_ACCESS_READWRITE, 417 NULL); 418 if (rc != NO_ERROR) 419 { 420 printf("Failed to open temporary kernel file. rc = %d\n", rc); 421 return FALSE; 422 } 423 rc = DosRead(hFile, &achBuffer[0], 0x200, &ulAction); 424 if (rc != NO_ERROR) 425 { 426 DosClose(hFile); 427 printf("Failed to read LX header from temporary kernel file.\n"); 428 return FALSE; 429 } 430 pe32 = (struct e32_exe*)(void*)&achBuffer[*(unsigned long*)(void*)&achBuffer[0x3c]]; 431 if (*(PUSHORT)pe32->e32_magic != E32MAGIC) 432 { 433 DosClose(hFile); 434 printf("Failed to read LX header from temporary kernel file (2).\n"); 435 return FALSE; 436 } 437 pe32->e32_eip = 0; 438 pe32->e32_startobj = 0; 439 pe32->e32_mflags &= ~(E32LIBTERM | E32LIBINIT); 440 if ((rc = DosSetFilePtr(hFile, *(unsigned long*)(void*)&achBuffer[0x3c], FILE_BEGIN, &ulAction)) != NO_ERROR 441 || (rc = DosWrite(hFile, pe32, sizeof(struct e32_exe), &ulAction)) != NO_ERROR) 442 { 443 DosClose(hFile); 444 printf("Failed to write patched LX header to temporary kernel file.\n"); 445 return FALSE; 446 } 447 DosClose(hFile); 448 449 /* 450 * Load the module. 451 */ 452 rc = DosLoadModule(szError, sizeof(szError), szName, SSToDS(&hmod)); 453 if (rc != NO_ERROR && (rc != ERROR_INVALID_PARAMETER && hmod == NULLHANDLE)) 454 { 455 printf("Failed to load OS/2 kernel image %s."); 456 return FALSE; 457 } 458 459 /* 460 * Get object information. 461 */ 462 rc = DosQuerySysState(QS_MTE, QS_MTE, 0L, 0L, pPtrRec, sizeof(achBuffer)); 463 if (rc != NO_ERROR) 464 { 465 printf("DosQuerySysState failed with rc=%d.\n", rc); 466 return FALSE; 467 } 468 469 pLrec = pPtrRec->pLibRec; 470 while (pLrec != NULL) 471 { 472 /* 473 * Bug detected in OS/2 FP13. Probably a problem which occurs 474 * in _LDRSysMteInfo when qsCheckCache is calle before writing 475 * object info. The result is that the cache flushed and the 476 * attempt of updating the qsLrec_t next and object pointer is 477 * not done. This used to work earlier and on Aurora AFAIK. 478 * 479 * The fix for this problem is to check if the pObjInfo is NULL 480 * while the number of objects isn't 0 and correct this. pNextRec 481 * will also be NULL at this time. This will be have to corrected 482 * before we exit the loop or moves to the next record. 483 * There is also a nasty alignment of the object info... Hope 484 * I got it right. (This aligment seems new to FP13.) 485 */ 486 if (pLrec->pObjInfo == NULL /*&& pLrec->pNextRec == NULL*/ && pLrec->ctObj > 0) 487 { 488 pLrec->pObjInfo = (qsLObjrec_t*)(void*)( 489 (char*)(void*)pLrec 490 + ((sizeof(qsLrec_t) /* size of the lib record */ 491 + pLrec->ctImpMod * sizeof(short) /* size of the array of imported modules */ 492 + strlen((char*)(void*)pLrec->pName) + 1 /* size of the filename */ 493 + 3) & ~3)); /* the size is align on 4 bytes boundrary */ 494 pLrec->pNextRec = (qsLrec_t*)(void*)((char*)(void*)pLrec->pObjInfo 495 + sizeof(qsLObjrec_t) * pLrec->ctObj); 496 } 497 if (pLrec->hmte == hmod) 498 break; 499 500 /* 501 * Next record 502 */ 503 pLrec = (qsLrec_t*)pLrec->pNextRec; 504 } 505 506 if (pLrec == NULL) 507 { 508 printf("DosQuerySysState(os2krnl): not found\n"); 509 return FALSE; 510 } 511 if (pLrec->pObjInfo == NULL) 512 { 513 printf("DosQuerySysState(os2krnl): no object info\n"); 514 return FALSE; 515 } 516 517 /* 518 * Fill the aKrnlOTE array. 519 */ 520 for (i = 0; i < pLrec->ctObj; i++) 521 { 522 aKrnlOTE[i].ote_size = pLrec->pObjInfo[i].osize; 523 aKrnlOTE[i].ote_base = pLrec->pObjInfo[i].oaddr; 524 aKrnlOTE[i].ote_flags = pLrec->pObjInfo[i].oflags; 525 aKrnlOTE[i].ote_pagemap = i > 0 ? aKrnlOTE[i-1].ote_pagemap + aKrnlOTE[i-1].ote_mapsize : 0; 526 aKrnlOTE[i].ote_mapsize = (pLrec->pObjInfo[i].osize + 0x0FFF) / 0x1000; 527 aKrnlOTE[i].ote_sel = (USHORT)FlatToSel(pLrec->pObjInfo[i].oaddr); 528 aKrnlOTE[i].ote_hob = 0; 529 } 530 cObjectsFake = pLrec->ctObj; 531 532 return TRUE; 533 } 229 534 230 535 /** … … 275 580 switch (iTest) 276 581 { 277 case 1: rc = TestCase1( ); break;582 case 1: rc = TestCase1(argc, argv); break; 278 583 case 2: rc = TestCase2(); break; 279 case 3: rc = TestCase3(); break;280 case 4: rc = TestCase4(); break;281 case 5: rc = TestCase5(); break;282 584 283 585 default: … … 296 598 /** 297 599 * Test case 1. 298 * Checks that default initiation works fine for Aurora SMP kernels. 600 * Checks that default initiation works fine for a given kernel. 601 * 602 * Syntax: win32ktst.exe 1 <os2krnl> <majorver> <minorver> <build> <kerneltype: S|U|4> [os2krnl.sym] 299 603 * 300 604 * @sketch Create init packet with no arguments. … … 307 611 * @author knut st. osmundsen (knut.stange.osmundsen@pmsc.no) 308 612 */ 309 int TestCase1(void) 310 { 613 int TestCase1(int argc, char **argv) 614 { 615 static char szInitArgs[CCHMAXPATH + 10]; 311 616 int rc = 1; 312 617 RP32INIT rpinit; 313 618 619 /* verify argument count */ 620 if (argc < 7 || argc > 8) 621 { 622 printf("Invalid parameter count for testcase 1.\n"); 623 return ERROR_INVALID_PARAMETER; 624 } 625 314 626 /* init fake variabels */ 315 pszInternalRevision ="\r\nInternal revision 14.040_SMP"; 316 cObjectsFake = 15; 317 _usFakeVerMajor = 20; 318 _usFakeVerMinor = 45; 627 _usFakeVerMajor = (USHORT)atoi(argv[3]); 628 _usFakeVerMinor = (USHORT)atoi(argv[4]); 629 630 /* make init string */ 631 strcpy(szInitArgs, "-w3"); 632 if (argc >= 8) 633 strcat(strcat(szInitArgs, " -S:"), argv[7]); 319 634 320 635 /* $elf */ 321 initRPInit(SSToDS(&rpinit), "-w3");636 initRPInit(SSToDS(&rpinit), szInitArgs); 322 637 rc = InitElf(&rpinit); /* no SSToDS! */ 323 638 printf("InitElf returned status=0x%04x\n", rpinit.rph.Status); … … 325 640 { 326 641 /* $win32k */ 327 initRPInit(SSToDS(&rpinit), "-w3");642 initRPInit(SSToDS(&rpinit), szInitArgs); 328 643 rc = InitWin32k(&rpinit); /* no SSToDS! */ 329 644 printf("InitWin32k returned status=0x%04x\n", rpinit.rph.Status); … … 331 646 { 332 647 struct options opt = DEFAULT_OPTION_ASSIGMENTS; 333 opt.fKernel = KF_SMP;334 opt.ulBuild = 14040;335 opt.usVerMajor = 20;336 opt.usVerMinor = 45;337 648 opt.ulInfoLevel = 3; 649 opt.fKernel = argv[6][0] == 'S' ? KF_SMP : (argv[6][0] == '4' ? KF_W4 : KF_UNI); 650 opt.ulBuild = atoi(argv[5]); 651 opt.usVerMajor = (USHORT)atoi(argv[3]); 652 opt.usVerMinor = (USHORT)atoi(argv[4]); 338 653 339 654 rc = CompareOptions(SSToDS(&opt)); 340 if (rc == NO_ERROR)341 {342 rc = TestCaseExeLoad1();343 }344 655 } 345 656 else … … 352 663 } 353 664 354 355 665 /** 356 666 * Test case 2. 357 * Checks that default initiation works fine for Aurora UNI kernels.667 * Checks that all parameters are read correctly (1). 358 668 * 359 669 * @sketch Create init packet with no arguments. … … 370 680 int rc = 1; 371 681 RP32INIT rpinit; 372 373 /* init fake variabels */374 pszInternalRevision ="\r\nInternal revision 14.040_UNI";375 cObjectsFake = 14;376 _usFakeVerMajor = 20;377 _usFakeVerMinor = 45;378 379 /* $elf */380 initRPInit(SSToDS(&rpinit), "");381 rc = InitElf(&rpinit); /* no SSToDS! */382 printf("InitElf returned status=0x%04x\n", rpinit.rph.Status);383 if ((rpinit.rph.Status & (STDON | STERR)) == STDON)384 {385 /* $win32k */386 initRPInit(SSToDS(&rpinit), "");387 rc = InitWin32k(&rpinit); /* no SSToDS! */388 printf("InitWin32k returned status=0x%04x\n", rpinit.rph.Status);389 if ((rpinit.rph.Status & (STDON | STERR)) == STDON)390 {391 struct options opt = DEFAULT_OPTION_ASSIGMENTS;392 opt.fKernel = KF_UNI;393 opt.ulBuild = 14040;394 opt.usVerMajor = 20;395 opt.usVerMinor = 45;396 397 rc = CompareOptions(SSToDS(&opt));398 }399 else400 printf("!failed!\n");401 }402 else403 printf("!failed!\n");404 405 return rc;406 }407 408 409 /**410 * Test case 3.411 * Checks that default initiation works fine for Warp FP13 kernel.412 *413 * @sketch Create init packet with no arguments.414 * Initiate elf$415 * Create init packet with no arguments.416 * Initiate win32k$417 * @returns 0 on success.418 * 1 on failure.419 * @status completely implemented.420 * @author knut st. osmundsen (knut.stange.osmundsen@pmsc.no)421 */422 int TestCase3(void)423 {424 int rc = 1;425 RP32INIT rpinit;426 427 /* init fake variabels */428 pszInternalRevision ="\r\nInternal revision 14.040_W4";429 cObjectsFake = 14;430 _usFakeVerMajor = 20;431 _usFakeVerMinor = 45;432 433 /* $elf */434 initRPInit(SSToDS(&rpinit), "");435 rc = InitElf(&rpinit); /* no SSToDS! */436 printf("InitElf returned status=0x%04x\n", rpinit.rph.Status);437 if ((rpinit.rph.Status & (STDON | STERR)) == STDON)438 {439 /* $win32k */440 initRPInit(SSToDS(&rpinit), "");441 rc = InitWin32k(&rpinit); /* no SSToDS! */442 printf("InitWin32k returned status=0x%04x\n", rpinit.rph.Status);443 if ((rpinit.rph.Status & (STDON | STERR)) == STDON)444 {445 struct options opt = DEFAULT_OPTION_ASSIGMENTS;446 opt.fKernel = KF_UNI | KF_W4;447 opt.ulBuild = 14040;448 opt.usVerMajor = 20;449 opt.usVerMinor = 45;450 451 rc = CompareOptions(SSToDS(&opt));452 }453 else454 printf("!failed!\n");455 }456 else457 printf("!failed!\n");458 459 return rc;460 }461 462 463 /**464 * Test case 4.465 * Checks that default initiation works fine for Aurora SMP kernels.466 *467 * @sketch Create init packet with no arguments.468 * Initiate elf$469 * Create init packet with no arguments.470 * Initiate win32k$471 * @returns 0 on success.472 * 1 on failure.473 * @status completely implemented.474 * @author knut st. osmundsen (knut.stange.osmundsen@pmsc.no)475 */476 int TestCase4(void)477 {478 int rc = 1;479 RP32INIT rpinit;480 481 /* init fake variabels */482 pszInternalRevision ="\r\nInternal revision 9.036";483 cObjectsFake = 14;484 _usFakeVerMajor = 20;485 _usFakeVerMinor = 40;486 487 /* $elf */488 initRPInit(SSToDS(&rpinit), "");489 rc = InitElf(&rpinit); /* no SSToDS! */490 printf("InitElf returned status=0x%04x\n", rpinit.rph.Status);491 if ((rpinit.rph.Status & (STDON | STERR)) == STDON)492 {493 /* $win32k */494 initRPInit(SSToDS(&rpinit), "");495 rc = InitWin32k(&rpinit); /* no SSToDS! */496 printf("InitWin32k returned status=0x%04x\n", rpinit.rph.Status);497 if ((rpinit.rph.Status & (STDON | STERR)) == STDON)498 {499 struct options opt = DEFAULT_OPTION_ASSIGMENTS;500 opt.fKernel = KF_UNI;501 opt.ulBuild = 9036;502 opt.usVerMajor = 20;503 opt.usVerMinor = 40;504 505 rc = CompareOptions(SSToDS(&opt));506 }507 else508 printf("!failed!\n");509 }510 else511 printf("!failed!\n");512 513 return rc;514 }515 516 517 /**518 * Test case 5.519 * Checks that all parameters are read correctly (1) (Warp FP13 kernel).520 *521 * @sketch Create init packet with no arguments.522 * Initiate elf$523 * Create init packet with no arguments.524 * Initiate win32k$525 * @returns 0 on success.526 * 1 on failure.527 * @status completely implemented.528 * @author knut st. osmundsen (knut.stange.osmundsen@pmsc.no)529 */530 int TestCase5(void)531 {532 int rc = 1;533 RP32INIT rpinit;534 682 char * pszInitArgs = "-C1 -L:N -Verbose -Quiet -Elf:Yes -Pe:Mixed -Script:No -W4 -Heap:512000 -ResHeap:0256000 -HeapMax:4096000 -ResHeapMax:0x100000"; 535 536 /* init fake variabels */537 pszInternalRevision ="\r\nInternal revision 14.040_W4";538 cObjectsFake = 14;539 _usFakeVerMajor = 20;540 _usFakeVerMinor = 45;541 683 542 684 /* $elf */ … … 553 695 { 554 696 struct options opt = DEFAULT_OPTION_ASSIGMENTS; 555 opt.fKernel = KF_UNI | KF_W4;556 opt.ulBuild = 14040;557 opt.usVerMajor = 20;558 opt.usVerMinor = 45;559 697 opt.cbSwpHeapInit = 512000; 560 698 opt.cbSwpHeapMax = 4096000; … … 600 738 if (options.fLogging != pOpt->fLogging) 601 739 printf("fLogging = %d - should be %d\n", options.fLogging, pOpt->fLogging, rc++); 602 if (options.fKernel != pOpt->fKernel) 603 printf("fKernel = %d - should be %d\n", options.fKernel, pOpt->fKernel, rc++); 604 if (options.ulBuild != pOpt->ulBuild) 605 printf("ulBuild = %d - should be %d\n", options.ulBuild, pOpt->ulBuild, rc++); 606 if (options.usVerMajor != pOpt->usVerMajor) 607 printf("usVerMajor = %d - should be %d\n", options.usVerMajor, pOpt->usVerMajor, rc++); 608 if (options.usVerMinor != pOpt->usVerMinor) 609 printf("usVerMinor = %d - should be %d\n", options.usVerMinor, pOpt->usVerMinor, rc++); 740 if (options.ulBuild != ~0UL) 741 { 742 if (options.fKernel != pOpt->fKernel) 743 printf("fKernel = %d - should be %d\n", options.fKernel, pOpt->fKernel, rc++); 744 if (options.ulBuild != pOpt->ulBuild) 745 printf("ulBuild = %d - should be %d\n", options.ulBuild, pOpt->ulBuild, rc++); 746 if (options.usVerMajor != pOpt->usVerMajor) 747 printf("usVerMajor = %d - should be %d\n", options.usVerMajor, pOpt->usVerMajor, rc++); 748 if (options.usVerMinor != pOpt->usVerMinor) 749 printf("usVerMinor = %d - should be %d\n", options.usVerMinor, pOpt->usVerMinor, rc++); 750 } 610 751 if (options.fPE != pOpt->fPE) 611 752 printf("fPE = %d - should be %d\n", options.fPE, pOpt->fPE, rc++); … … 649 790 * @remark 650 791 */ 651 int TestCaseExeLoad 1(void)792 int TestCaseExeLoad2(void) 652 793 { 653 794 APIRET rc; -
branches/GRACE/src/win32k/win32ktst.def
r3829 r4010 33 33 _DOS16OPEN = DOSCALL1.70 34 34 _DOS16CLOSE = DOSCALL1.59 35 35 DosQuerySysState = DOSCALL1.368
Note:
See TracChangeset
for help on using the changeset viewer.