ReactOS  0.4.15-dev-1054-gd029a62
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 426 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 215 of file crtexe.c.

218 {
219  _TCHAR *lpszCommandLine = NULL;
220  STARTUPINFO StartupInfo;
221  WINBOOL inDoubleQuote = FALSE;
222  memset (&StartupInfo, 0, sizeof (STARTUPINFO));
223 
224 #ifndef _WIN64
225  /* We need to make sure that this function is build with frame-pointer
226  and that we align the stack to 16 bytes for the sake of SSE ops in main
227  or in functions inlined into main. */
228  lpszCommandLine = (_TCHAR *) alloca (32);
229  memset (lpszCommandLine, 0xcc, 32);
230 #ifdef __GNUC__
231  asm __volatile__ ("andl $-16, %%esp" : : : "%esp");
232 #endif
233 #endif
234 
235  if (mingw_app_type)
236  GetStartupInfo (&StartupInfo);
237  {
238  void *lock_free = NULL;
239  void *fiberid = ((PNT_TIB)NtCurrentTeb())->StackBase;
240  int nested = FALSE;
241  while((lock_free = InterlockedCompareExchangePointer ((volatile PVOID *) &__native_startup_lock,
242  fiberid, 0)) != 0)
243  {
244  if (lock_free == fiberid)
245  {
246  nested = TRUE;
247  break;
248  }
249  Sleep(1000);
250  }
252  {
253  _amsg_exit (31);
254  }
256  {
258  _initterm ((_PVFV *)(void *)__xi_a, (_PVFV *)(void *) __xi_z);
259  }
260  else
261  has_cctor = 1;
262 
264  {
265  _initterm (__xc_a, __xc_z);
267  }
269  if (! nested)
271 
274 
277 #ifdef _WIN64
279 #endif
281 
282  _fpreset ();
283 
284  if (mingw_app_type)
285  {
286 #ifdef WPRFLAG
287  lpszCommandLine = (_TCHAR *) _wcmdln;
288 #else
289  lpszCommandLine = (char *) _acmdln;
290 #endif
291  while (*lpszCommandLine > SPACECHAR || (*lpszCommandLine && inDoubleQuote))
292  {
293  if (*lpszCommandLine == DQUOTECHAR)
294  inDoubleQuote = !inDoubleQuote;
295 #ifdef _MBCS
296  if (_ismbblead (*lpszCommandLine))
297  {
298  if (lpszCommandLine) /* FIXME: Why this check? Should I check for *lpszCommandLine != 0 too? */
299  lpszCommandLine++;
300  }
301 #endif
302  ++lpszCommandLine;
303  }
304  while (*lpszCommandLine && (*lpszCommandLine <= SPACECHAR))
305  lpszCommandLine++;
306 
308  __mingw_winmain_lpCmdLine = lpszCommandLine;
310  StartupInfo.wShowWindow : SW_SHOWDEFAULT;
311  }
313  __main ();
314 #ifdef WPRFLAG
315 #if !defined(__arm__) && !defined(__aarch64__)
316  __winitenv = envp;
317 #endif
318  /* C++ initialization.
319  gcc inserts this call automatically for a function called main, but not for wmain. */
320  mainret = wmain (argc, argv, envp);
321 #else
322 #if !defined(__arm__) && !defined(__aarch64__)
323  __initenv = envp;
324 #endif
325  mainret = main (argc, argv, envp);
326 #endif
327  if (!managedapp)
328  exit (mainret);
329 
330  if (has_cctor == 0)
331  _cexit ();
332  }
333  return mainret;
334 }
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:405
void __main(void)
Definition: gccmain.c:53
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:820
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:444
#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:792
__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
smooth NULL
Definition: ftsmooth.c:416
#define _ASSERTE(expr)
Definition: crtdbg.h:124
#define STARTF_USESHOWWINDOW
Definition: winbase.h:472
char _TCHAR
Definition: tchar.h:1392
#define InterlockedExchangePointer(Target, Value)
Definition: dshow.h:45
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:117
#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
WORD wShowWindow
Definition: winbase.h:821
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:3681
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 }
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 LoadLibraryW(x)
Definition: compat.h:495
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

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 429 of file crtexe.c.

434 {
435 #ifdef __MINGW_SHOW_INVALID_PARAMETER_EXCEPTION
436  wprintf(L"Invalid parameter detected in function %s. File: %s Line: %u\n", function, file, line);
437  wprintf(L"Expression: %s\n", expression);
438 #endif
439 }
#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 444 of file crtexe.c.

445 {
447 
448  fIPH = (void*)GetProcAddress (__mingw_get_msvcrt_handle(), "_set_invalid_parameter_handler");
449  if (fIPH)
451 }
HANDLE __mingw_get_msvcrt_handle(void)
Definition: pesect.c:236
smooth NULL
Definition: ftsmooth.c:416
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:429
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:501

Referenced by __declspec().

◆ __tmainCRTStartup()

static int __cdecl __tmainCRTStartup ( void  )
static

◆ _CRTALLOC()

_CRTALLOC ( ".CRT$XIA"  )

Definition at line 68 of file crtexe.c.

120 {
121  managedapp = check_managed_app ();
122  if (mingw_app_type)
124  else
127 
130 
131 #ifdef WPRFLAG
132  _wsetargv();
133 #else
134  _setargv();
135 #endif
137  {
139  }
140 #ifndef __clang__ /* FIXME: CORE-14042 */
141  if (__globallocalestatus == -1)
142  {
143  }
144 #endif
145  return 0;
146 }
#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 _encode_pointer(void *)
Definition: mingw_helpers.c:25
void CDECL __setusermatherr(MSVCRT_matherr_func func)
Definition: matherr.c:45
_PVFV * __onexitbegin
Definition: atonexit.c:24
_PVFV * __onexitend
Definition: atonexit.c:25
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:342
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 }
GLuint GLuint end
Definition: gl.h:1545
#define TRACE(s)
Definition: solgame.cpp:4
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 342 of file crtexe.c.

343 {
344  PIMAGE_DOS_HEADER pDOSHeader;
345  PIMAGE_NT_HEADERS pPEHeader;
346  PIMAGE_OPTIONAL_HEADER32 pNTHeader32;
347  PIMAGE_OPTIONAL_HEADER64 pNTHeader64;
348 
349  /* Force to be linked. */
354 
355  pDOSHeader = (PIMAGE_DOS_HEADER) &__ImageBase;
356  if (pDOSHeader->e_magic != IMAGE_DOS_SIGNATURE)
357  return 0;
358 
359  pPEHeader = (PIMAGE_NT_HEADERS)((char *)pDOSHeader + pDOSHeader->e_lfanew);
360  if (pPEHeader->Signature != IMAGE_NT_SIGNATURE)
361  return 0;
362 
363  pNTHeader32 = (PIMAGE_OPTIONAL_HEADER32) &pPEHeader->OptionalHeader;
364  switch (pNTHeader32->Magic)
365  {
368  return 0;
371  pNTHeader64 = (PIMAGE_OPTIONAL_HEADER64)pNTHeader32;
373  return 0;
375  }
376  return 0;
377 }
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 405 of file crtexe.c.

406 {
407  char **avl;
408  int i;
409  char **n = (char **) malloc (sizeof (char *) * (ac + 1));
410 
411  avl=*av;
412  for (i=0; i < ac; i++)
413  {
414  size_t l = strlen (avl[i]) + 1;
415  n[i] = (char *) malloc (l);
416  memcpy (n[i], avl[i], l);
417  }
418  n[i] = NULL;
419  *av = n;
420 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLdouble n
Definition: glext.h:7729
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
smooth NULL
Definition: ftsmooth.c:416
r l[0]
Definition: byte_order.h:167
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define malloc
Definition: debug_ros.c:4

Referenced by __declspec().

◆ mainCRTStartup()

int __cdecl mainCRTStartup ( void  )

Definition at line 192 of file crtexe.c.

193 {
194  int ret = 255;
195 #ifdef __SEH__
196  asm ("\t.l_start:\n"
197  "\t.seh_handler __C_specific_handler, @except\n"
198  "\t.seh_handlerdata\n"
199  "\t.long 1\n"
200  "\t.rva .l_start, .l_end, _gnu_exception_handler ,.l_end\n"
201  "\t.text"
202  );
203 #endif
204  mingw_app_type = 0;
206  ret = __tmainCRTStartup ();
207 #ifdef __SEH__
208  asm ("\tnop\n"
209  "\t.l_end: nop\n");
210 #endif
211  return ret;
212 }
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 149 of file crtexe.c.

150 {
151  startinfo.newmode = _newmode;
152 
153 #ifdef WPRFLAG
154  argret = __wgetmainargs(&argc,&argv,&envp,_dowildcard,&startinfo);
155 #else
156  argret = __getmainargs(&argc,&argv,&envp,_dowildcard,&startinfo);
157 #endif
158 }
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 164 of file crtexe.c.

165 {
166  int ret = 255;
167 #ifdef __SEH__
168  asm ("\t.l_startw:\n"
169  "\t.seh_handler __C_specific_handler, @except\n"
170  "\t.seh_handlerdata\n"
171  "\t.long 1\n"
172  "\t.rva .l_startw, .l_endw, _gnu_exception_handler ,.l_endw\n"
173  "\t.text"
174  );
175 #endif
176  mingw_app_type = 1;
178  ret = __tmainCRTStartup ();
179 #ifdef __SEH__
180  asm ("\tnop\n"
181  "\t.l_endw: nop\n");
182 #endif
183  return ret;
184 }
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().