EnableProcessOptionalXStateFeatures function (winbase.h)

This function enables a set of optional XState features for the current process.

Syntax

BOOL EnableProcessOptionalXStateFeatures(
  DWORD64 Features
);

Parameters

Features

A bitmask in which each bit represents an optional XState feature to enable for the current process.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

In general, optional XState features are disabled by default for newly created threads and enabled on demand later. When this function returns, the specified optional XState features will be enabled for all existing threads in the current process, and all future threads created in the process will have the specified optional XState features enabled at thread creation time.

Only XState feature bits supported by the system are allowed to be supplied to this function, otherwise an error is returned. The XState feature bits supported by the system can be obtained via the GetEnabledXStateFeatures routine. If non-optional XState feature bits supported by the system are supplied (for example AVX, AVX2, etc. are non-optional XState features), those are ignored and will not cause this function to return an error. Note that all non-optional XState features supported by the system are always enabled for every thread by default.

Requirements

Requirement Value
Minimum supported client Windows 11
Minimum supported server Windows Server 2022
Header winbase.h

See also

GetEnabledXStateFeatures

GetThreadEnabledXStateFeatures