Ignore:
Timestamp:
Oct 27, 1999, 4:03:01 AM (26 years ago)
Author:
bird
Message:

Corrections to make win32k work.
(And now it does work, at least at my test machine...)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/dev16/probkrnl.c

    r847 r1467  
    1 /* $Id: probkrnl.c,v 1.1 1999-09-06 02:19:55 bird Exp $
     1/* $Id: probkrnl.c,v 1.2 1999-10-27 02:02:53 bird Exp $
    22 *
    33 * Description:   Autoprobes the os2krnl file and os2krnl[*].sym files.
     
    1313 *                How this works:
    1414 *                1. parses the device-line parameters and collects some "SysInfo".
    15  *                2. gets the kernel object table. (win32i$)
     15 *                2. gets the kernel object table. (elf$)
    1616 *                3. finds the kernel image and scans it for a build number.
    1717 *                4. locates and scans the symbol-file(s) for the entrypoints which are wanted.
    18  *                5. the entry points are verified. (win32i$)
     18 *                5. the entry points are verified. (elf$)
    1919 *                6. finished.
    2020 *
     
    2929#ifdef DEBUGR3
    3030    #if 1
     31        int printf(const char *, ...);
    3132        #define dprintf(a) printf a
    3233    #else
     
    3536#else
    3637    #define dprintf(a)
     38    #define static
    3739#endif
    3840
     
    125127static char szMsg1[]     = "\n\r\tFound kernel: ";
    126128static char szMsg1a[]    = "\n\r\tBuild: ";
    127 static char szMsg2[]     = "\n\r\n\r\tFound symbolfile: ";
     129static char szMsg2[]     = "\n\r\tFound symbolfile: ";
    128130static char szMsg4[]     = "\n\r\tFailed to find symbolfile!\n\r";
    129131static char szMsgfailed[]= "failed!";
     
    311313
    312314/**
    313  * kstrlen - String length
    314  * @returns   length of string
    315  * @param     p  Pointer to string
    316  */
    317 static int kstrlen(const char * p)
    318 {
    319     int len = 0;
    320     while ( p[len++] != '\0');
    321     return len-1;
     315 * kstrlen - String length.
     316 * @returns   Length of the string.
     317 * @param     psz  Pointer to string.
     318 * @status    completely implemented and tested.
     319 * @author    knut st. osmundsen
     320 */
     321static int kstrlen(const char * psz)
     322{
     323    int cch = 0;
     324    while (psz[cch] != '\0')
     325        cch++;
     326    return cch;
    322327}
    323328
     
    381386    USHORT          usAction = 0;
    382387
    383     rc = DosOpen("\\dev\\win32i$", &hDev0, &usAction, 0UL, FILE_NORMAL,
     388    rc = DosOpen("\\dev\\elf$", &hDev0, &usAction, 0UL, FILE_NORMAL,
    384389                 OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
    385390                 OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY,
     
    430435    /* read header and display it */
    431436    rc = fread(&MapDef, sizeof(MAPDEF), 1, SymFile);
    432     if ( rc )
     437    if (rc)
    433438    {
    434439        Buffer[0] = MapDef.achModName[0];
     
    591596}
    592597
    593 /* Worker function for ReadOS2Krnl */
     598/**
     599 * Worker function for ReadOS2Krnl
     600 * @returns   0 on success.
     601 *            errorcodes on failure. (-1 >= rc >= -14)
     602 * @param
     603 * @equiv
     604 * @time
     605 * @sketch
     606 * @status
     607 * @author    knut st. osmundsen
     608 * @remark
     609 */
    594610static int ReadOS2Krnl2(HFILE krnl, unsigned long  cbKrnl)
    595611{
     
    722738            if (pObj->o32_size < KrnlOTEs.aObjects[i].ote_size)
    723739                return -12;
     740
     741            #if 0 /* don't work! */
    724742            if ((pObj->o32_flags & 0xffffUL) != (KrnlOTEs.aObjects[i].ote_flags & 0xffffUL))
    725743                return -14;
     744            #endif
    726745        }
    727746    }
     
    764783    USHORT          usAction = 0;
    765784
    766     rc = DosOpen("\\dev\\win32i$", &hDev0, &usAction, 0UL, FILE_NORMAL,
     785    rc = DosOpen("\\dev\\elf$", &hDev0, &usAction, 0UL, FILE_NORMAL,
    767786                 OPEN_ACTION_FAIL_IF_NEW | OPEN_ACTION_OPEN_IF_EXISTS,
    768787                 OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY,
     
    779798    return rc;
    780799#else
     800    KrnlOTEs.cObjects = 23;
    781801    return 0;
    782802#endif
     
    857877
    858878        /* functions */
    859         if (rc > -50)
     879        if (rc == 0)
    860880        {
    861881            puts(szMsg2);
Note: See TracChangeset for help on using the changeset viewer.