ReactOS 0.4.16-dev-2252-gb2c1dd8
ucrt_tls_sup.c File Reference
#include <process.h>
#include <assert.h>
#include "msvcrt.h"
#include "wine/debug.h"
Include dependency graph for ucrt_tls_sup.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msvcrt)
 
BOOL msvcrt_init_tls (void)
 
BOOL msvcrt_free_tls (void)
 
void msvcrt_free_tls_mem (void)
 
thread_data_t *CDECL msvcrt_get_thread_data (void)
 

Variables

DWORD msvcrt_tls_index
 

Function Documentation

◆ msvcrt_free_tls()

BOOL msvcrt_free_tls ( void  )

Definition at line 29 of file ucrt_tls_sup.c.

30{
32 {
33 ERR("TlsFree() failed!\n");
34 return FALSE;
35 }
36
37 return TRUE;
38}
#define ERR(fmt,...)
Definition: precomp.h:57
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL WINAPI TlsFree(IN DWORD Index)
Definition: thread.c:1166
DWORD msvcrt_tls_index
Definition: ucrt_tls_sup.c:15

◆ msvcrt_free_tls_mem()

void msvcrt_free_tls_mem ( void  )

Definition at line 40 of file ucrt_tls_sup.c.

41{
43 if (tls)
44 {
45 free(tls->efcvt_buffer);
46 assert(tls->asctime_buffer == NULL);
47 assert(tls->wasctime_buffer == NULL);
48 assert(tls->strerror_buffer == NULL);
49 assert(tls->wcserror_buffer == NULL);
50 assert(tls->time_buffer == NULL);
51 assert(tls->tmpnam_buffer == NULL);
52 assert(tls->wtmpnam_buffer == NULL);
53 assert(tls->locinfo == NULL);
54 assert(tls->mbcinfo == NULL);
56 }
57}
#define free
Definition: debug_ros.c:5
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
LPVOID WINAPI TlsGetValue(IN DWORD Index)
Definition: thread.c:1240
#define assert(_expr)
Definition: assert.h:32
static DWORD tls
Definition: sock.c:229

◆ msvcrt_get_thread_data()

thread_data_t *CDECL msvcrt_get_thread_data ( void  )

Definition at line 59 of file ucrt_tls_sup.c.

60{
62 DWORD err = GetLastError(); /* need to preserve last error */
63
65 if (ptr == NULL)
66 {
68 if (ptr == NULL)
70
73
74 ptr->tid = GetCurrentThreadId();
75 ptr->handle = INVALID_HANDLE_VALUE;
76 ptr->random_seed = 1;
77 }
78
80 return ptr;
81}
#define SetLastError(x)
Definition: compat.h:752
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
BOOL WINAPI TlsSetValue(IN DWORD Index, IN LPVOID Value)
Definition: thread.c:1276
#define _RT_THREAD
Definition: msvcrt.h:308
unsigned long DWORD
Definition: ntddk_ex.h:95
static PVOID ptr
Definition: dispmode.c:27
#define err(...)
#define exit(n)
Definition: config.h:202
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459

◆ msvcrt_init_tls()

BOOL msvcrt_init_tls ( void  )

Definition at line 17 of file ucrt_tls_sup.c.

18{
21 {
22 ERR("TlsAlloc() failed!\n");
23 return FALSE;
24 }
25
26 return TRUE;
27}
DWORD WINAPI DECLSPEC_HOTPATCH TlsAlloc(void)
Definition: thread.c:657
#define TLS_OUT_OF_INDEXES
Definition: winbase.h:529

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msvcrt  )

Variable Documentation

◆ msvcrt_tls_index

DWORD msvcrt_tls_index