ReactOS 0.4.16-dev-2110-ge3521eb
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 1783 of file undname.c.

1786{
1787 return __unDNameEx(buffer, mangled, buflen, memget, memfree, NULL, flags);
1788}
#define NULL
Definition: types.h:112
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:1736
GLuint buffer
Definition: glext.h:5915
GLbitfield flags
Definition: glext.h:7161

◆ _default_handler()

void _default_handler ( int  signal)

Definition at line 120 of file signal.c.

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

Referenced by raise().

◆ _purecall()

void __cdecl _purecall ( void  )

Definition at line 494 of file exit.c.

495{
496 TRACE("(void)\n");
497
500 _amsg_exit( 25 );
501}
static _purecall_handler purecall_handler
Definition: exit.c:35
void CDECL _amsg_exit(int errnum)
Definition: exit.c:233
#define TRACE(s)
Definition: solgame.cpp:4

◆ _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
#define WX_OPEN
Definition: file.c:80
#define MSVCRT_MAX_FILES
Definition: file.c:125
static ioinfo * get_ioinfo_nolock(int fd)
Definition: file.c:394
GLsizeiptr size
Definition: glext.h:5919
static unsigned(__cdecl *hash_bstr)(bstr_t s)
#define calloc
Definition: rosglue.h:14
#define WX_DONTINHERIT
Definition: file.c:97
static int fd
Definition: io.c:51
Definition: file.c:128
unsigned char wxflag
Definition: file.c:130
HANDLE handle
Definition: file.c:129
PVOID HANDLE
Definition: typedefs.h:73
static unsigned int block
Definition: xmlmemory.c:101

◆ msvcrt_free_args()

void msvcrt_free_args ( void  )

Definition at line 462 of file data.c.

463{
464 /* FIXME: more things to free */
469}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
char * MSVCRT__pgmptr
Definition: data.c:60
char ** MSVCRT___argv
Definition: data.c:50
WCHAR * MSVCRT__wpgmptr
Definition: data.c:61
static wchar_t ** wargv_expand
Definition: data.c:52

◆ msvcrt_free_console()

void msvcrt_free_console ( void  )

Definition at line 68 of file console.c.

69{
70 TRACE(":Closing console handles\n");
73}
#define CloseHandle
Definition: compat.h:739
static HANDLE MSVCRT_console_out
Definition: console.c:37
static HANDLE MSVCRT_console_in
Definition: console.c:36

◆ msvcrt_free_io()

void msvcrt_free_io ( void  )

Definition at line 1392 of file file.c.

1393{
1394 unsigned int i;
1395 int j;
1396
1397 _flushall();
1398 _fcloseall();
1399
1400 for(i=0; i<ARRAY_SIZE(MSVCRT___pioinfo); i++)
1401 {
1402 if(!MSVCRT___pioinfo[i])
1403 continue;
1404
1405 for(j=0; j<MSVCRT_FD_BLOCK_SIZE; j++)
1406 {
1409 }
1411 }
1412
1413 for(j=0; j<MSVCRT_stream_idx; j++)
1414 {
1417
1418 if(cs)
1419 {
1420 cs->DebugInfo->Spare[0] = 0;
1422 }
1423 }
1424
1425 for(i=0; i<ARRAY_SIZE(MSVCRT_fstream); i++)
1427}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define free
Definition: debug_ros.c:5
static file_crit * MSVCRT_fstream[MSVCRT_MAX_FILES/MSVCRT_FD_BLOCK_SIZE]
Definition: file.c:278
ioinfo * MSVCRT___pioinfo[MSVCRT_MAX_FILES/MSVCRT_FD_BLOCK_SIZE]
Definition: file.c:155
static BOOL ioinfo_is_crit_init(ioinfo *info)
Definition: file.c:201
int CDECL _fcloseall(void)
Definition: file.c:1373
static FILE * msvcrt_get_file(int i)
Definition: file.c:520
static CRITICAL_SECTION * file_get_cs(FILE *f)
Definition: file.c:270
int CDECL _flushall(void)
Definition: file.c:1174
#define MSVCRT_FD_BLOCK_SIZE
Definition: file.c:126
static int MSVCRT_stream_idx
Definition: file.c:279
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 cs
Definition: i386-dis.c:442
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}
static LOCKTABLEENTRY lock_table[_TOTAL_LOCKS]
Definition: lock.c:38
static void msvcrt_uninitialize_mlock(int locknum)
Definition: lock.c:52
#define _TOTAL_LOCKS
Definition: mtdll.h:59

◆ msvcrt_free_popen_data()

void msvcrt_free_popen_data ( void  )

Definition at line 1034 of file process.c.

1035{
1037}
static struct popen_handle * popen_handles

◆ msvcrt_free_signals()

void msvcrt_free_signals ( void  )

Definition at line 640 of file except.c.

641{
643}
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleCtrlHandler(PHANDLER_ROUTINE HandlerRoutine, BOOL Add)
Definition: console.c:2111
static BOOL WINAPI msvcrt_console_handler(DWORD ctrlType)
Definition: except.c:507

◆ msvcrt_init_args()

void msvcrt_init_args ( void  )

Definition at line 404 of file data.c.

405{
407
414
415 TRACE("got %s, wide = %s argc=%d\n", debugstr_a(MSVCRT__acmdln),
417
425 TRACE( "winver %08x winmajor %08x winminor %08x osver %08x\n",
427#ifdef _CRTDLL
431#endif
432
436#ifndef __REACTOS__
438#endif
439
441
443 if (MSVCRT__pgmptr)
444 {
446 MSVCRT__pgmptr[0] = '\0';
447 else
448 MSVCRT__pgmptr[MAX_PATH - 1] = '\0';
449 }
450
452 if (MSVCRT__wpgmptr)
453 {
455 MSVCRT__wpgmptr[0] = '\0';
456 else
457 MSVCRT__wpgmptr[MAX_PATH - 1] = '\0';
458 }
459}
#define _strdup
Definition: debug_ros.c:7
#define _O_TEXT
Definition: cabinet.h:50
unsigned int CRTDLL__baseminor_dll
Definition: dllmain.c:38
unsigned int CRTDLL__basemajor_dll
Definition: dllmain.c:37
unsigned int CRTDLL__baseversion_dll
Definition: dllmain.c:39
#define HeapAlloc
Definition: compat.h:733
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:539
BOOL WINAPI GetVersionExW(IN LPOSVERSIONINFOW lpVersionInformation)
Definition: version.c:37
LPWSTR WINAPI GetCommandLineW(void)
Definition: process.c:1338
LPSTR WINAPI GetCommandLineA(void)
Definition: process.c:1329
DWORD WINAPI GetVersion(void)
Definition: version.c:1458
unsigned int MSVCRT__winmajor
Definition: data.c:37
wchar_t ** MSVCRT___wargv
Definition: data.c:51
unsigned int MSVCRT__osplatform
Definition: data.c:36
unsigned int MSVCRT___unguarded_readlc_active
Definition: data.c:48
unsigned int MSVCRT___setlc_active
Definition: data.c:47
unsigned int MSVCRT__osver
Definition: data.c:35
static char ** build_argv(WCHAR **wargv)
Definition: data.c:63
int MSVCRT__fmode
Definition: data.c:34
static WCHAR ** cmdline_to_argv(const WCHAR *src, int *ret_argc)
Definition: data.c:85
static int initial_argc
Definition: data.c:30
unsigned int MSVCRT__winminor
Definition: data.c:38
double MSVCRT__HUGE
Definition: data.c:49
static WCHAR ** initial_wargv
Definition: data.c:29
unsigned int MSVCRT__winver
Definition: data.c:39
int MSVCRT___argc
Definition: data.c:31
wchar_t * MSVCRT__wcmdln
Definition: data.c:54
char * MSVCRT__acmdln
Definition: data.c:53
int env_init(BOOL unicode, BOOL modif)
Definition: environ.c:30
_ACRTIMP wchar_t *__cdecl _wcsdup(const wchar_t *) __WINE_DEALLOC(free) __WINE_MALLOC
Definition: wcs.c:81
#define HUGE_VAL
Definition: math.h:274
#define debugstr_a
Definition: kernel32.h:31
#define debugstr_w
Definition: kernel32.h:32
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
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ msvcrt_init_console()

void msvcrt_init_console ( void  )

◆ msvcrt_init_io()

void msvcrt_init_io ( void  )

Definition at line 720 of file file.c.

721{
722 STARTUPINFOA si;
723 int i;
724 ioinfo *fdinfo;
725
726 GetStartupInfoA(&si);
727 if (si.cbReserved2 >= sizeof(unsigned int) && si.lpReserved2 != NULL)
728 {
729 BYTE* wxflag_ptr;
730 HANDLE* handle_ptr;
731 unsigned int count;
732
733 count = *(unsigned*)si.lpReserved2;
734 wxflag_ptr = si.lpReserved2 + sizeof(unsigned);
735 handle_ptr = (HANDLE*)(wxflag_ptr + count);
736
737 count = min(count, (si.cbReserved2 - sizeof(unsigned)) / (sizeof(HANDLE) + 1));
739 for (i = 0; i < count; i++)
740 {
741 if ((*wxflag_ptr & WX_OPEN) && GetFileType(*handle_ptr) != FILE_TYPE_UNKNOWN)
742 {
743 fdinfo = get_ioinfo_alloc_fd(i);
744 if(fdinfo != &MSVCRT___badioinfo)
745 msvcrt_set_fd(fdinfo, *handle_ptr, *wxflag_ptr);
746 release_ioinfo(fdinfo);
747 }
748
749 wxflag_ptr++; handle_ptr++;
750 }
751 }
752
754 if (!(fdinfo->wxflag & WX_OPEN) || fdinfo->handle == INVALID_HANDLE_VALUE) {
758
759 if (type == FILE_TYPE_UNKNOWN) {
761 flags |= WX_TTY;
762 } else if ((type & 0xf) == FILE_TYPE_CHAR) {
763 flags |= WX_TTY;
764 } else if ((type & 0xf) == FILE_TYPE_PIPE) {
765 flags |= WX_PIPE;
766 }
767
768 msvcrt_set_fd(fdinfo, h, flags);
769 }
770 release_ioinfo(fdinfo);
771
773 if (!(fdinfo->wxflag & WX_OPEN) || fdinfo->handle == INVALID_HANDLE_VALUE) {
777
778 if (type == FILE_TYPE_UNKNOWN) {
780 flags |= WX_TTY;
781 } else if ((type & 0xf) == FILE_TYPE_CHAR) {
782 flags |= WX_TTY;
783 } else if ((type & 0xf) == FILE_TYPE_PIPE) {
784 flags |= WX_PIPE;
785 }
786
787 msvcrt_set_fd(fdinfo, h, flags);
788 }
789 release_ioinfo(fdinfo);
790
792 if (!(fdinfo->wxflag & WX_OPEN) || fdinfo->handle == INVALID_HANDLE_VALUE) {
796
797 if (type == FILE_TYPE_UNKNOWN) {
799 flags |= WX_TTY;
800 } else if ((type & 0xf) == FILE_TYPE_CHAR) {
801 flags |= WX_TTY;
802 } else if ((type & 0xf) == FILE_TYPE_PIPE) {
803 flags |= WX_PIPE;
804 }
805
806 msvcrt_set_fd(fdinfo, h, flags);
807 }
808 release_ioinfo(fdinfo);
809
810 TRACE(":handles (%p)(%p)(%p)\n", get_ioinfo_nolock(STDIN_FILENO)->handle,
813
814 for (i = 0; i < 3; i++)
815 {
816 FILE *f = iob_get_file(i);
818
819 /* FILE structs for stdin/out/err are static and never deleted */
822 f->_tmpfname = NULL;
823 f->_flag = (i == 0) ? _IOREAD : _IOWRT;
824
825 if (cs)
826 {
828 cs->DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": file_crit.crit");
829 }
830 }
832}
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
BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount, IN DWORD flags)
Definition: sync.c:107
static ioinfo * get_ioinfo_alloc_fd(int fd)
Definition: file.c:467
ioinfo MSVCRT___badioinfo
Definition: file.c:148
#define WX_TTY
Definition: file.c:86
static void msvcrt_set_fd(ioinfo *fdinfo, HANDLE hand, int flag)
Definition: file.c:576
static FILE * iob_get_file(int i)
Definition: file.c:265
#define WX_PIPE
Definition: file.c:83
static void release_ioinfo(ioinfo *info)
Definition: file.c:514
#define WX_TEXT
Definition: file.c:87
#define _IOWRT
Definition: stdio.h:16
#define _IOREAD
Definition: stdio.h:15
#define STDOUT_FILENO
Definition: stdio.h:25
#define STDERR_FILENO
Definition: stdio.h:26
#define STDIN_FILENO
Definition: stdio.h:24
#define MSVCRT_NO_CONSOLE_FD
Definition: msvcrt.h:327
#define MSVCRT_NO_CONSOLE
Definition: msvcrt.h:328
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLfloat f
Definition: glext.h:7540
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define min(a, b)
Definition: monoChain.cc:55
#define DWORD_PTR
Definition: treelist.c:76
#define STD_OUTPUT_HANDLE
Definition: winbase.h:292
#define STD_INPUT_HANDLE
Definition: winbase.h:291
#define FILE_TYPE_UNKNOWN
Definition: winbase.h:282
#define STD_ERROR_HANDLE
Definition: winbase.h:293
#define FILE_TYPE_CHAR
Definition: winbase.h:284
#define FILE_TYPE_PIPE
Definition: winbase.h:285
#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO
Definition: winnt_old.h:1146
unsigned char BYTE
Definition: xxhash.c:193

◆ msvcrt_init_locale()

BOOL msvcrt_init_locale ( void  )

Definition at line 2151 of file locale.c.

2152{
2153 int i;
2154
2155 _lock_locales();
2156 MSVCRT_locale = _create_locale(0, "C");
2158 if(!MSVCRT_locale)
2159 return FALSE;
2160
2165 for(i=LC_MIN; i<=LC_MAX; i++)
2168 return TRUE;
2169}
#define LC_MAX
Definition: locale.h:32
#define LC_MIN
Definition: locale.h:31
#define _MB_CP_ANSI
Definition: mbctype.h:53
_ACRTIMP int __cdecl _setmbcp(int)
Definition: mbcs.c:400
unsigned short * MSVCRT__pctype
Definition: locale.c:44
int MSVCRT___lc_collate_cp
Definition: locale.c:46
unsigned int MSVCRT___lc_codepage
Definition: locale.c:45
void CDECL _lock_locales(void)
Definition: locale.c:574
_locale_t CDECL _create_locale(int category, const char *locale)
Definition: locale.c:1981
LCID MSVCRT___lc_handle[LC_MAX - LC_MIN+1]
Definition: locale.c:47
int MSVCRT___mb_cur_max
Definition: locale.c:48
void CDECL _unlock_locales(void)
Definition: locale.c:582
_locale_t MSVCRT_locale
Definition: locale.c:43
pthreadlocinfo locinfo
Definition: corecrt.h:260
unsigned int lc_collate_cp
Definition: corecrt.h:285
unsigned int lc_codepage
Definition: corecrt.h:278
unsigned short * pctype
Definition: corecrt.h:276
__msvcrt_ulong lc_handle[6]
Definition: corecrt.h:286

◆ msvcrt_init_math()

void msvcrt_init_math ( void  )

◆ msvcrt_init_mt_locks()

void msvcrt_init_mt_locks ( void  )

Definition at line 66 of file lock.c.

67{
68 int i;
69
70 TRACE( "initializing mtlocks\n" );
71
72 /* Initialize the table */
73 for( i=0; i < _TOTAL_LOCKS; i++ )
74 {
76 }
77
78 /* Initialize our lock table lock */
80}
static void msvcrt_mlock_set_entry_initialized(int locknum, BOOL initialized)
Definition: lock.c:40
static void msvcrt_initialize_mlock(int locknum)
Definition: lock.c:45
#define _LOCKTAB_LOCK
Definition: mtdll.h:41

◆ msvcrt_init_signals()

void msvcrt_init_signals ( void  )

Definition at line 635 of file except.c.

◆ MSVCRT_operator_delete()

void __cdecl MSVCRT_operator_delete ( void )

◆ MSVCRT_operator_new()

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

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