Platform SDK: DLLs, Processes, and Threads

Process and Thread Functions

The following functions are used with processes.

Function Description
CommandLineToArgvW Parses a Unicode command-line string.
CreateProcess Creates a new process and its primary thread.
CreateProcessAsUser Creates a new process and its primary thread. The new process runs in the security context of the specified user.
CreateProcessWithLogonW Creates a new process and its primary thread. The new process then runs the specified executable file in the security context of the specified credentials (user, domain, and password).
ExitProcess Ends a process and all its threads.
FreeEnvironmentStrings Frees a block of environment strings.
GetCommandLine Retrieves the command-line string for the current process.
GetCurrentProcess Retrieves a pseudo handle for the current process.
GetCurrentProcessId Retrieves the process identifier of the calling process.
GetEnvironmentStrings Retrieves the environment block for the current process.
GetEnvironmentVariable Retrieves the value of the specified variable from the environment block of the calling process.
GetExitCodeProcess Retrieves the termination status of the specified process.
GetGuiResources Retrieves the count of handles to graphical user interface (GUI) objects in use by the specified process.
GetPriorityClass Retrieves the priority class for the specified process.
GetProcessAffinityMask Retrieves a process affinity mask for the specified process and the system affinity mask for the system.
GetProcessIoCounters Retrieves accounting information for all I/O operations performed by the specified process.
GetProcessPriorityBoost Retrieves the priority boost control state of the specified process.
GetProcessShutdownParameters Retrieves shutdown parameters for the currently calling process.
GetProcessTimes Retrieves timing information about for the specified process.
GetProcessVersion Retrieves the major and minor version numbers of the system on which the specified process expects to run.
GetProcessWorkingSetSize Retrieves the minimum and maximum working set sizes of the specified process.
GetStartupInfo Retrieves the contents of the STARTUPINFO structure that was specified when the calling process was created.
OpenProcess Opens an existing process object.
SetEnvironmentVariable Sets the value of an environment variable for the current process.
SetPriorityClass Sets the priority class for the specified process.
SetProcessAffinityMask Sets a processor affinity mask for the threads of a specified process.
SetProcessPriorityBoost Disables the ability of the system to temporarily boost the priority of the threads of the specified process.
SetProcessShutdownParameters Sets shutdown parameters for the currently calling process.
SetProcessWorkingSetSize Sets the minimum and maximum working set sizes for the specified process.
TerminateProcess Terminates the specified process and all of its threads.

The following functions are used with threads.

Function Description
AttachThreadInput Attaches the input processing mechanism of one thread to that of another thread.
CreateRemoteThread Creates a thread that runs in the virtual address space of another process.
CreateThread Creates a thread to execute within the virtual address space of the calling process.
ExitThread Ends a thread.
GetCurrentThread Retrieves a pseudo handle for the current thread.
GetCurrentThreadId Retrieves the thread identifier of the calling thread.
GetExitCodeThread Retrieves the termination status of the specified thread.
GetThreadPriority Retrieves the priority value for the specified thread.
GetThreadPriorityBoost Retrieves the priority boost control state of the specified thread.
GetThreadTimes Retrieves timing information for the specified thread.
OpenThread Opens an existing thread object.
ResumeThread Decrements a thread's suspend count.
SetThreadAffinityMask Sets a processor affinity mask for the specified thread.
SetThreadIdealProcessor Specifies a preferred processor for a thread.
SetThreadPriority Sets the priority value for the specified thread.
SetThreadPriorityBoost Disables the ability of the system to temporarily boost the priority of a thread.
Sleep Suspends the execution of the current thread for a specified interval.
SleepEx Suspends the current thread until the specified condition is met.
SuspendThread Suspends the specified thread.
SwitchToThread Causes the calling thread to yield execution to another thread that is ready to run on the current processor.
TerminateThread Terminates a thread.
ThreadProc An application-defined function that serves as the starting address for a thread.
TlsAlloc Allocates a thread local storage (TLS) index.
TlsFree Releases a TLS index.
TlsGetValue Retrieves the value in the calling thread's TLS slot for a specified TLS index.
TlsSetValue Stores a value in the calling thread's TLS slot for a specified TLS index.
WaitForInputIdle Waits until the specified process is waiting for user input with no input pending, or until the time-out interval has elapsed.

The following functions are used with job objects.

Function Description
AssignProcessToJobObject Associates a process with an existing job object.
CreateJobObject Creates or opens a job object.
OpenJobObject Opens an existing job object.
QueryInformationJobObject Retrieves limit and job state information from the job object.
SetInformationJobObject Set limits for a job object.
TerminateJobObject Terminates all processes currently associated with the job.
UserHandleGrantAccess Grants or denies access to a handle to a User object to a job that has a user-interface restriction.

The following functions are used in thread pooling.

Function Description
BindIoCompletionCallback Binds the specified file handle to the thread pool's I/O completion port.
QueueUserWorkItem Queues a work item to a worker thread in the thread pool.

The following functions are used with fibers.

Function Description
ConvertThreadToFiber Converts the current thread into a fiber.
CreateFiber Allocates a fiber object, assigns it a stack, and sets up execution to begin at the specified start address.
DeleteFiber Deletes an existing fiber.
FiberProc An application-defined function used with the CreateFiber function.
SwitchToFiber Schedules a fiber.

Obsolete Functions

These functions are provided only for compatibility with 16-bit versions of Windows.

WinExec
Yield