ExGetPreviousMode function (wdm.h)
The ExGetPreviousMode routine returns the previous processor mode for the current thread.
Syntax
KPROCESSOR_MODE ExGetPreviousMode();
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
Requirement | Value |
---|---|
Minimum supported client | Available starting with Windows 2000. |
Target Platform | Universal |
Header | wdm.h (include Wdm.h, Ntddk.h, Ntifs.h) |
Library | NtosKrnl.lib |
DLL | NtosKrnl.exe |
IRQL | <= DISPATCH_LEVEL |
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for