Locate imagefile (path search)
Convert DOS name to NT name
Call NtOpenFile()
Call NtCreateSection(SEC_IMAGE)
Check for special handling: VDM, WoW64, restrictions, CMD files
Call NtQuerySection() to get ImageInformation
Use LdrQueryImageFileExecutionOptions() to see if debugging
Special handling for POSIX executable
Create the new process in the kernel via NtCreateProcessEx()
If requested, call NtSetInformationProcess(ProcessPriorityClass)
If (dwCreationFlags & CREATE_DEFAULT_ERROR_MODE)
call NtSetInformationProcess(ProcessDefaultHardErrorMode)
Call BasePushProcessParameters() to push params into new process
Stuff in the standard handles if needed
Call BaseCreateStack() to create a user-mode stack in process
Call BaseInitializeContext() to create an initial thread context
Call NtCreateThread() to create the first thread
// thread may run, so no more modification to new process virtual space
Use CsrClientCallServer(BasepCreateProcess) to register new process and thread with CSRSS
If app is restricted
Set a restricted token on the process
assign it to a job object so that it can't escape the token.
Unless the initial thread was created suspended, start it with NtResumeThread()