Skip to main content
SetUmsThreadInformation function

Sets application-specific context information for the specified user-mode scheduling (UMS) worker thread.


BOOL WINAPI SetUmsThreadInformation(
  _In_ PUMS_CONTEXT          UmsThread,
  _In_ UMS_THREAD_INFO_CLASS UmsThreadInfoClass,
  _In_ PVOID                 UmsThreadInformation,
  _In_ ULONG                 UmsThreadInformationLength


UmsThread [in]

A pointer to a UMS thread context.

UmsThreadInfoClass [in]

A UMS_THREAD_INFO_CLASS value that specifies the kind of information to set. This parameter must be UmsThreadUserContext.

UmsThreadInformation [in]

A pointer to a buffer that contains the information to set.

UmsThreadInformationLength [in]

The size of the UmsThreadInformation buffer, in bytes.

Return value

If the function succeeds, it returns a nonzero value.

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

Return codeDescription

The buffer size does not match the required size for the specified information class.


The UmsThreadInfoClass parameter specifies an information class that is not supported.



The SetUmsThreadInformation function can be used to set an application-defined context for the specified UMS worker thread. The context information can consist of anything the application might find useful to track, such as per-scheduler or per-worker thread state. The underlying structures for UMS worker threads are managed by the system and should not be modified directly.

The QueryUmsThreadInformation function can be used to retrieve other exposed information about the specified thread, such as its thread execution block ( TEB) and whether the thread is suspended or terminated. Information that is not exposed through QueryUmsThreadInformation should be considered reserved.


Minimum supported client

Windows 7 (64-bit only) [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]


WinBase.h (include Windows.h)





See also