Changeset 4010 for branches/GRACE/src


Ignore:
Timestamp:
Aug 14, 2000, 10:57:07 AM (25 years ago)
Author:
bird
Message:

Corrections...
Testing is now done with real kernel image!!!

Location:
branches/GRACE/src/win32k
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/GRACE/src/win32k/Makefile

    r4005 r4010  
    11################################################################################
    2 # $Id: Makefile,v 1.43.4.2 2000-08-13 09:23:54 bird Exp $
     2# $Id: Makefile,v 1.43.4.3 2000-08-14 08:57:02 bird Exp $
    33#
    44# Win32k makefile.
     
    659659        dev32\*.c* pe2lx\*.c* k32\*.c* lib\*.c elf2lx\*.c* test\*.c* \
    660660        $(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*
    661663    $(PDWIN32_TOOLS)\fastdep -a+ -o$$(WIN32KOBJ) $(CINCLUDES16) dev16\*.c*
    662664    $(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:56 bird Exp $
     1/* $Id: d16init.c,v 1.6.4.3 2000-08-14 08:57:03 bird Exp $
    22 *
    33 * d16init - init routines for both drivers.
     
    249249    if (TKSSBase16 != 0)
    250250        return NO_ERROR;
     251    /*
    251252    _asm {
    252253        int 3;
    253254    }
     255    */
    254256
    255257    /* 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:57 bird Exp $
     1/* $Id: probkrnl.c,v 1.20.4.3 2000-08-14 08:57:03 bird Exp $
    22 *
    33 * Description:   Autoprobes the os2krnl file and os2krnl[*].sym files.
     
    6969#include "log.h"
    7070#include "options.h"
    71 
     71#include "errors.h"
    7272
    7373/*******************************************************************************
     
    196196    {ERROR_PROB_SYM_SEG_DEF_READ,       "Sym: Failed to read a segment definition."},
    197197    {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."},
    198203
    199204    {ERROR_PROB_SYMDB_KRNL_NOT_FOUND,   "SymDB: Kernel was not found."}
     
    204209 */
    205210#ifdef R3TST
    206 USHORT      usFakeVerMajor = 20;
    207 USHORT      usFakeVerMinor = 45;
     211USHORT      usFakeVerMajor = 0;
     212USHORT      usFakeVerMinor = 0;
    208213#ifdef R3TST
    209214static ach[11] =  {0}; /* works around compiler/linker bug */
     
    642647        rc = DosDevIOCtl("", "", D16_IOCTL_VERIFYIMPORTTAB, D16_IOCTL_CAT, hDev0);
    643648        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;
    644651    }
    645652
     
    10481055                printf16("0x%08lx%s", aImportTab[i].ulAddress, (i % 2) == 0 ? "" : "\n");
    10491056            else
    1050                 printf16("failed!%s", (i % 2) == 0 ? "" : "\n");
     1057                printf16("failed!%s", (i % 2) == 0 ? "   " : "\n");
    10511058        }
    10521059        if (i % 2) printf16("\n");
     
    11461153    options.usVerMinor  = pGIS->uchMinorVersion;
    11471154#else
     1155    if (usFakeVerMajor == 0)
     1156    {
     1157        usFakeVerMajor = pGIS->uchMajorVersion;
     1158        usFakeVerMinor = pGIS->uchMinorVersion;
     1159    }
    11481160    options.usVerMajor  = usFakeVerMajor;
    11491161    options.usVerMinor  = usFakeVerMinor;
     
    11941206                )
    11951207            {
     1208                #ifndef R3TST
    11961209                /* search on disk */
    11971210                i = 0;
     
    12001213                       )
    12011214                    i++;
     1215                #endif
    12021216            }
    12031217        }
     
    16461660        int         i;
    16471661
    1648         printf16("/* $Id: probkrnl.c,v 1.20.4.2 2000-08-13 09:23:57 bird Exp $\n"
     1662        printf16("/* $Id: probkrnl.c,v 1.20.4.3 2000-08-14 08:57:03 bird Exp $\n"
    16491663                 "*\n"
    16501664                 "* 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:03 bird Exp $
     1/* $Id: d32init.c,v 1.19.4.2 2000-08-14 08:57:04 bird Exp $
    22 *
    33 * d32init.c - 32-bits init routines.
     
    4444#include "ldrCalls.h"
    4545#include "macros.h"
     46#include "errors.h"
    4647
    4748#ifdef R3TST
     
    471472                    for (i = 0; i < 2 && pKrnlInfo->ulBuild == 0; i++)
    472473                    {
    473                         #ifndef R3TST
    474474                        const char *psz = (const char*)pKrnlOTE[i].ote_base;
    475475                        const char *pszEnd = psz + pKrnlOTE[i].ote_size - 50; /* Last possible search position. */
    476                         #else
    477                         extern const char *pszInternalRevision; /* defined in win32ktst.c */
    478                         const char *psz =  pszInternalRevision;
    479                         const char *pszEnd = psz + 3;
    480                         #endif
    481476
    482477                        while (psz < pszEnd)
     
    524519
    525520                                /* Check if its a debug kernel (look for DEBUG at start of object 3-5) */
    526                             #ifndef R3TST
    527521                                j = 3;
    528522                                while (j < 5)
     
    541535                                    j++;
    542536                                }
    543                             #else
    544                                 NOREF(j);
    545                             #endif
    546537
    547538                                /* Display info */
     
    598589        || ((bModRM & 0xc0) == 0 && (bModRM & 0x07) == 5)) /* ex. mov ebp,[0ff231234h] */
    599590    {   /* 32-bit displacement */
    600         return 5;
     591        return 5 + ((bModRM & 0x7) == 0x4); // + SIB
    601592    }
    602593    else if ((bModRM & 0xc0) == 0x40) /* ex. mov ecx,[esi]+4fh */
    603594    {   /* 8-bit displacement */
    604         return 2;
     595        return 2 + ((bModRM & 0x7) == 0x4); // + SIB
    605596    }
    606597    /* no displacement (only /r byte) */
     
    670661     *     push ebp
    671662     *  or
     663     *     mov ecx, r/m32
     664     *  or
     665     *     jmp dword
     666     *  or
     667     *     sub esp, imm8
     668     *  or
    672669     *     mov eax, msoff32
    673670     *
    674671     */
    675     if ((pach[0] == 0x55 && (pach[1] == 0x8b || pach[1] == 0xa1)) /* two first prologs */
     672    if ((pach[0] == 0x55 && (pach[1] == 0x8b || pach[1] == 0xa1)) /* the two first prologs */
    676673        ||
    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 */
    678681        ||
    679682        (pach[0] == 0xa1 && !fOverload) /* last prolog */
     
    762765                case 0x8b:              /* mov /r */
    763766                case 0x8d:              /* lea /r */
    764                     if ((pach[1] & 0x7) == 4 && (pach[1] & 0xc0) != 0xc0) /* invalid instruction!?! */
    765                         return -1;
    766767                    cb += cb2 = ModR_M_32bit(pach[1]);
    767768                    pach += cb2;
     
    801802                    break;
    802803
     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
    803812                default:
    804813                    kprintf(("interpretFunctionProlog32: unknown instruction 0x%x 0x%x 0x%x\n", pach[0], pach[1], pach[2]));
     
    811820    else
    812821    {
    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]));
    814824        cb = 0;
    815825    }
     
    947957                    else
    948958                    {
    949                         kprintf(("interpretFunctionProlog32: 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]));
    950960                        return -3;
    951961                    }
     
    986996    pulTKSSBase32 = (PULONG)_TKSSBase16;
    987997
    988 #ifdef R3TST
    989     R3TstFixImportTab();
    990 #endif
    991 
    992998    /* Check that pKrnlOTE is set */
    993999    usRc = GetKernelInfo32(NULL);
     
    10141020        }
    10151021
    1016     #ifndef R3TST
    10171022        /* Verify read/writeable. */
    10181023        if (_aImportTab[i].iObject >= pKrnlSMTE->smte_objcnt                                /* object index valid? */
     
    10321037
    10331038
    1034 
     1039        #ifndef R3TST
    10351040        if (_aImportTab[i].ulAddress < 0xffe00000UL)
    10361041        {
     
    10391044            return STATUS_DONE | STERR | ERROR_D32_INVALID_ADDRESS;
    10401045        }
    1041     #endif
     1046        #endif
    10421047
    10431048        switch (_aImportTab[i].fType & ~EPT_BIT_MASK)
     
    10661071                if (cb <= 0 || cb + cbmin >= MAXSIZE_PROLOG)
    10671072                {   /* failed, too small or too large. */
    1068                     kprintf(("VerifyImportTab32: verify failed for procedure no.%d (cd=%d)\n", i, cb));
     1073                    kprintf(("VerifyImportTab32: verify failed for procedure no.%d (cb=%d)\n", i, cb));
    10691074                    return STATUS_DONE | STERR | ERROR_D32_TOO_INVALID_PROLOG;
    10701075                }
     
    12001205                else
    12011206                {   /* !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));
    12031208                    Int3(); /* ipe - later! */
    12041209                    return ERROR_D32_VERIFY_FAILED;
     
    12451250                else
    12461251                {   /* !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));
    12481253                    Int3(); /* ipe - later! */
    12491254                    return ERROR_D32_VERIFY_FAILED;
     
    12731278                else
    12741279                {   /* !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));
    12761281                    Int3(); /* ipe - later! */
    12771282                    return ERROR_D32_VERIFY_FAILED;
     
    13011306                else
    13021307                {   /* !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));
    13041309                    Int3(); /* ipe - later! */
    13051310                    return ERROR_D32_VERIFY_FAILED;
     
    13501355    static MTE    KrnlMTE;
    13511356    static SMTE   KrnlSMTE;
    1352     static OTE    aKrnlOTE[17];
    1353 
    1354     extern int  cObjectsFake; /* defined in win32ktst.c */
    13551357
    13561358    KrnlMTE.mte_swapmte = &KrnlSMTE;
    13571359    KrnlSMTE.smte_objtab = &aKrnlOTE[0];
    13581360    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;
    14951361
    14961362    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:33 bird Exp $
     1/* $Id: probkrnl.h,v 1.13.4.2 2000-08-14 08:57:07 bird Exp $
    22 *
    33 * Include file for ProbKrnl.
     
    4848#define TYPE_W4                 0x02     /* Warp4 fp13 and above. */
    4949#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                             10000
    57 #define ERROR_PROB_KRNL_FIRST                       ERROR_PROB_KRNL_OPEN_FAILED
    58 #define ERROR_PROB_KRNL_LAST                        ERROR_PROB_KRNL_OTE_READ
    59 #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_FOUND
    81 #define ERROR_PROB_SYM_LAST                         ERROR_PROB_SYM_IMPORTS_NOTFOUND
    82 #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 
    9650
    9751
  • branches/GRACE/src/win32k/include/test.h

    r3829 r4010  
    1 /* $Id: test.h,v 1.1 2000-07-16 22:17:13 bird Exp $
     1/* $Id: test.h,v 1.1.4.1 2000-08-14 08:57:07 bird Exp $
    22 *
    33 * Definitions and declarations for test moduls.
     
    113113
    114114#ifdef INCL_16
    115 extern USHORT  usFakeVerMajor;          /* define in probkrnl.c */
    116 extern USHORT  usFakeVerMinor;          /* define in probkrnl.c */
     115extern USHORT   usFakeVerMajor;         /* define in probkrnl.c */
     116extern USHORT   usFakeVerMinor;         /* define in probkrnl.c */
    117117#else
    118 extern USHORT  _usFakeVerMajor;
    119 extern USHORT  _usFakeVerMinor;
     118extern USHORT   _usFakeVerMajor;
     119extern USHORT   _usFakeVerMinor;
    120120#endif
    121121
    122 extern const char *pszInternalRevision; /* defined in win32ktst.c */
     122#ifdef _OS2Krnl_h_
     123extern int      cObjectsFake;           /* defined in win32ktst.c */
     124extern OTE      aKrnlOTE[24];           /* defined in win32ktst.c */
     125#endif
    123126
    124127#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:35 bird Exp $
     1/* $Id: win32ktst.c,v 1.1.4.2 2000-08-14 08:57:07 bird Exp $
    22 *
    33 * Win32k test module.
     
    2626    (PVOID)( ( (((unsigned)(flataddr) << 3) & 0xfff80000) | (SEL_LDT_RPL3 << 16) ) | ((unsigned)(flataddr) & 0xffff) )
    2727
     28#define DWORD   ULONG
     29#define WORD    USHORT
     30
    2831/*******************************************************************************
    2932*   Internal Functions                                                         *
    3033*******************************************************************************/
    3134#include <os2.h>
     35#include <exe386.h>
    3236
    3337#include "malloc.h"
     
    133137 */
    134138
    135 
    136139/*******************************************************************************
    137 *   Internal Functions                                                         *
     140*   Structures and Typedefs                                                    *
    138141*******************************************************************************/
    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
    150221
    151222
     
    156227const char *    pszInternalRevision = "\r\nInternal revision 14.040_W4";
    157228int             cObjectsFake = 14;
    158 
     229OTE             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*******************************************************************************/
     246void    syntax(void);
     247int     kernelInit(int iTest, int argc, char **argv);
     248void    workersinit(void);
     249void    initRPInit(RP32INIT *pRpInit, char *pszInitArgs);
     250int     tests(int iTest, int argc, char **argv);
     251int     TestCase1(int argc, char **argv);
     252int     TestCase2(void);
     253int     TestCase3(void);
     254int     TestCase4(void);
     255int     TestCase5(void);
     256int     TestCase6(void);
     257int     CompareOptions(struct options *pOpt);
     258int     TestCaseExeLoad2(void);
    159259
    160260
     
    188288    workersinit();
    189289
     290    /*
     291     * Init Kernel
     292     */
     293    if (!kernelInit(iTest, argc, argv))
     294        return -2;
    190295
    191296    /*
     
    227332}
    228333
     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 */
     345int     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}
    229534
    230535/**
     
    275580    switch (iTest)
    276581    {
    277         case 1:     rc = TestCase1();   break;
     582        case 1:     rc = TestCase1(argc, argv);   break;
    278583        case 2:     rc = TestCase2();   break;
    279         case 3:     rc = TestCase3();   break;
    280         case 4:     rc = TestCase4();   break;
    281         case 5:     rc = TestCase5();   break;
    282584
    283585        default:
     
    296598/**
    297599 * 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]
    299603 *
    300604 * @sketch  Create init packet with no arguments.
     
    307611 * @author  knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
    308612 */
    309 int TestCase1(void)
    310 {
     613int TestCase1(int argc, char **argv)
     614{
     615    static char szInitArgs[CCHMAXPATH + 10];
    311616    int         rc = 1;
    312617    RP32INIT    rpinit;
    313618
     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
    314626    /* 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]);
    319634
    320635    /* $elf */
    321     initRPInit(SSToDS(&rpinit), "-w3");
     636    initRPInit(SSToDS(&rpinit), szInitArgs);
    322637    rc = InitElf(&rpinit);              /* no SSToDS! */
    323638    printf("InitElf returned status=0x%04x\n", rpinit.rph.Status);
     
    325640    {
    326641        /* $win32k */
    327         initRPInit(SSToDS(&rpinit), "-w3");
     642        initRPInit(SSToDS(&rpinit), szInitArgs);
    328643        rc = InitWin32k(&rpinit);       /* no SSToDS! */
    329644        printf("InitWin32k returned status=0x%04x\n", rpinit.rph.Status);
     
    331646        {
    332647            struct options opt = DEFAULT_OPTION_ASSIGMENTS;
    333             opt.fKernel = KF_SMP;
    334             opt.ulBuild = 14040;
    335             opt.usVerMajor = 20;
    336             opt.usVerMinor = 45;
    337648            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]);
    338653
    339654            rc = CompareOptions(SSToDS(&opt));
    340             if (rc == NO_ERROR)
    341             {
    342                 rc = TestCaseExeLoad1();
    343             }
    344655        }
    345656        else
     
    352663}
    353664
    354 
    355665/**
    356666 * Test case 2.
    357  * Checks that default initiation works fine for Aurora UNI kernels.
     667 * Checks that all parameters are read correctly (1).
    358668 *
    359669 * @sketch  Create init packet with no arguments.
     
    370680    int         rc = 1;
    371681    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         else
    400             printf("!failed!\n");
    401     }
    402     else
    403         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         else
    454             printf("!failed!\n");
    455     }
    456     else
    457         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         else
    508             printf("!failed!\n");
    509     }
    510     else
    511         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;
    534682    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;
    541683
    542684    /* $elf */
     
    553695        {
    554696            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;
    559697            opt.cbSwpHeapInit   = 512000;
    560698            opt.cbSwpHeapMax    = 4096000;
     
    600738    if (options.fLogging != pOpt->fLogging)
    601739        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    }
    610751    if (options.fPE != pOpt->fPE)
    611752        printf("fPE = %d - should be %d\n", options.fPE, pOpt->fPE, rc++);
     
    649790 * @remark
    650791 */
    651 int TestCaseExeLoad1(void)
     792int TestCaseExeLoad2(void)
    652793{
    653794    APIRET rc;
  • branches/GRACE/src/win32k/win32ktst.def

    r3829 r4010  
    3333     _DOS16OPEN       = DOSCALL1.70
    3434     _DOS16CLOSE      = DOSCALL1.59
    35 
     35     DosQuerySysState = DOSCALL1.368
Note: See TracChangeset for help on using the changeset viewer.