ReactOS 0.4.16-dev-889-g9563c07
msvcrt.h File Reference
#include <errno.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <wchar.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  MSVCRT__LDOUBLE
 
struct  __lc_time_data
 
struct  threadmbcinfostruct
 
struct  _frame_info
 
struct  cxx_frame_info
 
struct  __thread_data
 
struct  fpnum
 
union  _printf_arg
 

Macros

#define _NO_CRT_STDIO_INLINE
 
#define DBL80_MAX_10_EXP   4932
 
#define DBL80_MIN_10_EXP   -4951
 
#define LOCALE_FREE   0x1
 
#define LOCALE_THREAD   0x2
 
#define _RT_STACK   0
 
#define _RT_NULLPTR   1
 
#define _RT_FLOAT   2
 
#define _RT_INTDIV   3
 
#define _RT_EXECMEM   5
 
#define _RT_EXECFORM   6
 
#define _RT_EXECENV   7
 
#define _RT_SPACEARG   8
 
#define _RT_SPACEENV   9
 
#define _RT_ABORT   10
 
#define _RT_NPTR   12
 
#define _RT_FPTR   13
 
#define _RT_BREAK   14
 
#define _RT_INT   15
 
#define _RT_THREAD   16
 
#define _RT_LOCK   17
 
#define _RT_HEAP   18
 
#define _RT_OPENCON   19
 
#define _RT_QWIN   20
 
#define _RT_NOMAIN   21
 
#define _RT_NONCONT   22
 
#define _RT_INVALDISP   23
 
#define _RT_ONEXIT   24
 
#define _RT_PUREVIRT   25
 
#define _RT_STDIOINIT   26
 
#define _RT_LOWIOINIT   27
 
#define _RT_HEAPINIT   28
 
#define _RT_DOMAIN   120
 
#define _RT_SING   121
 
#define _RT_TLOSS   122
 
#define _RT_CRNL   252
 
#define _RT_BANNER   255
 
#define MSVCRT_NO_CONSOLE_FD   (-2)
 
#define MSVCRT_NO_CONSOLE   ((HANDLE)MSVCRT_NO_CONSOLE_FD)
 
#define MSVCRT_stdin   (MSVCRT__iob+STDIN_FILENO)
 
#define MSVCRT_stdout   (MSVCRT__iob+STDOUT_FILENO)
 
#define MSVCRT_stderr   (MSVCRT__iob+STDERR_FILENO)
 
#define MSVCRT__USERBUF   0x0100
 
#define MSVCRT__IOCOMMIT   0x4000
 
#define _MAX__TIME64_T   (((__time64_t)0x00000007 << 32) | 0x93406FFF)
 
#define MSVCRT_INVALID_PMT(x, err)   (*_errno() = (err), _invalid_parameter(NULL, NULL, NULL, 0, 0))
 
#define MSVCRT_CHECK_PMT_ERR(x, err)   ((x) || (MSVCRT_INVALID_PMT( 0, (err) ), FALSE))
 
#define MSVCRT_CHECK_PMT(x)   MSVCRT_CHECK_PMT_ERR((x), EINVAL)
 
#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 UCRTBASE_PRINTF_MASK
 
#define MSVCRT_PRINTF_POSITIONAL_PARAMS   (0x0100)
 
#define MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER   (0x0200)
 
#define UCRTBASE_SCANF_MASK
 
#define COOPERATIVE_TIMEOUT_INFINITE   ((unsigned int)-1)
 
#define COOPERATIVE_WAIT_TIMEOUT   ~0
 
#define INHERIT_THREAD_PRIORITY   0xF000
 

Typedefs

typedef void(__cdeclterminate_function) (void)
 
typedef void(__cdeclunexpected_function) (void)
 
typedef void(__cdecl_se_translator_function) (unsigned int code, struct _EXCEPTION_POINTERS *info)
 
typedef void(__cdeclMSVCRT_security_error_handler) (int, void *)
 
typedef struct __lc_time_data __lc_time_data
 
typedef struct threadmbcinfostruct threadmbcinfo
 
typedef struct _frame_info frame_info
 
typedef struct __thread_data thread_data_t
 
typedef void *(__cdeclmalloc_func_t) (size_t)
 
typedef void(__cdeclfree_func_t) (void *)
 
typedef int(* puts_clbk_a) (void *, int, const char *)
 
typedef int(* puts_clbk_w) (void *, int, const wchar_t *)
 
typedef union _printf_arg printf_arg
 
typedef printf_arg(* args_clbk) (void *, int, int, va_list *)
 

Enumerations

enum  fpmod {
  FP_ROUND_ZERO , FP_ROUND_DOWN , FP_ROUND_EVEN , FP_ROUND_UP ,
  FP_VAL_INFINITY , FP_VAL_NAN , FP_ROUND_ZERO , FP_ROUND_DOWN ,
  FP_ROUND_EVEN , FP_ROUND_UP , FP_VAL_INFINITY , FP_VAL_NAN
}
 

Functions

void __cdecl terminate (void)
 
frame_info *__cdecl _CreateFrameInfo (frame_info *fi, void *obj)
 
BOOL __cdecl __CxxRegisterExceptionObject (EXCEPTION_POINTERS *, cxx_frame_info *)
 
void __cdecl __CxxUnregisterExceptionObject (cxx_frame_info *, BOOL)
 
void CDECL __DestructExceptionObject (EXCEPTION_RECORD *)
 
thread_data_t *CDECL msvcrt_get_thread_data (void) DECLSPEC_HIDDEN
 
LCID locale_to_LCID (const char *, unsigned short *, BOOL *) DECLSPEC_HIDDEN
 
void msvcrt_set_errno (int) DECLSPEC_HIDDEN
 
void __cdecl _purecall (void)
 
void __cdecl _amsg_exit (int errnum)
 
char ** msvcrt_SnapshotOfEnvironmentA (char **) DECLSPEC_HIDDEN
 
wchar_t ** msvcrt_SnapshotOfEnvironmentW (wchar_t **) DECLSPEC_HIDDEN
 
wchar_tmsvcrt_wstrdupa (const char *) DECLSPEC_HIDDEN
 
void *__cdecl operator_new (size_t)
 
void __cdecl operator_delete (void *)
 
int __cdecl _set_new_mode (int mode)
 
void msvcrt_init_mt_locks (void) DECLSPEC_HIDDEN
 
void msvcrt_free_locks (void) DECLSPEC_HIDDEN
 
void msvcrt_init_exception (void *) DECLSPEC_HIDDEN
 
BOOL msvcrt_init_locale (void) DECLSPEC_HIDDEN
 
void msvcrt_init_math (void *) DECLSPEC_HIDDEN
 
void msvcrt_init_io (void) DECLSPEC_HIDDEN
 
void msvcrt_free_io (void) DECLSPEC_HIDDEN
 
void msvcrt_free_console (void) DECLSPEC_HIDDEN
 
void msvcrt_init_args (void) DECLSPEC_HIDDEN
 
void msvcrt_free_args (void) DECLSPEC_HIDDEN
 
void msvcrt_init_signals (void) DECLSPEC_HIDDEN
 
void msvcrt_free_signals (void) DECLSPEC_HIDDEN
 
void msvcrt_free_popen_data (void) DECLSPEC_HIDDEN
 
BOOL msvcrt_init_heap (void) DECLSPEC_HIDDEN
 
void msvcrt_destroy_heap (void) DECLSPEC_HIDDEN
 
void msvcrt_init_clock (void) DECLSPEC_HIDDEN
 
BOOL msvcrt_create_io_inherit_block (WORD *, BYTE **) DECLSPEC_HIDDEN
 
_locale_t CDECL get_current_locale_noalloc (_locale_t locale) DECLSPEC_HIDDEN
 
void CDECL free_locale_noalloc (_locale_t locale) DECLSPEC_HIDDEN
 
pthreadlocinfo CDECL get_locinfo (void) DECLSPEC_HIDDEN
 
pthreadmbcinfo CDECL get_mbcinfo (void) DECLSPEC_HIDDEN
 
threadmbcinfocreate_mbcinfo (int, LCID, threadmbcinfo *) DECLSPEC_HIDDEN
 
void free_locinfo (pthreadlocinfo) DECLSPEC_HIDDEN
 
void free_mbcinfo (pthreadmbcinfo) DECLSPEC_HIDDEN
 
int __cdecl __crtLCMapStringA (LCID, DWORD, const char *, int, char *, int, unsigned int, int) DECLSPEC_HIDDEN
 
struct fpnum fpnum_parse (wchar_t(*)(void *), void(*)(void *), void *, pthreadlocinfo, BOOL) DECLSPEC_HIDDEN
 
int fpnum_double (struct fpnum *, double *) DECLSPEC_HIDDEN
 
int pf_printf_a (puts_clbk_a, void *, const char *, _locale_t, DWORD, args_clbk, void *, va_list *) DECLSPEC_HIDDEN
 
int pf_printf_w (puts_clbk_w, void *, const wchar_t *, _locale_t, DWORD, args_clbk, void *, va_list *) DECLSPEC_HIDDEN
 
int create_positional_ctx_a (void *, const char *, va_list) DECLSPEC_HIDDEN
 
int create_positional_ctx_w (void *, const wchar_t *, va_list) DECLSPEC_HIDDEN
 
printf_arg arg_clbk_valist (void *, int, int, va_list *) DECLSPEC_HIDDEN
 
printf_arg arg_clbk_positional (void *, int, int, va_list *) DECLSPEC_HIDDEN
 
char *__cdecl __unDName (char *, const char *, int, malloc_func_t, free_func_t, unsigned short int)
 

Variables

BOOL sse2_supported DECLSPEC_HIDDEN
 
unsigned int MSVCRT___lc_codepage
 
int MSVCRT___lc_collate_cp
 
WORD MSVCRT__ctype [257]
 
WORDMSVCRT__pwctype
 
char ** MSVCRT__environ
 
wchar_t ** MSVCRT__wenviron
 
unsigned int MSVCRT__commode
 
FILE MSVCRT__iob []
 

Macro Definition Documentation

◆ _MAX__TIME64_T

#define _MAX__TIME64_T   (((__time64_t)0x00000007 << 32) | 0x93406FFF)

Definition at line 299 of file msvcrt.h.

◆ _NO_CRT_STDIO_INLINE

#define _NO_CRT_STDIO_INLINE

Definition at line 26 of file msvcrt.h.

◆ _RT_ABORT

#define _RT_ABORT   10

Definition at line 258 of file msvcrt.h.

◆ _RT_BANNER

#define _RT_BANNER   255

Definition at line 280 of file msvcrt.h.

◆ _RT_BREAK

#define _RT_BREAK   14

Definition at line 261 of file msvcrt.h.

◆ _RT_CRNL

#define _RT_CRNL   252

Definition at line 279 of file msvcrt.h.

◆ _RT_DOMAIN

#define _RT_DOMAIN   120

Definition at line 276 of file msvcrt.h.

◆ _RT_EXECENV

#define _RT_EXECENV   7

Definition at line 255 of file msvcrt.h.

◆ _RT_EXECFORM

#define _RT_EXECFORM   6

Definition at line 254 of file msvcrt.h.

◆ _RT_EXECMEM

#define _RT_EXECMEM   5

Definition at line 253 of file msvcrt.h.

◆ _RT_FLOAT

#define _RT_FLOAT   2

Definition at line 251 of file msvcrt.h.

◆ _RT_FPTR

#define _RT_FPTR   13

Definition at line 260 of file msvcrt.h.

◆ _RT_HEAP

#define _RT_HEAP   18

Definition at line 265 of file msvcrt.h.

◆ _RT_HEAPINIT

#define _RT_HEAPINIT   28

Definition at line 275 of file msvcrt.h.

◆ _RT_INT

#define _RT_INT   15

Definition at line 262 of file msvcrt.h.

◆ _RT_INTDIV

#define _RT_INTDIV   3

Definition at line 252 of file msvcrt.h.

◆ _RT_INVALDISP

#define _RT_INVALDISP   23

Definition at line 270 of file msvcrt.h.

◆ _RT_LOCK

#define _RT_LOCK   17

Definition at line 264 of file msvcrt.h.

◆ _RT_LOWIOINIT

#define _RT_LOWIOINIT   27

Definition at line 274 of file msvcrt.h.

◆ _RT_NOMAIN

#define _RT_NOMAIN   21

Definition at line 268 of file msvcrt.h.

◆ _RT_NONCONT

#define _RT_NONCONT   22

Definition at line 269 of file msvcrt.h.

◆ _RT_NPTR

#define _RT_NPTR   12

Definition at line 259 of file msvcrt.h.

◆ _RT_NULLPTR

#define _RT_NULLPTR   1

Definition at line 250 of file msvcrt.h.

◆ _RT_ONEXIT

#define _RT_ONEXIT   24

Definition at line 271 of file msvcrt.h.

◆ _RT_OPENCON

#define _RT_OPENCON   19

Definition at line 266 of file msvcrt.h.

◆ _RT_PUREVIRT

#define _RT_PUREVIRT   25

Definition at line 272 of file msvcrt.h.

◆ _RT_QWIN

#define _RT_QWIN   20

Definition at line 267 of file msvcrt.h.

◆ _RT_SING

#define _RT_SING   121

Definition at line 277 of file msvcrt.h.

◆ _RT_SPACEARG

#define _RT_SPACEARG   8

Definition at line 256 of file msvcrt.h.

◆ _RT_SPACEENV

#define _RT_SPACEENV   9

Definition at line 257 of file msvcrt.h.

◆ _RT_STACK

#define _RT_STACK   0

Definition at line 249 of file msvcrt.h.

◆ _RT_STDIOINIT

#define _RT_STDIOINIT   26

Definition at line 273 of file msvcrt.h.

◆ _RT_THREAD

#define _RT_THREAD   16

Definition at line 263 of file msvcrt.h.

◆ _RT_TLOSS

#define _RT_TLOSS   122

Definition at line 278 of file msvcrt.h.

◆ COOPERATIVE_TIMEOUT_INFINITE

#define COOPERATIVE_TIMEOUT_INFINITE   ((unsigned int)-1)

Definition at line 397 of file msvcrt.h.

◆ COOPERATIVE_WAIT_TIMEOUT

#define COOPERATIVE_WAIT_TIMEOUT   ~0

Definition at line 398 of file msvcrt.h.

◆ DBL80_MAX_10_EXP

#define DBL80_MAX_10_EXP   4932

Definition at line 43 of file msvcrt.h.

◆ DBL80_MIN_10_EXP

#define DBL80_MIN_10_EXP   -4951

Definition at line 44 of file msvcrt.h.

◆ INHERIT_THREAD_PRIORITY

#define INHERIT_THREAD_PRIORITY   0xF000

Definition at line 400 of file msvcrt.h.

◆ LOCALE_FREE

#define LOCALE_FREE   0x1

Definition at line 128 of file msvcrt.h.

◆ LOCALE_THREAD

#define LOCALE_THREAD   0x2

Definition at line 129 of file msvcrt.h.

◆ MSVCRT__IOCOMMIT

#define MSVCRT__IOCOMMIT   0x4000

Definition at line 293 of file msvcrt.h.

◆ MSVCRT__USERBUF

#define MSVCRT__USERBUF   0x0100

Definition at line 292 of file msvcrt.h.

◆ MSVCRT_CHECK_PMT

#define MSVCRT_CHECK_PMT (   x)    MSVCRT_CHECK_PMT_ERR((x), EINVAL)

Definition at line 338 of file msvcrt.h.

◆ MSVCRT_CHECK_PMT_ERR

#define MSVCRT_CHECK_PMT_ERR (   x,
  err 
)    ((x) || (MSVCRT_INVALID_PMT( 0, (err) ), FALSE))

Definition at line 337 of file msvcrt.h.

◆ MSVCRT_INVALID_PMT

#define MSVCRT_INVALID_PMT (   x,
  err 
)    (*_errno() = (err), _invalid_parameter(NULL, NULL, NULL, 0, 0))

Definition at line 336 of file msvcrt.h.

◆ MSVCRT_NO_CONSOLE

#define MSVCRT_NO_CONSOLE   ((HANDLE)MSVCRT_NO_CONSOLE_FD)

Definition at line 285 of file msvcrt.h.

◆ MSVCRT_NO_CONSOLE_FD

#define MSVCRT_NO_CONSOLE_FD   (-2)

Definition at line 284 of file msvcrt.h.

◆ MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER

#define MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER   (0x0200)

Definition at line 390 of file msvcrt.h.

◆ MSVCRT_PRINTF_POSITIONAL_PARAMS

#define MSVCRT_PRINTF_POSITIONAL_PARAMS   (0x0100)

Definition at line 389 of file msvcrt.h.

◆ MSVCRT_stderr

#define MSVCRT_stderr   (MSVCRT__iob+STDERR_FILENO)

Definition at line 289 of file msvcrt.h.

◆ MSVCRT_stdin

#define MSVCRT_stdin   (MSVCRT__iob+STDIN_FILENO)

Definition at line 287 of file msvcrt.h.

◆ MSVCRT_stdout

#define MSVCRT_stdout   (MSVCRT__iob+STDOUT_FILENO)

Definition at line 288 of file msvcrt.h.

◆ UCRTBASE_PRINTF_MASK

#define UCRTBASE_PRINTF_MASK

◆ UCRTBASE_SCANF_MASK

#define UCRTBASE_SCANF_MASK
Value:

Definition at line 392 of file msvcrt.h.

◆ UNDNAME_32_BIT_DECODE

#define UNDNAME_32_BIT_DECODE   (0x0800)

Definition at line 375 of file msvcrt.h.

◆ UNDNAME_COMPLETE

#define UNDNAME_COMPLETE   (0x0000)

Definition at line 362 of file msvcrt.h.

◆ UNDNAME_NAME_ONLY

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

Definition at line 376 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 371 of file msvcrt.h.

◆ UNDNAME_NO_ALLOCATION_LANGUAGE

#define UNDNAME_NO_ALLOCATION_LANGUAGE   (0x0010)

Definition at line 367 of file msvcrt.h.

◆ UNDNAME_NO_ALLOCATION_MODEL

#define UNDNAME_NO_ALLOCATION_MODEL   (0x0008)

Definition at line 366 of file msvcrt.h.

◆ UNDNAME_NO_ARGUMENTS

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

Definition at line 377 of file msvcrt.h.

◆ UNDNAME_NO_COMPLEX_TYPE

#define UNDNAME_NO_COMPLEX_TYPE   (0x8000)

Definition at line 379 of file msvcrt.h.

◆ UNDNAME_NO_CV_THISTYPE

#define UNDNAME_NO_CV_THISTYPE   (0x0040)

Definition at line 369 of file msvcrt.h.

◆ UNDNAME_NO_FUNCTION_RETURNS

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

Definition at line 365 of file msvcrt.h.

◆ UNDNAME_NO_LEADING_UNDERSCORES

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

Definition at line 363 of file msvcrt.h.

◆ UNDNAME_NO_MEMBER_TYPE

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

Definition at line 373 of file msvcrt.h.

◆ UNDNAME_NO_MS_KEYWORDS

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

Definition at line 364 of file msvcrt.h.

◆ UNDNAME_NO_MS_THISTYPE

#define UNDNAME_NO_MS_THISTYPE   (0x0020)

Definition at line 368 of file msvcrt.h.

◆ UNDNAME_NO_RETURN_UDT_MODEL

#define UNDNAME_NO_RETURN_UDT_MODEL   (0x0400)

Definition at line 374 of file msvcrt.h.

◆ UNDNAME_NO_SPECIAL_SYMS

#define UNDNAME_NO_SPECIAL_SYMS   (0x4000)

Definition at line 378 of file msvcrt.h.

◆ UNDNAME_NO_THISTYPE

#define UNDNAME_NO_THISTYPE   (0x0060)

Definition at line 370 of file msvcrt.h.

◆ UNDNAME_NO_THROW_SIGNATURES

#define UNDNAME_NO_THROW_SIGNATURES   (0x0100)

Definition at line 372 of file msvcrt.h.

Typedef Documentation

◆ __lc_time_data

◆ _se_translator_function

typedef void(__cdecl * _se_translator_function) (unsigned int code, struct _EXCEPTION_POINTERS *info)

Definition at line 48 of file msvcrt.h.

◆ args_clbk

typedef printf_arg(* args_clbk) (void *, int, int, va_list *)

Definition at line 349 of file msvcrt.h.

◆ frame_info

◆ free_func_t

typedef void(__cdecl * free_func_t) (void *)

Definition at line 219 of file msvcrt.h.

◆ malloc_func_t

typedef void *(__cdecl * malloc_func_t) (size_t)

Definition at line 218 of file msvcrt.h.

◆ MSVCRT_security_error_handler

typedef void(__cdecl * MSVCRT_security_error_handler) (int, void *)

Definition at line 51 of file msvcrt.h.

◆ printf_arg

typedef union _printf_arg printf_arg

◆ puts_clbk_a

typedef int(* puts_clbk_a) (void *, int, const char *)

Definition at line 340 of file msvcrt.h.

◆ puts_clbk_w

typedef int(* puts_clbk_w) (void *, int, const wchar_t *)

Definition at line 341 of file msvcrt.h.

◆ terminate_function

typedef void(__cdecl * terminate_function) (void)

Definition at line 46 of file msvcrt.h.

◆ thread_data_t

Definition at line 180 of file msvcrt.h.

◆ threadmbcinfo

◆ unexpected_function

typedef void(__cdecl * unexpected_function) (void)

Definition at line 47 of file msvcrt.h.

Enumeration Type Documentation

◆ fpmod

Enumerator
FP_ROUND_ZERO 
FP_ROUND_DOWN 
FP_ROUND_EVEN 
FP_ROUND_UP 
FP_VAL_INFINITY 
FP_VAL_NAN 
FP_ROUND_ZERO 
FP_ROUND_DOWN 
FP_ROUND_EVEN 
FP_ROUND_UP 
FP_VAL_INFINITY 
FP_VAL_NAN 

Definition at line 310 of file msvcrt.h.

310 {
311 FP_ROUND_ZERO, /* only used when dropped part contains only zeros */
317};
@ FP_VAL_NAN
Definition: msvcrt.h:316
@ FP_ROUND_EVEN
Definition: msvcrt.h:313
@ FP_VAL_INFINITY
Definition: msvcrt.h:315
@ FP_ROUND_UP
Definition: msvcrt.h:314
@ FP_ROUND_ZERO
Definition: msvcrt.h:311
@ FP_ROUND_DOWN
Definition: msvcrt.h:312

Function Documentation

◆ __crtLCMapStringA()

int __cdecl __crtLCMapStringA ( LCID  lcid,
DWORD  mapflags,
const char src,
int  srclen,
char dst,
int  dstlen,
unsigned int  codepage,
int  xflag 
)

Definition at line 512 of file locale.c.

515 {
516 FIXME("(lcid %x, flags %x, %s(%d), %p(%d), %x, %d), partial stub!\n",
517 lcid,mapflags,src,srclen,dst,dstlen,codepage,xflag);
518 /* FIXME: A bit incorrect. But msvcrt itself just converts its
519 * arguments to wide strings and then calls LCMapStringW
520 */
521 return LCMapStringA(lcid,mapflags,src,srclen,dst,dstlen);
522}
#define FIXME(fmt,...)
Definition: precomp.h:53
INT WINAPI LCMapStringA(LCID lcid, DWORD flags, LPCSTR src, INT srclen, LPSTR dst, INT dstlen)
Definition: locale.c:3831
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
static DWORD LPDWORD LPCSTR DWORD srclen
Definition: directory.c:52
static DWORD dstlen
Definition: directory.c:51
int codepage
Definition: win_iconv.c:156

◆ __CxxRegisterExceptionObject()

BOOL __cdecl __CxxRegisterExceptionObject ( EXCEPTION_POINTERS ep,
cxx_frame_info frame_info 
)

Definition at line 444 of file except.c.

445{
447
448 TRACE("(%p, %p)\n", ep, frame_info);
449
450 if (!ep || !ep->ExceptionRecord)
451 {
452 frame_info->rec = (void*)-1;
453 frame_info->context = (void*)-1;
454 return TRUE;
455 }
456
457 frame_info->rec = data->exc_record;
458 frame_info->context = data->ctx_record;
459 data->exc_record = ep->ExceptionRecord;
460 data->ctx_record = ep->ContextRecord;
462 return TRUE;
463}
#define TRUE
Definition: types.h:120
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
thread_data_t * msvcrt_get_thread_data(void)
Definition: tls.c:31
frame_info *CDECL _CreateFrameInfo(frame_info *fi, void *obj)
Definition: except.c:348
#define TRACE(s)
Definition: solgame.cpp:4
PEXCEPTION_RECORD ExceptionRecord
Definition: rtltypes.h:200
PCONTEXT ContextRecord
Definition: rtltypes.h:201
ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]
Definition: compat.h:213

◆ __CxxUnregisterExceptionObject()

void __cdecl __CxxUnregisterExceptionObject ( cxx_frame_info frame_info,
BOOL  in_use 
)

Definition at line 468 of file except.c.

469{
471
472 TRACE("(%p)\n", frame_info);
473
474 if(frame_info->rec == (void*)-1)
475 return;
476
477 _FindAndUnlinkFrame(&frame_info->frame_info);
478 if(data->exc_record->ExceptionCode == CXX_EXCEPTION && !in_use
479 && _IsExceptionObjectToBeDestroyed((void*)data->exc_record->ExceptionInformation[1]))
480 __DestructExceptionObject(data->exc_record);
481 data->exc_record = frame_info->rec;
482 data->ctx_record = frame_info->context;
483}
#define CXX_EXCEPTION
Definition: cppexcept.h:27
void CDECL __DestructExceptionObject(EXCEPTION_RECORD *rec)
Definition: except.c:409
void CDECL _FindAndUnlinkFrame(frame_info *fi)
Definition: except.c:363
BOOL __cdecl _IsExceptionObjectToBeDestroyed(const void *obj)
Definition: except.c:391

◆ __DestructExceptionObject()

void CDECL __DestructExceptionObject ( EXCEPTION_RECORD rec)

Definition at line 409 of file except.c.

410{
412 void *object = (void*)rec->ExceptionInformation[1];
413
414 TRACE("(%p)\n", rec);
415
416 if (rec->ExceptionCode != CXX_EXCEPTION) return;
417#ifndef __x86_64__
418 if (rec->NumberParameters != 3) return;
419#else
420 if (rec->NumberParameters != 4) return;
421#endif
424
425 if (!info || !info->destructor)
426 return;
427
428#if defined(__i386__)
429#ifdef _MSC_VER
430 ((void(__fastcall*)(void*))info->destructor)(object);
431#else
432 __asm__ __volatile__("call *%0" : : "r" (info->destructor), "c" (object) : "eax", "edx", "memory");
433#endif
434#elif defined(__x86_64__)
435 ((void (__cdecl*)(void*))(info->destructor+rec->ExceptionInformation[3]))(object);
436#else
437 ((void (__cdecl*)(void*))info->destructor)(object);
438#endif
439}
#define __cdecl
Definition: accygwin.h:79
#define CXX_FRAME_MAGIC_VC6
Definition: cppexcept.h:24
#define CXX_FRAME_MAGIC_VC8
Definition: cppexcept.h:26
#define __fastcall
Definition: sync.c:38
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tsub %rbp, %rax\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tsub %rax, %rdx\n" "\tmov %rdx, %rbp\n" "\tjmp *%r8\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")
DWORD ExceptionCode
Definition: compat.h:208
DWORD NumberParameters
Definition: compat.h:212

Referenced by __CxxUnregisterExceptionObject().

◆ __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 1650 of file undname.c.

1653{
1654 return __unDNameEx(buffer, mangled, buflen, memget, memfree, NULL, flags);
1655}
#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:1603

◆ _amsg_exit()

void __cdecl _amsg_exit ( int  errnum)

Definition at line 44 of file amsg.c.

45{
46 if ((errnum >=0) && (errnum < sizeof(__rt_err_msg)/sizeof(__rt_err_msg[0])))
47 fprintf(stderr, "runtime error - %s\n", __rt_err_msg[errnum]);
48 else
49 fprintf(stderr, "runtime error - %d\n", errnum);
50 _exit(-1);
51}
void _exit(int exitcode)
Definition: _exit.c:25
static char * __rt_err_msg[]
Definition: amsg.c:13
#define stderr
Definition: stdio.h:100
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)

◆ _CreateFrameInfo()

frame_info *__cdecl _CreateFrameInfo ( frame_info fi,
void obj 
)

Definition at line 348 of file except.c.

349{
351
352 TRACE("(%p, %p)\n", fi, obj);
353
354 fi->next = data->frame_info_head;
355 data->frame_info_head = fi;
356 fi->object = obj;
357 return fi;
358}

Referenced by __CxxRegisterExceptionObject().

◆ _purecall()

void __cdecl _purecall ( void  )

Definition at line 429 of file adapter.cpp.

430{
431 return 0;
432}

◆ _set_new_mode()

int __cdecl _set_new_mode ( int  mode)

Definition at line 248 of file heap.c.

249{
250 if(!MSVCRT_CHECK_PMT(mode == 0 || mode == 1)) return -1;
252}
#define InterlockedExchange
Definition: armddk.h:54
GLenum mode
Definition: glext.h:6217
#define MSVCRT_CHECK_PMT(x)
Definition: mbstowcs_s.c:26
static int MSVCRT_new_mode
Definition: heap.c:70

◆ arg_clbk_positional()

printf_arg arg_clbk_positional ( void ,
int  ,
int  ,
va_list  
)

◆ arg_clbk_valist()

printf_arg arg_clbk_valist ( void ,
int  ,
int  ,
va_list  
)

◆ create_mbcinfo()

threadmbcinfo * create_mbcinfo ( int  ,
LCID  ,
threadmbcinfo  
)

◆ create_positional_ctx_a()

int create_positional_ctx_a ( void ,
const char ,
va_list   
)

◆ create_positional_ctx_w()

int create_positional_ctx_w ( void ,
const wchar_t ,
va_list   
)

◆ fpnum_double()

int fpnum_double ( struct fpnum fp,
double d 
)

Definition at line 24 of file i10output.c.

25{
26 ULONGLONG bits = 0;
27
28 if (fp->mod == FP_VAL_INFINITY)
29 {
30 *d = fp->sign * INFINITY;
31 return 0;
32 }
33
34 if (fp->mod == FP_VAL_NAN)
35 {
36 bits = ~0;
37 if (fp->sign == 1)
38 bits &= ~((ULONGLONG)1 << (MANT_BITS + EXP_BITS - 1));
39 *d = *(double*)&bits;
40 return 0;
41 }
42
43 TRACE("%c %#I64x *2^%d (round %d)\n", fp->sign == -1 ? '-' : '+',
44 fp->m, fp->exp, fp->mod);
45 if (!fp->m)
46 {
47 *d = fp->sign * 0.0;
48 return 0;
49 }
50
51 /* make sure that we don't overflow modifying exponent */
52 if (fp->exp > 1<<EXP_BITS)
53 {
54 *d = fp->sign * INFINITY;
55 return ERANGE;
56 }
57 if (fp->exp < -(1<<EXP_BITS))
58 {
59 *d = fp->sign * 0.0;
60 return ERANGE;
61 }
62 fp->exp += MANT_BITS - 1;
63
64 /* normalize mantissa */
65 while(fp->m < (ULONGLONG)1 << (MANT_BITS-1))
66 {
67 fp->m <<= 1;
68 fp->exp--;
69 }
70 while(fp->m >= (ULONGLONG)1 << MANT_BITS)
71 {
72 if (fp->m & 1 || fp->mod != FP_ROUND_ZERO)
73 {
74 if (!(fp->m & 1)) fp->mod = FP_ROUND_DOWN;
75 else if(fp->mod == FP_ROUND_ZERO) fp->mod = FP_ROUND_EVEN;
76 else fp->mod = FP_ROUND_UP;
77 }
78 fp->m >>= 1;
79 fp->exp++;
80 }
81 fp->exp += (1 << (EXP_BITS-1)) - 1;
82
83 /* handle subnormals */
84 if (fp->exp <= 0)
85 {
86 if (fp->m & 1 && fp->mod == FP_ROUND_ZERO) fp->mod = FP_ROUND_EVEN;
87 else if (fp->m & 1) fp->mod = FP_ROUND_UP;
88 else if (fp->mod != FP_ROUND_ZERO) fp->mod = FP_ROUND_DOWN;
89 fp->m >>= 1;
90 }
91 while(fp->m && fp->exp<0)
92 {
93 if (fp->m & 1 && fp->mod == FP_ROUND_ZERO) fp->mod = FP_ROUND_EVEN;
94 else if (fp->m & 1) fp->mod = FP_ROUND_UP;
95 else if (fp->mod != FP_ROUND_ZERO) fp->mod = FP_ROUND_DOWN;
96 fp->m >>= 1;
97 fp->exp++;
98 }
99
100 /* round mantissa */
101 if (fp->mod == FP_ROUND_UP || (fp->mod == FP_ROUND_EVEN && fp->m & 1))
102 {
103 fp->m++;
104
105 /* handle subnormal that falls into regular range due to rounding */
106 if (fp->m == (ULONGLONG)1 << (MANT_BITS - 1))
107 {
108 fp->exp++;
109 }
110 else if (fp->m >= (ULONGLONG)1 << MANT_BITS)
111 {
112 fp->exp++;
113 fp->m >>= 1;
114 }
115 }
116
117 if (fp->exp >= (1<<EXP_BITS)-1)
118 {
119 *d = fp->sign * INFINITY;
120 return ERANGE;
121 }
122 if (!fp->m || fp->exp < 0)
123 {
124 *d = fp->sign * 0.0;
125 return ERANGE;
126 }
127
128 if (fp->sign == -1)
129 bits |= (ULONGLONG)1 << (MANT_BITS + EXP_BITS - 1);
130 bits |= (ULONGLONG)fp->exp << (MANT_BITS - 1);
131 bits |= fp->m & (((ULONGLONG)1 << (MANT_BITS - 1)) - 1);
132
133 TRACE("returning %#I64x\n", bits);
134 *d = *(double*)&bits;
135 return 0;
136}
#define ERANGE
Definition: acclib.h:92
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
#define EXP_BITS
Definition: i10output.c:21
#define MANT_BITS
Definition: i10output.c:22
@ FP_VAL_NAN
Definition: i10output.c:11
@ FP_ROUND_EVEN
Definition: i10output.c:8
@ FP_VAL_INFINITY
Definition: i10output.c:10
@ FP_ROUND_UP
Definition: i10output.c:9
@ FP_ROUND_ZERO
Definition: i10output.c:6
@ FP_ROUND_DOWN
Definition: i10output.c:7
#define INFINITY
Definition: math.h:56
#define d
Definition: ke_i.h:81
enum fpmod mod
Definition: i10output.c:17
ULONGLONG m
Definition: i10output.c:16
int exp
Definition: i10output.c:15
int sign
Definition: i10output.c:14
uint64_t ULONGLONG
Definition: typedefs.h:67

Referenced by I10_OUTPUT().

◆ fpnum_parse()

struct fpnum fpnum_parse ( wchar_t(*)(void *)  ,
void(*)(void *)  ,
void ,
pthreadlocinfo  ,
BOOL   
)

◆ free_locale_noalloc()

void CDECL free_locale_noalloc ( _locale_t  locale)

◆ free_locinfo()

void free_locinfo ( pthreadlocinfo  )

◆ free_mbcinfo()

void free_mbcinfo ( pthreadmbcinfo  )

◆ get_current_locale_noalloc()

_locale_t CDECL get_current_locale_noalloc ( _locale_t  locale)

◆ get_locinfo()

pthreadlocinfo CDECL get_locinfo ( void  )

Definition at line 356 of file locale.c.

356 {
358
359 if(!data || !data->have_locale)
360 return MSVCRT_locale->locinfo;
361
362 return data->locinfo;
363}
#define MSVCRT_locale
Definition: locale.h:80

Referenced by ___lc_collate_cp_func(), __p__pctype(), __pctype_func(), _Getdays(), _Getmonths(), _Gettnames(), localeconv(), MSVCRT__get_current_locale(), MSVCRT_btowc(), and setlocale().

◆ get_mbcinfo()

pthreadmbcinfo CDECL get_mbcinfo ( void  )

Definition at line 366 of file locale.c.

366 {
368
369 if(!data || !data->have_locale)
370 return MSVCRT_locale->mbcinfo;
371
372 return data->mbcinfo;
373}

Referenced by _getmbcp(), and MSVCRT__get_current_locale().

◆ locale_to_LCID()

LCID locale_to_LCID ( const char ,
unsigned short ,
BOOL  
)

◆ msvcrt_create_io_inherit_block()

BOOL msvcrt_create_io_inherit_block ( WORD ,
BYTE **   
)

◆ msvcrt_destroy_heap()

void msvcrt_destroy_heap ( void  )

Definition at line 899 of file heap.c.

900{
902 if(sb_heap)
904}
BOOL WINAPI HeapDestroy(HANDLE hHeap)
Definition: heapmem.c:85
static HANDLE heap
Definition: heap.c:65
static HANDLE sb_heap
Definition: heap.c:65

◆ 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_locks()

void msvcrt_free_locks ( void  )

◆ 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

◆ msvcrt_free_signals()

void msvcrt_free_signals ( void  )

Definition at line 185 of file except.c.

186{
188}
#define FALSE
Definition: types.h:117
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:52

◆ msvcrt_get_thread_data()

thread_data_t *CDECL msvcrt_get_thread_data ( void  )

Definition at line 31 of file tls.c.

32{
34 DWORD err = GetLastError(); /* need to preserve last error */
35
37 {
38 if (!(ptr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ptr) )))
41 ptr->tid = GetCurrentThreadId();
42 ptr->handle = INVALID_HANDLE_VALUE;
43 ptr->random_seed = 1;
44#ifndef __UCRTSUPPORT__
45 ptr->locinfo = MSVCRT_locale->locinfo;
46 ptr->mbcinfo = MSVCRT_locale->mbcinfo;
47#endif /* !__UCRTSUPPORT__ */
48 }
50 return ptr;
51}
#define GetProcessHeap()
Definition: compat.h:736
#define SetLastError(x)
Definition: compat.h:752
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
LPVOID WINAPI TlsGetValue(IN DWORD Index)
Definition: thread.c:1240
BOOL WINAPI TlsSetValue(IN DWORD Index, IN LPVOID Value)
Definition: thread.c:1276
unsigned long DWORD
Definition: ntddk_ex.h:95
static PVOID ptr
Definition: dispmode.c:27
#define _RT_THREAD
Definition: msvcrt.h:267
void __cdecl _amsg_exit(int errnum)
Definition: amsg.c:44
#define err(...)
static DWORD msvcrt_tls_index
Definition: tls.c:7
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459

◆ msvcrt_init_args()

void msvcrt_init_args ( void  )

◆ msvcrt_init_clock()

void msvcrt_init_clock ( void  )

◆ msvcrt_init_exception()

void msvcrt_init_exception ( void )

Definition at line 33 of file dllmain.c.

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

Referenced by msvcrt_init_exception().

◆ msvcrt_init_heap()

BOOL msvcrt_init_heap ( void  )

Definition at line 889 of file heap.c.

890{
891#ifdef __REACTOS__
893#else
894 heap = HeapCreate(0, 0, 0);
895#endif
896 return heap != NULL;
897}
HANDLE WINAPI HeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize)
Definition: heapmem.c:45

◆ 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
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
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_OPEN
Definition: file.c:91
#define MSVCRT_MAX_FILES
Definition: file.c:112
#define WX_TTY
Definition: file.c:99
static void msvcrt_set_fd(ioinfo *fdinfo, HANDLE hand, int flag)
Definition: file.c:325
static ioinfo * get_ioinfo_nolock(int fd)
Definition: file.c:158
#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
Definition: file.c:59
unsigned char wxflag
Definition: file.c:61
HANDLE handle
Definition: file.c:60
#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
#define _TOTAL_LOCKS
Definition: mtdll.h:70
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 180 of file except.c.

◆ msvcrt_set_errno()

void msvcrt_set_errno ( int  )

◆ msvcrt_SnapshotOfEnvironmentA()

char ** msvcrt_SnapshotOfEnvironmentA ( char **  )

◆ msvcrt_SnapshotOfEnvironmentW()

wchar_t ** msvcrt_SnapshotOfEnvironmentW ( wchar_t **  )

◆ msvcrt_wstrdupa()

wchar_t * msvcrt_wstrdupa ( const char str)

Definition at line 669 of file file.c.

670{
671 const unsigned int len = strlen(str) + 1 ;
672 wchar_t *wstr = malloc(len* sizeof (wchar_t));
673 if (!wstr)
674 return NULL;
676 return wstr;
677}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define malloc
Definition: debug_ros.c:4
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
GLenum GLsizei len
Definition: glext.h:6722
const WCHAR * str
#define MB_PRECOMPOSED
Definition: winnls.h:283

Referenced by _fdopen(), _fsopen(), _sopen_s(), and freopen().

◆ operator_delete()

◆ operator_new()

void *__cdecl operator_new ( size_t  size)

Definition at line 15 of file stubs.c.

16{
17 return malloc(size);
18}
GLsizeiptr size
Definition: glext.h:5919

Referenced by operator_new_dbg().

◆ pf_printf_a()

int pf_printf_a ( puts_clbk_a  ,
void ,
const char ,
_locale_t  ,
DWORD  ,
args_clbk  ,
void ,
va_list  
)

◆ pf_printf_w()

int pf_printf_w ( puts_clbk_w  ,
void ,
const wchar_t ,
_locale_t  ,
DWORD  ,
args_clbk  ,
void ,
va_list  
)

◆ terminate()

void __cdecl terminate ( void  )

Definition at line 716 of file cpp.c.

717{
719 if (data->terminate_handler) data->terminate_handler();
720 abort();
721}
#define abort()
Definition: i386-dis.c:34

Referenced by unexpected().

Variable Documentation

◆ DECLSPEC_HIDDEN

BOOL initial_locale DECLSPEC_HIDDEN
extern

Definition at line 126 of file msvcrt.h.

◆ MSVCRT___lc_codepage

unsigned int MSVCRT___lc_codepage
extern

◆ MSVCRT___lc_collate_cp

int MSVCRT___lc_collate_cp
extern

Definition at line 37 of file locale.c.

Referenced by __init_global_locale(), and setlocale().

◆ MSVCRT__commode

unsigned int MSVCRT__commode
extern

◆ MSVCRT__ctype

WORD MSVCRT__ctype[257]
extern

◆ MSVCRT__environ

char** MSVCRT__environ
extern

◆ MSVCRT__iob

FILE MSVCRT__iob[]
extern

◆ MSVCRT__pwctype

WORD* MSVCRT__pwctype
extern

◆ MSVCRT__wenviron

wchar_t** MSVCRT__wenviron
extern