ReactOS 0.4.16-dev-2104-gb84fa49
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 ,
  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 
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:356
@ FP_ROUND_EVEN
Definition: msvcrt.h:353
@ FP_VAL_INFINITY
Definition: msvcrt.h:355
@ FP_ROUND_UP
Definition: msvcrt.h:354
@ FP_ROUND_ZERO
Definition: msvcrt.h:351
@ FP_ROUND_DOWN
Definition: msvcrt.h:352

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 877 of file locale.c.

880 {
881 WCHAR buf_in[32], *in = buf_in;
882 WCHAR buf_out[32], *out = buf_out;
883 int in_len, out_len, r;
884
885 TRACE("(lcid %lx, flags %lx, %s(%d), %p(%d), %x, %d), partial stub!\n",
886 lcid, mapflags, src, srclen, dst, dstlen, codepage, xflag);
887
889 if (!in_len) return 0;
890 if (in_len > ARRAY_SIZE(buf_in))
891 {
892 in = malloc(in_len * sizeof(WCHAR));
893 if (!in) return 0;
894 }
895
897 if (!r) goto done;
898
899 if (mapflags & LCMAP_SORTKEY)
900 {
901 r = LCMapStringW(lcid, mapflags, in, in_len, (WCHAR*)dst, dstlen);
902 goto done;
903 }
904
905 r = LCMapStringW(lcid, mapflags, in, in_len, NULL, 0);
906 if (!r) goto done;
907 out_len = r;
908 if (r > ARRAY_SIZE(buf_out))
909 {
910 out = malloc(r * sizeof(WCHAR));
911 if (!out)
912 {
913 r = 0;
914 goto done;
915 }
916 }
917
918 r = LCMapStringW(lcid, mapflags, in, in_len, out, out_len);
919 if (!r) goto done;
920
921 r = WideCharToMultiByte(codepage, 0, out, out_len, dst, dstlen, NULL, NULL);
922
923done:
924 if (in != buf_in) free(in);
925 if (out != buf_out) free(out);
926 return r;
927}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define WideCharToMultiByte
Definition: compat.h:111
#define MultiByteToWideChar
Definition: compat.h:110
LCID lcid
Definition: locale.c:5656
INT WINAPI DECLSPEC_HOTPATCH LCMapStringW(LCID lcid, DWORD flags, const WCHAR *src, int srclen, WCHAR *dst, int dstlen)
Definition: locale.c:6959
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLenum src
Definition: glext.h:6340
GLuint in
Definition: glext.h:9616
GLenum GLenum dst
Definition: glext.h:6340
#define MB_ERR_INVALID_CHARS
Definition: unicode.h:41
static DWORD LPDWORD LPCSTR DWORD srclen
Definition: directory.c:52
static DWORD dstlen
Definition: directory.c:51
#define TRACE(s)
Definition: solgame.cpp:4
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
int codepage
Definition: win_iconv.c:156
#define LCMAP_SORTKEY
Definition: winnls.h:199
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by _mbctolower_l(), _mbctoupper_l(), _tolower_l(), and _toupper_l().

◆ __CxxRegisterExceptionObject()

BOOL __cdecl __CxxRegisterExceptionObject ( EXCEPTION_POINTERS ep,
cxx_frame_info frame_info 
)

Definition at line 968 of file except.c.

969{
971
972 TRACE("(%p, %p)\n", ep, frame_info);
973
974 if (!ep || !ep->ExceptionRecord)
975 {
976 frame_info->rec = (void*)-1;
977 frame_info->context = (void*)-1;
978 return TRUE;
979 }
980
981 frame_info->rec = data->exc_record;
982 frame_info->context = data->ctx_record;
983 data->exc_record = ep->ExceptionRecord;
984 data->ctx_record = ep->ContextRecord;
986 return TRUE;
987}
#define TRUE
Definition: types.h:120
frame_info *CDECL _CreateFrameInfo(frame_info *fi, void *obj)
Definition: except.c:889
thread_data_t *CDECL msvcrt_get_thread_data(void)
Definition: thread.c:45
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
PEXCEPTION_RECORD ExceptionRecord
Definition: rtltypes.h:200
PCONTEXT ContextRecord
Definition: rtltypes.h:201
ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]
Definition: compat.h:213

Referenced by call_catch_block().

◆ __CxxUnregisterExceptionObject()

void __cdecl __CxxUnregisterExceptionObject ( cxx_frame_info frame_info,
BOOL  in_use 
)

Definition at line 992 of file except.c.

993{
995
996 TRACE("(%p)\n", frame_info);
997
998 if(frame_info->rec == (void*)-1)
999 return;
1000
1001 _FindAndUnlinkFrame(&frame_info->frame_info);
1002 if(data->exc_record->ExceptionCode == CXX_EXCEPTION && !in_use
1003 && _IsExceptionObjectToBeDestroyed((void*)data->exc_record->ExceptionInformation[1]))
1004 __DestructExceptionObject(data->exc_record);
1005 data->exc_record = frame_info->rec;
1006 data->ctx_record = frame_info->context;
1007}
#define CXX_EXCEPTION
Definition: cppexcept.h:34
void CDECL __DestructExceptionObject(EXCEPTION_RECORD *rec)
Definition: except.c:950
void CDECL _FindAndUnlinkFrame(frame_info *fi)
Definition: except.c:904
BOOL __cdecl _IsExceptionObjectToBeDestroyed(const void *obj)
Definition: except.c:932

Referenced by cxx_catch_cleanup().

◆ __DestructExceptionObject()

void CDECL __DestructExceptionObject ( EXCEPTION_RECORD rec)

Definition at line 950 of file except.c.

951{
953 void *object = (void*)rec->ExceptionInformation[1];
954
955 TRACE("(%p)\n", rec);
956
957 if (!is_cxx_exception( rec )) return;
958
959 if (!info || !info->destructor)
960 return;
961
962 call_dtor( rtti_rva( info->destructor, rec->ExceptionInformation[3] ), object );
963}
static void call_dtor(void *func, void *this)
Definition: cppexcept.h:207
static BOOL is_cxx_exception(EXCEPTION_RECORD *rec)
Definition: cppexcept.h:146
static void * rtti_rva(unsigned int rva, uintptr_t base)
Definition: cxx.h:469

Referenced by __CxxUnregisterExceptionObject(), call_catch_block(), and se_translation_filter().

◆ __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}
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

◆ _amsg_exit()

void __cdecl _amsg_exit ( int  errnum)

Definition at line 233 of file exit.c.

234{
235 TRACE("(%d)\n", errnum);
236
239 {
240 char text[32];
241 sprintf(text, "Error: R60%d",errnum);
242 DoMessageBox("Runtime error!", text);
243 }
244 else
245 _cprintf("\nruntime error R60%d\n",errnum);
246 _aexit_rtn(255);
247}
aexit_t _aexit_rtn
Definition: amsg.c:39
const WCHAR * text
Definition: package.c:1794
int WINAPIV _cprintf(const char *format,...)
Definition: console.c:563
static void DoMessageBox(const char *lead, const char *message)
Definition: exit.c:220
int MSVCRT_app_type
Definition: data.c:59
static int MSVCRT_error_mode
Definition: exit.c:58
#define _OUT_TO_MSGBOX
Definition: stdlib.h:75
#define _OUT_TO_DEFAULT
Definition: stdlib.h:73
#define sprintf
Definition: sprintf.c:45

Referenced by _purecall(), and msvcrt_get_thread_data().

◆ _CreateFrameInfo()

frame_info *__cdecl _CreateFrameInfo ( frame_info fi,
void obj 
)

Definition at line 889 of file except.c.

890{
892
893 TRACE("(%p, %p)\n", fi, obj);
894
895 fi->next = data->frame_info_head;
896 data->frame_info_head = fi;
897 fi->object = obj;
898 return fi;
899}

Referenced by __CxxRegisterExceptionObject().

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

◆ _set_new_mode()

int __cdecl _set_new_mode ( int  mode)

Definition at line 227 of file heap.c.

228{
229 if(!MSVCRT_CHECK_PMT(mode == 0 || mode == 1)) return -1;
231}
#define InterlockedExchange
Definition: armddk.h:54
static LONG MSVCRT_new_mode
Definition: heap.c:49
#define MSVCRT_CHECK_PMT(x)
Definition: msvcrt.h:378
GLenum mode
Definition: glext.h:6217

Referenced by __getmainargs(), and __wgetmainargs().

◆ arg_clbk_positional()

printf_arg arg_clbk_positional ( void ctx,
int  pos,
int  type,
va_list valist 
)

Definition at line 870 of file wcs.c.

871{
873 return args[pos];
874}
Definition: match.c:390

Referenced by _vscprintf_p_l(), vsprintf_p_l_opt(), and vswprintf_p_l_opt().

◆ arg_clbk_valist()

printf_arg arg_clbk_valist ( void ctx,
int  arg_pos,
int  type,
va_list valist 
)

Definition at line 847 of file wcs.c.

848{
850
851 if(type == VT_I8)
852 ret.get_longlong = va_arg(*valist, LONGLONG);
853 else if(type == VT_INT)
854 ret.get_int = va_arg(*valist, int);
855 else if(type == VT_R8)
856 ret.get_double = va_arg(*valist, double);
857 else if(type == VT_PTR)
858 ret.get_ptr = va_arg(*valist, void*);
859 else {
860 ERR("Incorrect type\n");
861 ret.get_int = 0;
862 }
863
864 return ret;
865}
#define ERR(fmt,...)
Definition: precomp.h:57
@ VT_INT
Definition: compat.h:2316
@ VT_PTR
Definition: compat.h:2320
@ VT_R8
Definition: compat.h:2300
@ VT_I8
Definition: compat.h:2314
#define va_arg(v, l)
Definition: stdarg.h:27
return ret
Definition: mutex.c:146
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static va_list valist
Definition: printf.c:46
int64_t LONGLONG
Definition: typedefs.h:68

Referenced by _vscprintf_p_l(), _vsnprintf(), _vsnprintf_l(), _vsnwprintf(), _vsnwprintf_l(), vsnprintf_s_l_opt(), vsnwprintf_s_l_opt(), vsprintf_p_l_opt(), and vswprintf_p_l_opt().

◆ create_mbcinfo()

threadmbcinfo * create_mbcinfo ( int  cp,
LCID  lcid,
threadmbcinfo old_mbcinfo 
)

Definition at line 219 of file mbcs.c.

220{
221 threadmbcinfo *mbcinfo;
222 int newcp;
223 CPINFO cpi;
224 BYTE *bytes;
225 WORD chartypes[256];
226 char bufA[256];
227 WCHAR bufW[256], lowW[256], upW[256];
228 int charcount, maxchar;
229 int ret;
230 int i;
231
232 if(old_mbcinfo && cp==old_mbcinfo->mbcodepage
233 && (lcid==-1 || lcid==old_mbcinfo->mblcid)) {
234 InterlockedIncrement(&old_mbcinfo->refcount);
235 return old_mbcinfo;
236 }
237
238 mbcinfo = malloc(sizeof(threadmbcinfo));
239 if(!mbcinfo)
240 return NULL;
241 mbcinfo->refcount = 1;
242
243 switch (cp)
244 {
245 case _MB_CP_ANSI:
246 newcp = GetACP();
247 break;
248 case _MB_CP_OEM:
249 newcp = GetOEMCP();
250 break;
251 case _MB_CP_LOCALE:
252 newcp = get_locinfo()->lc_codepage;
253 if(newcp)
254 break;
255 /* fall through (C locale) */
256 case _MB_CP_SBCS:
257 newcp = 20127; /* ASCII */
258 break;
259 default:
260 newcp = cp;
261 break;
262 }
263
264 if(lcid == -1) {
266 sprintf(bufA, ".%d", newcp);
267 mbcinfo->mblcid = locale_to_sname(bufA, NULL, NULL, wbuf) ? LocaleNameToLCID(wbuf, LOCALE_ALLOW_NEUTRAL_NAMES) : -1;
268 } else {
269 mbcinfo->mblcid = lcid;
270 }
271
272 if(mbcinfo->mblcid == -1)
273 {
274 WARN("Can't assign LCID to codepage (%d)\n", mbcinfo->mblcid);
275 mbcinfo->mblcid = 0;
276 }
277
278 if (!GetCPInfo(newcp, &cpi))
279 {
280 WARN("Codepage %d not found\n", newcp);
281 free(mbcinfo);
282 return NULL;
283 }
284
285 /* setup the _mbctype */
286 memset(mbcinfo->mbctype, 0, sizeof(unsigned char[257]));
287 memset(mbcinfo->mbcasemap, 0, sizeof(unsigned char[256]));
288
289 bytes = cpi.LeadByte;
290 while (bytes[0] || bytes[1])
291 {
292 for (i = bytes[0]; i <= bytes[1]; i++)
293 mbcinfo->mbctype[i + 1] |= _M1;
294 bytes += 2;
295 }
296
297 if (cpi.MaxCharSize == 2)
298 {
299 /* trail bytes not available through kernel32 but stored in a structure in msvcrt */
300 struct cp_extra_info_t *cpextra = g_cpextrainfo;
301
302 mbcinfo->ismbcodepage = 1;
303 while (TRUE)
304 {
305 if (cpextra->cp == 0 || cpextra->cp == newcp)
306 {
307 if (cpextra->cp == 0)
308 FIXME("trail bytes data not available for DBCS codepage %d - assuming all bytes\n", newcp);
309
310 bytes = cpextra->TrailBytes;
311 while (bytes[0] || bytes[1])
312 {
313 for (i = bytes[0]; i <= bytes[1]; i++)
314 mbcinfo->mbctype[i + 1] |= _M2;
315 bytes += 2;
316 }
317 break;
318 }
319 cpextra++;
320 }
321 }
322 else
323 mbcinfo->ismbcodepage = 0;
324
325 maxchar = (newcp == CP_UTF8) ? 128 : 256;
326
327 /* we can't use GetStringTypeA directly because we don't have a locale - only a code page
328 */
329 charcount = 0;
330 for (i = 0; i < maxchar; i++)
331 if (!(mbcinfo->mbctype[i + 1] & _M1))
332 bufA[charcount++] = i;
333
334 ret = MultiByteToWideChar(newcp, 0, bufA, charcount, bufW, charcount);
335 if (ret != charcount)
336 {
337 ERR("MultiByteToWideChar of chars failed for cp %d, ret=%d (exp %d), error=%ld\n",
338 newcp, ret, charcount, GetLastError());
339 }
340
341 GetStringTypeW(CT_CTYPE1, bufW, charcount, chartypes);
342 LCMapStringW(mbcinfo->mblcid, LCMAP_LOWERCASE, bufW, charcount, lowW, charcount);
343 LCMapStringW(mbcinfo->mblcid, LCMAP_UPPERCASE, bufW, charcount, upW, charcount);
344
345 charcount = 0;
346 for (i = 0; i < maxchar; i++)
347 if (!(mbcinfo->mbctype[i + 1] & _M1))
348 {
349 if (chartypes[charcount] & C1_UPPER)
350 {
351 mbcinfo->mbctype[i + 1] |= _SBUP;
352 bufW[charcount] = lowW[charcount];
353 }
354 else if (chartypes[charcount] & C1_LOWER)
355 {
356 mbcinfo->mbctype[i + 1] |= _SBLOW;
357 bufW[charcount] = upW[charcount];
358 }
359 charcount++;
360 }
361
362 ret = WideCharToMultiByte(newcp, 0, bufW, charcount, bufA, charcount, NULL, NULL);
363 if (ret != charcount)
364 {
365 ERR("WideCharToMultiByte failed for cp %d, ret=%d (exp %d), error=%ld\n",
366 newcp, ret, charcount, GetLastError());
367 }
368
369 charcount = 0;
370 for (i = 0; i < maxchar; i++)
371 {
372 if(!(mbcinfo->mbctype[i + 1] & _M1))
373 {
374 if(mbcinfo->mbctype[i + 1] & (_SBUP | _SBLOW))
375 mbcinfo->mbcasemap[i] = bufA[charcount];
376 charcount++;
377 }
378 }
379
380 if (newcp == 932) /* CP932 only - set _MP and _MS */
381 {
382 /* On Windows it's possible to calculate the _MP and _MS from CT_CTYPE1
383 * and CT_CTYPE3. But as of Wine 0.9.43 we return wrong values what makes
384 * it hard. As this is set only for codepage 932 we hardcode it what gives
385 * also faster execution.
386 */
387 for (i = 161; i <= 165; i++)
388 mbcinfo->mbctype[i + 1] |= _MP;
389 for (i = 166; i <= 223; i++)
390 mbcinfo->mbctype[i + 1] |= _MS;
391 }
392
393 mbcinfo->mbcodepage = newcp;
394 return mbcinfo;
395}
static unsigned char bytes[4]
Definition: adnsresfilter.c:74
#define InterlockedIncrement
Definition: armddk.h:53
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
LCID WINAPI LocaleNameToLCID(_In_ LPCWSTR lpName, _In_ DWORD dwFlags)
UINT WINAPI GetACP(void)
Definition: locale.c:2023
BOOL WINAPI GetCPInfo(UINT codepage, LPCPINFO cpinfo)
Definition: locale.c:2146
BOOL WINAPI GetStringTypeW(DWORD type, LPCWSTR src, INT count, LPWORD chartype)
Definition: locale.c:3098
INT WINAPI LCMapStringW(LCID lcid, DWORD flags, LPCWSTR src, INT srclen, LPWSTR dst, INT dstlen)
Definition: locale.c:3808
UINT WINAPI GetOEMCP(void)
Definition: locale.c:2062
#define _M2
Definition: mbctype.h:39
#define _MP
Definition: mbctype.h:37
#define _MB_CP_OEM
Definition: mbctype.h:52
#define _MB_CP_ANSI
Definition: mbctype.h:53
#define _MB_CP_LOCALE
Definition: mbctype.h:54
#define _M1
Definition: mbctype.h:38
#define _SBLOW
Definition: mbctype.h:42
#define _SBUP
Definition: mbctype.h:41
#define _MS
Definition: mbctype.h:36
#define _MB_CP_SBCS
Definition: mbctype.h:51
BOOL locale_to_sname(const char *locale, unsigned short *codepage, BOOL *sname_match, WCHAR *sname)
Definition: locale.c:335
unsigned short WORD
Definition: ntddk_ex.h:93
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define C1_LOWER
Definition: unicode.h:32
#define C1_UPPER
Definition: unicode.h:31
POINT cp
Definition: magnifier.c:59
static struct cp_extra_info_t g_cpextrainfo[]
Definition: mbcs.c:48
#define for
Definition: utility.h:88
#define LOCALE_NAME_MAX_LENGTH
#define CP_UTF8
Definition: nls.h:20
#define memset(x, y, z)
Definition: compat.h:39
BYTE LeadByte[MAX_LEADBYTES]
Definition: winnls.h:652
UINT MaxCharSize
Definition: winnls.h:650
BYTE TrailBytes[MAX_LEADBYTES]
Definition: mbcs.c:45
unsigned char mbcasemap[256]
Definition: msvcrt.h:139
unsigned char mbctype[257]
Definition: msvcrt.h:138
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define get_locinfo()
Definition: winesup.h:25
#define LOCALE_ALLOW_NEUTRAL_NAMES
Definition: winnls.h:25
#define CT_CTYPE1
Definition: winnls.h:255
#define LCMAP_UPPERCASE
Definition: winnls.h:198
#define LCMAP_LOWERCASE
Definition: winnls.h:197
unsigned char BYTE
Definition: xxhash.c:193

Referenced by _create_locale(), and _setmbcp().

◆ 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 365 of file string.c.

366{
367 ULONGLONG bits = 0;
368
369 if (fp->mod == FP_VAL_INFINITY)
370 {
371 *d = fp->sign * INFINITY;
372 return 0;
373 }
374
375 if (fp->mod == FP_VAL_NAN)
376 {
377 bits = ~0;
378 if (fp->sign == 1)
379 bits &= ~((ULONGLONG)1 << (MANT_BITS + EXP_BITS - 1));
380 *d = *(double*)&bits;
381 return 0;
382 }
383
384 TRACE("%c %#I64x *2^%d (round %d)\n", fp->sign == -1 ? '-' : '+',
385 fp->m, fp->exp, fp->mod);
386 if (!fp->m)
387 {
388 *d = fp->sign * 0.0;
389 return 0;
390 }
391
392 /* make sure that we don't overflow modifying exponent */
393 if (fp->exp > 1<<EXP_BITS)
394 {
395 *d = fp->sign * INFINITY;
396 return ERANGE;
397 }
398 if (fp->exp < -(1<<EXP_BITS))
399 {
400 *d = fp->sign * 0.0;
401 return ERANGE;
402 }
403 fp->exp += MANT_BITS - 1;
404
405 /* normalize mantissa */
406 while(fp->m < (ULONGLONG)1 << (MANT_BITS-1))
407 {
408 fp->m <<= 1;
409 fp->exp--;
410 }
411 while(fp->m >= (ULONGLONG)1 << MANT_BITS)
412 {
413 if (fp->m & 1 || fp->mod != FP_ROUND_ZERO)
414 {
415 if (!(fp->m & 1)) fp->mod = FP_ROUND_DOWN;
416 else if(fp->mod == FP_ROUND_ZERO) fp->mod = FP_ROUND_EVEN;
417 else fp->mod = FP_ROUND_UP;
418 }
419 fp->m >>= 1;
420 fp->exp++;
421 }
422 fp->exp += (1 << (EXP_BITS-1)) - 1;
423
424 /* handle subnormals */
425 if (fp->exp <= 0)
426 {
427 if (fp->m & 1 && fp->mod == FP_ROUND_ZERO) fp->mod = FP_ROUND_EVEN;
428 else if (fp->m & 1) fp->mod = FP_ROUND_UP;
429 else if (fp->mod != FP_ROUND_ZERO) fp->mod = FP_ROUND_DOWN;
430 fp->m >>= 1;
431 }
432 while(fp->m && fp->exp<0)
433 {
434 if (fp->m & 1 && fp->mod == FP_ROUND_ZERO) fp->mod = FP_ROUND_EVEN;
435 else if (fp->m & 1) fp->mod = FP_ROUND_UP;
436 else if (fp->mod != FP_ROUND_ZERO) fp->mod = FP_ROUND_DOWN;
437 fp->m >>= 1;
438 fp->exp++;
439 }
440
441 /* round mantissa */
442 if (fp->mod == FP_ROUND_UP || (fp->mod == FP_ROUND_EVEN && fp->m & 1))
443 {
444 fp->m++;
445
446 /* handle subnormal that falls into regular range due to rounding */
447 if (fp->m == (ULONGLONG)1 << (MANT_BITS - 1))
448 {
449 fp->exp++;
450 }
451 else if (fp->m >= (ULONGLONG)1 << MANT_BITS)
452 {
453 fp->exp++;
454 fp->m >>= 1;
455 }
456 }
457
458 if (fp->exp >= (1<<EXP_BITS)-1)
459 {
460 *d = fp->sign * INFINITY;
461 return ERANGE;
462 }
463 if (!fp->m || fp->exp < 0)
464 {
465 *d = fp->sign * 0.0;
466 return ERANGE;
467 }
468
469 if (fp->sign == -1)
470 bits |= (ULONGLONG)1 << (MANT_BITS + EXP_BITS - 1);
471 bits |= (ULONGLONG)fp->exp << (MANT_BITS - 1);
472 bits |= fp->m & (((ULONGLONG)1 << (MANT_BITS - 1)) - 1);
473
474 TRACE("returning %#I64x\n", bits);
475 *d = *(double*)&bits;
476 return 0;
477}
#define EXP_BITS
Definition: bnum.h:22
#define MANT_BITS
Definition: bnum.h:23
#define ERANGE
Definition: errno.h:55
#define INFINITY
Definition: math.h:272
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
#define d
Definition: ke_i.h:81
enum fpmod mod
Definition: msvcrt.h:363
ULONGLONG m
Definition: msvcrt.h:362
int exp
Definition: msvcrt.h:361
int sign
Definition: msvcrt.h:360
uint64_t ULONGLONG
Definition: typedefs.h:67

Referenced by I10_OUTPUT(), and strtod_helper().

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

Definition at line 1162 of file locale.c.

1163{
1164 free_locinfo(locale->locinfo);
1165 free_mbcinfo(locale->mbcinfo);
1166}
Definition: _locale.h:75
void free_mbcinfo(pthreadmbcinfo mbcinfo)
Definition: locale.c:1138
void free_locinfo(pthreadlocinfo locinfo)
Definition: locale.c:1061

Referenced by _free_locale(), _wcsicmp_l(), _wcslwr_s_l(), _wcsnicmp_l(), and _wcsupr_s_l().

◆ free_locinfo()

void free_locinfo ( pthreadlocinfo  locinfo)

Definition at line 1061 of file locale.c.

1062{
1063 int i;
1064
1065 if(!locinfo)
1066 return;
1067
1068 for(i=LC_MIN+1; i<=LC_MAX; i++) {
1069 if(!locinfo->lc_category[i].refcount
1070 || !InterlockedDecrement((LONG *)locinfo->lc_category[i].refcount)) {
1071 free(locinfo->lc_category[i].locale);
1072 free(locinfo->lc_category[i].refcount);
1073 }
1074 if(!locinfo->lc_category[i].wrefcount
1075 || !InterlockedDecrement((LONG *)locinfo->lc_category[i].wrefcount)) {
1076#if _MSVCR_VER >= 110
1077 free(locinfo->lc_name[i]);
1078#endif
1079 free(locinfo->lc_category[i].wrefcount);
1080 }
1081 }
1082
1083 if(locinfo->lconv_num_refcount
1084 && !InterlockedDecrement((LONG *)locinfo->lconv_num_refcount)) {
1085 free(locinfo->lconv->decimal_point);
1086 free(locinfo->lconv->thousands_sep);
1087 free(locinfo->lconv->grouping);
1088#if _MSVCR_VER >= 100
1089 free(locinfo->lconv->_W_decimal_point);
1090 free(locinfo->lconv->_W_thousands_sep);
1091#endif
1092 free(locinfo->lconv_num_refcount);
1093 }
1094 if(locinfo->lconv_mon_refcount
1095 && !InterlockedDecrement((LONG *)locinfo->lconv_mon_refcount)) {
1096 free(locinfo->lconv->int_curr_symbol);
1097 free(locinfo->lconv->currency_symbol);
1098 free(locinfo->lconv->mon_decimal_point);
1099 free(locinfo->lconv->mon_thousands_sep);
1100 free(locinfo->lconv->mon_grouping);
1101 free(locinfo->lconv->positive_sign);
1102 free(locinfo->lconv->negative_sign);
1103#if _MSVCR_VER >= 100
1104 free(locinfo->lconv->_W_int_curr_symbol);
1105 free(locinfo->lconv->_W_currency_symbol);
1106 free(locinfo->lconv->_W_mon_decimal_point);
1107 free(locinfo->lconv->_W_mon_thousands_sep);
1108 free(locinfo->lconv->_W_positive_sign);
1109 free(locinfo->lconv->_W_negative_sign);
1110#endif
1111 free(locinfo->lconv_mon_refcount);
1112 }
1113 if(locinfo->lconv_intl_refcount
1114 && !InterlockedDecrement((LONG *)locinfo->lconv_intl_refcount)) {
1115 free(locinfo->lconv_intl_refcount);
1116 free(locinfo->lconv);
1117 }
1118
1119 if(locinfo->ctype1_refcount
1120 && !InterlockedDecrement((LONG *)locinfo->ctype1_refcount)) {
1121 free(locinfo->ctype1_refcount);
1122 free(locinfo->ctype1);
1123 free((void*)locinfo->pclmap);
1124 free((void*)locinfo->pcumap);
1125 }
1126
1127 if(locinfo->lc_time_curr && !InterlockedDecrement(&locinfo->lc_time_curr->refcount)
1128 && locinfo->lc_time_curr != &cloc_time_data)
1129 free(locinfo->lc_time_curr);
1130
1131 if(InterlockedDecrement((LONG *)&locinfo->refcount))
1132 return;
1133
1134 free(locinfo);
1135}
#define InterlockedDecrement
Definition: armddk.h:52
#define LC_MAX
Definition: locale.h:32
#define LC_MIN
Definition: locale.h:31
__lc_time_data cloc_time_data
Definition: locale.c:60
else locinfo
Definition: scanf.h:225
long LONG
Definition: pedump.c:60

Referenced by _configthreadlocale(), _create_locale(), create_locinfo(), free_locale_noalloc(), MSVCRT__free_locale(), msvcrt_free_tls_mem(), setlocale(), and update_thread_locale().

◆ free_mbcinfo()

void free_mbcinfo ( pthreadmbcinfo  mbcinfo)

Definition at line 1138 of file locale.c.

1139{
1140 if(!mbcinfo)
1141 return;
1142
1143 if(InterlockedDecrement(&mbcinfo->refcount))
1144 return;
1145
1146 free(mbcinfo);
1147}

Referenced by _configthreadlocale(), _setmbcp(), free_locale_noalloc(), MSVCRT__free_locale(), msvcrt_free_tls_mem(), and update_thread_locale().

◆ get_current_locale_noalloc()

_locale_t CDECL get_current_locale_noalloc ( _locale_t  locale)

Definition at line 1149 of file locale.c.

1150{
1152
1154 locale->locinfo = data->locinfo;
1155 locale->mbcinfo = data->mbcinfo;
1156
1157 grab_locinfo(locale->locinfo);
1158 InterlockedIncrement(&locale->mbcinfo->refcount);
1159 return locale;
1160}
static void update_thread_locale(thread_data_t *data)
Definition: locale.c:609
static void grab_locinfo(pthreadlocinfo locinfo)
Definition: locale.c:587

Referenced by _get_current_locale(), _wcsicmp_l(), _wcslwr_s_l(), _wcsnicmp_l(), and _wcsupr_s_l().

◆ get_locinfo()

◆ get_mbcinfo()

◆ locale_to_LCID()

LCID locale_to_LCID ( const char ,
unsigned short ,
BOOL  
)

◆ msvcrt_create_io_inherit_block()

BOOL msvcrt_create_io_inherit_block ( WORD size,
BYTE **  block 
)

Definition at line 675 of file file.c.

676{
677 int fd, last_fd;
678 char* wxflag_ptr;
679 HANDLE* handle_ptr;
680 ioinfo* fdinfo;
681
682 for (last_fd=MSVCRT_MAX_FILES-1; last_fd>=0; last_fd--)
684 break;
685 last_fd++;
686
687 *size = sizeof(unsigned) + (sizeof(char) + sizeof(HANDLE)) * last_fd;
688 *block = calloc(1, *size);
689 if (!*block)
690 {
691 *size = 0;
692 return FALSE;
693 }
694 wxflag_ptr = (char*)*block + sizeof(unsigned);
695 handle_ptr = (HANDLE*)(wxflag_ptr + last_fd);
696
697 *(unsigned*)*block = last_fd;
698 for (fd = 0; fd < last_fd; fd++)
699 {
700 /* to be inherited, we need it to be open, and that DONTINHERIT isn't set */
701 fdinfo = get_ioinfo_nolock(fd);
702 if ((fdinfo->wxflag & (WX_OPEN | WX_DONTINHERIT)) == WX_OPEN)
703 {
704 *wxflag_ptr = fdinfo->wxflag;
705 *handle_ptr = fdinfo->handle;
706 }
707 else
708 {
709 *wxflag_ptr = 0;
710 *handle_ptr = INVALID_HANDLE_VALUE;
711 }
712 wxflag_ptr++; handle_ptr++;
713 }
714 return TRUE;
715}
#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

Referenced by msvcrt_spawn().

◆ msvcrt_destroy_heap()

void msvcrt_destroy_heap ( void  )

Definition at line 840 of file heap.c.

841{
842#if _MSVCR_VER <= 100 && !defined(__REACTOS__)
844#endif
845 if(sb_heap)
847}
static HANDLE heap
Definition: heap.c:44
static HANDLE sb_heap
Definition: heap.c:44
BOOL WINAPI HeapDestroy(HANDLE hHeap)
Definition: heapmem.c:85

Referenced by DllMain().

◆ 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

Referenced by DllMain().

◆ 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

Referenced by DllMain().

◆ 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}
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 GLint GLint j
Definition: glfuncs.h:250
#define cs
Definition: i386-dis.c:442
Definition: fci.c:127
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

Referenced by DllMain().

◆ msvcrt_free_locks()

void msvcrt_free_locks ( void  )

Definition at line 149 of file lock.c.

150{
151 int i;
152
153 TRACE( ": uninitializing all mtlocks\n" );
154
155 /* Uninitialize the table */
156 for( i=0; i < _TOTAL_LOCKS; i++ )
157 {
158 if( lock_table[ i ].bInit )
159 {
161 }
162 }
163}
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

Referenced by DllMain().

◆ 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

Referenced by DllMain().

◆ msvcrt_get_thread_data()

thread_data_t *CDECL msvcrt_get_thread_data ( void  )

Definition at line 45 of file thread.c.

46{
48 DWORD err = GetLastError(); /* need to preserve last error */
49
51 {
52 if (!(ptr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ptr) )))
55 ptr->tid = GetCurrentThreadId();
56 ptr->handle = INVALID_HANDLE_VALUE;
57 ptr->random_seed = 1;
58 ptr->locinfo = MSVCRT_locale->locinfo;
59 ptr->mbcinfo = MSVCRT_locale->mbcinfo;
60 ptr->cached_locale[0] = 'C';
61 ptr->cached_locale[1] = 0;
62#if _MSVCR_VER >= 140
63 ptr->module = NULL;
64#endif
65 }
67 return ptr;
68}
#define SetLastError(x)
Definition: compat.h:752
#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
DWORD msvcrt_tls_index
Definition: main.c:29
#define _RT_THREAD
Definition: msvcrt.h:308
unsigned long DWORD
Definition: ntddk_ex.h:95
static PVOID ptr
Definition: dispmode.c:27
#define err(...)
#define MSVCRT_locale
Definition: locale.h:80
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459

Referenced by _beginthread_trampoline(), and _beginthreadex_trampoline().

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

Referenced by DllMain().

◆ msvcrt_init_clock()

void msvcrt_init_clock ( void  )

Definition at line 49 of file time.c.

50{
51 LARGE_INTEGER systime;
52
53 NtQuerySystemTime(&systime);
54 init_time = systime.QuadPart;
55}
static LONGLONG init_time
Definition: time.c:47
NTSTATUS NTAPI NtQuerySystemTime(OUT PLARGE_INTEGER SystemTime)
Definition: time.c:569
LONGLONG QuadPart
Definition: typedefs.h:114

◆ msvcrt_init_exception()

void msvcrt_init_exception ( void )

◆ msvcrt_init_heap()

BOOL msvcrt_init_heap ( void  )

Definition at line 830 of file heap.c.

831{
832#if _MSVCR_VER <= 100 && !defined(__REACTOS__)
833 heap = HeapCreate(0, 0, 0);
834#else
836#endif
837 return heap != NULL;
838}
HANDLE WINAPI HeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize)
Definition: heapmem.c:45

Referenced by DllMain().

◆ 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
GLuint GLuint GLsizei count
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

Referenced by DllMain().

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

Referenced by DllMain().

◆ msvcrt_init_math()

void msvcrt_init_math ( void module)

Definition at line 74 of file math.c.

75{
77#if _MSVCR_VER <=71
79#else
81#endif
82}
BOOL WINAPI IsProcessorFeaturePresent(IN DWORD ProcessorFeature)
Definition: sysinfo.c:169
static BOOL sse2_enabled
Definition: math.c:72
BOOL sse2_supported
Definition: math.c:71
#define PF_XMMI64_INSTRUCTIONS_AVAILABLE
Definition: ketypes.h:186

◆ 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

Referenced by DllMain().

◆ msvcrt_init_signals()

void msvcrt_init_signals ( void  )

Definition at line 635 of file except.c.

Referenced by DllMain().

◆ msvcrt_set_errno()

void msvcrt_set_errno ( int  err)

Definition at line 132 of file errno.c.

133{
134 int *errno_ptr = _errno();
135 __msvcrt_ulong *doserrno = __doserrno();
136
137 *doserrno = err;
138
139 switch(err)
140 {
141#define ERR_CASE(oserr) case oserr:
142#define ERR_MAPS(oserr, crterr) case oserr: *errno_ptr = crterr; break
185 default:
186 /* Remaining cases map to EINVAL */
187 /* FIXME: may be missing some errors above */
188 *errno_ptr = EINVAL;
189 }
190}
#define ERROR_BUSY
Definition: dderror.h:12
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
#define ERR_MAPS(oserr, crterr)
__msvcrt_ulong *CDECL __doserrno(void)
Definition: errno.c:223
int *CDECL _errno(void)
Definition: errno.c:215
#define ERR_CASE(oserr)
unsigned long __msvcrt_ulong
Definition: corecrt.h:168
#define ENOENT
Definition: errno.h:25
#define ENOSPC
Definition: errno.h:49
#define EEXIST
Definition: errno.h:39
#define EINVAL
Definition: errno.h:44
#define ECHILD
Definition: errno.h:33
#define ENOEXEC
Definition: errno.h:31
#define EDEADLK
Definition: errno.h:56
#define EPIPE
Definition: errno.h:53
#define EMFILE
Definition: errno.h:46
#define ENOMEM
Definition: errno.h:35
#define EIO
Definition: errno.h:28
#define EBUSY
Definition: errno.h:38
#define ENOTEMPTY
Definition: errno.h:61
#define ENODEV
Definition: errno.h:41
#define E2BIG
Definition: errno.h:30
#define EACCES
Definition: errno.h:36
#define EBADF
Definition: errno.h:32
#define EAGAIN
Definition: errno.h:34
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define ERROR_BAD_NETPATH
Definition: winerror.h:267
#define ERROR_NOT_ENOUGH_QUOTA
Definition: winerror.h:1480
#define ERROR_CURRENT_DIRECTORY
Definition: winerror.h:241
#define ERROR_IO_DEVICE
Definition: winerror.h:977
#define ERROR_NESTING_NOT_ALLOWED
Definition: winerror.h:392
#define ERROR_BAD_ENVIRONMENT
Definition: winerror.h:235
#define ERROR_SHARING_VIOLATION
Definition: winerror.h:257
#define ERROR_POSSIBLE_DEADLOCK
Definition: winerror.h:991
#define ERROR_TOO_MANY_OPEN_FILES
Definition: winerror.h:229
#define ERROR_INVALID_BLOCK
Definition: winerror.h:234
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:228
#define ERROR_BAD_PATHNAME
Definition: winerror.h:355
#define ERROR_NO_PROC_SLOTS
Definition: winerror.h:295
#define ERROR_DISK_FULL
Definition: winerror.h:308
#define ERROR_BROKEN_PIPE
Definition: winerror.h:305
#define ERROR_NOT_LOCKED
Definition: winerror.h:352
#define ERROR_CHILD_NOT_COMPLETE
Definition: winerror.h:323
#define ERROR_DIR_NOT_EMPTY
Definition: winerror.h:339
#define ERROR_FILE_EXISTS
Definition: winerror.h:287
#define ERROR_LOCK_VIOLATION
Definition: winerror.h:258
#define ERROR_SEEK_ON_DEVICE
Definition: winerror.h:326
#define ERROR_CANNOT_MAKE
Definition: winerror.h:288
#define ERROR_FAIL_I24
Definition: winerror.h:289
#define ERROR_NO_MORE_FILES
Definition: winerror.h:243
#define ERROR_WAIT_NO_CHILDREN
Definition: winerror.h:322
#define ERROR_BAD_FORMAT
Definition: winerror.h:236
#define ERROR_FILENAME_EXCED_RANGE
Definition: winerror.h:385
#define ERROR_DRIVE_LOCKED
Definition: winerror.h:304
#define ERROR_LOCK_FAILED
Definition: winerror.h:358
#define ERROR_MAX_THRDS_REACHED
Definition: winerror.h:357
#define ERROR_INVALID_ACCESS
Definition: winerror.h:237
#define ERROR_NETWORK_ACCESS_DENIED
Definition: winerror.h:279
#define ERROR_ARENA_TRASHED
Definition: winerror.h:232
#define ERROR_INVALID_DRIVE
Definition: winerror.h:240
#define ERROR_BAD_NET_NAME
Definition: winerror.h:281
#define ERROR_BAD_DEVICE
Definition: winerror.h:1032

◆ 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 373 of file data.c.

374{
375 const unsigned int len = strlen(str) + 1 ;
376 wchar_t *wstr = malloc(len* sizeof (wchar_t));
377 if (!wstr)
378 return NULL;
380 return wstr;
381}
#define CP_ACP
Definition: compat.h:109
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1592
GLenum GLsizei len
Definition: glext.h:6722
const WCHAR * str
#define MB_PRECOMPOSED
Definition: winnls.h:299

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

◆ operator_delete()

void __cdecl operator_delete ( void mem)

◆ operator_new()

void *__cdecl operator_new ( size_t  size)

Definition at line 143 of file heap.c.

144{
145 void *retval;
146
147 do
148 {
150 if(retval)
151 {
152 TRACE("(%Iu) returning %p\n", size, retval);
153 return retval;
154 }
155 } while(_callnewh(size));
156
157 TRACE("(%Iu) out of memory\n", size);
158#if _MSVCR_VER >= 80
159 throw_bad_alloc();
160#endif
161 return NULL;
162}
static void * msvcrt_heap_alloc(DWORD flags, size_t size)
Definition: heap.c:56
int CDECL _callnewh(size_t size)
Definition: heap.c:131
int retval
Definition: wcstombs.cpp:91

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

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

Definition at line 45 of file locale.c.

Referenced by msvcrt_init_locale(), and setlocale().

◆ MSVCRT___lc_collate_cp

int MSVCRT___lc_collate_cp
extern

Definition at line 46 of file locale.c.

Referenced by __init_global_locale(), msvcrt_init_locale(), and setlocale().

◆ MSVCRT__commode

unsigned int MSVCRT__commode
extern

Definition at line 33 of file data.c.

Referenced by __p__commode(), and msvcrt_get_flags().

◆ MSVCRT__ctype

WORD MSVCRT__ctype[257]
extern

Definition at line 34 of file ctype.c.

Referenced by create_locinfo().

◆ MSVCRT__environ

char** MSVCRT__environ
extern

◆ MSVCRT__iob

FILE MSVCRT__iob[]
extern

Definition at line 263 of file file.c.

Referenced by iob_get_file().

◆ MSVCRT__pwctype

WORD* MSVCRT__pwctype
extern

Definition at line 128 of file ctype.c.

Referenced by __p__pwctype(), __pwctype_func(), and _iswctype_l().

◆ MSVCRT__wenviron

wchar_t** MSVCRT__wenviron
extern