ReactOS  0.4.15-dev-2704-gd5265b0
crtexe.c File Reference
#include <oscalls.h>
#include <internal.h>
#include <process.h>
#include <signal.h>
#include <math.h>
#include <stdlib.h>
#include <tchar.h>
#include <sect_attribs.h>
#include <locale.h>
Include dependency graph for crtexe.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _DLL
 
#define SPECIAL_CRTEXE
 
#define __winitenv   (* __MINGW_IMP_SYMBOL(__winitenv))
 
#define __initenv   (* __MINGW_IMP_SYMBOL(__initenv))
 
#define SPACECHAR   _T(' ')
 
#define DQUOTECHAR   _T('\"')
 
#define _commode   (* __MINGW_IMP_SYMBOL(_commode))
 
#define __UNUSED_PARAM_1   __UNUSED_PARAM
 

Functions

wchar_t *** __MINGW_IMP_SYMBOL (__winitenv)
 
char *** __MINGW_IMP_SYMBOL (__initenv)
 
void __cdecl _fpreset (void)
 
int__MINGW_IMP_SYMBOL (_fmode)
 
int__MINGW_IMP_SYMBOL (_commode)
 
_CRTIMP void __cdecl _initterm (_PVFV *, _PVFV *)
 
static int __cdecl check_managed_app (void)
 
 _CRTALLOC (".CRT$XIA")
 
static void __cdecl pre_cpp_init (void)
 
static int __cdecl __tmainCRTStartup (void)
 
int __cdecl WinMainCRTStartup (void)
 
int __cdecl mainCRTStartup (void)
 
static __declspec (noinline)
 
static void duplicate_ppstrings (int ac, char ***av)
 
static void __cdecl __mingw_invalidParameterHandler (const wchar_t *__UNUSED_PARAM_1(expression), const wchar_t *__UNUSED_PARAM_1(function), const wchar_t *__UNUSED_PARAM_1(file), unsigned int __UNUSED_PARAM_1(line), uintptr_t __UNUSED_PARAM(pReserved))
 
HANDLE __mingw_get_msvcrt_handle (void)
 
static void __cdecl __mingw_prepare_except_for_msvcr80_and_higher (void)
 

Variables

IMAGE_DOS_HEADER __ImageBase
 
int _fmode
 
int _dowildcard
 
int mingw_initltsdrot_force
 
int mingw_initltsdyn_force
 
int mingw_initltssuo_force
 
int mingw_initcharmax
 

Macro Definition Documentation

◆ __initenv

#define __initenv   (* __MINGW_IMP_SYMBOL(__initenv))

Definition at line 38 of file crtexe.c.

◆ __UNUSED_PARAM_1

#define __UNUSED_PARAM_1   __UNUSED_PARAM

Definition at line 435 of file crtexe.c.

◆ __winitenv

#define __winitenv   (* __MINGW_IMP_SYMBOL(__winitenv))

Definition at line 33 of file crtexe.c.

◆ _commode

#define _commode   (* __MINGW_IMP_SYMBOL(_commode))

Definition at line 61 of file crtexe.c.

◆ _DLL

#define _DLL

This file has no copyright assigned and is placed in the Public Domain. This file is part of the w64 mingw-runtime package. No warranty is given; refer to the file DISCLAIMER.PD within this package.

Definition at line 9 of file crtexe.c.

◆ DQUOTECHAR

#define DQUOTECHAR   _T('\"')

Definition at line 53 of file crtexe.c.

◆ SPACECHAR

#define SPACECHAR   _T(' ')

Definition at line 52 of file crtexe.c.

◆ SPECIAL_CRTEXE

#define SPECIAL_CRTEXE

Definition at line 12 of file crtexe.c.

Function Documentation

◆ __declspec()

static __declspec ( noinline  )
static

Definition at line 219 of file crtexe.c.

222 {
223  _TCHAR *lpszCommandLine = NULL;
224  STARTUPINFO StartupInfo;
225  WINBOOL inDoubleQuote = FALSE;
226  memset (&StartupInfo, 0, sizeof (STARTUPINFO));
227 
228 #ifndef _WIN64
229  /* We need to make sure that this function is build with frame-pointer
230  and that we align the stack to 16 bytes for the sake of SSE ops in main
231  or in functions inlined into main. */
232  lpszCommandLine = (_TCHAR *) alloca (32);
233  memset (lpszCommandLine, 0xcc, 32);
234 #ifdef __GNUC__
235  asm __volatile__ ("andl $-16, %%esp" : : : "%esp");
236 #endif
237 #endif
238 
239  if (mingw_app_type)
240  GetStartupInfo (&StartupInfo);
241  {
242  void *lock_free = NULL;
243  void *fiberid = ((PNT_TIB)NtCurrentTeb())->StackBase;
244  int nested = FALSE;
245  while((lock_free = InterlockedCompareExchangePointer ((volatile PVOID *) &__native_startup_lock,
246  fiberid, 0)) != 0)
247  {
248  if (lock_free == fiberid)
249  {
250  nested = TRUE;
251  break;
252  }
253  Sleep(1000);
254  }
256  {
257  _amsg_exit (31);
258  }
260  {
262  _initterm ((_PVFV *)(void *)__xi_a, (_PVFV *)(void *) __xi_z);
263  }
264  else
265  has_cctor = 1;
266 
268  {
269  _initterm (__xc_a, __xc_z);
271  }
273  if (! nested)
275 
278 
281 #ifdef _WIN64
283 #endif
285 
286  _fpreset ();
287 
288  if (mingw_app_type)
289  {
290 #ifdef WPRFLAG
291  lpszCommandLine = (_TCHAR *) _wcmdln;
292 #else
293  lpszCommandLine = (char *) _acmdln;
294 #endif
295  while (*lpszCommandLine > SPACECHAR || (*lpszCommandLine && inDoubleQuote))
296  {
297  if (*lpszCommandLine == DQUOTECHAR)
298  inDoubleQuote = !inDoubleQuote;
299 #ifdef _MBCS
300  if (_ismbblead (*lpszCommandLine))
301  {
302  if (lpszCommandLine) /* FIXME: Why this check? Should I check for *lpszCommandLine != 0 too? */
303  lpszCommandLine++;
304  }
305 #endif
306  ++lpszCommandLine;
307  }
308  while (*lpszCommandLine && (*lpszCommandLine <= SPACECHAR))
309  lpszCommandLine++;
310 
312  __mingw_winmain_lpCmdLine = lpszCommandLine;
314  StartupInfo.wShowWindow : SW_SHOWDEFAULT;
315  }
317  __main ();
318 #ifdef WPRFLAG
319 #if !defined(__arm__) && !defined(__aarch64__)
320  __winitenv = envp;
321 #endif
322  /* C++ initialization.
323  gcc inserts this call automatically for a function called main, but not for wmain. */
324  mainret = wmain (argc, argv, envp);
325 #else
326 #if !defined(__arm__) && !defined(__aarch64__)
327  __initenv = envp;
328 #endif
329  mainret = main (argc, argv, envp);
330 #endif
331 
332 #ifdef __GNUC__
334 #endif
335 
336  if (!managedapp)
337  exit (mainret);
338 
339  if (has_cctor == 0)
340  _cexit ();
341  }
342  return mainret;
343 }
int mingw_app_type
Definition: mingw_helpers.c:31
#define __initenv
Definition: crtexe.c:38
static int argc
Definition: ServiceArgs.c:12
#define SW_SHOWDEFAULT
Definition: winuser.h:774
void(__cdecl * _PVFV)(void)
Definition: internal.h:33
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
static void duplicate_ppstrings(int ac, char ***av)
Definition: crtexe.c:414
void __main(void)
Definition: gccmain.c:51
void _pei386_runtime_relocator(void)
Definition: mscmain.c:23
int wmain(int argc, WCHAR **argv)
Definition: at.c:753
void __cdecl _fpreset(void)
Definition: fpreset.c:13
#define SPACECHAR
Definition: crtexe.c:52
#define TRUE
Definition: types.h:120
#define DLL_THREAD_ATTACH
Definition: compat.h:132
int main(int argc, char *argv[])
Definition: atactl.cpp:1685
volatile __enative_startup_state __native_startup_state
Definition: natstart.c:13
_CRTIMP void __cdecl _initterm(_PVFV *, _PVFV *)
Definition: initterm.c:10
DWORD dwFlags
Definition: winbase.h:836
long CALLBACK _gnu_exception_handler(EXCEPTION_POINTERS *exception_data)
Definition: crt_handler.c:196
static void __cdecl __mingw_prepare_except_for_msvcr80_and_higher(void)
Definition: crtexe.c:453
#define argv
Definition: mplay32.c:18
#define alloca
Definition: malloc.h:361
void __cdecl _amsg_exit(int errnum)
Definition: amsg.c:47
DWORD __mingw_winmain_nShowCmd
#define FALSE
Definition: types.h:117
LPTOP_LEVEL_EXCEPTION_FILTER WINAPI DECLSPEC_HOTPATCH SetUnhandledExceptionFilter(IN LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter)
Definition: except.c:788
__analysis_noreturn _CRTIMP void __cdecl _cexit(void)
Definition: _exit.c:7
LPTOP_LEVEL_EXCEPTION_FILTER __mingw_oldexcpt_handler
Definition: crt_handler.c:188
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
#define _ASSERTE(expr)
Definition: crtdbg.h:124
#define STARTF_USESHOWWINDOW
Definition: winbase.h:488
char _TCHAR
Definition: tchar.h:1392
#define InterlockedExchangePointer(Target, Value)
Definition: dshow.h:45
void __do_global_dtors(void)
Definition: gccmain.c:20
int32_t WINBOOL
Definition: typedefs.h:58
struct _NT_TIB * PNT_TIB
HINSTANCE __mingw_winmain_hInstance
IMAGE_DOS_HEADER __ImageBase
Definition: mstscax.cpp:17
HANDLE HINSTANCE
Definition: typedefs.h:77
#define VOID
Definition: acefi.h:82
const PIMAGE_TLS_CALLBACK __dyn_tls_init_callback
Definition: tlssup.c:107
#define _acmdln
Definition: internal.h:134
LPSTR __mingw_winmain_lpCmdLine
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
#define __winitenv
Definition: crtexe.c:33
#define NULL
Definition: types.h:112
WORD wShowWindow
Definition: winbase.h:837
int __cdecl _ismbblead(unsigned int)
Definition: ismblead.c:20
#define _wcmdln
Definition: internal.h:140
#define DQUOTECHAR
Definition: crtexe.c:53
#define GetStartupInfo
Definition: winbase.h:3697
void exit(int exitcode)
Definition: _exit.c:33
#define memset(x, y, z)
Definition: compat.h:39
int __mingw_init_ehandler(void)
Definition: mscmain.c:27
volatile void * __native_startup_lock
Definition: natstart.c:14

◆ __mingw_get_msvcrt_handle()

HMODULE __mingw_get_msvcrt_handle ( void  )

Definition at line 236 of file pesect.c.

237 {
238  static HANDLE msvcrt_handle;
239 
240  if(!msvcrt_handle) {
241  const char *lib_name;
242  int i = 0;
243 
244  while ((lib_name = __mingw_enum_import_library_names (i++))) {
245  if((lib_name[0] == 'm' || lib_name[0] == 'M')
246  && (lib_name[1] == 's' || lib_name[1] == 'S')
247  && (lib_name[2] == 'v' || lib_name[2] == 'V')
248  && (lib_name[3] == 'c' || lib_name[3] == 'C')
249  && (lib_name[4] == 'r' || lib_name[4] == 'R')
250  && (lib_name[5] == 't' || lib_name[5] == 'T' || ('0' <= lib_name[5] && lib_name[5] <= '9')))
251  break;
252  }
253 
254  if(lib_name)
255  msvcrt_handle = GetModuleHandleA(lib_name);
256  if(!msvcrt_handle)
257  msvcrt_handle = LoadLibraryW(L"msvcrt.dll");
258  }
259 
260  return msvcrt_handle;
261 }
#define LoadLibraryW(x)
Definition: compat.h:606
static const WCHAR L[]
Definition: oid.c:1250
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
const char * __mingw_enum_import_library_names(int)
Definition: pesect.c:195
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

Referenced by __mingw_prepare_except_for_msvcr80_and_higher().

◆ __MINGW_IMP_SYMBOL() [1/4]

wchar_t*** __MINGW_IMP_SYMBOL ( __winitenv  )

◆ __MINGW_IMP_SYMBOL() [2/4]

char*** __MINGW_IMP_SYMBOL ( __initenv  )

◆ __MINGW_IMP_SYMBOL() [3/4]

int* __MINGW_IMP_SYMBOL ( _fmode  )

◆ __MINGW_IMP_SYMBOL() [4/4]

int * __MINGW_IMP_SYMBOL ( _commode  )

◆ __mingw_invalidParameterHandler()

static void __cdecl __mingw_invalidParameterHandler ( const wchar_t __UNUSED_PARAM_1expression,
const wchar_t __UNUSED_PARAM_1function,
const wchar_t __UNUSED_PARAM_1file,
unsigned int   __UNUSED_PARAM_1line,
uintptr_t   __UNUSED_PARAMpReserved 
)
static

Definition at line 438 of file crtexe.c.

443 {
444 #ifdef __MINGW_SHOW_INVALID_PARAMETER_EXCEPTION
445  wprintf(L"Invalid parameter detected in function %s. File: %s Line: %u\n", function, file, line);
446  wprintf(L"Expression: %s\n", expression);
447 #endif
448 }
#define wprintf(...)
Definition: whoami.c:18
Definition: parser.c:48
static const WCHAR L[]
Definition: oid.c:1250
Definition: fci.c:126

Referenced by __mingw_prepare_except_for_msvcr80_and_higher().

◆ __mingw_prepare_except_for_msvcr80_and_higher()

static void __cdecl __mingw_prepare_except_for_msvcr80_and_higher ( void  )
static

Definition at line 453 of file crtexe.c.

454 {
456 
457  fIPH = (void*)GetProcAddress (__mingw_get_msvcrt_handle(), "_set_invalid_parameter_handler");
458  if (fIPH)
460 }
HANDLE __mingw_get_msvcrt_handle(void)
Definition: pesect.c:236
static void __cdecl __mingw_invalidParameterHandler(const wchar_t *__UNUSED_PARAM_1(expression), const wchar_t *__UNUSED_PARAM_1(function), const wchar_t *__UNUSED_PARAM_1(file), unsigned int __UNUSED_PARAM_1(line), uintptr_t __UNUSED_PARAM(pReserved))
Definition: crtexe.c:438
#define NULL
Definition: types.h:112
void(__cdecl * _invalid_parameter_handler)(const wchar_t *, const wchar_t *, const wchar_t *, unsigned int, uintptr_t)
Definition: stdlib.h:137
#define GetProcAddress(x, y)
Definition: compat.h:612

Referenced by __declspec().

◆ __tmainCRTStartup()

static int __cdecl __tmainCRTStartup ( void  )
static

◆ _CRTALLOC()

_CRTALLOC ( ".CRT$XIA"  )

Definition at line 68 of file crtexe.c.

124 {
125  managedapp = check_managed_app ();
126  if (mingw_app_type)
128  else
130  __onexitbegin = __onexitend = (_PVFV *)(-1);
131 
134 
135 #ifdef WPRFLAG
136  _wsetargv();
137 #else
138  _setargv();
139 #endif
141  {
143  }
144 #ifndef __clang__ /* FIXME: CORE-14042 */
145  if (__globallocalestatus == -1)
146  {
147  }
148 #endif
149  return 0;
150 }
#define _commode
Definition: crtexe.c:61
int mingw_app_type
Definition: mingw_helpers.c:31
int __globallocalestatus
int _MINGW_INSTALL_DEBUG_MATHERR
Definition: reactos.c:2
void(__cdecl * _PVFV)(void)
Definition: internal.h:33
void CDECL __setusermatherr(MSVCRT_matherr_func func)
Definition: matherr.c:45
_PVFV * __onexitbegin
Definition: atonexit.c:23
_PVFV * __onexitend
Definition: atonexit.c:24
int __CRTDECL _setargv(void)
Definition: dllargv.c:18
_CRTIMP void __cdecl __set_app_type(int)
Definition: environ.c:360
static int __cdecl check_managed_app(void)
Definition: crtexe.c:351
wchar_t *** __MINGW_IMP_SYMBOL(__winitenv)
int _fmode
Definition: txtmode.c:13
int __CRTDECL _matherr(_Inout_ struct _exception *exception)
#define _CONSOLE_APP
Definition: internal.h:164
int __CRTDECL _wsetargv(void)
#define _GUI_APP
Definition: internal.h:165

◆ _fpreset()

void __cdecl _fpreset ( void  )

Definition at line 13 of file fpreset.c.

14 {
15  const unsigned short x86_cw = 0x27f;
16 #ifdef _MSC_VER
17  __asm { fninit }
18  __asm { fldcw [x86_cw] }
19 #else
20  __asm__ __volatile__( "fninit; fldcw %0" : : "m" (x86_cw) );
21 #endif
23  {
24  const unsigned long sse2_cw = 0x1f80;
25 #ifdef _MSC_VER
26  __asm { ldmxcsr [sse2_cw] }
27 #else
28  __asm__ __volatile__( "ldmxcsr %0" : : "m" (sse2_cw) );
29 #endif
30  }
31 }
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")
BOOL WINAPI IsProcessorFeaturePresent(IN DWORD ProcessorFeature)
Definition: sysinfo.c:168
#define PF_XMMI64_INSTRUCTIONS_AVAILABLE

Referenced by __declspec().

◆ _initterm()

_CRTIMP void __cdecl _initterm ( _PVFV ,
_PVFV  
)

Definition at line 10 of file initterm.c.

11 {
13 
14  TRACE("(%p,%p)\n",start,end);
15  while (current<end)
16  {
17  if (*current)
18  {
19  TRACE("Call init function %p\n",*current);
20  (**current)();
21  TRACE("returned\n");
22  }
23  current++;
24  }
25 }
#define TRACE(s)
Definition: solgame.cpp:4
GLuint GLuint end
Definition: gl.h:1545
void(CDECL * _INITTERMFUN)(void)
Definition: initterm.c:3
GLuint start
Definition: gl.h:1545
struct task_struct * current
Definition: linux.c:32

Referenced by __declspec().

◆ check_managed_app()

static int __cdecl check_managed_app ( void  )
static

Definition at line 351 of file crtexe.c.

352 {
353  PIMAGE_DOS_HEADER pDOSHeader;
354  PIMAGE_NT_HEADERS pPEHeader;
355  PIMAGE_OPTIONAL_HEADER32 pNTHeader32;
356  PIMAGE_OPTIONAL_HEADER64 pNTHeader64;
357 
358  /* Force to be linked. */
363 
364  pDOSHeader = (PIMAGE_DOS_HEADER) &__ImageBase;
365  if (pDOSHeader->e_magic != IMAGE_DOS_SIGNATURE)
366  return 0;
367 
368  pPEHeader = (PIMAGE_NT_HEADERS)((char *)pDOSHeader + pDOSHeader->e_lfanew);
369  if (pPEHeader->Signature != IMAGE_NT_SIGNATURE)
370  return 0;
371 
372  pNTHeader32 = (PIMAGE_OPTIONAL_HEADER32) &pPEHeader->OptionalHeader;
373  switch (pNTHeader32->Magic)
374  {
377  return 0;
380  pNTHeader64 = (PIMAGE_OPTIONAL_HEADER64)pNTHeader32;
382  return 0;
384  }
385  return 0;
386 }
IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]
Definition: ntddk_ex.h:178
int mingw_initltssuo_force
#define IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR
Definition: ntimage.h:489
#define IMAGE_NT_OPTIONAL_HDR32_MAGIC
Definition: ntimage.h:376
#define IMAGE_DOS_SIGNATURE
Definition: pedump.c:89
int mingw_initcharmax
struct _IMAGE_DOS_HEADER * PIMAGE_DOS_HEADER
switch(r->id)
Definition: btrfs.c:2980
#define IMAGE_NT_SIGNATURE
Definition: pedump.c:93
#define IMAGE_NT_OPTIONAL_HDR64_MAGIC
Definition: ntimage.h:377
IMAGE_DOS_HEADER __ImageBase
Definition: mstscax.cpp:17
struct _IMAGE_OPTIONAL_HEADER * PIMAGE_OPTIONAL_HEADER32
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184
int mingw_initltsdyn_force
IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]
Definition: ntimage.h:370
int mingw_initltsdrot_force
struct _IMAGE_OPTIONAL_HEADER64 * PIMAGE_OPTIONAL_HEADER64
PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS
Definition: ntddk_ex.h:187

◆ duplicate_ppstrings()

static void duplicate_ppstrings ( int  ac,
char ***  av 
)
static

Definition at line 414 of file crtexe.c.

415 {
416  char **avl;
417  int i;
418  char **n = (char **) malloc (sizeof (char *) * (ac + 1));
419 
420  avl=*av;
421  for (i=0; i < ac; i++)
422  {
423  size_t l = strlen (avl[i]) + 1;
424  n[i] = (char *) malloc (l);
425  memcpy (n[i], avl[i], l);
426  }
427  n[i] = NULL;
428  *av = n;
429 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLdouble n
Definition: glext.h:7729
r l[0]
Definition: byte_order.h:167
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define NULL
Definition: types.h:112
#define malloc
Definition: debug_ros.c:4

Referenced by __declspec().

◆ mainCRTStartup()

int __cdecl mainCRTStartup ( void  )

Definition at line 196 of file crtexe.c.

197 {
198  int ret = 255;
199 #ifdef __SEH__
200  asm ("\t.l_start:\n"
201  "\t.seh_handler __C_specific_handler, @except\n"
202  "\t.seh_handlerdata\n"
203  "\t.long 1\n"
204  "\t.rva .l_start, .l_end, _gnu_exception_handler ,.l_end\n"
205  "\t.text"
206  );
207 #endif
208  mingw_app_type = 0;
210  ret = __tmainCRTStartup ();
211 #ifdef __SEH__
212  asm ("\tnop\n"
213  "\t.l_end: nop\n");
214 #endif
215  return ret;
216 }
int mingw_app_type
Definition: mingw_helpers.c:31
static int __cdecl __tmainCRTStartup(void)
void __cdecl __security_init_cookie(void)
Definition: gs_support.c:55
int ret

◆ pre_cpp_init()

static void __cdecl pre_cpp_init ( void  )
static

Definition at line 153 of file crtexe.c.

154 {
155  startinfo.newmode = _newmode;
156 
157 #ifdef WPRFLAG
158  argret = __wgetmainargs(&argc,&argv,&envp,_dowildcard,&startinfo);
159 #else
160  argret = __getmainargs(&argc,&argv,&envp,_dowildcard,&startinfo);
161 #endif
162 }
static int argc
Definition: ServiceArgs.c:12
#define argv
Definition: mplay32.c:18
void __getmainargs(int *argc, char ***argv, char ***envp, int expand_wildcards, int *new_mode)
Definition: getargs.c:182
int _newmode
Definition: _newmode.c:7
void CDECL __wgetmainargs(int *argc, WCHAR ***wargv, WCHAR ***wenvp, int expand_wildcards, int *new_mode)
int _dowildcard
Definition: wildcard.c:32

◆ WinMainCRTStartup()

int __cdecl WinMainCRTStartup ( void  )

Definition at line 168 of file crtexe.c.

169 {
170  int ret = 255;
171 #ifdef __SEH__
172  asm ("\t.l_startw:\n"
173  "\t.seh_handler __C_specific_handler, @except\n"
174  "\t.seh_handlerdata\n"
175  "\t.long 1\n"
176  "\t.rva .l_startw, .l_endw, _gnu_exception_handler ,.l_endw\n"
177  "\t.text"
178  );
179 #endif
180  mingw_app_type = 1;
182  ret = __tmainCRTStartup ();
183 #ifdef __SEH__
184  asm ("\tnop\n"
185  "\t.l_endw: nop\n");
186 #endif
187  return ret;
188 }
int mingw_app_type
Definition: mingw_helpers.c:31
static int __cdecl __tmainCRTStartup(void)
void __cdecl __security_init_cookie(void)
Definition: gs_support.c:55
int ret

Variable Documentation

◆ __ImageBase

IMAGE_DOS_HEADER __ImageBase

Definition at line 17 of file mstscax.cpp.

Referenced by __declspec(), and check_managed_app().

◆ _dowildcard

int _dowildcard

Definition at line 32 of file wildcard.c.

Referenced by pre_cpp_init().

◆ _fmode

int _fmode

This file has no copyright assigned and is placed in the Public Domain. This file is part of the w64 mingw-runtime package. No warranty is given; refer to the file DISCLAIMER.PD within this package.

Definition at line 13 of file txtmode.c.

Referenced by __p__fmode().

◆ mingw_initcharmax

int mingw_initcharmax

Referenced by check_managed_app().

◆ mingw_initltsdrot_force

int mingw_initltsdrot_force

Referenced by check_managed_app().

◆ mingw_initltsdyn_force

int mingw_initltsdyn_force

Referenced by check_managed_app().

◆ mingw_initltssuo_force

int mingw_initltssuo_force

Referenced by check_managed_app().