Share via


Creation Flags

Creation flags are system-defined flags that define how to create a process. The following table shows possible values.

Value Name Description
67108864 DADEFAULTERRORMODE The new process does not inherit the error mode of the calling process. Instead, CreateProcessWithLogonW gives the new process the current default error mode. An application sets the current default error mode by calling SetErrorMode. This flag is enabled by default.
16 DANEWCONSOLE The new process has a new console, instead of inheriting the console of the parent. This flag cannot be used with the DETACHED_PROCESS flag. This flag is enabled by default.
512 DANEWPROCESSGROUP The new process is the root process of a new process group. The process and the new process group have the same identifier, which is returned in the lpProcessInfo parameter. Process groups are used by the GenerateConsoleCtrlEvent function to enable sending a CTRL+C or CTRL+BREAK signal to a group of console processes. This flag is enabled by default.
2048 DASEPARATEWOWVDM This flag is only valid starting a 16-bit Windows-based application. If set, the new process runs in a private Virtual DOS Machine (VDM). By default, all 16-bit Windows-based applications run in a single, shared VDM. The advantage of running separately is that a crash only terminates the single VDM; other programs running in distinct VDMs continue to function as usual. Also, 16-bit Windows-based applications that run in separate VDMs have separate input queues. If one application stops responding momentarily, applications in separate VDMs continue to receive input.
4 DASUSPENDED The primary thread of the new process is created in a suspended state, and does not run until the ResumeThread function is called.
1024 DAUNICODEENV Indicates the format of the lpEnvironment parameter. If this flag is set, the environment block pointed to by lpEnvironment uses Unicode characters. Otherwise, the environment block uses ANSI characters. This flag is set by default.
33554432 DAWITHUSERPROFILE If this flag is set, the system loads the profile of the user after the logon succeeds. Loading the profile can take time, so it is best to use this flag only if you must access the profile of the user.

The CreationFlags parameter also controls the new priority class of the process, which is used to determine the scheduling priorities of the process threads. The following table shows the value, name, and description for the flags that can be specified.

Value Name Description
32768 DAABOVE_NORMAL_PRIORITY_CLASS Indicates a process that has priority higher than NORMAL_PRIORITY_CLASS but lower than HIGH_PRIORITY_CLASS.
16384 DABELOW_NORMAL_PRIORITY_CLASS Indicates a process that has priority higher than IDLE_PRIORITY_CLASS but lower than NORMAL_PRIORITY_CLASS.
128 DAHIGH_PRIORITY_CLASS Indicates a process that performs time-critical tasks. The threads of a high-priority class process pre-empt the threads of normal-priority or idle-priority class processes. An example is the Tasks list, which must respond quickly when called by the user, regardless of the load on the operating system. Use caution when using the high-priority class, because a CPU-bound application with a high-priority class can use all available cycles.
64 DAIDLE_PRIORITY_CLASS Indicates a process whose threads run only when the system is idle and are pre-empted by the threads of any process running in a higher priority class. An example is a screen saver. Child processes inherit the idle priority class.
32 DANORMAL_PRIORITY_CLASS Indicates a standard process with no special scheduling needs.
256 DAREALTIME_PRIORITY_CLASS Indicates a process that has the highest possible priority. The threads of a real-time priority class process pre-empt the threads of all other processes, including operating system processes performing important tasks. For example, a real-time process that executes for more than a short interval can cause disk caches not to flush or cause the mouse to be unresponsive.

If none of these priority class flags are specified, the priority class is NORMAL_PRIORITY_CLASS, unless the priority class of the creating process is IDLE_PRIORITY_CLASS or BELOW_NORMAL_PRIORITY_CLASS. In this case, the child process receives the default priority class of the calling process.

See Also

Constants

Last updated on Wednesday, October 18, 2006

© 2006 Microsoft Corporation. All rights reserved.