Export (0) Print
Expand All
Expand Minimize

ExGetPreviousMode routine

The ExGetPreviousMode routine returns the previous processor mode for the current thread.

Syntax


KPROCESSOR_MODE ExGetPreviousMode(void);

Parameters

This routine has no parameters.

Return value

ExGetPreviousMode returns a KPROCESSOR_MODE value, one of KernelMode or UserMode. This value specifies the previous processor mode for the current thread.

Remarks

If an I/O request can originate either in user mode or kernel mode and the caller passes pointers to data structures used for I/O, the driver must be able to determine whether the caller's pointers are valid in user mode or kernel mode.

If drivers are processing I/O requests using the normal IRP-based I/O dispatch method, they can determine the previous processor mode by checking the RequestorMode parameter in the IRP header. (The RequestorMode parameter is set by the I/O manager.)

Alternatively, ExGetPreviousMode can be used to determine the previous processor mode. This routine is particularly useful in situations where a previous mode parameter is not available, for example, in a file driver that uses fast I/O.

Requirements

Target platform

Universal

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

Ntoskrnl.lib

IRQL

<= DISPATCH_LEVEL

See also

KeGetCurrentThread

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft