Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
C28135

C28135

warning C28135: If the first argument to KeWaitForSingleObject is a local variable, the Mode parameter must be KernelMode

The driver is waiting in user mode. As such, the kernel stack can be swapped out during the wait. If the driver attempts to pass parameters on the stack, a system crash can result.

Example

The following code example elicits this warning.


KeWaitForSingleObject(&MyMutex, UserRequest, UserMode, false, NULL);

The following code example avoids this warning.


KeWaitForSingleObject(&MyMutex, UserRequest, KernelMode, false, NULL);

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft