ReactOS 0.4.16-dev-297-gc569aee
msvcrt.h File Reference
#include <stdarg.h>
#include <signal.h>
#include "windef.h"
#include "winbase.h"
Include dependency graph for msvcrt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _sig_element
 
struct  ioinfo
 

Macros

#define _UNKNOWN_APP   0
 
#define _CONSOLE_APP   1
 
#define _GUI_APP   2
 
#define _IOYOURBUF   0x0100
 
#define _IOAPPEND   0x0200
 
#define _IOSETVBUF   0x0400
 
#define _IOFEOF   0x0800
 
#define _IOFLRTN   0x1000
 
#define _IOCTRLZ   0x2000
 
#define _IOCOMMIT   0x4000
 
#define _IOFREE   0x10000
 
#define MSVCRT__WRITE_ABORT_MSG   1
 
#define MSVCRT__CALL_REPORTFAULT   2
 
#define MSVCRT_LC_ALL   LC_ALL
 
#define MSVCRT_LC_COLLATE   LC_COLLATE
 
#define MSVCRT_LC_CTYPE   LC_CTYPE
 
#define MSVCRT_LC_MONETARY   LC_MONETARY
 
#define MSVCRT_LC_NUMERIC   LC_NUMERIC
 
#define MSVCRT_LC_TIME   LC_TIME
 
#define MSVCRT_LC_MIN   LC_MIN
 
#define MSVCRT_LC_MAX   LC_MAX
 
#define MSVCRT__OUT_TO_DEFAULT   0
 
#define MSVCRT__OUT_TO_STDERR   1
 
#define MSVCRT__OUT_TO_MSGBOX   2
 
#define MSVCRT__REPORT_ERRMODE   3
 
#define UNDNAME_COMPLETE   (0x0000)
 
#define UNDNAME_NO_LEADING_UNDERSCORES   (0x0001) /* Don't show __ in calling convention */
 
#define UNDNAME_NO_MS_KEYWORDS   (0x0002) /* Don't show calling convention at all */
 
#define UNDNAME_NO_FUNCTION_RETURNS   (0x0004) /* Don't show function/method return value */
 
#define UNDNAME_NO_ALLOCATION_MODEL   (0x0008)
 
#define UNDNAME_NO_ALLOCATION_LANGUAGE   (0x0010)
 
#define UNDNAME_NO_MS_THISTYPE   (0x0020)
 
#define UNDNAME_NO_CV_THISTYPE   (0x0040)
 
#define UNDNAME_NO_THISTYPE   (0x0060)
 
#define UNDNAME_NO_ACCESS_SPECIFIERS   (0x0080) /* Don't show access specifier (public/protected/private) */
 
#define UNDNAME_NO_THROW_SIGNATURES   (0x0100)
 
#define UNDNAME_NO_MEMBER_TYPE   (0x0200) /* Don't show static/virtual specifier */
 
#define UNDNAME_NO_RETURN_UDT_MODEL   (0x0400)
 
#define UNDNAME_32_BIT_DECODE   (0x0800)
 
#define UNDNAME_NAME_ONLY   (0x1000) /* Only report the variable/method name */
 
#define UNDNAME_NO_ARGUMENTS   (0x2000) /* Don't show method arguments */
 
#define UNDNAME_NO_SPECIAL_SYMS   (0x4000)
 
#define UNDNAME_NO_COMPLEX_TYPE   (0x8000)
 
#define MSVCRT_malloc   malloc
 
#define MSVCRT_free   free
 

Typedefs

typedef void *(__cdeclmalloc_func_t) (size_t)
 
typedef void(__cdeclfree_func_t) (void *)
 
typedef void(* float_handler) (int, int)
 
typedef struct _sig_element sig_element
 

Functions

void __cdecl _purecall (void)
 
 __declspec (noreturn) void __cdecl _amsg_exit(int errnum)
 
char ** SnapshotOfEnvironmentA (char **)
 
wchar_t ** SnapshotOfEnvironmentW (wchar_t **)
 
void *__cdecl MSVCRT_operator_new (size_t)
 
void __cdecl MSVCRT_operator_delete (void *)
 
void msvcrt_init_mt_locks (void)
 
void msvcrt_free_mt_locks (void)
 
BOOL msvcrt_init_locale (void)
 
void msvcrt_init_math (void)
 
void msvcrt_init_io (void)
 
void msvcrt_free_io (void)
 
void msvcrt_init_console (void)
 
void msvcrt_free_console (void)
 
void msvcrt_init_args (void)
 
void msvcrt_free_args (void)
 
void msvcrt_init_signals (void)
 
void msvcrt_free_signals (void)
 
void msvcrt_free_popen_data (void)
 
unsigned create_io_inherit_block (WORD *, BYTE **)
 
char *__cdecl __unDName (char *, const char *, int, malloc_func_t, free_func_t, unsigned short int)
 
void _default_handler (int signal)
 
char_setlocale (int, const char *)
 
NTSYSAPI VOID NTAPI RtlAssert (PVOID FailedAssertion, PVOID FileName, ULONG LineNumber, PCHAR Message)
 

Variables

unsigned int __lc_codepage
 
int __lc_collate_cp
 
int __mb_cur_max
 
const unsigned short _ctype [257]
 
char ** _environ
 
wchar_t ** _wenviron
 

Macro Definition Documentation

◆ _CONSOLE_APP

#define _CONSOLE_APP   1

Definition at line 59 of file msvcrt.h.

◆ _GUI_APP

#define _GUI_APP   2

Definition at line 60 of file msvcrt.h.

◆ _IOAPPEND

#define _IOAPPEND   0x0200

Definition at line 64 of file msvcrt.h.

◆ _IOCOMMIT

#define _IOCOMMIT   0x4000

Definition at line 69 of file msvcrt.h.

◆ _IOCTRLZ

#define _IOCTRLZ   0x2000

Definition at line 68 of file msvcrt.h.

◆ _IOFEOF

#define _IOFEOF   0x0800

Definition at line 66 of file msvcrt.h.

◆ _IOFLRTN

#define _IOFLRTN   0x1000

Definition at line 67 of file msvcrt.h.

◆ _IOFREE

#define _IOFREE   0x10000

Definition at line 70 of file msvcrt.h.

◆ _IOSETVBUF

#define _IOSETVBUF   0x0400

Definition at line 65 of file msvcrt.h.

◆ _IOYOURBUF

#define _IOYOURBUF   0x0100

Definition at line 63 of file msvcrt.h.

◆ _UNKNOWN_APP

#define _UNKNOWN_APP   0

Definition at line 58 of file msvcrt.h.

◆ MSVCRT__CALL_REPORTFAULT

#define MSVCRT__CALL_REPORTFAULT   2

Definition at line 104 of file msvcrt.h.

◆ MSVCRT__OUT_TO_DEFAULT

#define MSVCRT__OUT_TO_DEFAULT   0

Definition at line 115 of file msvcrt.h.

◆ MSVCRT__OUT_TO_MSGBOX

#define MSVCRT__OUT_TO_MSGBOX   2

Definition at line 117 of file msvcrt.h.

◆ MSVCRT__OUT_TO_STDERR

#define MSVCRT__OUT_TO_STDERR   1

Definition at line 116 of file msvcrt.h.

◆ MSVCRT__REPORT_ERRMODE

#define MSVCRT__REPORT_ERRMODE   3

Definition at line 118 of file msvcrt.h.

◆ MSVCRT__WRITE_ABORT_MSG

#define MSVCRT__WRITE_ABORT_MSG   1

Definition at line 103 of file msvcrt.h.

◆ MSVCRT_free

#define MSVCRT_free   free

Definition at line 152 of file msvcrt.h.

◆ MSVCRT_LC_ALL

#define MSVCRT_LC_ALL   LC_ALL

Definition at line 106 of file msvcrt.h.

◆ MSVCRT_LC_COLLATE

#define MSVCRT_LC_COLLATE   LC_COLLATE

Definition at line 107 of file msvcrt.h.

◆ MSVCRT_LC_CTYPE

#define MSVCRT_LC_CTYPE   LC_CTYPE

Definition at line 108 of file msvcrt.h.

◆ MSVCRT_LC_MAX

#define MSVCRT_LC_MAX   LC_MAX

Definition at line 113 of file msvcrt.h.

◆ MSVCRT_LC_MIN

#define MSVCRT_LC_MIN   LC_MIN

Definition at line 112 of file msvcrt.h.

◆ MSVCRT_LC_MONETARY

#define MSVCRT_LC_MONETARY   LC_MONETARY

Definition at line 109 of file msvcrt.h.

◆ MSVCRT_LC_NUMERIC

#define MSVCRT_LC_NUMERIC   LC_NUMERIC

Definition at line 110 of file msvcrt.h.

◆ MSVCRT_LC_TIME

#define MSVCRT_LC_TIME   LC_TIME

Definition at line 111 of file msvcrt.h.

◆ MSVCRT_malloc

#define MSVCRT_malloc   malloc

Definition at line 151 of file msvcrt.h.

◆ UNDNAME_32_BIT_DECODE

#define UNDNAME_32_BIT_DECODE   (0x0800)

Definition at line 136 of file msvcrt.h.

◆ UNDNAME_COMPLETE

#define UNDNAME_COMPLETE   (0x0000)

Definition at line 123 of file msvcrt.h.

◆ UNDNAME_NAME_ONLY

#define UNDNAME_NAME_ONLY   (0x1000) /* Only report the variable/method name */

Definition at line 137 of file msvcrt.h.

◆ UNDNAME_NO_ACCESS_SPECIFIERS

#define UNDNAME_NO_ACCESS_SPECIFIERS   (0x0080) /* Don't show access specifier (public/protected/private) */

Definition at line 132 of file msvcrt.h.

◆ UNDNAME_NO_ALLOCATION_LANGUAGE

#define UNDNAME_NO_ALLOCATION_LANGUAGE   (0x0010)

Definition at line 128 of file msvcrt.h.

◆ UNDNAME_NO_ALLOCATION_MODEL

#define UNDNAME_NO_ALLOCATION_MODEL   (0x0008)

Definition at line 127 of file msvcrt.h.

◆ UNDNAME_NO_ARGUMENTS

#define UNDNAME_NO_ARGUMENTS   (0x2000) /* Don't show method arguments */

Definition at line 138 of file msvcrt.h.

◆ UNDNAME_NO_COMPLEX_TYPE

#define UNDNAME_NO_COMPLEX_TYPE   (0x8000)

Definition at line 140 of file msvcrt.h.

◆ UNDNAME_NO_CV_THISTYPE

#define UNDNAME_NO_CV_THISTYPE   (0x0040)

Definition at line 130 of file msvcrt.h.

◆ UNDNAME_NO_FUNCTION_RETURNS

#define UNDNAME_NO_FUNCTION_RETURNS   (0x0004) /* Don't show function/method return value */

Definition at line 126 of file msvcrt.h.

◆ UNDNAME_NO_LEADING_UNDERSCORES

#define UNDNAME_NO_LEADING_UNDERSCORES   (0x0001) /* Don't show __ in calling convention */

Definition at line 124 of file msvcrt.h.

◆ UNDNAME_NO_MEMBER_TYPE

#define UNDNAME_NO_MEMBER_TYPE   (0x0200) /* Don't show static/virtual specifier */

Definition at line 134 of file msvcrt.h.

◆ UNDNAME_NO_MS_KEYWORDS

#define UNDNAME_NO_MS_KEYWORDS   (0x0002) /* Don't show calling convention at all */

Definition at line 125 of file msvcrt.h.

◆ UNDNAME_NO_MS_THISTYPE

#define UNDNAME_NO_MS_THISTYPE   (0x0020)

Definition at line 129 of file msvcrt.h.

◆ UNDNAME_NO_RETURN_UDT_MODEL

#define UNDNAME_NO_RETURN_UDT_MODEL   (0x0400)

Definition at line 135 of file msvcrt.h.

◆ UNDNAME_NO_SPECIAL_SYMS

#define UNDNAME_NO_SPECIAL_SYMS   (0x4000)

Definition at line 139 of file msvcrt.h.

◆ UNDNAME_NO_THISTYPE

#define UNDNAME_NO_THISTYPE   (0x0060)

Definition at line 131 of file msvcrt.h.

◆ UNDNAME_NO_THROW_SIGNATURES

#define UNDNAME_NO_THROW_SIGNATURES   (0x0100)

Definition at line 133 of file msvcrt.h.

Typedef Documentation

◆ float_handler

typedef void(* float_handler) (int, int)

Definition at line 142 of file msvcrt.h.

◆ free_func_t

typedef void(__cdecl * free_func_t) (void *)

Definition at line 82 of file msvcrt.h.

◆ malloc_func_t

typedef void *(__cdecl * malloc_func_t) (size_t)

Definition at line 81 of file msvcrt.h.

◆ sig_element

Function Documentation

◆ __declspec()

__declspec ( noreturn  )

Definition at line 19 of file noreturn.cpp.

21{
22 throw 1;
23}

◆ __unDName()

char *__cdecl __unDName ( char buffer,
const char mangled,
int  buflen,
malloc_func_t  memget,
free_func_t  memfree,
unsigned short int  flags 
)

Definition at line 1647 of file undname.c.

1650{
1651 return __unDNameEx(buffer, mangled, buflen, memget, memfree, NULL, flags);
1652}
#define NULL
Definition: types.h:112
GLuint buffer
Definition: glext.h:5915
GLbitfield flags
Definition: glext.h:7161
char *CDECL __unDNameEx(char *buffer, const char *mangled, int buflen, malloc_func_t memget, free_func_t memfree, void *unknown, unsigned short int flags)
Definition: undname.c:1600

◆ _default_handler()

void _default_handler ( int  signal)

Definition at line 120 of file signal.c.

121{
122 _exit(3);
123}
void _exit(int exitcode)
Definition: _exit.c:25

Referenced by raise().

◆ _purecall()

void __cdecl _purecall ( void  )

Definition at line 429 of file adapter.cpp.

430{
431 return 0;
432}

◆ _setlocale()

char * _setlocale ( int  ,
const char  
)

◆ create_io_inherit_block()

unsigned create_io_inherit_block ( WORD size,
BYTE **  block 
)

Definition at line 411 of file file.c.

412{
413 int fd, last_fd;
414 char* wxflag_ptr;
415 HANDLE* handle_ptr;
416 ioinfo* fdinfo;
417
418 for (last_fd=MSVCRT_MAX_FILES-1; last_fd>=0; last_fd--)
420 break;
421 last_fd++;
422
423 *size = sizeof(unsigned) + (sizeof(char) + sizeof(HANDLE)) * last_fd;
424 *block = calloc(1, *size);
425 if (!*block)
426 {
427 *size = 0;
428 return FALSE;
429 }
430 wxflag_ptr = (char*)*block + sizeof(unsigned);
431 handle_ptr = (HANDLE*)(wxflag_ptr + last_fd);
432
433 *(unsigned*)*block = last_fd;
434 for (fd = 0; fd < last_fd; fd++)
435 {
436 /* to be inherited, we need it to be open, and that DONTINHERIT isn't set */
437 fdinfo = get_ioinfo_nolock(fd);
438 if ((fdinfo->wxflag & (WX_OPEN | WX_DONTINHERIT)) == WX_OPEN)
439 {
440 *wxflag_ptr = fdinfo->wxflag;
441 *handle_ptr = fdinfo->handle;
442 }
443 else
444 {
445 *wxflag_ptr = 0;
446 *handle_ptr = INVALID_HANDLE_VALUE;
447 }
448 wxflag_ptr++; handle_ptr++;
449 }
450 return TRUE;
451}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
GLsizeiptr size
Definition: glext.h:5919
static unsigned(__cdecl *hash_bstr)(bstr_t s)
#define calloc
Definition: rosglue.h:14
#define WX_OPEN
Definition: file.c:91
#define MSVCRT_MAX_FILES
Definition: file.c:112
#define WX_DONTINHERIT
Definition: file.c:97
static ioinfo * get_ioinfo_nolock(int fd)
Definition: file.c:158
static int fd
Definition: io.c:51
Definition: file.c:40
unsigned char wxflag
Definition: file.c:42
HANDLE handle
Definition: file.c:41
PVOID HANDLE
Definition: typedefs.h:73
static unsigned int block
Definition: xmlmemory.c:101

◆ msvcrt_free_args()

void msvcrt_free_args ( void  )

◆ msvcrt_free_console()

void msvcrt_free_console ( void  )

◆ msvcrt_free_io()

void msvcrt_free_io ( void  )

Definition at line 1100 of file file.c.

1101{
1102 unsigned int i;
1103 int j;
1104
1105 _flushall();
1106 _fcloseall();
1107
1108 for(i=0; i<sizeof(__pioinfo)/sizeof(__pioinfo[0]); i++)
1109 {
1110 if(!__pioinfo[i])
1111 continue;
1112
1113 for(j=0; j<MSVCRT_FD_BLOCK_SIZE; j++)
1114 {
1115 if(__pioinfo[i][j].exflag & EF_CRIT_INIT)
1117 }
1118 free(__pioinfo[i]);
1119 }
1120
1121 for(j=0; j<MSVCRT_stream_idx; j++)
1122 {
1125 {
1126 ((file_crit*)file)->crit.DebugInfo->Spare[0] = 0;
1128 }
1129 }
1130
1131 for(i=0; i<sizeof(MSVCRT_fstream)/sizeof(MSVCRT_fstream[0]); i++)
1133}
#define free
Definition: debug_ros.c:5
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
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 GLint GLint j
Definition: glfuncs.h:250
#define _IOB_ENTRIES
Definition: stdio.h:23
static file_crit * MSVCRT_fstream[MSVCRT_MAX_FILES/MSVCRT_FD_BLOCK_SIZE]
Definition: file.c:134
FILE _iob[_IOB_ENTRIES]
Definition: file.c:133
int CDECL _fcloseall(void)
Definition: file.c:1081
#define EF_CRIT_INIT
Definition: file.c:105
static FILE * msvcrt_get_file(int i)
Definition: file.c:269
ioinfo * __pioinfo[MSVCRT_MAX_FILES/MSVCRT_FD_BLOCK_SIZE]
Definition: file.c:121
int CDECL _flushall(void)
Definition: file.c:893
#define MSVCRT_FD_BLOCK_SIZE
Definition: file.c:113
static int MSVCRT_stream_idx
Definition: file.c:135
Definition: fci.c:127
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

◆ msvcrt_free_mt_locks()

void msvcrt_free_mt_locks ( void  )

Definition at line 77 of file lock.c.

78{
79 int i;
80
81 TRACE(": uninitializing all mtlocks\n" );
82
83 /* Uninitialize the table */
84 for( i=0; i < _TOTAL_LOCKS; i++ )
85 {
86 if( lock_table[ i ].bInit )
87 {
89 }
90 }
91}
#define _TOTAL_LOCKS
Definition: mtdll.h:70
static __inline void msvcrt_uninitialize_mlock(int locknum)
Definition: lock.c:41
static LOCKTABLEENTRY lock_table[_TOTAL_LOCKS]
Definition: lock.c:28
#define TRACE(s)
Definition: solgame.cpp:4

◆ msvcrt_free_popen_data()

void msvcrt_free_popen_data ( void  )

Definition at line 29 of file popen.c.

30{
32}
struct popen_handle * popen_handles
Definition: popen.c:26

Referenced by DllMain(), and msvcrt_init_exception().

◆ msvcrt_free_signals()

void msvcrt_free_signals ( void  )

Definition at line 183 of file except.c.

184{
186}
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleCtrlHandler(PHANDLER_ROUTINE HandlerRoutine, BOOL Add)
Definition: console.c:2109
static BOOL WINAPI msvcrt_console_handler(DWORD ctrlType)
Definition: except.c:50

◆ msvcrt_init_args()

void msvcrt_init_args ( void  )

◆ msvcrt_init_console()

void msvcrt_init_console ( void  )

◆ msvcrt_init_io()

void msvcrt_init_io ( void  )

Definition at line 456 of file file.c.

457{
458 STARTUPINFOA si;
459 unsigned int i;
460 ioinfo *fdinfo;
461
462 GetStartupInfoA(&si);
463 if (si.cbReserved2 >= sizeof(unsigned int) && si.lpReserved2 != NULL)
464 {
465 BYTE* wxflag_ptr;
466 HANDLE* handle_ptr;
467 unsigned int count;
468
469 count = *(unsigned*)si.lpReserved2;
470 wxflag_ptr = si.lpReserved2 + sizeof(unsigned);
471 handle_ptr = (HANDLE*)(wxflag_ptr + count);
472
473 count = min(count, (si.cbReserved2 - sizeof(unsigned)) / (sizeof(HANDLE) + 1));
475 for (i = 0; i < count; i++)
476 {
477 if ((*wxflag_ptr & WX_OPEN) && GetFileType(*handle_ptr) != FILE_TYPE_UNKNOWN)
478 {
479 fdinfo = get_ioinfo_alloc_fd(i);
480 if(fdinfo != &__badioinfo)
481 msvcrt_set_fd(fdinfo, *handle_ptr, *wxflag_ptr);
482 release_ioinfo(fdinfo);
483 }
484
485 wxflag_ptr++; handle_ptr++;
486 }
487 }
488
490 if (!(fdinfo->wxflag & WX_OPEN) || fdinfo->handle == INVALID_HANDLE_VALUE) {
493
494 msvcrt_set_fd(fdinfo, h, WX_OPEN|WX_TEXT|((type&0xf)==FILE_TYPE_CHAR ? WX_TTY : 0)
495 |((type&0xf)==FILE_TYPE_PIPE ? WX_PIPE : 0));
496 }
497 release_ioinfo(fdinfo);
498
500 if (!(fdinfo->wxflag & WX_OPEN) || fdinfo->handle == INVALID_HANDLE_VALUE) {
503
504 msvcrt_set_fd(fdinfo, h, WX_OPEN|WX_TEXT|((type&0xf)==FILE_TYPE_CHAR ? WX_TTY : 0)
505 |((type&0xf)==FILE_TYPE_PIPE ? WX_PIPE : 0));
506 }
507 release_ioinfo(fdinfo);
508
510 if (!(fdinfo->wxflag & WX_OPEN) || fdinfo->handle == INVALID_HANDLE_VALUE) {
513
514 msvcrt_set_fd(fdinfo, h, WX_OPEN|WX_TEXT|((type&0xf)==FILE_TYPE_CHAR ? WX_TTY : 0)
515 |((type&0xf)==FILE_TYPE_PIPE ? WX_PIPE : 0));
516 }
517 release_ioinfo(fdinfo);
518
519 TRACE(":handles (%p)(%p)(%p)\n", get_ioinfo_nolock(STDIN_FILENO)->handle,
522
523 memset(_iob,0,3*sizeof(FILE));
524 for (i = 0; i < 3; i++)
525 {
526 /* FILE structs for stdin/out/err are static and never deleted */
527 _iob[i]._file = i;
528 _iob[i]._tmpfname = NULL;
529 _iob[i]._flag = (i == 0) ? _IOREAD : _IOWRT;
530 }
532}
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
Definition: console.c:203
DWORD WINAPI GetFileType(HANDLE hFile)
Definition: fileinfo.c:269
VOID WINAPI GetStartupInfoA(IN LPSTARTUPINFOA lpStartupInfo)
Definition: proc.c:1320
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define _IOWRT
Definition: stdio.h:125
#define _IOREAD
Definition: stdio.h:124
#define min(a, b)
Definition: monoChain.cc:55
#define STDOUT_FILENO
Definition: syshdrs.h:89
#define STDERR_FILENO
Definition: syshdrs.h:90
#define STDIN_FILENO
Definition: syshdrs.h:88
static ioinfo * get_ioinfo_alloc_fd(int fd)
Definition: file.c:216
void release_ioinfo(ioinfo *info)
Definition: file.c:263
#define WX_TTY
Definition: file.c:99
static void msvcrt_set_fd(ioinfo *fdinfo, HANDLE hand, int flag)
Definition: file.c:325
#define WX_PIPE
Definition: file.c:95
#define WX_TEXT
Definition: file.c:100
ioinfo __badioinfo
Definition: file.c:126
#define memset(x, y, z)
Definition: compat.h:39
WORD cbReserved2
Definition: winbase.h:869
PBYTE lpReserved2
Definition: winbase.h:870
int _file
Definition: mbstring.h:24
int _flag
Definition: mbstring.h:23
char * _tmpfname
Definition: mbstring.h:27
#define STD_OUTPUT_HANDLE
Definition: winbase.h:294
#define STD_INPUT_HANDLE
Definition: winbase.h:293
#define FILE_TYPE_UNKNOWN
Definition: winbase.h:284
#define STD_ERROR_HANDLE
Definition: winbase.h:295
#define FILE_TYPE_CHAR
Definition: winbase.h:286
#define FILE_TYPE_PIPE
Definition: winbase.h:287
unsigned char BYTE
Definition: xxhash.c:193

◆ msvcrt_init_locale()

BOOL msvcrt_init_locale ( void  )

◆ msvcrt_init_math()

void msvcrt_init_math ( void  )

◆ msvcrt_init_mt_locks()

void msvcrt_init_mt_locks ( void  )

Definition at line 54 of file lock.c.

55{
56 int i;
57
58 TRACE( "initializing mtlocks\n" );
59
60 /* Initialize the table */
61 for( i=0; i < _TOTAL_LOCKS; i++ )
62 {
64 }
65
66 /* Initialize our lock table lock */
68}
#define _LOCKTAB_LOCK
Definition: mtdll.h:54
static __inline void msvcrt_mlock_set_entry_initialized(int locknum, BOOL initialized)
Definition: lock.c:30
static __inline void msvcrt_initialize_mlock(int locknum)
Definition: lock.c:35

◆ msvcrt_init_signals()

void msvcrt_init_signals ( void  )

Definition at line 178 of file except.c.

◆ MSVCRT_operator_delete()

void __cdecl MSVCRT_operator_delete ( void mem)

Definition at line 196 of file heap.c.

197{
198 TRACE("(%p)\n", mem);
200}
static BOOL msvcrt_heap_free(void *ptr)
Definition: heap.c:127
Definition: mem.c:349

◆ MSVCRT_operator_new()

void *__cdecl MSVCRT_operator_new ( size_t  size)
  • FIXME: This should be declared in new.h but it's not an extern "C" so

Definition at line 152 of file heap.c.

153{
154 void *retval;
155 int freed;
157
158 do
159 {
160 retval = msvcrt_heap_alloc(0, size);
161 if(retval)
162 {
163 TRACE("(%ld) returning %p\n", size, retval);
164 return retval;
165 }
166
167 LOCK_HEAP;
169 if(handler)
170 freed = (*handler)(size);
171 else
172 freed = 0;
174 } while(freed);
175
176 TRACE("(%ld) out of memory\n", size);
177#if _MSVCR_VER >= 80
178 throw_exception(EXCEPTION_BAD_ALLOC, 0, "bad allocation");
179#endif
180 return NULL;
181}
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7512
int(CDECL * MSVCRT_new_handler_func)(MSVCRT_size_t size)
Definition: heap.c:67
static void * msvcrt_heap_alloc(DWORD flags, MSVCRT_size_t size)
Definition: heap.c:77
#define UNLOCK_HEAP
Definition: heap.c:54
static MSVCRT_new_handler_func MSVCRT_new_handler
Definition: heap.c:69
#define LOCK_HEAP
Definition: heap.c:53

◆ RtlAssert()

NTSYSAPI VOID NTAPI RtlAssert ( PVOID  FailedAssertion,
PVOID  FileName,
ULONG  LineNumber,
PCHAR  Message 
)

◆ SnapshotOfEnvironmentA()

char ** SnapshotOfEnvironmentA ( char **  )

◆ SnapshotOfEnvironmentW()

wchar_t ** SnapshotOfEnvironmentW ( wchar_t **  )

Variable Documentation

◆ __lc_codepage

unsigned int __lc_codepage
extern

Definition at line 36 of file locale.c.

Referenced by ___lc_codepage_func(), __init_global_locale(), setlocale(), and Test___lc_codepage().

◆ __lc_collate_cp

int __lc_collate_cp
extern

Referenced by Test___lc_collate_cp().

◆ __mb_cur_max

int __mb_cur_max
extern

Definition at line 39 of file locale.c.

Referenced by __init_global_locale(), and setlocale().

◆ _ctype

const unsigned short _ctype[257]
extern

Definition at line 36 of file ctype.c.

Referenced by MSVCRT__create_locale(), and Test__ctype().

◆ _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.