Logo ProcessKit API Reference

WindowsUiRestrictions Type

The Windows Job Object **UI restrictions** a process group can impose on its whole tree (`JOBOBJECT_BASIC_UI_RESTRICTIONS`) — see `ProcessGroupOptions.WithUiRestrictions`. These are the desktop-side counterpart of the resource caps: where the rest of `ResourceLimits` bounds what a contained tree may *consume* (and which cores it may consume it on), these bound what it may *do to the interactive session it happens to share with you* — read or overwrite the clipboard, change display or system-wide parameters, create or switch desktops, or log the user off / shut the machine down. A build plugin or a downloaded tool has no business doing any of that, and unlike a resource cap there is no way to notice after the fact that it did. A `[]` set: combine the members with `|||` (F#) or `|` (C#), or take the whole set with `All`. `None` (the default) leaves the Job's UI restrictions untouched, byte-identical to a group created before this option existed. **Windows-only, and honestly so.** The Job Object is the only primitive with this concept; POSIX (and Linux cgroup v2) have no equivalent, so requesting any restriction there fails `ProcessGroup.Create`/`UpdateLimits` with `ProcessError.Unsupported` rather than silently dropping it — exactly as the Unix-only `Command.Uid`/`Umask` family fails on Windows. What the restrictions do *not* do is sandbox the child's filesystem, network, or registry access; they are one layer of a perimeter (see the hardening guide), not a sandbox.

Record fields

Record Field Description

All

Full Usage: All

Field type: WindowsUiRestrictions
Modifiers: static

Every restriction above at once — the "this child has no business touching the desktop session at all" set, and the sensible starting point for a genuinely untrusted child that is not a GUI application.

Field type: WindowsUiRestrictions

Desktop

Full Usage: Desktop

Field type: WindowsUiRestrictions
Modifiers: static

Deny creating or switching desktops (`JOB_OBJECT_UILIMIT_DESKTOP`).

Field type: WindowsUiRestrictions

DisplaySettings

Full Usage: DisplaySettings

Field type: WindowsUiRestrictions
Modifiers: static

Deny changing display settings through `ChangeDisplaySettings` (`JOB_OBJECT_UILIMIT_DISPLAYSETTINGS`).

Field type: WindowsUiRestrictions

ExitWindows

Full Usage: ExitWindows

Field type: WindowsUiRestrictions
Modifiers: static

Deny logging the user off, shutting down, or restarting the machine (`JOB_OBJECT_UILIMIT_EXITWINDOWS`) — an untrusted child taking the host down with it is a real and cheap denial of service.

Field type: WindowsUiRestrictions

GlobalAtoms

Full Usage: GlobalAtoms

Field type: WindowsUiRestrictions
Modifiers: static

Give the job its own atom table instead of the global one (`JOB_OBJECT_UILIMIT_GLOBALATOMS`), so a contained child can neither read nor exhaust the session's global atoms.

Field type: WindowsUiRestrictions

Handles

Full Usage: Handles

Field type: WindowsUiRestrictions
Modifiers: static

Deny the use of USER handles owned by processes *outside* the job (`JOB_OBJECT_UILIMIT_HANDLES`) — the broadest of the set: it stops a contained child from reaching into another process's windows, menus, or hooks. Also the most likely to break a legitimate GUI child, so opt in deliberately.

Field type: WindowsUiRestrictions

None

Full Usage: None

Field type: WindowsUiRestrictions
Modifiers: static

No UI restrictions — the default, and what a Job carries unless one is requested.

Field type: WindowsUiRestrictions

ReadClipboard

Full Usage: ReadClipboard

Field type: WindowsUiRestrictions
Modifiers: static

Deny reading the clipboard (`JOB_OBJECT_UILIMIT_READCLIPBOARD`) — a child that cannot read it cannot harvest whatever the user last copied (a password out of a password manager, say).

Field type: WindowsUiRestrictions

SystemParameters

Full Usage: SystemParameters

Field type: WindowsUiRestrictions
Modifiers: static

Deny changing system-wide parameters through `SystemParametersInfo` (`JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS`) — accessibility, input, and desktop settings.

Field type: WindowsUiRestrictions

WriteClipboard

Full Usage: WriteClipboard

Field type: WindowsUiRestrictions
Modifiers: static

Deny writing to the clipboard (`JOB_OBJECT_UILIMIT_WRITECLIPBOARD`).

Field type: WindowsUiRestrictions

Type something to start searching.