ReactOS 0.4.16-dev-197-g92996da
dllmain.c File Reference
#include "precomp.h"
Include dependency graph for dllmain.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msvcrt)
 
BOOL crt_process_init (void)
 
void FreeEnvironment (char **environment)
 
void msvcrt_init_exception (void *)
 

Variables

char ** _environ
 
char ** __initenv
 
wchar_t ** _wenviron
 
wchar_t ** __winitenv
 

Function Documentation

◆ crt_process_init()

BOOL crt_process_init ( void  )

Definition at line 21 of file crt_init.c.

22{
24
25 /* initialize version info */
33
34 /* create tls stuff */
36 return FALSE;
37
38 if (!msvcrt_init_heap())
39 return FALSE;
40
41 if (BlockEnvToEnvironA() < 0)
42 return FALSE;
43
44 if (BlockEnvToEnvironW() < 0)
45 {
47 return FALSE;
48 }
49
52
53 /* Initialization of the WINE code */
55
56 //msvcrt_init_math();
58 //msvcrt_init_console();
59 //msvcrt_init_args();
60 //msvcrt_init_signals();
61
62 return TRUE;
63}
char * _acmdln
Definition: environ.c:18
void msvcrt_init_io(void)
Definition: file.c:456
void msvcrt_init_mt_locks(void)
Definition: lock.c:54
int BlockEnvToEnvironA(void)
Definition: environ.c:34
void FreeEnvironment(char **environment)
Definition: environ.c:190
BOOL msvcrt_init_heap(void)
Definition: heap.c:895
wchar_t * _wcmdln
Definition: environ.c:19
int BlockEnvToEnvironW(void)
Definition: environ.c:86
char ** _environ
Definition: environ.c:22
#define _strdup
Definition: debug_ros.c:7
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LPSTR WINAPI GetCommandLineA(VOID)
Definition: proc.c:2009
LPWSTR WINAPI GetCommandLineW(VOID)
Definition: proc.c:2019
BOOL WINAPI GetVersionExW(IN LPOSVERSIONINFOW lpVersionInformation)
Definition: version.c:37
if(dx< 0)
Definition: linetemp.h:194
unsigned int _winminor
Definition: environ.c:12
unsigned int _winmajor
Definition: environ.c:13
unsigned int _osver
Definition: environ.c:11
unsigned int _osplatform
Definition: environ.c:10
unsigned int _winver
Definition: environ.c:14
_Check_return_ _CRTIMP wchar_t *__cdecl _wcsdup(_In_z_ const wchar_t *_Str)
BOOL msvcrt_init_tls(void)
Definition: tls.c:9
ULONG dwPlatformId
Definition: rtltypes.h:241
ULONG dwOSVersionInfoSize
Definition: rtltypes.h:237
ULONG dwMajorVersion
Definition: rtltypes.h:238
ULONG dwBuildNumber
Definition: rtltypes.h:240
ULONG dwMinorVersion
Definition: rtltypes.h:239
OSVERSIONINFO osvi
Definition: ver.c:28
struct _OSVERSIONINFOW OSVERSIONINFOW

◆ FreeEnvironment()

void FreeEnvironment ( char **  environment)

Internal function to deallocate environment block. Although it's parameter are defined as char**, it's able to work also with wide character environment block which are of type wchar_t**.

Parameters
environmentEnvironment to free.

Definition at line 190 of file environ.c.

191{
192 char **envptr;
193 for (envptr = environment; *envptr != NULL; envptr++)
194 free(*envptr);
195 free(environment);
196}
#define free
Definition: debug_ros.c:5
#define NULL
Definition: types.h:112

◆ msvcrt_init_exception()

void msvcrt_init_exception ( void )

Definition at line 33 of file dllmain.c.

40{
41 switch (dwReason)
42 {
44
45 TRACE("Process Attach\n");
46
47 msvcrt_init_exception(hinstDll);
48
49 if (!crt_process_init())
50 {
51 ERR("crt_init() failed!\n");
52 return FALSE;
53 }
54
55 TRACE("Attach done\n");
56 break;
57
59 //msvcrt_get_thread_data creates data when first called
60 break;
61
64 break;
65
67 TRACE("Detach\n");
68 /* Deinit of the WINE code */
70 if (reserved) break;
73 //msvcrt_free_console();
74 //msvcrt_free_args();
75 //msvcrt_free_signals();
77 if (!msvcrt_free_tls())
78 return FALSE;
81
84 if (_wenviron)
86
89 if (_environ)
91
92 TRACE("Detach done\n");
93 break;
94 }
95
96 return TRUE;
97}
#define ERR(fmt,...)
Definition: precomp.h:57
DWORD dwReason
Definition: misc.cpp:141
void FreeEnvironment(char **environment)
Definition: environ.c:190
char ** __initenv
Definition: environ.c:24
wchar_t ** __winitenv
Definition: environ.c:25
wchar_t ** _wenviron
Definition: environ.c:23
BOOL crt_process_init(void)
Definition: crt_init.c:21
char ** _environ
Definition: environ.c:22
#define DLL_THREAD_DETACH
Definition: compat.h:133
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
#define DLL_THREAD_ATTACH
Definition: compat.h:132
void msvcrt_init_exception(void *)
Definition: dllmain.c:33
r reserved
Definition: btrfs.c:3006
MSVCRT__locale_t global_locale
Definition: locale.c:1497
void __cdecl MSVCRT__free_locale(MSVCRT__locale_t)
Definition: locale.c:713
void msvcrt_free_mt_locks(void)
Definition: lock.c:77
void msvcrt_free_io(void)
Definition: file.c:1100
void msvcrt_free_tls_mem(void)
Definition: tls.c:51
BOOL msvcrt_free_tls(void)
Definition: tls.c:21
void msvcrt_free_popen_data(void)
Definition: popen.c:29
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by msvcrt_init_exception().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msvcrt  )

Variable Documentation

◆ __initenv

char** __initenv
extern

Definition at line 24 of file environ.c.

◆ __winitenv

wchar_t** __winitenv
extern

Definition at line 25 of file environ.c.

◆ _environ

char** _environ
extern

Definition at line 22 of file environ.c.

◆ _wenviron

wchar_t** _wenviron
extern

Definition at line 23 of file environ.c.