

To avoid this problem, specify the minimum set of access rights required for the operation. If an application compiled for Windows Server 2008 and Windows Vista is run on Windows Server 2003 or Windows XP, the THREAD_ALL_ACCESS flag contains access bits that are not supported and the function specifying this flag fails with ERROR_ACCESS_DENIED. Windows Server 2003 and Windows XP: The value of the THREAD_ALL_ACCESS flag increased on Windows Server 2008 and Windows Vista. ValueĮnables the use of the thread handle in any of the wait functions.Īll possible access rights for a thread object.

The following table lists the thread-specific access rights. Required to change the owner in the security descriptor for the object. Required to modify the DACL in the security descriptor for the object. This enables a thread to wait until the object is in the signaled state. The right to use the object for synchronization. For more information, see SACL Access Right. To read or write the SACL, you must request the ACCESS_SYSTEM_SECURITY access right. Required to read information in the security descriptor for the object, not including the information in the SACL. The following table lists the standard access rights used by all objects. The valid access rights for thread objects include the standard access rights and some thread-specific access rights. When you call the GetCurrentThread function, the system returns a pseudohandle with the maximum access that the thread's security descriptor allows the caller. The handle returned by the CreateThread function has THREAD_ALL_ACCESS access to the thread object.

To change a thread's security descriptor, call the SetSecurityInfo function.

To retrieve a thread's security descriptor, call the GetSecurityInfo function. The ACLs in the default security descriptor for a thread come from the primary or impersonation token of the creator. If you specify NULL, the thread gets a default security descriptor. You can specify a security descriptor for a thread when you call the CreateProcess, CreateProcessAsUser, CreateProcessWithLogonW, CreateThread, or CreateRemoteThread function. For more information about security, see Access-Control Model. Microsoft Windows enables you to control access to thread objects.
