Skip to content

Latest commit

 

History

History
103 lines (79 loc) · 4.28 KB

nf-processthreadsapi-tlsfree.md

File metadata and controls

103 lines (79 loc) · 4.28 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:processthreadsapi.TlsFree
TlsFree function (processthreadsapi.h)
Releases a thread local storage (TLS) index, making it available for reuse.
TlsFree
TlsFree function
_win32_tlsfree
base.tlsfree
processthreadsapi/TlsFree
winbase/TlsFree
base\tlsfree.htm
processthreadsapi
f5b1e8fc-02eb-4a06-b606-2b647944029b
02/02/2024
TlsFree, TlsFree function, _win32_tlsfree, base.tlsfree, processthreadsapi/TlsFree, winbase/TlsFree
processthreadsapi.h
Windows.h on Windows Vista, Windows 7, Windows Server 2008 Windows Server 2008 R2
Windows
Windows XP [desktop apps \| UWP apps]
Windows Server 2003 [desktop apps \| UWP apps]
Kernel32.lib; WindowsPhoneCore.lib on Windows Phone 8.1
KernelBase.dll on Windows Phone 8.1; Kernel32.dll
Windows
19H1
TlsFree
processthreadsapi/TlsFree
c++
APIRef
kbSyntax
DllExport
KernelBase.dll
Kernel32.dll
API-MS-Win-Core-ProcessThreads-l1-1-0.dll
MinKernelBase.dll
API-MS-Win-Core-ProcessThreads-l1-1-1.dll
API-MS-Win-Core-ProcessThreads-l1-1-2.dll
api-ms-win-downlevel-kernel32-l1-1-0.dll
API-MS-Win-Core-ProcessThreads-L1-1-3.dll
vertdll.dll
TlsFree

TlsFree function

-description

Releases a thread local storage (TLS) index, making it available for reuse.

-parameters

-param dwTlsIndex [in]

The TLS index that was allocated by the TlsAlloc function.

-returns

If the function succeeds, the return value is nonzero.

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

-remarks

Windows Phone 8.1: This function is supported for Windows Phone Store apps on Windows Phone 8.1 and later. When a Windows Phone Store app calls this function, it is replaced with an inline call to FlsFree. Refer to FlsFree for function documentation.

Windows 8.1, Windows Server 2012 R2, and Windows 10, version 1507: This function is supported for Windows Store apps on Windows 8.1, Windows Server 2012 R2, and Windows 10, version 1507. When a Windows Store app calls this function, it is replaced with an inline call to FlsFree. Refer to FlsFree for function documentation.

Windows 10, version 1511 and Windows 10, version 1607: This function is fully supported for Universal Windows Platform (UWP) apps, and is no longer replaced with an inline call to FlsFree.

If the threads of the process have allocated memory and stored a pointer to the memory in a TLS slot, they should free the memory before calling TlsFree. The TlsFree function does not free memory blocks whose addresses have been stored in the TLS slots associated with the TLS index. It is expected that DLLs call this function (if at all) only during DLL_PROCESS_DETACH.

For more information, see Thread Local Storage.

Examples

For an example, see Using Thread Local Storage or Using Thread Local Storage in a Dynamic-Link Library.

-see-also

Processes and Threads Overview

Thread Local Storage

TlsAlloc

TlsGetValue

TlsSetValue

Vertdll APIs available in VBS enclaves