TlsSetValue
The TlsSetValue
function stores a value in the calling thread s thread local storage (TLS) slot
for a specified TLS index. Each thread of a process has its own slot for each
TLS index.
BOOL TlsSetValue(
DWORD dwTlsIndex, |
// TLS index to set
value for |
LPVOID lpTlsValue |
// value to be
stored |
); |
|
Parameters
dwTlsIndex
Specifies a
TLS index that was allocated by the TlsAllocQZKZRO function.
lpTlsValue
Specifies the
value to be stored in the calling thread s TLS slot specified by dwTlsIndex.
Return Values
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
TLS indexes
are typically allocated by the TlsAlloc
TlsSetValue and TlsGetValue were implemented with speed as
the primary goal. These functions perform minimal parameter validation and
error checking. In particular, this function succeeds if dwTlsIndex is
in the range 0 through (TLS_MINIMUM_AVAILABLE - 1). It is up to the programmer to ensure that the
index is valid.
See Also