The IRQL is DISPATCH probably because you are under
some spinlock (or WDF lock if you use KMDF).
So you need to find where you grab this spinlock and
call MmMapLockedPagesSpecifyCache before or after it.
Note that a work item won't help here because it runs
outside of your user process context.
1. Don't map the memory to user mode. In Windows we don't like it as
much as in embedded or some other OS. Just do it in the good Windows way.
2. Tell your boss to find a consultant to take care of the driver,
and be done with this nuisance at last.
Hardware folks should do hardware, driverists should do drivers.
Mixing these is not kosher.
On 22-Aug-2012 15:34, firstname.lastname@example.org wrote:
> Dear Members,
> My driver is based on Plx9x5x sample.
> There is no KeRaiseIrql nor KeLowerIrql in other places.
> Upon IOCTL request (used to map kernel space to user space) I checked IRQL. It is 2
> So I used KeRaiseIrql to make it 1.
> I think it is a BUG that KeRaiseIrql helped me to make IRQL=1.
> Can you tell what is the reason my IRQL is 2 upon IOCTL ?
> I'm aware changing IRQL is wrong.
> Can you suggest an alternative so that MmMapLockedPagesSpecifyCache will not cause exception ?