stefan__100__@hotmail.com wrote:
>> And the reason you couldn't pass Parameters?
> Because KeBugCheck expects the array to contain 4 entries, and Parameters isn't guranteed to be that big.
> What do you think of the following?
>
> NTSTATUS NTAPI ExpSystemErrorHandler (
> // ... abbreviated ...
> {
>    ULONG_PTR BugCheckParameters[MAXIMUM_HARDERROR_PARAMETERS] = {0, 0, 0, 0};
>    // ... abbreviated ...

>    for (i = 0; i < NumberOfParameters; i++)
>    {
>        /* Copy them over */
>        BugCheckParameters[i] = Parameters[i];
>    }

If you are going to use that, you'd better include something like this first:
 
    if (NumberOfParameters > MAXIMUM_HARDERROR_PARAMETERS)
        NumberOfParameters = MAXIMUM_HARDERROR_PARAMETERS;

or make it
 
    for (i = 0; i < min( NumberOfParameters, MAXIMUM_HARDERROR_PARAMETERS ); i++)

or you might create more problems than you solve, unless you're 100% guarateed
you can never receive more than MAXIMUM_HARDERROR_PARAMETERS.
(This said without studying the actual problem at hand).
 
Best Regards // Love



Keep your friends updated— even when you’re not signed in.