Ignore:
Timestamp:
Aug 15, 2000, 8:16:09 AM (25 years ago)
Author:
bird
Message:

Another night of coding/testing/debuging.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GRACE/src/win32k/dev32/d32init.c

    r4010 r4017  
    1 /* $Id: d32init.c,v 1.19.4.2 2000-08-14 08:57:04 bird Exp $
     1/* $Id: d32init.c,v 1.19.4.3 2000-08-15 06:16:01 bird Exp $
    22 *
    33 * d32init.c - 32-bits init routines.
     
    9191
    9292
    93 #ifndef DEBUGR3
    9493/**
    9594 * Ring-0, 32-bit, init function.
     
    497496                                    && !(pKrnlInfo->ulBuild >=  9023 && pKrnlInfo->ulBuild <= 9036) /* Warp 4 GA -> fp 12 */
    498497                                    && !(pKrnlInfo->ulBuild >= 14039 && pKrnlInfo->ulBuild < 14080) /* Warp 4.5 GA -> fp 40 */
     498                                    && !(pKrnlInfo->ulBuild >=  6600 && pKrnlInfo->ulBuild <= 6678) /* Warp 2.1x fix?? (just for fun!) */
    499499                                      )
    500500                                {
     
    511511                                else
    512512                                    if (*psz != ','
    513                                         && (psz[0] == '_' && (psz[1] == 'W' || psz[1] == 'w') && psz[2] == '4')  /* _W4 */
     513                                        && (   (psz[0] == '_' && psz[1] == 'W' && psz[2] == '4')  /* _W4 */
     514                                            || (psz[1] == '_' && psz[2] == 'W' && psz[3] == '4')  /* A_W4 */
     515                                            || (psz[0] == '_' && psz[1] == 'U' && psz[2] == 'N' && psz[3] == 'I' && psz[4] == '4')  /* _UNI4 */
     516                                            || (psz[1] == '_' && psz[2] == 'U' && psz[3] == 'N' && psz[4] == 'I' && psz[5] == '4')  /* A_UNI4 */
     517                                            )
    514518                                        )
    515519                                    pKrnlInfo->fKernel = KF_W4 | KF_UNI;
     
    573577    return (USHORT)(usRc | (usRc != NO_ERROR ? STATUS_DONE | STERR : STATUS_DONE));
    574578}
    575 #endif /* !DEBUGR3*/
    576579
    577580
     
    667670     *     sub esp, imm8
    668671     *  or
     672     *     call ptr16:32
     673     *  or
     674     *     enter imm16, imm8    (2.1x)
     675     *  or
     676     *     mov eax, imm32       (2.1x)
     677     *     <anything>
     678     *  or
    669679     *     mov eax, msoff32
    670680     *
     
    679689        ||
    680690        (pach[0] == 0x83 && !fOverload) /* the next prolog */
     691        ||
     692        (pach[0] == 0x9a && !fOverload) /* the next prolog */
     693        ||
     694        (pach[0] == 0xc8)               /* the next prolog */
     695        ||
     696        (pach[0] == 0xB8 && !fOverload) /* the next prolog */
    681697        ||
    682698        (pach[0] == 0xa1 && !fOverload) /* last prolog */
     
    800816                        return -2;
    801817                    }
     818                    break;
     819
     820                case 0x9a:              /* call ptr16:32 */
     821                    cb += cb2 = 6;
     822                    pach += cb2;
     823                    break;
     824
     825                case 0xc8:              /* enter imm16, imm8 */
     826                    cb += cb = 3;
     827                    pach += cb2;
    802828                    break;
    803829
     
    9791005
    9801006
    981 #ifndef DEBUGR3
    9821007/**
    9831008 * Verifies the aImportTab.
     
    10381063
    10391064        #ifndef R3TST
    1040         if (_aImportTab[i].ulAddress < 0xffe00000UL)
     1065        if (_aImportTab[i].ulAddress < 0xffc00000UL)
    10411066        {
    10421067            kprintf(("VerifyImportTab32: procedure no.%d has an invalid address, %#08x!\n",
     
    13411366    return NO_ERROR;
    13421367}
    1343 #endif /* !DEBUGR3 */
    13441368
    13451369
     
    14631487#endif
    14641488
    1465 
    1466 
    1467 /*******************************************************************************
    1468 *   Ring-3 Debug Stuff
    1469 *******************************************************************************/
    1470 #ifdef DEBUGR3
    1471 #include <stdio.h>
    1472 
    1473 void main(void)
    1474 {
    1475     char ach_ldrRead[] = {
    1476         0x55, 0x8b, 0xec, 0x8d, 0x65, 0xf8, 0x53, 0x56,
    1477         0x57, 0x33, 0xd2, 0x42, 0x89, 0x55, 0xf8, 0x38,
    1478         0x35, 0xce, 0x70, 0x00, 0x00, 0x75, 0x4d, 0x8b,
    1479         0x55, 0x08, 0x66, 0x83, 0xfa, 0xff, 0x74, 0x62
    1480     };
    1481     char ach_ldrOpen[] = {
    1482         0x55, 0x8b, 0xec, 0x33, 0xc0, 0x38, 0x05, 0xce,
    1483         0x70, 0x00, 0x00, 0x75, 0x4b, 0x50, 0xff, 0x75,
    1484         0x08, 0x6a, 0x01, 0x68, 0xa3, 0x00, 0x00, 0x00,
    1485         0xff, 0x75, 0x0c, 0xff, 0x15, 0xc4, 0xc1, 0x0d
    1486     };
    1487     char ach_ldrClose[] = {
    1488         0x55, 0x8b, 0xec, 0x33, 0xc0, 0x38, 0x05, 0xce,
    1489         0x70, 0x00, 0x00, 0x75, 0x13, 0x8b, 0x55, 0x08,
    1490         0x0f, 0xb7, 0xd2, 0x66, 0x83, 0xfa, 0xff, 0x74,
    1491         0x07, 0x52, 0xff, 0x15, 0xcc, 0xc1, 0x0d, 0x00
    1492     };
    1493     char ach_LDRQAppType[] = {
    1494         0x55, 0x8b, 0x0d, 0xa0, 0x0a, 0x00, 0x00, 0x8b,
    1495         0xec, 0x83, 0xec, 0x3c, 0x53, 0x81, 0xc1, 0x24,
    1496         0x06, 0x00, 0x00, 0x57, 0x56, 0x6a, 0xff, 0x66,
    1497         0xc7, 0x45, 0xc6, 0x00, 0x00, 0x51, 0xe8, 0x38
    1498     };
    1499     char ach_ldrEnum32bitRelRecs[] = {
    1500         0x55, 0xa1, 0xe8, 0xcf, 0x0d, 0x00, 0x8b, 0xec,
    1501         0x83, 0xec, 0x5c, 0x53, 0x8b, 0x55, 0x08, 0x57,
    1502         0x56, 0x8b, 0x52, 0x04, 0xf6, 0x40, 0x04, 0x80,
    1503         0x89, 0x55, 0xfc, 0x0f, 0x84, 0x10, 0x01, 0x00
    1504     };
    1505     char ach_IOSftOpen[] = {
    1506         0x55, 0x8b, 0xec, 0x8d, 0xa5, 0xa0, 0xfe, 0xff,
    1507         0xff, 0xf6, 0x05, 0x95, 0x2d, 0x00, 0x00, 0x80,
    1508         0x74, 0x13, 0x66, 0x68, 0x50, 0x30, 0xff, 0x75,
    1509         0x08, 0x6a, 0x3c, 0x6a, 0x06, 0xe8, 0x5a, 0x03
    1510     };
    1511     char ach_IOSftClose[] = {
    1512         0x55, 0x8b, 0xec, 0x8d, 0xa5, 0x28, 0xff, 0xff,
    1513         0xff, 0xf6, 0x05, 0x95, 0x2d, 0x00, 0x00, 0x80,
    1514         0x74, 0x16, 0x50, 0x66, 0x68, 0x51, 0x30, 0x8b,
    1515         0x45, 0x08, 0x50, 0x6a, 0x0c, 0x6a, 0x06, 0xe8
    1516     };
    1517     char ach_IOSftTransPath[] = {
    1518         0x55, 0x8b, 0xec, 0x8d, 0xa5, 0xd8, 0xfd, 0xff,
    1519         0xff, 0x53, 0x56, 0x57, 0x1e, 0x06, 0xa1, 0xa4,
    1520         0x0a, 0x00, 0x00, 0x66, 0x8d, 0x9d, 0xe2, 0xfe,
    1521         0xff, 0xff, 0x66, 0x89, 0x98, 0xf6, 0x01, 0x00
    1522     };
    1523     char ach_IOSftReadAt[] = {
    1524         0xb8, 0xc4, 0x68, 0x14, 0x00, 0xeb, 0x05, 0xb8,
    1525         0xcc, 0x68, 0x14, 0x00, 0x55, 0x8b, 0xec, 0x8d,
    1526         0xa5, 0x20, 0xff, 0xff, 0xff, 0xf6, 0x05, 0x95,
    1527         0x2d, 0x00, 0x00, 0x80, 0x74, 0x28, 0x50, 0x66
    1528     };
    1529     char ach_IOSftWriteAt[] = {
    1530         0xb8, 0xcc, 0x68, 0x14, 0x00, 0x55, 0x8b, 0xec,
    1531         0x8d, 0xa5, 0x20, 0xff, 0xff, 0xff, 0xf6, 0x05,
    1532         0x95, 0x2d, 0x00, 0x00, 0x80, 0x74, 0x28, 0x50,
    1533         0x66, 0x68, 0x52, 0x30, 0x8b, 0x45, 0x08, 0x25
    1534     };
    1535     char ach_SftFileSize[] = {
    1536         0x55, 0x8b, 0xec, 0x8d, 0xa5, 0x28, 0xff, 0xff,
    1537         0xff, 0x57, 0x56, 0x53, 0xc6, 0x85, 0x2b, 0xff,
    1538         0xff, 0xff, 0x00, 0x8b, 0x35, 0xa4, 0x0a, 0x00,
    1539         0x00, 0xf6, 0x46, 0x04, 0x01, 0x74, 0x0a, 0x80
    1540     };
    1541     char ach_VMAllocMem[] = {
    1542         0xa1, 0xe8, 0xcf, 0x0d, 0x00, 0x55, 0x8b, 0xec,
    1543         0x83, 0xec, 0x44, 0x53, 0x57, 0xf6, 0x40, 0x04,
    1544         0x80, 0x56, 0x0f, 0x84, 0x34, 0x01, 0x00, 0x00,
    1545         0xf6, 0x00, 0x40, 0x74, 0x44, 0xa1, 0xcc, 0x02
    1546     };
    1547     char ach_VMGetOwner[] = {
    1548         0x55, 0x8b, 0xec, 0x83, 0xec, 0x30, 0x57, 0x66,
    1549         0x8b, 0x4d, 0x08, 0x66, 0x89, 0x4d, 0xd8, 0xf6,
    1550         0xc1, 0x04, 0x75, 0x39, 0x80, 0x3d, 0x40, 0x8c,
    1551         0x00, 0x00, 0x00, 0x74, 0x07, 0xa1, 0xac, 0x0a
    1552     };
    1553     char achg_tkExecPgm[] = {
    1554         0x55, 0x8b, 0xec, 0x8d, 0x65, 0xa4, 0x66, 0x89,
    1555         0x5d, 0xf4, 0x66, 0x8c, 0x45, 0xf6, 0x66, 0x89,
    1556         0x55, 0xfc, 0x66, 0x8c, 0x5d, 0xfe, 0x66, 0x89,
    1557         0x75, 0xf0, 0x66, 0x89, 0x7d, 0xf2, 0xc7, 0x45
    1558     };
    1559     char achf_FuStrLenZ[] = {
    1560         0x6a, 0x02, 0x52, 0x66, 0x55, 0x0f, 0xa8, 0x68,
    1561         0x0c, 0x00, 0x0f, 0xa9, 0x65, 0x67, 0x66, 0x8b,
    1562         0x2d, 0xa8, 0x0a, 0x00, 0x00, 0x65, 0x67, 0xff,
    1563         0xb5, 0xb4, 0x1f, 0x00, 0x00, 0x65, 0x67, 0x66
    1564     };
    1565     char achf_FuStrLen[] = {
    1566         0x6a, 0x02, 0x52, 0x66, 0x55, 0x0f, 0xa8, 0x68,
    1567         0x0c, 0x00, 0x0f, 0xa9, 0x65, 0x67, 0x66, 0x8b,
    1568         0x2d, 0xa8, 0x0a, 0x00, 0x00, 0x65, 0x67, 0xff,
    1569         0xb5, 0xb4, 0x1f, 0x00, 0x00, 0x65, 0x67, 0x66
    1570     };
    1571     char achf_FuBuff[] = {
    1572         0x6a, 0x02, 0x52, 0x66, 0x55, 0x0f, 0xa8, 0x68,
    1573         0x0c, 0x00, 0x0f, 0xa9, 0x65, 0x67, 0x66, 0x8b,
    1574         0x2d, 0xa8, 0x0a, 0x00, 0x00, 0x65, 0x67, 0xff,
    1575         0xb5, 0xb4, 0x1f, 0x00, 0x00, 0x65, 0x67, 0x66
    1576     };
    1577     char achf_VMObjHandleInfo[] =  {
    1578         0x55, 0x8B, 0x0D, 0x9C, 0xBF, 0x0D, 0x00, 0x8B,
    1579         0xEC, 0x83, 0xEC, 0x0C, 0x53, 0x57, 0x8D, 0x55,
    1580         0xF8
    1581     };
    1582     char achf_ldrOpenPath[] = {
    1583         0x55, 0xA1, 0xA4, 0x0A, 0x00, 0x00, 0x8B, 0xEC,
    1584         0x83, 0xEC, 0x28, 0x66, 0x8B, 0x80, 0xFE, 0x01,
    1585         0x00, 0x00, 0x53, 0x57, 0x66, 0x89, 0x45, 0xE2
    1586     };
    1587 
    1588 
    1589     char *aProcs[] =
    1590     {
    1591         ach_ldrRead            ,
    1592         ach_ldrOpen            ,
    1593         ach_ldrClose           ,
    1594         ach_LDRQAppType        ,
    1595         ach_ldrEnum32bitRelRecs,
    1596         ach_IOSftOpen          ,
    1597         ach_IOSftClose         ,
    1598         ach_IOSftTransPath     ,
    1599         ach_IOSftReadAt        ,
    1600         ach_IOSftWriteAt       ,
    1601         ach_SftFileSize        ,
    1602         ach_VMAllocMem         ,
    1603         ach_VMGetOwner         ,
    1604         achg_tkExecPgm         ,
    1605         achf_FuStrLenZ         ,
    1606         achf_FuStrLen          ,
    1607         achf_FuBuff            ,
    1608         achf_VMObjHandleInfo   ,
    1609         achf_ldrOpenPath       ,
    1610         NULL
    1611     };
    1612     int i;
    1613 
    1614     /* loop thru procs */
    1615     for (i = 0; aProcs[i] != NULL; i++)
    1616     {
    1617         unsigned cb;
    1618         printf("Proc.no.%i\n", i);
    1619         if (i < 14 || i > 16)
    1620             cb = interpretFunctionProlog32(aProcs[i], i < 5 || i == 13);
    1621         else
    1622             cb = interpretFunctionProlog16(aProcs[i], FALSE);
    1623         printf(" cb=%d\n\n", cb);
    1624     }
    1625 }
    1626 #endif
Note: See TracChangeset for help on using the changeset viewer.