SetUmsThreadInformation function

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

Syntax

BOOL SetUmsThreadInformation(
  PUMS_CONTEXT          UmsThread,
  UMS_THREAD_INFO_CLASS UmsThreadInfoClass,
  PVOID                 UmsThreadInformation,
  ULONG                 UmsThreadInformationLength
);

Parameters

UmsThread

A pointer to a UMS thread context.

UmsThreadInfoClass

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

UmsThreadInformation

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

UmsThreadInformationLength

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 code Description
ERROR_INFO_LENGTH_MISMATCH
The buffer size does not match the required size for the specified information class.
ERROR_INVALID_INFO_CLASS
The UmsThreadInfoClass parameter specifies an information class that is not supported.

Remarks

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.

Requirements

   
Minimum supported client Windows 7 (64-bit only) [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header winbase.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See Also

QueryUmsThreadInformation