算了,俺E文不过关,还是看原版的吧。
Windows® drivers can run in either user mode or kernel mode.
User-mode drivers run in the non-privileged processor mode in which other application code, including protected subsystem code, executes. User-mode drivers cannot gain access to system data except by calling the Win32® API which, in turn, calls system services.
Kernel-mode drivers run as part of the operating system's executive, the underlying operating system component that supports one or more protected subsystems.
User-mode and kernel-mode drivers have different structures, different entry points, and different system interfaces. Whether a device requires a user-mode or kernel-mode driver depends on the type of device and the support already provided for it in the operating system.
Some device drivers can run wholly or partially in user mode. User-mode drivers have unlimited stack space, access to the Win32 API, and easier debugging (with user-mode debuggers).
For example, printer drivers are divided into user interface and rendering components. The user interface component runs in user mode, and calls the Win32 API to render images. The Win32 API, in turn, calls the rendering component, which can run in either kernel mode or user mode.
Most device drivers run in kernel mode. Kernel-mode drivers can perform certain protected operations and can access system structures that user-mode drivers cannot access. The increased access comes at the price, however, of more difficult debugging and a greater chance of system corruption. When code runs in the privileged kernel-mode environment, the operating system, by design, performs fewer checks on data integrity and the validity of requests.