2 * Copyright 2001 Jon Griffiths
3 * Copyright 2004 Dimitrie O. Paun
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 * - Symbols are prefixed with MSVCRT_ if they conflict
23 * - Internal symbols are usually prefixed by msvcrt_.
24 * - Exported symbols that are not present in the public
25 * headers are usually kept the same as the original.
27 * - To avoid conflicts with the standard C library,
28 * no msvcrt headers are included in the implementation.
29 * - Instead, symbols are duplicated here, prefixed with
30 * MSVCRT_, as explained above.
31 * - To avoid inconsistencies, a test for each symbol is
32 * added into tests/headers.c. Please always add a
33 * corresponding test when you add a new symbol!
36 #ifndef __WINE_MSVCRT_H
37 #define __WINE_MSVCRT_H
44 #define MSVCRT_LONG_MAX 0x7fffffff
45 #define MSVCRT_LONG_MIN (-MSVCRT_LONG_MAX-1)
46 #define MSVCRT_ULONG_MAX 0xffffffff
47 #define MSVCRT_I64_MAX (((__int64)0x7fffffff << 32) | 0xffffffff)
48 #define MSVCRT_I64_MIN (-MSVCRT_I64_MAX-1)
49 #define MSVCRT_UI64_MAX (((unsigned __int64)0xffffffff << 32) | 0xffffffff)
50 #define MSVCRT_MB_LEN_MAX 5
52 #define MSVCRT_SIZE_MAX MSVCRT_UI64_MAX
54 #define MSVCRT_SIZE_MAX MSVCRT_ULONG_MAX
57 #define MSVCRT__MAX_DRIVE 3
58 #define MSVCRT__MAX_DIR 256
59 #define MSVCRT__MAX_FNAME 256
60 #define MSVCRT__MAX_EXT 256
62 typedef unsigned char MSVCRT_bool
;
63 typedef unsigned short MSVCRT_wchar_t
;
64 typedef unsigned short MSVCRT_wint_t
;
65 typedef unsigned short MSVCRT_wctype_t
;
66 typedef unsigned short MSVCRT__ino_t
;
67 typedef unsigned int MSVCRT__fsize_t
;
68 typedef int MSVCRT_long
;
69 typedef unsigned int MSVCRT_ulong
;
70 typedef __int64 MSVCRT_longlong
;
72 typedef unsigned __int64 MSVCRT_size_t
;
73 typedef __int64 MSVCRT_intptr_t
;
74 typedef unsigned __int64 MSVCRT_uintptr_t
;
76 typedef unsigned long MSVCRT_size_t
;
77 typedef long MSVCRT_intptr_t
;
78 typedef unsigned long MSVCRT_uintptr_t
;
80 typedef unsigned int MSVCRT__dev_t
;
81 typedef int MSVCRT__off_t
;
82 typedef int MSVCRT_clock_t
;
83 typedef int MSVCRT___time32_t
;
84 typedef __int64
DECLSPEC_ALIGN(8) MSVCRT___time64_t
;
85 typedef __int64
DECLSPEC_ALIGN(8) MSVCRT_fpos_t
;
86 typedef int MSVCRT_mbstate_t
;
88 typedef void (__cdecl
*MSVCRT_terminate_handler
)(void);
89 typedef void (__cdecl
*MSVCRT_terminate_function
)(void);
90 typedef void (__cdecl
*MSVCRT_unexpected_handler
)(void);
91 typedef void (__cdecl
*MSVCRT_unexpected_function
)(void);
92 typedef void (__cdecl
*MSVCRT__se_translator_function
)(unsigned int code
, struct _EXCEPTION_POINTERS
*info
);
93 typedef void (__cdecl
*MSVCRT__beginthread_start_routine_t
)(void *);
94 typedef unsigned int (__stdcall
*MSVCRT__beginthreadex_start_routine_t
)(void *);
95 typedef int (__cdecl
*MSVCRT__onexit_t
)(void);
96 typedef void (__cdecl
*MSVCRT_invalid_parameter_handler
)(const MSVCRT_wchar_t
*, const MSVCRT_wchar_t
*, const MSVCRT_wchar_t
*, unsigned, MSVCRT_uintptr_t
);
97 typedef void (__cdecl
*MSVCRT_purecall_handler
)(void);
98 typedef void (__cdecl
*MSVCRT_security_error_handler
)(int, void *);
100 typedef struct {ULONG x80
[3];} MSVCRT__LDOUBLE
; /* Intel 80 bit FP format has sizeof() 12 */
114 typedef struct MSVCRT_tagLC_ID
{
115 unsigned short wLanguage
;
116 unsigned short wCountry
;
117 unsigned short wCodePage
;
118 } MSVCRT_LC_ID
, *MSVCRT_LPLC_ID
;
140 MSVCRT_wchar_t
*wstr
[43];
142 MSVCRT_wchar_t
*short_wday
[7];
143 MSVCRT_wchar_t
*wday
[7];
144 MSVCRT_wchar_t
*short_mon
[12];
145 MSVCRT_wchar_t
*mon
[12];
148 MSVCRT_wchar_t
*short_date
;
149 MSVCRT_wchar_t
*date
;
150 MSVCRT_wchar_t
*time
;
153 #if _MSVCR_VER >= 110
154 MSVCRT_wchar_t
*locname
;
157 } MSVCRT___lc_time_data
;
159 typedef struct MSVCRT_threadlocaleinfostruct
{
161 unsigned int lc_codepage
;
162 unsigned int lc_collate_cp
;
163 MSVCRT_ulong lc_handle
[6];
164 MSVCRT_LC_ID lc_id
[6];
167 MSVCRT_wchar_t
*wlocale
;
173 int *lconv_intl_refcount
;
174 int *lconv_num_refcount
;
175 int *lconv_mon_refcount
;
176 struct MSVCRT_lconv
*lconv
;
177 int *ctype1_refcount
;
178 unsigned short *ctype1
;
179 unsigned short *pctype
;
180 unsigned char *pclmap
;
181 unsigned char *pcumap
;
182 MSVCRT___lc_time_data
*lc_time_curr
;
183 #if _MSVCR_VER >= 110
184 MSVCRT_wchar_t
*lc_name
[6];
186 } MSVCRT_threadlocinfo
;
188 typedef struct MSVCRT_threadmbcinfostruct
{
193 unsigned short mbulinfo
[6];
194 unsigned char mbctype
[257];
195 unsigned char mbcasemap
[256];
196 } MSVCRT_threadmbcinfo
;
198 typedef struct MSVCRT_threadlocaleinfostruct
*MSVCRT_pthreadlocinfo
;
199 typedef struct MSVCRT_threadmbcinfostruct
*MSVCRT_pthreadmbcinfo
;
201 typedef struct MSVCRT_localeinfo_struct
203 MSVCRT_pthreadlocinfo locinfo
;
204 MSVCRT_pthreadmbcinfo mbcinfo
;
205 } MSVCRT__locale_tstruct
, *MSVCRT__locale_t
;
207 typedef struct _frame_info
210 struct _frame_info
*next
;
215 frame_info frame_info
;
216 EXCEPTION_RECORD
*rec
;
220 frame_info
* __cdecl
_CreateFrameInfo(frame_info
*fi
, void *obj
);
221 BOOL __cdecl
__CxxRegisterExceptionObject(EXCEPTION_POINTERS
*, cxx_frame_info
*);
222 void __cdecl
__CxxUnregisterExceptionObject(cxx_frame_info
*, BOOL
);
223 void CDECL
__DestructExceptionObject(EXCEPTION_RECORD
*);
226 extern DWORD msvcrt_tls_index DECLSPEC_HIDDEN
;
228 /* Keep in sync with msvcr90/tests/msvcr90.c */
229 struct __thread_data
{
233 MSVCRT_ulong thread_doserrno
;
235 unsigned int random_seed
; /* seed for rand() */
236 char *strtok_next
; /* next ptr for strtok() */
237 MSVCRT_wchar_t
*wcstok_next
; /* next ptr for wcstok() */
238 unsigned char *mbstok_next
; /* next ptr for mbstok() */
239 char *strerror_buffer
; /* buffer for strerror */
240 MSVCRT_wchar_t
*wcserror_buffer
; /* buffer for wcserror */
241 char *tmpnam_buffer
; /* buffer for tmpname() */
242 MSVCRT_wchar_t
*wtmpnam_buffer
; /* buffer for wtmpname() */
244 char *asctime_buffer
; /* buffer for asctime */
245 MSVCRT_wchar_t
*wasctime_buffer
; /* buffer for wasctime */
246 struct MSVCRT_tm
*time_buffer
; /* buffer for localtime/gmtime */
247 char *efcvt_buffer
; /* buffer for ecvt/fcvt */
250 EXCEPTION_POINTERS
*xcptinfo
;
252 MSVCRT_pthreadmbcinfo mbcinfo
;
253 MSVCRT_pthreadlocinfo locinfo
;
256 MSVCRT_terminate_function terminate_handler
;
257 MSVCRT_unexpected_function unexpected_handler
;
258 MSVCRT__se_translator_function se_translator
;
261 EXCEPTION_RECORD
*exc_record
;
263 int processing_throw
;
264 frame_info
*frame_info_head
;
270 char cached_locale
[131];
272 #if _MSVCR_VER >= 140
273 MSVCRT_invalid_parameter_handler invalid_parameter_handler
;
277 typedef struct __thread_data thread_data_t
;
279 extern thread_data_t
*msvcrt_get_thread_data(void) DECLSPEC_HIDDEN
;
281 LCID
MSVCRT_locale_to_LCID(const char*, unsigned short*, BOOL
*) DECLSPEC_HIDDEN
;
282 extern MSVCRT__locale_t MSVCRT_locale DECLSPEC_HIDDEN
;
283 extern unsigned int MSVCRT___lc_codepage
;
284 extern int MSVCRT___lc_collate_cp
;
285 extern WORD MSVCRT__ctype
[257];
287 void msvcrt_set_errno(int) DECLSPEC_HIDDEN
;
291 #if _MSVCR_VER >= 100
292 EXCEPTION_SCHEDULER_RESOURCE_ALLOCATION_ERROR
,
293 EXCEPTION_IMPROPER_LOCK
,
294 EXCEPTION_INVALID_SCHEDULER_POLICY_KEY
,
295 EXCEPTION_INVALID_SCHEDULER_POLICY_VALUE
,
296 EXCEPTION_INVALID_SCHEDULER_POLICY_THREAD_SPECIFICATION
,
297 EXCEPTION_IMPROPER_SCHEDULER_ATTACH
,
298 EXCEPTION_IMPROPER_SCHEDULER_DETACH
,
301 void throw_exception(exception_type
, HRESULT
, const char*) DECLSPEC_HIDDEN
;
304 void __cdecl
_purecall(void);
305 void __cdecl
_amsg_exit(int errnum
);
307 extern char **MSVCRT__environ
;
308 extern MSVCRT_wchar_t
**MSVCRT__wenviron
;
310 extern char ** msvcrt_SnapshotOfEnvironmentA(char **) DECLSPEC_HIDDEN
;
311 extern MSVCRT_wchar_t
** msvcrt_SnapshotOfEnvironmentW(MSVCRT_wchar_t
**) DECLSPEC_HIDDEN
;
313 MSVCRT_wchar_t
*msvcrt_wstrdupa(const char *) DECLSPEC_HIDDEN
;
315 extern unsigned int MSVCRT__commode
;
317 /* FIXME: This should be declared in new.h but it's not an extern "C" so
318 * it would not be much use anyway. Even for Winelib applications.
320 int __cdecl
MSVCRT__set_new_mode(int mode
);
322 void* __cdecl
MSVCRT_operator_new(MSVCRT_size_t
);
323 void __cdecl
MSVCRT_operator_delete(void*);
325 typedef void* (__cdecl
*malloc_func_t
)(MSVCRT_size_t
);
326 typedef void (__cdecl
*free_func_t
)(void*);
328 /* Setup and teardown multi threaded locks */
329 extern void msvcrt_init_mt_locks(void) DECLSPEC_HIDDEN
;
330 extern void msvcrt_free_locks(void) DECLSPEC_HIDDEN
;
332 extern void msvcrt_init_exception(void*) DECLSPEC_HIDDEN
;
333 extern BOOL
msvcrt_init_locale(void) DECLSPEC_HIDDEN
;
334 extern void msvcrt_init_math(void) DECLSPEC_HIDDEN
;
335 extern void msvcrt_init_io(void) DECLSPEC_HIDDEN
;
336 extern void msvcrt_free_io(void) DECLSPEC_HIDDEN
;
337 extern void msvcrt_init_console(void) DECLSPEC_HIDDEN
;
338 extern void msvcrt_free_console(void) DECLSPEC_HIDDEN
;
339 extern void msvcrt_init_args(void) DECLSPEC_HIDDEN
;
340 extern void msvcrt_free_args(void) DECLSPEC_HIDDEN
;
341 extern void msvcrt_init_signals(void) DECLSPEC_HIDDEN
;
342 extern void msvcrt_free_signals(void) DECLSPEC_HIDDEN
;
343 extern void msvcrt_free_popen_data(void) DECLSPEC_HIDDEN
;
344 extern BOOL
msvcrt_init_heap(void) DECLSPEC_HIDDEN
;
345 extern void msvcrt_destroy_heap(void) DECLSPEC_HIDDEN
;
347 #if _MSVCR_VER >= 100
348 extern void msvcrt_init_scheduler(void*) DECLSPEC_HIDDEN
;
349 extern void msvcrt_free_scheduler(void) DECLSPEC_HIDDEN
;
350 extern void msvcrt_free_scheduler_thread(void) DECLSPEC_HIDDEN
;
353 extern unsigned msvcrt_create_io_inherit_block(WORD
*, BYTE
**) DECLSPEC_HIDDEN
;
355 extern unsigned int __cdecl
_control87(unsigned int, unsigned int);
357 /* run-time error codes */
359 #define _RT_NULLPTR 1
362 #define _RT_EXECMEM 5
363 #define _RT_EXECFORM 6
364 #define _RT_EXECENV 7
365 #define _RT_SPACEARG 8
366 #define _RT_SPACEENV 9
372 #define _RT_THREAD 16
375 #define _RT_OPENCON 19
377 #define _RT_NOMAIN 21
378 #define _RT_NONCONT 22
379 #define _RT_INVALDISP 23
380 #define _RT_ONEXIT 24
381 #define _RT_PUREVIRT 25
382 #define _RT_STDIOINIT 26
383 #define _RT_LOWIOINIT 27
384 #define _RT_HEAPINIT 28
385 #define _RT_DOMAIN 120
387 #define _RT_TLOSS 122
389 #define _RT_BANNER 255
391 struct MSVCRT___timeb32
{
392 MSVCRT___time32_t time
;
393 unsigned short millitm
;
398 struct MSVCRT___timeb64
{
399 MSVCRT___time64_t time
;
400 unsigned short millitm
;
405 struct MSVCRT__iobuf
{
416 typedef struct MSVCRT__iobuf MSVCRT_FILE
;
418 struct MSVCRT_lconv
{
422 char* int_curr_symbol
;
423 char* currency_symbol
;
424 char* mon_decimal_point
;
425 char* mon_thousands_sep
;
429 char int_frac_digits
;
437 #if _MSVCR_VER >= 100
438 MSVCRT_wchar_t
* _W_decimal_point
;
439 MSVCRT_wchar_t
* _W_thousands_sep
;
440 MSVCRT_wchar_t
* _W_int_curr_symbol
;
441 MSVCRT_wchar_t
* _W_currency_symbol
;
442 MSVCRT_wchar_t
* _W_mon_decimal_point
;
443 MSVCRT_wchar_t
* _W_mon_thousands_sep
;
444 MSVCRT_wchar_t
* _W_positive_sign
;
445 MSVCRT_wchar_t
* _W_negative_sign
;
449 struct MSVCRT__exception
{
457 struct MSVCRT__complex
{
458 double x
; /* Real part */
459 double y
; /* Imaginary part */
461 typedef struct MSVCRT__complex _Dcomplex
;
463 typedef struct MSVCRT__div_t
{
464 int quot
; /* quotient */
465 int rem
; /* remainder */
468 typedef struct MSVCRT__ldiv_t
{
469 MSVCRT_long quot
; /* quotient */
470 MSVCRT_long rem
; /* remainder */
473 typedef struct MSVCRT__lldiv_t
{
474 MSVCRT_longlong quot
; /* quotient */
475 MSVCRT_longlong rem
; /* remainder */
478 struct MSVCRT__heapinfo
{
485 struct MSVCRT___JUMP_BUFFER
{
492 unsigned long Registration
;
493 unsigned long TryLevel
;
494 /* Start of new struct members */
495 unsigned long Cookie
;
496 unsigned long UnwindFunc
;
497 unsigned long UnwindData
[6];
499 #elif defined(__x86_64__)
500 struct MSVCRT__SETJMP_FLOAT128
502 unsigned __int64
DECLSPEC_ALIGN(16) Part
[2];
504 struct MSVCRT___JUMP_BUFFER
506 unsigned __int64 Frame
;
507 unsigned __int64 Rbx
;
508 unsigned __int64 Rsp
;
509 unsigned __int64 Rbp
;
510 unsigned __int64 Rsi
;
511 unsigned __int64 Rdi
;
512 unsigned __int64 R12
;
513 unsigned __int64 R13
;
514 unsigned __int64 R14
;
515 unsigned __int64 R15
;
516 unsigned __int64 Rip
;
517 unsigned __int64 Spare
;
518 struct MSVCRT__SETJMP_FLOAT128 Xmm6
;
519 struct MSVCRT__SETJMP_FLOAT128 Xmm7
;
520 struct MSVCRT__SETJMP_FLOAT128 Xmm8
;
521 struct MSVCRT__SETJMP_FLOAT128 Xmm9
;
522 struct MSVCRT__SETJMP_FLOAT128 Xmm10
;
523 struct MSVCRT__SETJMP_FLOAT128 Xmm11
;
524 struct MSVCRT__SETJMP_FLOAT128 Xmm12
;
525 struct MSVCRT__SETJMP_FLOAT128 Xmm13
;
526 struct MSVCRT__SETJMP_FLOAT128 Xmm14
;
527 struct MSVCRT__SETJMP_FLOAT128 Xmm15
;
529 #elif defined(__arm__)
530 struct MSVCRT___JUMP_BUFFER
544 unsigned long long D
[8];
546 #elif defined(__aarch64__)
547 struct MSVCRT___JUMP_BUFFER
549 unsigned __int64 Frame
;
550 unsigned __int64 Reserved
;
551 unsigned __int64 X19
;
552 unsigned __int64 X20
;
553 unsigned __int64 X21
;
554 unsigned __int64 X22
;
555 unsigned __int64 X23
;
556 unsigned __int64 X24
;
557 unsigned __int64 X25
;
558 unsigned __int64 X26
;
559 unsigned __int64 X27
;
560 unsigned __int64 X28
;
568 #endif /* __i386__ */
570 struct MSVCRT__diskfree_t
{
571 unsigned int total_clusters
;
572 unsigned int avail_clusters
;
573 unsigned int sectors_per_cluster
;
574 unsigned int bytes_per_sector
;
577 struct MSVCRT__finddata32_t
{
579 MSVCRT___time32_t time_create
;
580 MSVCRT___time32_t time_access
;
581 MSVCRT___time32_t time_write
;
582 MSVCRT__fsize_t size
;
586 struct MSVCRT__finddata32i64_t
{
588 MSVCRT___time32_t time_create
;
589 MSVCRT___time32_t time_access
;
590 MSVCRT___time32_t time_write
;
591 __int64
DECLSPEC_ALIGN(8) size
;
595 struct MSVCRT__finddata64i32_t
{
597 MSVCRT___time64_t time_create
;
598 MSVCRT___time64_t time_access
;
599 MSVCRT___time64_t time_write
;
600 MSVCRT__fsize_t size
;
604 struct MSVCRT__finddata64_t
{
606 MSVCRT___time64_t time_create
;
607 MSVCRT___time64_t time_access
;
608 MSVCRT___time64_t time_write
;
609 __int64
DECLSPEC_ALIGN(8) size
;
613 struct MSVCRT__wfinddata32_t
{
615 MSVCRT___time32_t time_create
;
616 MSVCRT___time32_t time_access
;
617 MSVCRT___time32_t time_write
;
618 MSVCRT__fsize_t size
;
619 MSVCRT_wchar_t name
[260];
622 struct MSVCRT__wfinddata32i64_t
{
624 MSVCRT___time32_t time_create
;
625 MSVCRT___time32_t time_access
;
626 MSVCRT___time32_t time_write
;
627 __int64
DECLSPEC_ALIGN(8) size
;
628 MSVCRT_wchar_t name
[260];
631 struct MSVCRT__wfinddata64i32_t
{
633 MSVCRT___time64_t time_create
;
634 MSVCRT___time64_t time_access
;
635 MSVCRT___time64_t time_write
;
636 MSVCRT__fsize_t size
;
637 MSVCRT_wchar_t name
[260];
640 struct MSVCRT__wfinddata64_t
{
642 MSVCRT___time64_t time_create
;
643 MSVCRT___time64_t time_access
;
644 MSVCRT___time64_t time_write
;
645 __int64
DECLSPEC_ALIGN(8) size
;
646 MSVCRT_wchar_t name
[260];
649 struct MSVCRT___utimbuf32
651 MSVCRT___time32_t actime
;
652 MSVCRT___time32_t modtime
;
655 struct MSVCRT___utimbuf64
657 MSVCRT___time64_t actime
;
658 MSVCRT___time64_t modtime
;
666 struct MSVCRT__stat32
{
667 MSVCRT__dev_t st_dev
;
668 MSVCRT__ino_t st_ino
;
669 unsigned short st_mode
;
673 MSVCRT__dev_t st_rdev
;
674 MSVCRT__off_t st_size
;
675 MSVCRT___time32_t st_atime
;
676 MSVCRT___time32_t st_mtime
;
677 MSVCRT___time32_t st_ctime
;
680 struct MSVCRT__stat32i64
{
681 MSVCRT__dev_t st_dev
;
682 MSVCRT__ino_t st_ino
;
683 unsigned short st_mode
;
687 MSVCRT__dev_t st_rdev
;
688 __int64
DECLSPEC_ALIGN(8) st_size
;
689 MSVCRT___time32_t st_atime
;
690 MSVCRT___time32_t st_mtime
;
691 MSVCRT___time32_t st_ctime
;
694 struct MSVCRT__stat64i32
{
695 MSVCRT__dev_t st_dev
;
696 MSVCRT__ino_t st_ino
;
697 unsigned short st_mode
;
701 MSVCRT__dev_t st_rdev
;
702 MSVCRT__off_t st_size
;
703 MSVCRT___time64_t st_atime
;
704 MSVCRT___time64_t st_mtime
;
705 MSVCRT___time64_t st_ctime
;
708 struct MSVCRT__stat64
{
709 MSVCRT__dev_t st_dev
;
710 MSVCRT__ino_t st_ino
;
711 unsigned short st_mode
;
715 MSVCRT__dev_t st_rdev
;
716 __int64
DECLSPEC_ALIGN(8) st_size
;
717 MSVCRT___time64_t st_atime
;
718 MSVCRT___time64_t st_mtime
;
719 MSVCRT___time64_t st_ctime
;
723 #define MSVCRT__finddata_t MSVCRT__finddata64i32_t
724 #define MSVCRT__finddatai64_t MSVCRT__finddata64_t
725 #define MSVCRT__wfinddata_t MSVCRT__wfinddata64i32_t
726 #define MSVCRT__wfinddatai64_t MSVCRT__wfinddata64_t
727 #define MSVCRT__stat MSVCRT__stat64i32
728 #define MSVCRT__stati64 MSVCRT__stat64
730 #define MSVCRT__finddata_t MSVCRT__finddata32_t
731 #define MSVCRT__finddatai64_t MSVCRT__finddata32i64_t
732 #define MSVCRT__wfinddata_t MSVCRT__wfinddata32_t
733 #define MSVCRT__wfinddatai64_t MSVCRT__wfinddata32i64_t
734 #define MSVCRT__stat MSVCRT__stat32
735 #define MSVCRT__stati64 MSVCRT__stat32i64
738 #define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF)
739 #define MSVCRT_EOF (-1)
740 #define MSVCRT_TMP_MAX 0x7fff
741 #define MSVCRT_TMP_MAX_S 0x7fffffff
742 #define MSVCRT_RAND_MAX 0x7fff
743 #define MSVCRT_BUFSIZ 512
745 #define MSVCRT_SEEK_SET 0
746 #define MSVCRT_SEEK_CUR 1
747 #define MSVCRT_SEEK_END 2
749 #define MSVCRT_NO_CONSOLE_FD (-2)
750 #define MSVCRT_NO_CONSOLE ((HANDLE)MSVCRT_NO_CONSOLE_FD)
752 #define MSVCRT_STDIN_FILENO 0
753 #define MSVCRT_STDOUT_FILENO 1
754 #define MSVCRT_STDERR_FILENO 2
756 /* more file._flag flags, but these conflict with Unix */
757 #define MSVCRT__IOFBF 0x0000
758 #define MSVCRT__IONBF 0x0004
759 #define MSVCRT__IOLBF 0x0040
761 #define MSVCRT_FILENAME_MAX 260
762 #define MSVCRT_DRIVE_MAX 3
763 #define MSVCRT_FNAME_MAX 256
764 #define MSVCRT_DIR_MAX 256
765 #define MSVCRT_EXT_MAX 256
766 #define MSVCRT_PATH_MAX 260
767 #define MSVCRT_stdin (MSVCRT__iob+MSVCRT_STDIN_FILENO)
768 #define MSVCRT_stdout (MSVCRT__iob+MSVCRT_STDOUT_FILENO)
769 #define MSVCRT_stderr (MSVCRT__iob+MSVCRT_STDERR_FILENO)
771 #define MSVCRT__P_WAIT 0
772 #define MSVCRT__P_NOWAIT 1
773 #define MSVCRT__P_OVERLAY 2
774 #define MSVCRT__P_NOWAITO 3
775 #define MSVCRT__P_DETACH 4
777 #define MSVCRT_EPERM 1
778 #define MSVCRT_ENOENT 2
779 #define MSVCRT_ESRCH 3
780 #define MSVCRT_EINTR 4
782 #define MSVCRT_ENXIO 6
783 #define MSVCRT_E2BIG 7
784 #define MSVCRT_ENOEXEC 8
785 #define MSVCRT_EBADF 9
786 #define MSVCRT_ECHILD 10
787 #define MSVCRT_EAGAIN 11
788 #define MSVCRT_ENOMEM 12
789 #define MSVCRT_EACCES 13
790 #define MSVCRT_EFAULT 14
791 #define MSVCRT_EBUSY 16
792 #define MSVCRT_EEXIST 17
793 #define MSVCRT_EXDEV 18
794 #define MSVCRT_ENODEV 19
795 #define MSVCRT_ENOTDIR 20
796 #define MSVCRT_EISDIR 21
797 #define MSVCRT_EINVAL 22
798 #define MSVCRT_ENFILE 23
799 #define MSVCRT_EMFILE 24
800 #define MSVCRT_ENOTTY 25
801 #define MSVCRT_EFBIG 27
802 #define MSVCRT_ENOSPC 28
803 #define MSVCRT_ESPIPE 29
804 #define MSVCRT_EROFS 30
805 #define MSVCRT_EMLINK 31
806 #define MSVCRT_EPIPE 32
807 #define MSVCRT_EDOM 33
808 #define MSVCRT_ERANGE 34
809 #define MSVCRT_EDEADLK 36
810 #define MSVCRT_EDEADLOCK MSVCRT_EDEADLK
811 #define MSVCRT_ENAMETOOLONG 38
812 #define MSVCRT_ENOLCK 39
813 #define MSVCRT_ENOSYS 40
814 #define MSVCRT_ENOTEMPTY 41
815 #define MSVCRT_EILSEQ 42
816 #define MSVCRT_STRUNCATE 80
818 #define MSVCRT_LC_ALL 0
819 #define MSVCRT_LC_COLLATE 1
820 #define MSVCRT_LC_CTYPE 2
821 #define MSVCRT_LC_MONETARY 3
822 #define MSVCRT_LC_NUMERIC 4
823 #define MSVCRT_LC_TIME 5
824 #define MSVCRT_LC_MIN MSVCRT_LC_ALL
825 #define MSVCRT_LC_MAX MSVCRT_LC_TIME
827 #define MSVCRT__HEAPEMPTY -1
828 #define MSVCRT__HEAPOK -2
829 #define MSVCRT__HEAPBADBEGIN -3
830 #define MSVCRT__HEAPBADNODE -4
831 #define MSVCRT__HEAPEND -5
832 #define MSVCRT__HEAPBADPTR -6
834 #define MSVCRT__FREEENTRY 0
835 #define MSVCRT__USEDENTRY 1
837 #define MSVCRT__OUT_TO_DEFAULT 0
838 #define MSVCRT__OUT_TO_STDERR 1
839 #define MSVCRT__OUT_TO_MSGBOX 2
840 #define MSVCRT__REPORT_ERRMODE 3
842 /* ASCII char classification table - binary compatible */
843 #define MSVCRT__UPPER 0x0001 /* C1_UPPER */
844 #define MSVCRT__LOWER 0x0002 /* C1_LOWER */
845 #define MSVCRT__DIGIT 0x0004 /* C1_DIGIT */
846 #define MSVCRT__SPACE 0x0008 /* C1_SPACE */
847 #define MSVCRT__PUNCT 0x0010 /* C1_PUNCT */
848 #define MSVCRT__CONTROL 0x0020 /* C1_CNTRL */
849 #define MSVCRT__BLANK 0x0040 /* C1_BLANK */
850 #define MSVCRT__HEX 0x0080 /* C1_XDIGIT */
851 #define MSVCRT__LEADBYTE 0x8000
852 #define MSVCRT__ALPHA (0x0100|MSVCRT__UPPER|MSVCRT__LOWER) /* (C1_ALPHA|_UPPER|_LOWER) */
854 #define MSVCRT__IOREAD 0x0001
855 #define MSVCRT__IOWRT 0x0002
856 #define MSVCRT__IOMYBUF 0x0008
857 #define MSVCRT__IOEOF 0x0010
858 #define MSVCRT__IOERR 0x0020
859 #define MSVCRT__IOSTRG 0x0040
860 #define MSVCRT__IORW 0x0080
861 #define MSVCRT__USERBUF 0x0100
862 #define MSVCRT__IOCOMMIT 0x4000
864 #define MSVCRT__S_IEXEC 0x0040
865 #define MSVCRT__S_IWRITE 0x0080
866 #define MSVCRT__S_IREAD 0x0100
867 #define MSVCRT__S_IFIFO 0x1000
868 #define MSVCRT__S_IFCHR 0x2000
869 #define MSVCRT__S_IFDIR 0x4000
870 #define MSVCRT__S_IFREG 0x8000
871 #define MSVCRT__S_IFMT 0xF000
873 #define MSVCRT__LK_UNLCK 0
874 #define MSVCRT__LK_LOCK 1
875 #define MSVCRT__LK_NBLCK 2
876 #define MSVCRT__LK_RLCK 3
877 #define MSVCRT__LK_NBRLCK 4
879 #define MSVCRT__SH_COMPAT 0x00 /* Compatibility */
880 #define MSVCRT__SH_DENYRW 0x10 /* Deny read/write */
881 #define MSVCRT__SH_DENYWR 0x20 /* Deny write */
882 #define MSVCRT__SH_DENYRD 0x30 /* Deny read */
883 #define MSVCRT__SH_DENYNO 0x40 /* Deny nothing */
885 #define MSVCRT__O_RDONLY 0
886 #define MSVCRT__O_WRONLY 1
887 #define MSVCRT__O_RDWR 2
888 #define MSVCRT__O_ACCMODE (MSVCRT__O_RDONLY|MSVCRT__O_WRONLY|MSVCRT__O_RDWR)
889 #define MSVCRT__O_APPEND 0x0008
890 #define MSVCRT__O_RANDOM 0x0010
891 #define MSVCRT__O_SEQUENTIAL 0x0020
892 #define MSVCRT__O_TEMPORARY 0x0040
893 #define MSVCRT__O_NOINHERIT 0x0080
894 #define MSVCRT__O_CREAT 0x0100
895 #define MSVCRT__O_TRUNC 0x0200
896 #define MSVCRT__O_EXCL 0x0400
897 #define MSVCRT__O_SHORT_LIVED 0x1000
898 #define MSVCRT__O_TEXT 0x4000
899 #define MSVCRT__O_BINARY 0x8000
900 #define MSVCRT__O_RAW MSVCRT__O_BINARY
901 #define MSVCRT__O_WTEXT 0x10000
902 #define MSVCRT__O_U16TEXT 0x20000
903 #define MSVCRT__O_U8TEXT 0x40000
905 /* _statusfp bit flags */
906 #define MSVCRT__SW_INEXACT 0x00000001 /* inexact (precision) */
907 #define MSVCRT__SW_UNDERFLOW 0x00000002 /* underflow */
908 #define MSVCRT__SW_OVERFLOW 0x00000004 /* overflow */
909 #define MSVCRT__SW_ZERODIVIDE 0x00000008 /* zero divide */
910 #define MSVCRT__SW_INVALID 0x00000010 /* invalid */
912 #define MSVCRT__SW_UNEMULATED 0x00000040 /* unemulated instruction */
913 #define MSVCRT__SW_SQRTNEG 0x00000080 /* square root of a neg number */
914 #define MSVCRT__SW_STACKOVERFLOW 0x00000200 /* FP stack overflow */
915 #define MSVCRT__SW_STACKUNDERFLOW 0x00000400 /* FP stack underflow */
917 #define MSVCRT__SW_DENORMAL 0x00080000 /* denormal status bit */
919 /* fpclass constants */
920 #define MSVCRT__FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */
921 #define MSVCRT__FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */
922 #define MSVCRT__FPCLASS_NINF 0x0004 /* Negative Infinity */
923 #define MSVCRT__FPCLASS_NN 0x0008 /* Negative Normal */
924 #define MSVCRT__FPCLASS_ND 0x0010 /* Negative Denormal */
925 #define MSVCRT__FPCLASS_NZ 0x0020 /* Negative Zero */
926 #define MSVCRT__FPCLASS_PZ 0x0040 /* Positive Zero */
927 #define MSVCRT__FPCLASS_PD 0x0080 /* Positive Denormal */
928 #define MSVCRT__FPCLASS_PN 0x0100 /* Positive Normal */
929 #define MSVCRT__FPCLASS_PINF 0x0200 /* Positive Infinity */
931 /* fpclassify constants */
932 #define MSVCRT_FP_INFINITE 1
933 #define MSVCRT_FP_NAN 2
934 #define MSVCRT_FP_NORMAL -1
935 #define MSVCRT_FP_SUBNORMAL -2
936 #define MSVCRT_FP_ZERO 0
938 #define MSVCRT__MCW_EM 0x0008001f
939 #define MSVCRT__MCW_IC 0x00040000
940 #define MSVCRT__MCW_RC 0x00000300
941 #define MSVCRT__MCW_PC 0x00030000
942 #define MSVCRT__MCW_DN 0x03000000
944 #define MSVCRT__EM_INVALID 0x00000010
945 #define MSVCRT__EM_DENORMAL 0x00080000
946 #define MSVCRT__EM_ZERODIVIDE 0x00000008
947 #define MSVCRT__EM_OVERFLOW 0x00000004
948 #define MSVCRT__EM_UNDERFLOW 0x00000002
949 #define MSVCRT__EM_INEXACT 0x00000001
950 #define MSVCRT__IC_AFFINE 0x00040000
951 #define MSVCRT__IC_PROJECTIVE 0x00000000
952 #define MSVCRT__RC_CHOP 0x00000300
953 #define MSVCRT__RC_UP 0x00000200
954 #define MSVCRT__RC_DOWN 0x00000100
955 #define MSVCRT__RC_NEAR 0x00000000
956 #define MSVCRT__PC_24 0x00020000
957 #define MSVCRT__PC_53 0x00010000
958 #define MSVCRT__PC_64 0x00000000
959 #define MSVCRT__DN_SAVE 0x00000000
960 #define MSVCRT__DN_FLUSH 0x01000000
961 #define MSVCRT__DN_FLUSH_OPERANDS_SAVE_RESULTS 0x02000000
962 #define MSVCRT__DN_SAVE_OPERANDS_FLUSH_RESULTS 0x03000000
963 #define MSVCRT__EM_AMBIGUOUS 0x80000000
967 unsigned int control
;
971 #define MSVCRT_CLOCKS_PER_SEC 1000
974 #define MSVCRT_SIGINT 2
975 #define MSVCRT_SIGILL 4
976 #define MSVCRT_SIGFPE 8
977 #define MSVCRT_SIGSEGV 11
978 #define MSVCRT_SIGTERM 15
979 #define MSVCRT_SIGBREAK 21
980 #define MSVCRT_SIGABRT 22
981 #define MSVCRT_NSIG (MSVCRT_SIGABRT + 1)
983 typedef void (__cdecl
*MSVCRT___sighandler_t
)(int);
985 #define MSVCRT_SIG_DFL ((MSVCRT___sighandler_t)0)
986 #define MSVCRT_SIG_IGN ((MSVCRT___sighandler_t)1)
987 #define MSVCRT_SIG_ERR ((MSVCRT___sighandler_t)-1)
989 #define MSVCRT__FPE_INVALID 0x81
990 #define MSVCRT__FPE_DENORMAL 0x82
991 #define MSVCRT__FPE_ZERODIVIDE 0x83
992 #define MSVCRT__FPE_OVERFLOW 0x84
993 #define MSVCRT__FPE_UNDERFLOW 0x85
994 #define MSVCRT__FPE_INEXACT 0x86
995 #define MSVCRT__FPE_UNEMULATED 0x87
996 #define MSVCRT__FPE_SQRTNEG 0x88
997 #define MSVCRT__FPE_STACKOVERFLOW 0x8a
998 #define MSVCRT__FPE_STACKUNDERFLOW 0x8b
999 #define MSVCRT__FPE_EXPLICITGEN 0x8c
1009 #define _MBC_SINGLE 0
1011 #define _MBC_TRAIL 2
1012 #define _MBC_ILLEGAL -1
1014 #define _MB_CP_SBCS 0
1015 #define _MB_CP_OEM -2
1016 #define _MB_CP_ANSI -3
1017 #define _MB_CP_LOCALE -4
1019 #define MSVCRT__TRUNCATE ((MSVCRT_size_t)-1)
1021 #define _MAX__TIME64_T (((MSVCRT___time64_t)0x00000007 << 32) | 0x93406FFF)
1023 /* _set_abort_behavior codes */
1024 #define MSVCRT__WRITE_ABORT_MSG 1
1025 #define MSVCRT__CALL_REPORTFAULT 2
1027 /* _get_output_format return code */
1028 #define MSVCRT__TWO_DIGIT_EXPONENT 0x1
1030 #define MSVCRT__NLSCMPERROR ((unsigned int)0x7fffffff)
1032 void __cdecl
MSVCRT_free(void*);
1033 void* __cdecl
MSVCRT_malloc(MSVCRT_size_t
);
1034 void* __cdecl
MSVCRT_calloc(MSVCRT_size_t
,MSVCRT_size_t
);
1035 void* __cdecl
MSVCRT_realloc(void*,MSVCRT_size_t
);
1037 int __cdecl
MSVCRT_iswalpha(MSVCRT_wint_t
);
1038 int __cdecl
MSVCRT_iswspace(MSVCRT_wint_t
);
1039 int __cdecl
MSVCRT_iswdigit(MSVCRT_wint_t
);
1040 int __cdecl
MSVCRT_isleadbyte(int);
1041 int __cdecl
MSVCRT__isleadbyte_l(int, MSVCRT__locale_t
);
1043 void __cdecl
MSVCRT__lock_file(MSVCRT_FILE
*);
1044 void __cdecl
MSVCRT__unlock_file(MSVCRT_FILE
*);
1045 int __cdecl
MSVCRT_fgetc(MSVCRT_FILE
*);
1046 int __cdecl
MSVCRT__fgetc_nolock(MSVCRT_FILE
*);
1047 int __cdecl
MSVCRT__fputc_nolock(int,MSVCRT_FILE
*);
1048 int __cdecl
MSVCRT_ungetc(int,MSVCRT_FILE
*);
1049 int __cdecl
MSVCRT__ungetc_nolock(int,MSVCRT_FILE
*);
1050 MSVCRT_wint_t __cdecl
MSVCRT_fgetwc(MSVCRT_FILE
*);
1051 MSVCRT_wint_t __cdecl
MSVCRT__fgetwc_nolock(MSVCRT_FILE
*);
1052 MSVCRT_wint_t __cdecl
MSVCRT__fputwc_nolock(MSVCRT_wint_t
,MSVCRT_FILE
*);
1053 MSVCRT_wint_t __cdecl
MSVCRT_ungetwc(MSVCRT_wint_t
,MSVCRT_FILE
*);
1054 MSVCRT_wint_t __cdecl
MSVCRT__ungetwc_nolock(MSVCRT_wint_t
, MSVCRT_FILE
*);
1055 int __cdecl
MSVCRT__fseeki64_nolock(MSVCRT_FILE
*,__int64
,int);
1056 __int64 __cdecl
MSVCRT__ftelli64(MSVCRT_FILE
* file
);
1057 __int64 __cdecl
MSVCRT__ftelli64_nolock(MSVCRT_FILE
*);
1058 void __cdecl
MSVCRT__exit(int);
1059 void __cdecl
MSVCRT_abort(void);
1060 MSVCRT_ulong
* __cdecl
MSVCRT___doserrno(void);
1061 int* __cdecl
MSVCRT__errno(void);
1062 char* __cdecl
MSVCRT_getenv(const char*);
1063 MSVCRT_size_t __cdecl
MSVCRT__fread_nolock(void*,MSVCRT_size_t
,MSVCRT_size_t
,MSVCRT_FILE
*);
1064 MSVCRT_size_t __cdecl
MSVCRT__fread_nolock_s(void*,MSVCRT_size_t
,MSVCRT_size_t
,MSVCRT_size_t
,MSVCRT_FILE
*);
1065 MSVCRT_size_t __cdecl
MSVCRT__fwrite_nolock(const void*,MSVCRT_size_t
,MSVCRT_size_t
,MSVCRT_FILE
*);
1066 int __cdecl
MSVCRT_fclose(MSVCRT_FILE
*);
1067 int __cdecl
MSVCRT__fclose_nolock(MSVCRT_FILE
*);
1068 int __cdecl
MSVCRT__fflush_nolock(MSVCRT_FILE
*);
1069 void __cdecl
MSVCRT_terminate(void);
1070 MSVCRT_FILE
* __cdecl
MSVCRT__iob_func(void);
1071 MSVCRT_clock_t __cdecl
MSVCRT_clock(void);
1072 MSVCRT___time32_t __cdecl
MSVCRT__time32(MSVCRT___time32_t
*);
1073 MSVCRT___time64_t __cdecl
MSVCRT__time64(MSVCRT___time64_t
*);
1074 MSVCRT_FILE
* __cdecl
MSVCRT__fdopen(int, const char *);
1075 MSVCRT_FILE
* __cdecl
MSVCRT__wfdopen(int, const MSVCRT_wchar_t
*);
1076 int __cdecl
MSVCRT_vsnprintf(char *str
, MSVCRT_size_t len
, const char *format
, __ms_va_list valist
);
1077 int __cdecl
MSVCRT_vsnwprintf(MSVCRT_wchar_t
*str
, MSVCRT_size_t len
,
1078 const MSVCRT_wchar_t
*format
, __ms_va_list valist
);
1079 int WINAPIV
MSVCRT__snwprintf(MSVCRT_wchar_t
*, unsigned int, const MSVCRT_wchar_t
*, ...);
1080 int WINAPIV
MSVCRT_sprintf(char*,const char*,...);
1081 int WINAPIV
MSVCRT__snprintf(char*,unsigned int,const char*,...);
1082 int WINAPIV
MSVCRT__scprintf(const char*,...);
1083 int __cdecl
MSVCRT_raise(int sig
);
1084 int __cdecl
MSVCRT__set_printf_count_output(int);
1086 #define MSVCRT__ENABLE_PER_THREAD_LOCALE 1
1087 #define MSVCRT__DISABLE_PER_THREAD_LOCALE 2
1089 extern MSVCRT__locale_t MSVCRT_locale
;
1090 MSVCRT_pthreadlocinfo
get_locinfo(void) DECLSPEC_HIDDEN
;
1091 MSVCRT_pthreadmbcinfo
get_mbcinfo(void) DECLSPEC_HIDDEN
;
1092 void __cdecl
MSVCRT__free_locale(MSVCRT__locale_t
);
1093 void free_locinfo(MSVCRT_pthreadlocinfo
) DECLSPEC_HIDDEN
;
1094 void free_mbcinfo(MSVCRT_pthreadmbcinfo
) DECLSPEC_HIDDEN
;
1095 int _setmbcp_l(int, LCID
, MSVCRT_pthreadmbcinfo
) DECLSPEC_HIDDEN
;
1097 #ifndef __WINE_MSVCRT_TEST
1098 int __cdecl
MSVCRT__write(int,const void*,unsigned int);
1099 int __cdecl
_getch(void);
1100 int __cdecl
_ismbblead(unsigned int);
1101 int __cdecl
_ismbblead_l(unsigned int, MSVCRT__locale_t
);
1102 int __cdecl
_ismbclegal(unsigned int c
);
1103 int __cdecl
_ismbstrail(const unsigned char* start
, const unsigned char* str
);
1104 int __cdecl
MSVCRT_mbtowc(MSVCRT_wchar_t
*,const char*,MSVCRT_size_t
);
1105 MSVCRT_size_t __cdecl
MSVCRT_mbstowcs(MSVCRT_wchar_t
*,const char*,MSVCRT_size_t
);
1106 MSVCRT_size_t __cdecl
MSVCRT__mbstowcs_l(MSVCRT_wchar_t
*, const char*, MSVCRT_size_t
, MSVCRT__locale_t
);
1107 MSVCRT_size_t __cdecl
MSVCRT_wcstombs(char*,const MSVCRT_wchar_t
*,MSVCRT_size_t
);
1108 MSVCRT_size_t __cdecl
MSVCRT__wcstombs_l(char*, const MSVCRT_wchar_t
*, MSVCRT_size_t
, MSVCRT__locale_t
);
1109 MSVCRT_intptr_t __cdecl
MSVCRT__spawnve(int,const char*,const char* const *,const char* const *);
1110 MSVCRT_intptr_t __cdecl
MSVRT__spawnvpe(int,const char*,const char* const *,const char* const *);
1111 MSVCRT_intptr_t __cdecl
MSVCRT__wspawnve(int,const MSVCRT_wchar_t
*,const MSVCRT_wchar_t
* const *,const MSVCRT_wchar_t
* const *);
1112 MSVCRT_intptr_t __cdecl
MSVCRT__wspawnvpe(int,const MSVCRT_wchar_t
*,const MSVCRT_wchar_t
* const *,const MSVCRT_wchar_t
* const *);
1113 void __cdecl
MSVCRT__searchenv(const char*,const char*,char*);
1114 int __cdecl
MSVCRT__getdrive(void);
1115 char* __cdecl
MSVCRT__strdup(const char*);
1116 char* __cdecl
MSVCRT__strnset(char*,int,MSVCRT_size_t
);
1117 char* __cdecl
_strset(char*,int);
1118 int __cdecl
_ungetch(int);
1119 int __cdecl
_cputs(const char*);
1120 int WINAPIV
_cprintf(const char*,...);
1121 int WINAPIV
_cwprintf(const MSVCRT_wchar_t
*,...);
1122 char*** __cdecl
MSVCRT___p__environ(void);
1123 int* __cdecl
__p___mb_cur_max(void);
1124 unsigned int* __cdecl
__p__fmode(void);
1125 MSVCRT_wchar_t
* __cdecl
MSVCRT__wcsdup(const MSVCRT_wchar_t
*);
1126 MSVCRT_size_t __cdecl
MSVCRT_strnlen(const char *,MSVCRT_size_t
);
1127 MSVCRT_size_t __cdecl
MSVCRT_wcsnlen(const MSVCRT_wchar_t
*,MSVCRT_size_t
);
1128 MSVCRT_wchar_t
*** __cdecl
MSVCRT___p__wenviron(void);
1129 INT __cdecl
MSVCRT_wctomb(char*,MSVCRT_wchar_t
);
1130 char* __cdecl
MSVCRT__strdate(char* date
);
1131 char* __cdecl
MSVCRT__strtime(char* date
);
1132 int __cdecl
_setmbcp(int);
1133 int __cdecl
MSVCRT__close(int);
1134 int __cdecl
MSVCRT__dup(int);
1135 int __cdecl
MSVCRT__dup2(int, int);
1136 int __cdecl
MSVCRT__pipe(int *, unsigned int, int);
1137 MSVCRT_wchar_t
* __cdecl
MSVCRT__wgetenv(const MSVCRT_wchar_t
*);
1138 void __cdecl
MSVCRT__wsearchenv(const MSVCRT_wchar_t
*, const MSVCRT_wchar_t
*, MSVCRT_wchar_t
*);
1139 MSVCRT_intptr_t __cdecl
MSVCRT__spawnvpe(int, const char*, const char* const*, const char* const*);
1140 void __cdecl
MSVCRT__invalid_parameter(const MSVCRT_wchar_t
*expr
, const MSVCRT_wchar_t
*func
,
1141 const MSVCRT_wchar_t
*file
, unsigned int line
, MSVCRT_uintptr_t arg
);
1142 int __cdecl
MSVCRT__toupper_l(int,MSVCRT__locale_t
);
1143 int __cdecl
MSVCRT__tolower_l(int,MSVCRT__locale_t
);
1144 int __cdecl
MSVCRT__strnicoll_l(const char*, const char*, MSVCRT_size_t
, MSVCRT__locale_t
);
1145 int __cdecl
MSVCRT__strncoll_l(const char*, const char*, MSVCRT_size_t
, MSVCRT__locale_t
);
1146 unsigned int __cdecl
MSVCRT__get_output_format(void);
1147 char* __cdecl
MSVCRT_strtok_s(char*, const char*, char**);
1149 /* Maybe one day we'll enable the invalid parameter handlers with the full set of information (msvcrXXd)
1150 * #define MSVCRT_INVALID_PMT(x) MSVCRT_call_invalid_parameter_handler(x, __FUNCTION__, __FILE__, __LINE__, 0)
1151 * #define MSVCRT_CHECK_PMT(x) ((x) ? TRUE : MSVCRT_INVALID_PMT(#x),FALSE)
1152 * Until this is done, just keep the same semantics for CHECK_PMT(), but without generating / sending
1154 * NB : MSVCRT_call_invalid_parameter_handler is a wrapper around MSVCRT__invalid_parameter in order
1155 * to do the Ansi to Unicode transformation
1157 #define MSVCRT_INVALID_PMT(x,err) (*MSVCRT__errno() = (err), MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0))
1158 #define MSVCRT_CHECK_PMT_ERR(x,err) ((x) || (MSVCRT_INVALID_PMT( 0, (err) ), FALSE))
1159 #define MSVCRT_CHECK_PMT(x) MSVCRT_CHECK_PMT_ERR((x), MSVCRT_EINVAL)
1162 #define MSVCRT__ARGMAX 100
1163 typedef int (*puts_clbk_a
)(void*, int, const char*);
1164 typedef int (*puts_clbk_w
)(void*, int, const MSVCRT_wchar_t
*);
1165 typedef union _printf_arg
1169 LONGLONG get_longlong
;
1172 typedef printf_arg (*args_clbk
)(void*, int, int, __ms_va_list
*);
1173 int pf_printf_a(puts_clbk_a
, void*, const char*, MSVCRT__locale_t
,
1174 DWORD
, args_clbk
, void*, __ms_va_list
*) DECLSPEC_HIDDEN
;
1175 int pf_printf_w(puts_clbk_w
, void*, const MSVCRT_wchar_t
*, MSVCRT__locale_t
,
1176 DWORD
, args_clbk
, void*, __ms_va_list
*) DECLSPEC_HIDDEN
;
1177 int create_positional_ctx_a(void*, const char*, __ms_va_list
) DECLSPEC_HIDDEN
;
1178 int create_positional_ctx_w(void*, const MSVCRT_wchar_t
*, __ms_va_list
) DECLSPEC_HIDDEN
;
1179 printf_arg
arg_clbk_valist(void*, int, int, __ms_va_list
*) DECLSPEC_HIDDEN
;
1180 printf_arg
arg_clbk_positional(void*, int, int, __ms_va_list
*) DECLSPEC_HIDDEN
;
1182 #define MSVCRT_FLT_MIN 1.175494351e-38F
1183 #define MSVCRT_DBL_MIN 2.2250738585072014e-308
1184 #define MSVCRT__OVERFLOW 3
1185 #define MSVCRT__UNDERFLOW 4
1190 } MSVCRT__CRT_FLOAT
;
1195 } MSVCRT__CRT_DOUBLE
;
1197 extern char* __cdecl
__unDName(char *,const char*,int,malloc_func_t
,free_func_t
,unsigned short int);
1199 /* __unDName/__unDNameEx flags */
1200 #define UNDNAME_COMPLETE (0x0000)
1201 #define UNDNAME_NO_LEADING_UNDERSCORES (0x0001) /* Don't show __ in calling convention */
1202 #define UNDNAME_NO_MS_KEYWORDS (0x0002) /* Don't show calling convention at all */
1203 #define UNDNAME_NO_FUNCTION_RETURNS (0x0004) /* Don't show function/method return value */
1204 #define UNDNAME_NO_ALLOCATION_MODEL (0x0008)
1205 #define UNDNAME_NO_ALLOCATION_LANGUAGE (0x0010)
1206 #define UNDNAME_NO_MS_THISTYPE (0x0020)
1207 #define UNDNAME_NO_CV_THISTYPE (0x0040)
1208 #define UNDNAME_NO_THISTYPE (0x0060)
1209 #define UNDNAME_NO_ACCESS_SPECIFIERS (0x0080) /* Don't show access specifier (public/protected/private) */
1210 #define UNDNAME_NO_THROW_SIGNATURES (0x0100)
1211 #define UNDNAME_NO_MEMBER_TYPE (0x0200) /* Don't show static/virtual specifier */
1212 #define UNDNAME_NO_RETURN_UDT_MODEL (0x0400)
1213 #define UNDNAME_32_BIT_DECODE (0x0800)
1214 #define UNDNAME_NAME_ONLY (0x1000) /* Only report the variable/method name */
1215 #define UNDNAME_NO_ARGUMENTS (0x2000) /* Don't show method arguments */
1216 #define UNDNAME_NO_SPECIAL_SYMS (0x4000)
1217 #define UNDNAME_NO_COMPLEX_TYPE (0x8000)
1219 #define UCRTBASE_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION (0x0001)
1220 #define UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR (0x0002)
1221 #define UCRTBASE_PRINTF_LEGACY_WIDE_SPECIFIERS (0x0004)
1222 #define UCRTBASE_PRINTF_LEGACY_MSVCRT_COMPATIBILITY (0x0008)
1223 #define UCRTBASE_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS (0x0010)
1225 #define UCRTBASE_PRINTF_MASK (0x001F)
1227 #define MSVCRT_PRINTF_POSITIONAL_PARAMS (0x0100)
1228 #define MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER (0x0200)
1230 #define UCRTBASE_SCANF_SECURECRT (0x0001)
1231 #define UCRTBASE_SCANF_LEGACY_WIDE_SPECIFIERS (0x0002)
1232 #define UCRTBASE_SCANF_LEGACY_MSVCRT_COMPATIBILITY (0x0004)
1234 #define UCRTBASE_SCANF_MASK (0x0007)
1236 #define COOPERATIVE_TIMEOUT_INFINITE ((unsigned int)-1)
1237 #define COOPERATIVE_WAIT_TIMEOUT ~0
1282 _FpCodeConvertTrunc
,
1344 } _FP_OPERATION_CODE
;
1362 typedef float _FP32
;
1363 typedef double _FP64
;
1366 typedef unsigned short _U16
;
1367 typedef unsigned int _U32
;
1368 typedef __int64 _Q64
;
1371 unsigned short W
[5];
1374 typedef struct DECLSPEC_ALIGN(16) {
1378 typedef struct DECLSPEC_ALIGN(8) {
1382 typedef struct DECLSPEC_ALIGN(8) {
1387 unsigned short W
[5];
1390 typedef struct DECLSPEC_ALIGN(16) {
1412 unsigned int OperandValid
: 1;
1413 unsigned int Format
: 4;
1417 unsigned int Inexact
: 1;
1418 unsigned int Underflow
: 1;
1419 unsigned int Overflow
: 1;
1420 unsigned int ZeroDivide
: 1;
1421 unsigned int InvalidOperation
: 1;
1422 } _FPIEEE_EXCEPTION_FLAGS
;
1425 unsigned int RoundingMode
: 2;
1426 unsigned int Precision
: 3;
1427 unsigned int Operation
:12;
1428 _FPIEEE_EXCEPTION_FLAGS Cause
;
1429 _FPIEEE_EXCEPTION_FLAGS Enable
;
1430 _FPIEEE_EXCEPTION_FLAGS Status
;
1431 _FPIEEE_VALUE Operand1
;
1432 _FPIEEE_VALUE Operand2
;
1433 _FPIEEE_VALUE Result
;
1434 } _FPIEEE_RECORD
, *_PFPIEEE_RECORD
;
1436 #define INHERIT_THREAD_PRIORITY 0xF000
1437 #endif /* __WINE_MSVCRT_H */