ReactOS
0.4.16-dev-1946-g52006dd
tlssup.c
Go to the documentation of this file.
1
//
2
// tlssup.c
3
//
4
// Copyright (c) 2025 Timo Kreuzer
5
//
6
// TLS callback support
7
//
8
// SPDX-License-Identifier: MIT
9
//
10
11
#include <
internal_shared.h
>
12
13
// Dummy TLS undex
14
unsigned
int
_tls_index
;
15
16
// The TLS data
17
_CRTALLOC
(
".tls"
)
char
*_tls_start =
NULL
;
18
_CRTALLOC
(".tls$ZZZ")
char
*_tls_end =
NULL
;
19
20
// Describes the range of TLS callbacks.
21
_CRTALLOC
(".CRT$XLA")
PIMAGE_TLS_CALLBACK
__xl_a = 0;
22
_CRTALLOC
(".CRT$XLZ")
PIMAGE_TLS_CALLBACK
__xl_z = 0;
23
24
//
25
// The TLS directory.
26
// The linker will point the executables TLS data directory entry to this.
27
// Must be force-included with "#pragma comment(linker, "/INCLUDE:_tls_used")"
28
// or by referencing it from another compilation unit.
29
//
30
const
IMAGE_TLS_DIRECTORY
_tls_used
=
31
{
32
(
ULONG_PTR
)&_tls_start,
33
(
ULONG_PTR
)&_tls_end,
34
(
ULONG_PTR
)&
_tls_index
,
35
(
ULONG_PTR
)(&__xl_a + 1),
36
(
ULONG
)0,
37
(
ULONG
)0
38
};
_tls_index
ULONG _tls_index
Definition:
tlssup.c:39
NULL
#define NULL
Definition:
types.h:112
char
unsigned char
Definition:
typeof.h:29
ULONG_PTR
#define ULONG_PTR
Definition:
config.h:101
_CRTALLOC
#define _CRTALLOC(x)
Definition:
fma3_available.c:37
internal_shared.h
_tls_used
const IMAGE_TLS_DIRECTORY _tls_used
PIMAGE_TLS_CALLBACK
VOID(NTAPI * PIMAGE_TLS_CALLBACK)(PVOID DllHandle, ULONG Reason, PVOID Reserved)
Definition:
ntimage.h:531
_IMAGE_TLS_DIRECTORY32
Definition:
ntimage.h:545
ULONG_PTR
uint32_t ULONG_PTR
Definition:
typedefs.h:65
ULONG
uint32_t ULONG
Definition:
typedefs.h:59
const
#define const
Definition:
zconf.h:233
sdk
lib
vcruntime
tlssup.c
Generated on Thu Dec 4 2025 06:16:28 for ReactOS by
1.9.6