Kernel Process Use of System Calls
System calls made by kernel processes do not result in a change of protection domain because the kernel process is already within the kernel protection domain.
Routines in the kernel (including routines executing in a kernel process) are bound by the loader to the system call function and not to the system call handler. When system calls use kernel services to access user-mode data, these kernel services recognize that the system call is running within a kernel process instead of a user process and correctly handle the data accesses.
However, the error information returned from a kernel process system call must be accessed differently than for a user process. A kernel process must use the getuerror kernel service to retrieve the system call error information normally provided in the errno global variable for user-mode processes. In addition, the kernel process can use the setuerror kernel service to set the error information to 0 before calling the system call. The return code from the system call is handled the same for all processes.
Kernel processes can use only a restricted set of the base system calls. System Calls Available to Kernel Extensions lists system calls available to kernel processes.