Ignore:
Timestamp:
Sep 4, 2000, 6:40:50 PM (25 years ago)
Author:
bird
Message:

Corrected FATAL error in k32QueryOptionsStatus.cpp. (Forgot SSToDS...)
Improved error messages during init.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/dev32/d32init.c

    r4181 r4185  
    1 /* $Id: d32init.c,v 1.21 2000-09-04 02:04:20 bird Exp $
     1/* $Id: d32init.c,v 1.22 2000-09-04 16:40:49 bird Exp $
    22 *
    33 * d32init.c - 32-bits init routines.
     
    351351    if (heapInit(options.cbResHeapInit, options.cbResHeapMax,
    352352                 options.cbSwpHeapInit, options.cbSwpHeapMax) != NO_ERROR)
    353         return STATUS_DONE | STERR | ERROR_I24_QUIET_INIT_FAIL;
     353        return ERROR_D32_HEAPINIT_FAILED;
    354354
    355355    /* loader */
    356     if (!options.fNoLoader)
    357         if (ldrInit() != NO_ERROR)
    358             return STATUS_DONE | STERR | ERROR_I24_QUIET_INIT_FAIL;
     356    if (ldrInit() != NO_ERROR)
     357        return ERROR_D32_LDR_INIT_FAILED;
    359358
    360359    /* functionoverrides */
    361     if (!options.fNoLoader)
    362         if (importTabInit() != NO_ERROR)
    363             return STATUS_DONE | STERR | ERROR_I24_QUIET_INIT_FAIL;
     360    if ((rc = importTabInit()) != NO_ERROR)
     361        return rc;
    364362
    365363    /*
     
    393391        kprintf(("16-bit data segment lock failed with with rc=%d\n", rc));
    394392
    395     return STATUS_DONE;
     393    return NO_ERROR;
    396394}
    397395
     
    10511049/**
    10521050 * Verifies the aImportTab.
    1053  * @returns   0 if ok. !0 if not ok.
     1051 * @returns   16-bit errorcode where the high byte is the procedure number which
     1052 *            the error occured on and the low byte the error code.
    10541053 * @remark    Called from IOCtl.
    10551054 *            WARNING! This function is called before the initroutine (R0INIT)!
     
    10681067    usRc = GetKernelInfo32(NULL);
    10691068    if (usRc != NO_ERROR)
    1070         return (USHORT)(STATUS_DONE | STERR | (usRc & STECODE));
     1069        return usRc;
    10711070
    10721071    /*
     
    10901089            {
    10911090                kprintf(("VerifyImportTab32: procedure no.%d was not fFound!\n", i));
    1092                 return STATUS_DONE | STERR | ERROR_D32_PROC_NOT_FOUND;
     1091                return (USHORT)(ERROR_D32_PROC_NOT_FOUND | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG);
    10931092            }
    10941093        }
    10951094
    10961095        /* Verify read/writeable. */
    1097         if (aImportTab[i].iObject >= pKrnlSMTE->smte_objcnt                                /* object index valid? */
     1096        if (   aImportTab[i].iObject >= pKrnlSMTE->smte_objcnt                                /* object index valid? */
    10981097            || aImportTab[i].ulAddress < pKrnlOTE[aImportTab[i].iObject].ote_base          /* address valid? */
    10991098            || aImportTab[i].ulAddress + 16 > (pKrnlOTE[aImportTab[i].iObject].ote_base +
     
    11071106                     i, &aImportTab[i].achName[0], aImportTab[i].ulAddress,
    11081107                     aImportTab[i].iObject, aImportTab[i].offObject));
    1109             return STATUS_DONE | STERR | ERROR_D32_INVALID_OBJ_OR_ADDR;
     1108            return (USHORT)(ERROR_D32_INVALID_OBJ_OR_ADDR | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG);
    11101109        }
    11111110
     
    11161115            kprintf(("VerifyImportTab32: procedure no.%d has an invalid address, %#08x!\n",
    11171116                     i, aImportTab[i].ulAddress));
    1118             return STATUS_DONE | STERR | ERROR_D32_INVALID_ADDRESS;
     1117            return (USHORT)(ERROR_D32_INVALID_ADDRESS | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG);
    11191118        }
    11201119        #endif
     
    11461145                {   /* failed, too small or too large. */
    11471146                    kprintf(("VerifyImportTab32: verify failed for procedure no.%d (cb=%d)\n", i, cb));
    1148                     return STATUS_DONE | STERR | ERROR_D32_TOO_INVALID_PROLOG;
     1147                    return (USHORT)(ERROR_D32_TOO_INVALID_PROLOG | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG);
    11491148                }
    11501149                break;
     
    11571156                kprintf(("VerifyImportTab32: invalid type/type not implemented\n",i));
    11581157                Int3(); /* temporary fix! */
    1159                 return STATUS_DONE | STERR | ERROR_D32_NOT_IMPLEMENTED;
     1158                return (USHORT)(ERROR_D32_NOT_IMPLEMENTED | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG);
    11601159        }
    11611160    }
    11621161
    1163     return STATUS_DONE;
     1162    return NO_ERROR;
    11641163}
    11651164
     
    11671166/**
    11681167 * Initiates the overrided functions.
    1169  * @returns   NO_ERROR on success. !0 on error.
     1168 * @returns   16-bit errorcode where the high byte is the procedure number which
     1169 *            the error occured on and the low byte the error code.
    11701170 */
    11711171int importTabInit(void)
     
    12561256        {
    12571257            kprintf(("ImportTabInit: Verify failed for procedure no.%d, cb=%d\n", i, cb));
    1258             return ERROR_D32_VERIFY_FAILED;
     1258            return ERROR_D32_VERIFY_FAILED | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG;
    12591259        }
    12601260    }
     
    13021302                    kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when rehooking it!\n", i));
    13031303                    Int3(); /* ipe - later! */
    1304                     return ERROR_D32_VERIFY_FAILED;
     1304                    return ERROR_D32_IPE | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG;
    13051305                }
    13061306                break;
     
    13471347                    kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when rehooking it!\n", i));
    13481348                    Int3(); /* ipe - later! */
    1349                     return ERROR_D32_VERIFY_FAILED;
     1349                    return ERROR_D32_IPE | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG;
    13501350                }
    13511351                break;
     
    13751375                    kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when importing it!\n", i));
    13761376                    Int3(); /* ipe - later! */
    1377                     return ERROR_D32_VERIFY_FAILED;
     1377                    return ERROR_D32_IPE | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG;
    13781378                }
    13791379                break;
     
    14031403                    kprintf(("ImportTabInit: FATAL verify failed for procedure no.%d when importing it!\n", i));
    14041404                    Int3(); /* ipe - later! */
    1405                     return ERROR_D32_VERIFY_FAILED;
     1405                    return ERROR_D32_IPE | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG;
    14061406                }
    14071407                break;
     
    14301430                kprintf(("ImportTabInit: unsupported type. (procedure no.%d, cb=%d)\n", i, cb));
    14311431                Int3(); /* ipe - later! */
    1432                 return ERROR_D32_VERIFY_FAILED;
     1432                return ERROR_D32_IPE | (i << ERROR_D32_PROC_SHIFT) | ERROR_D32_PROC_FLAG;
    14331433        } /* switch - type */
    14341434    }   /* for */
Note: See TracChangeset for help on using the changeset viewer.