GetUmsSystemThreadInformation function (winbase.h)

Queries whether the specified thread is a UMS scheduler thread, a UMS worker thread, or a non-UMS thread.

Warning

As of Windows 11, user-mode scheduling is not supported. All calls fail with the error ERROR_NOT_SUPPORTED.

Syntax

BOOL GetUmsSystemThreadInformation(
  [in]      HANDLE                         ThreadHandle,
  [in, out] PUMS_SYSTEM_THREAD_INFORMATION SystemThreadInfo
);

Parameters

[in] ThreadHandle

A handle to a thread. The thread handle must have the THREAD_QUERY_INFORMATION access right. For more information, see Thread Security and Access Rights.

[in, out] SystemThreadInfo

A pointer to a UMS_SYSTEM_THREAD_INFORMATION structure that receives information about the specified thread.

The caller must initialize the UmsVersion member before calling.

Return value

If the function fails, the return value is zero.

To get extended error information, call GetLastError.

Remarks

The GetUmsSystemThreadInformation function is intended for use in debuggers, troubleshooting tools, and profiling applications. For example, thread-isolated tracing or single-stepping through instructions might involve suspending all other threads in the process. However, if the thread to be traced is a UMS worker thread, suspending UMS scheduler threads might cause a deadlock because a UMS worker thread requires the intervention of a UMS scheduler thread in order to run. A debugger can call GetUmsSystemThreadInformation for each thread that it might suspend to determine the kind of thread, and then suspend it or not as needed for the code being debugged.

Requirements

Requirement Value
Minimum supported client Windows 7 with SP1 [desktop apps only],Windows 7 (64-bit only) and Windows Server 2008 R2 with KB977165 installed
Minimum supported server Windows Server 2008 R2 with SP1 [desktop apps only]
Target Platform Windows
Header winbase.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll
API set api-ms-win-core-ums-l1-1-0 (introduced in Windows 7)