GetXStateFeaturesMask function

Returns the mask of XState features set within a CONTEXT structure.


BOOL WINAPI GetXStateFeaturesMask(
  _In_  PCONTEXT Context,
  _Out_ PWORD64  FeatureMask


Context [in]

A pointer to a CONTEXT structure that has been initialized with InitializeContext.

FeatureMask [out]

A pointer to a variable that receives the mask of XState features which are present in the specified CONTEXT structure.

Return value

This function returns TRUE if successful, otherwise FALSE.


The GetXStateFeaturesMask function returns the mask of valid features in the specified context. If a CONTEXT is to be passed to GetThreadContext or Wow64GetThreadContext, the application must call SetXStateFeaturesMask to set which features are to be retrieved. GetXStateFeaturesMask should then be called on the CONTEXT returned by GetThreadContext or Wow64GetThreadContext to determine which feature areas contain valid data. If a particular feature bit is not set, the corresponding state is in a processor-specific INITIALIZED state and the contents of the feature area retrieved by LocateXStateFeature are undefined.

The definition of XState features are processor vendor specific. Please refer to the relevant processor reference manuals for additional information on a particular feature.

Note  The value returned by GetXStateFeaturesMask on a CONTEXT after a context operation will always be a subset of the mask specified in a call to SetXStateFeaturesMask prior to the context operation.

Windows 7 with SP1 and Windows Server 2008 R2 with SP1:  The AVX API is first implemented on Windows 7 with SP1 and Windows Server 2008 R2 with SP1 . Since there is no SDK for SP1, that means there are no available headers and library files to work with. In this situation, a caller must declare the needed functions from this documentation and get pointers to them using GetModuleHandle on "Kernel32.dll", followed by calls to GetProcAddress. See Working with XState Context for details.


Minimum supported client

Windows 7 with SP1 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2 with SP1 [desktop apps | Windows Store apps]


WinBase.h (include Windows.h)





See also

Intel AVX
Working with XState Context