1 /* 2 * Copyright 2001 Jon Griffiths 3 * Copyright 2004 Dimitrie O. Paun 4 * 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. 9 * 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. 14 * 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 18 * 19 * NOTES 20 * Naming conventions 21 * - Symbols are prefixed with MSVCRT_ if they conflict 22 * with libc symbols 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. 26 * Other conventions 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! 34 */ 35 36 #ifndef __WINE_MSVCRT_H 37 #define __WINE_MSVCRT_H 38 39 #include <stdarg.h> 40 41 #include "windef.h" 42 #include "winbase.h" 43 44 #define MSVCRT_INT_MAX 0x7fffffff 45 #define MSVCRT_LONG_MAX 0x7fffffff 46 #define MSVCRT_LONG_MIN (-MSVCRT_LONG_MAX-1) 47 #define MSVCRT_ULONG_MAX 0xffffffff 48 #define MSVCRT_I64_MAX (((__int64)0x7fffffff << 32) | 0xffffffff) 49 #define MSVCRT_I64_MIN (-MSVCRT_I64_MAX-1) 50 #define MSVCRT_UI64_MAX (((unsigned __int64)0xffffffff << 32) | 0xffffffff) 51 #define MSVCRT_MB_LEN_MAX 5 52 #define MSVCRT_FLT_MAX_10_EXP 38 53 #define MSVCRT_FLT_MIN_10_EXP (-37) 54 #define MSVCRT_DBL_MAX_10_EXP 308 55 #define MSVCRT_DBL_MIN_10_EXP (-307) 56 #define MSVCRT_DBL_DIG 15 57 #ifdef _WIN64 58 #define MSVCRT_SIZE_MAX MSVCRT_UI64_MAX 59 #else 60 #define MSVCRT_SIZE_MAX MSVCRT_ULONG_MAX 61 #endif 62 63 #define MSVCRT__MAX_DRIVE 3 64 #define MSVCRT__MAX_DIR 256 65 #define MSVCRT__MAX_FNAME 256 66 #define MSVCRT__MAX_EXT 256 67 68 typedef unsigned char MSVCRT_bool; 69 typedef unsigned short MSVCRT_wchar_t; 70 typedef unsigned short MSVCRT_wint_t; 71 typedef unsigned short MSVCRT_wctrans_t; 72 typedef unsigned short MSVCRT_wctype_t; 73 typedef unsigned short MSVCRT__ino_t; 74 typedef unsigned int MSVCRT__fsize_t; 75 typedef int MSVCRT_long; 76 typedef unsigned int MSVCRT_ulong; 77 typedef __int64 MSVCRT_longlong; 78 #ifdef _WIN64 79 typedef unsigned __int64 MSVCRT_size_t; 80 typedef __int64 MSVCRT_intptr_t; 81 typedef unsigned __int64 MSVCRT_uintptr_t; 82 #else 83 typedef unsigned int MSVCRT_size_t; 84 typedef int MSVCRT_intptr_t; 85 typedef unsigned int MSVCRT_uintptr_t; 86 #endif 87 #ifdef _CRTDLL 88 typedef short MSVCRT__dev_t; 89 #else 90 typedef unsigned int MSVCRT__dev_t; 91 #endif 92 typedef int MSVCRT__off_t; 93 typedef int MSVCRT_clock_t; 94 typedef int MSVCRT___time32_t; 95 typedef __int64 DECLSPEC_ALIGN(8) MSVCRT___time64_t; 96 typedef __int64 DECLSPEC_ALIGN(8) MSVCRT_fpos_t; 97 typedef int MSVCRT_mbstate_t; 98 99 typedef void (__cdecl *MSVCRT_terminate_handler)(void); 100 typedef void (__cdecl *MSVCRT_terminate_function)(void); 101 typedef void (__cdecl *MSVCRT_unexpected_handler)(void); 102 typedef void (__cdecl *MSVCRT_unexpected_function)(void); 103 typedef void (__cdecl *MSVCRT__se_translator_function)(unsigned int code, struct _EXCEPTION_POINTERS *info); 104 typedef void (__cdecl *MSVCRT__beginthread_start_routine_t)(void *); 105 typedef unsigned int (__stdcall *MSVCRT__beginthreadex_start_routine_t)(void *); 106 typedef int (__cdecl *MSVCRT__onexit_t)(void); 107 typedef void (__cdecl *MSVCRT_invalid_parameter_handler)(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, unsigned, MSVCRT_uintptr_t); 108 typedef void (__cdecl *MSVCRT_purecall_handler)(void); 109 typedef void (__cdecl *MSVCRT_security_error_handler)(int, void *); 110 111 typedef struct {ULONG x80[3];} MSVCRT__LDOUBLE; /* Intel 80 bit FP format has sizeof() 12 */ 112 113 struct MSVCRT_tm { 114 int tm_sec; 115 int tm_min; 116 int tm_hour; 117 int tm_mday; 118 int tm_mon; 119 int tm_year; 120 int tm_wday; 121 int tm_yday; 122 int tm_isdst; 123 }; 124 125 typedef struct MSVCRT_tagLC_ID { 126 unsigned short wLanguage; 127 unsigned short wCountry; 128 unsigned short wCodePage; 129 } MSVCRT_LC_ID, *MSVCRT_LPLC_ID; 130 131 typedef struct { 132 union { 133 const char *str[43]; 134 struct { 135 const char *short_wday[7]; 136 const char *wday[7]; 137 const char *short_mon[12]; 138 const char *mon[12]; 139 const char *am; 140 const char *pm; 141 const char *short_date; 142 const char *date; 143 const char *time; 144 } names; 145 } str; 146 #if _MSVCR_VER < 110 147 LCID lcid; 148 #endif 149 int unk[2]; 150 union { 151 const MSVCRT_wchar_t *wstr[43]; 152 struct { 153 const MSVCRT_wchar_t *short_wday[7]; 154 const MSVCRT_wchar_t *wday[7]; 155 const MSVCRT_wchar_t *short_mon[12]; 156 const MSVCRT_wchar_t *mon[12]; 157 const MSVCRT_wchar_t *am; 158 const MSVCRT_wchar_t *pm; 159 const MSVCRT_wchar_t *short_date; 160 const MSVCRT_wchar_t *date; 161 const MSVCRT_wchar_t *time; 162 } names; 163 } wstr; 164 #if _MSVCR_VER >= 110 165 const MSVCRT_wchar_t *locname; 166 #endif 167 char data[1]; 168 } MSVCRT___lc_time_data; 169 170 typedef struct MSVCRT_threadlocaleinfostruct { 171 #if _MSVCR_VER >= 140 172 unsigned short *pctype; 173 int mb_cur_max; 174 unsigned int lc_codepage; 175 #endif 176 177 int refcount; 178 #if _MSVCR_VER < 140 179 unsigned int lc_codepage; 180 #endif 181 unsigned int lc_collate_cp; 182 MSVCRT_ulong lc_handle[6]; 183 MSVCRT_LC_ID lc_id[6]; 184 struct { 185 char *locale; 186 MSVCRT_wchar_t *wlocale; 187 int *refcount; 188 int *wrefcount; 189 } lc_category[6]; 190 int lc_clike; 191 #if _MSVCR_VER < 140 192 int mb_cur_max; 193 #endif 194 int *lconv_intl_refcount; 195 int *lconv_num_refcount; 196 int *lconv_mon_refcount; 197 struct MSVCRT_lconv *lconv; 198 int *ctype1_refcount; 199 unsigned short *ctype1; 200 #if _MSVCR_VER < 140 201 unsigned short *pctype; 202 #endif 203 unsigned char *pclmap; 204 unsigned char *pcumap; 205 MSVCRT___lc_time_data *lc_time_curr; 206 #if _MSVCR_VER >= 110 207 MSVCRT_wchar_t *lc_name[6]; 208 #endif 209 } MSVCRT_threadlocinfo; 210 211 typedef struct MSVCRT_threadmbcinfostruct { 212 int refcount; 213 int mbcodepage; 214 int ismbcodepage; 215 int mblcid; 216 unsigned short mbulinfo[6]; 217 unsigned char mbctype[257]; 218 unsigned char mbcasemap[256]; 219 } MSVCRT_threadmbcinfo; 220 221 typedef struct MSVCRT_threadlocaleinfostruct *MSVCRT_pthreadlocinfo; 222 typedef struct MSVCRT_threadmbcinfostruct *MSVCRT_pthreadmbcinfo; 223 224 typedef struct MSVCRT_localeinfo_struct 225 { 226 MSVCRT_pthreadlocinfo locinfo; 227 MSVCRT_pthreadmbcinfo mbcinfo; 228 } MSVCRT__locale_tstruct, *MSVCRT__locale_t; 229 230 typedef struct MSVCRT__onexit_table_t 231 { 232 MSVCRT__onexit_t *_first; 233 MSVCRT__onexit_t *_last; 234 MSVCRT__onexit_t *_end; 235 } MSVCRT__onexit_table_t; 236 237 typedef struct _frame_info 238 { 239 void *object; 240 struct _frame_info *next; 241 } frame_info; 242 243 typedef struct 244 { 245 frame_info frame_info; 246 EXCEPTION_RECORD *rec; 247 CONTEXT *context; 248 } cxx_frame_info; 249 250 frame_info* __cdecl _CreateFrameInfo(frame_info *fi, void *obj); 251 BOOL __cdecl __CxxRegisterExceptionObject(EXCEPTION_POINTERS*, cxx_frame_info*); 252 void __cdecl __CxxUnregisterExceptionObject(cxx_frame_info*, BOOL); 253 void CDECL __DestructExceptionObject(EXCEPTION_RECORD*); 254 255 /* TLS data */ 256 extern DWORD msvcrt_tls_index DECLSPEC_HIDDEN; 257 258 /* Keep in sync with msvcr90/tests/msvcr90.c */ 259 struct __thread_data { 260 DWORD tid; 261 HANDLE handle; 262 int thread_errno; 263 MSVCRT_ulong thread_doserrno; 264 int unk1; 265 unsigned int random_seed; /* seed for rand() */ 266 char *strtok_next; /* next ptr for strtok() */ 267 MSVCRT_wchar_t *wcstok_next; /* next ptr for wcstok() */ 268 unsigned char *mbstok_next; /* next ptr for mbstok() */ 269 char *strerror_buffer; /* buffer for strerror */ 270 MSVCRT_wchar_t *wcserror_buffer; /* buffer for wcserror */ 271 char *tmpnam_buffer; /* buffer for tmpname() */ 272 MSVCRT_wchar_t *wtmpnam_buffer; /* buffer for wtmpname() */ 273 void *unk2[2]; 274 char *asctime_buffer; /* buffer for asctime */ 275 MSVCRT_wchar_t *wasctime_buffer; /* buffer for wasctime */ 276 struct MSVCRT_tm *time_buffer; /* buffer for localtime/gmtime */ 277 char *efcvt_buffer; /* buffer for ecvt/fcvt */ 278 int unk3[2]; 279 void *unk4[3]; 280 EXCEPTION_POINTERS *xcptinfo; 281 int fpecode; 282 MSVCRT_pthreadmbcinfo mbcinfo; 283 MSVCRT_pthreadlocinfo locinfo; 284 BOOL have_locale; 285 int unk5[1]; 286 MSVCRT_terminate_function terminate_handler; 287 MSVCRT_unexpected_function unexpected_handler; 288 MSVCRT__se_translator_function se_translator; 289 void *unk6[3]; 290 int unk7; 291 EXCEPTION_RECORD *exc_record; 292 CONTEXT *ctx_record; 293 int processing_throw; 294 frame_info *frame_info_head; 295 void *unk8[6]; 296 LCID cached_lcid; 297 BOOL cached_sname; 298 int unk9[2]; 299 DWORD cached_cp; 300 char cached_locale[131]; 301 void *unk10[100]; 302 #if _MSVCR_VER >= 140 303 MSVCRT_invalid_parameter_handler invalid_parameter_handler; 304 #endif 305 }; 306 307 typedef struct __thread_data thread_data_t; 308 309 extern thread_data_t *msvcrt_get_thread_data(void) DECLSPEC_HIDDEN; 310 311 LCID MSVCRT_locale_to_LCID(const char*, unsigned short*, BOOL*) DECLSPEC_HIDDEN; 312 extern MSVCRT__locale_t MSVCRT_locale DECLSPEC_HIDDEN; 313 extern MSVCRT___lc_time_data cloc_time_data DECLSPEC_HIDDEN; 314 extern unsigned int MSVCRT___lc_codepage; 315 extern int MSVCRT___lc_collate_cp; 316 extern WORD MSVCRT__ctype [257]; 317 extern BOOL initial_locale DECLSPEC_HIDDEN; 318 319 void msvcrt_set_errno(int) DECLSPEC_HIDDEN; 320 #if _MSVCR_VER >= 80 321 typedef enum { 322 EXCEPTION_BAD_ALLOC, 323 #if _MSVCR_VER >= 100 324 EXCEPTION_SCHEDULER_RESOURCE_ALLOCATION_ERROR, 325 EXCEPTION_IMPROPER_LOCK, 326 EXCEPTION_INVALID_SCHEDULER_POLICY_KEY, 327 EXCEPTION_INVALID_SCHEDULER_POLICY_VALUE, 328 EXCEPTION_INVALID_SCHEDULER_POLICY_THREAD_SPECIFICATION, 329 EXCEPTION_IMPROPER_SCHEDULER_ATTACH, 330 EXCEPTION_IMPROPER_SCHEDULER_DETACH, 331 #endif 332 } exception_type; 333 void throw_exception(exception_type, HRESULT, const char*) DECLSPEC_HIDDEN; 334 #endif 335 336 void __cdecl _purecall(void); 337 void __cdecl _amsg_exit(int errnum); 338 339 extern char **MSVCRT__environ; 340 extern MSVCRT_wchar_t **MSVCRT__wenviron; 341 342 extern char ** msvcrt_SnapshotOfEnvironmentA(char **) DECLSPEC_HIDDEN; 343 extern MSVCRT_wchar_t ** msvcrt_SnapshotOfEnvironmentW(MSVCRT_wchar_t **) DECLSPEC_HIDDEN; 344 345 MSVCRT_wchar_t *msvcrt_wstrdupa(const char *) DECLSPEC_HIDDEN; 346 347 extern unsigned int MSVCRT__commode; 348 349 /* FIXME: This should be declared in new.h but it's not an extern "C" so 350 * it would not be much use anyway. Even for Winelib applications. 351 */ 352 int __cdecl MSVCRT__set_new_mode(int mode); 353 354 void* __cdecl MSVCRT_operator_new(MSVCRT_size_t); 355 void __cdecl MSVCRT_operator_delete(void*); 356 357 typedef void* (__cdecl *malloc_func_t)(MSVCRT_size_t); 358 typedef void (__cdecl *free_func_t)(void*); 359 360 /* Setup and teardown multi threaded locks */ 361 extern void msvcrt_init_mt_locks(void) DECLSPEC_HIDDEN; 362 extern void msvcrt_free_locks(void) DECLSPEC_HIDDEN; 363 364 extern void msvcrt_init_exception(void*) DECLSPEC_HIDDEN; 365 extern BOOL msvcrt_init_locale(void) DECLSPEC_HIDDEN; 366 extern void msvcrt_init_math(void) DECLSPEC_HIDDEN; 367 extern void msvcrt_init_io(void) DECLSPEC_HIDDEN; 368 extern void msvcrt_free_io(void) DECLSPEC_HIDDEN; 369 extern void msvcrt_init_console(void) DECLSPEC_HIDDEN; 370 extern void msvcrt_free_console(void) DECLSPEC_HIDDEN; 371 extern void msvcrt_init_args(void) DECLSPEC_HIDDEN; 372 extern void msvcrt_free_args(void) DECLSPEC_HIDDEN; 373 extern void msvcrt_init_signals(void) DECLSPEC_HIDDEN; 374 extern void msvcrt_free_signals(void) DECLSPEC_HIDDEN; 375 extern void msvcrt_free_popen_data(void) DECLSPEC_HIDDEN; 376 extern BOOL msvcrt_init_heap(void) DECLSPEC_HIDDEN; 377 extern void msvcrt_destroy_heap(void) DECLSPEC_HIDDEN; 378 extern void msvcrt_init_clock(void) DECLSPEC_HIDDEN; 379 380 #if _MSVCR_VER >= 100 381 extern void msvcrt_init_scheduler(void*) DECLSPEC_HIDDEN; 382 extern void msvcrt_free_scheduler(void) DECLSPEC_HIDDEN; 383 extern void msvcrt_free_scheduler_thread(void) DECLSPEC_HIDDEN; 384 #endif 385 386 extern unsigned msvcrt_create_io_inherit_block(WORD*, BYTE**) DECLSPEC_HIDDEN; 387 388 extern unsigned int __cdecl _control87(unsigned int, unsigned int); 389 390 /* run-time error codes */ 391 #define _RT_STACK 0 392 #define _RT_NULLPTR 1 393 #define _RT_FLOAT 2 394 #define _RT_INTDIV 3 395 #define _RT_EXECMEM 5 396 #define _RT_EXECFORM 6 397 #define _RT_EXECENV 7 398 #define _RT_SPACEARG 8 399 #define _RT_SPACEENV 9 400 #define _RT_ABORT 10 401 #define _RT_NPTR 12 402 #define _RT_FPTR 13 403 #define _RT_BREAK 14 404 #define _RT_INT 15 405 #define _RT_THREAD 16 406 #define _RT_LOCK 17 407 #define _RT_HEAP 18 408 #define _RT_OPENCON 19 409 #define _RT_QWIN 20 410 #define _RT_NOMAIN 21 411 #define _RT_NONCONT 22 412 #define _RT_INVALDISP 23 413 #define _RT_ONEXIT 24 414 #define _RT_PUREVIRT 25 415 #define _RT_STDIOINIT 26 416 #define _RT_LOWIOINIT 27 417 #define _RT_HEAPINIT 28 418 #define _RT_DOMAIN 120 419 #define _RT_SING 121 420 #define _RT_TLOSS 122 421 #define _RT_CRNL 252 422 #define _RT_BANNER 255 423 424 struct MSVCRT___timeb32 { 425 MSVCRT___time32_t time; 426 unsigned short millitm; 427 short timezone; 428 short dstflag; 429 }; 430 431 struct MSVCRT___timeb64 { 432 MSVCRT___time64_t time; 433 unsigned short millitm; 434 short timezone; 435 short dstflag; 436 }; 437 438 struct MSVCRT__iobuf { 439 char* _ptr; 440 int _cnt; 441 char* _base; 442 int _flag; 443 int _file; 444 int _charbuf; 445 int _bufsiz; 446 char* _tmpfname; 447 }; 448 449 typedef struct MSVCRT__iobuf MSVCRT_FILE; 450 451 struct MSVCRT_lconv { 452 char* decimal_point; 453 char* thousands_sep; 454 char* grouping; 455 char* int_curr_symbol; 456 char* currency_symbol; 457 char* mon_decimal_point; 458 char* mon_thousands_sep; 459 char* mon_grouping; 460 char* positive_sign; 461 char* negative_sign; 462 char int_frac_digits; 463 char frac_digits; 464 char p_cs_precedes; 465 char p_sep_by_space; 466 char n_cs_precedes; 467 char n_sep_by_space; 468 char p_sign_posn; 469 char n_sign_posn; 470 #if _MSVCR_VER >= 100 471 MSVCRT_wchar_t* _W_decimal_point; 472 MSVCRT_wchar_t* _W_thousands_sep; 473 MSVCRT_wchar_t* _W_int_curr_symbol; 474 MSVCRT_wchar_t* _W_currency_symbol; 475 MSVCRT_wchar_t* _W_mon_decimal_point; 476 MSVCRT_wchar_t* _W_mon_thousands_sep; 477 MSVCRT_wchar_t* _W_positive_sign; 478 MSVCRT_wchar_t* _W_negative_sign; 479 #endif 480 }; 481 482 struct MSVCRT__exception { 483 int type; 484 char* name; 485 double arg1; 486 double arg2; 487 double retval; 488 }; 489 490 struct MSVCRT__complex { 491 double x; /* Real part */ 492 double y; /* Imaginary part */ 493 }; 494 typedef struct MSVCRT__complex _Dcomplex; 495 496 typedef struct MSVCRT__div_t { 497 int quot; /* quotient */ 498 int rem; /* remainder */ 499 } MSVCRT_div_t; 500 501 typedef struct MSVCRT__ldiv_t { 502 MSVCRT_long quot; /* quotient */ 503 MSVCRT_long rem; /* remainder */ 504 } MSVCRT_ldiv_t; 505 506 typedef struct MSVCRT__lldiv_t { 507 MSVCRT_longlong quot; /* quotient */ 508 MSVCRT_longlong rem; /* remainder */ 509 } MSVCRT_lldiv_t; 510 511 struct MSVCRT__heapinfo { 512 int* _pentry; 513 MSVCRT_size_t _size; 514 int _useflag; 515 }; 516 517 #ifdef __i386__ 518 struct MSVCRT___JUMP_BUFFER { 519 unsigned long Ebp; 520 unsigned long Ebx; 521 unsigned long Edi; 522 unsigned long Esi; 523 unsigned long Esp; 524 unsigned long Eip; 525 unsigned long Registration; 526 unsigned long TryLevel; 527 /* Start of new struct members */ 528 unsigned long Cookie; 529 unsigned long UnwindFunc; 530 unsigned long UnwindData[6]; 531 }; 532 #elif defined(__x86_64__) 533 struct MSVCRT__SETJMP_FLOAT128 534 { 535 unsigned __int64 DECLSPEC_ALIGN(16) Part[2]; 536 }; 537 struct MSVCRT___JUMP_BUFFER 538 { 539 unsigned __int64 Frame; 540 unsigned __int64 Rbx; 541 unsigned __int64 Rsp; 542 unsigned __int64 Rbp; 543 unsigned __int64 Rsi; 544 unsigned __int64 Rdi; 545 unsigned __int64 R12; 546 unsigned __int64 R13; 547 unsigned __int64 R14; 548 unsigned __int64 R15; 549 unsigned __int64 Rip; 550 unsigned __int64 Spare; 551 struct MSVCRT__SETJMP_FLOAT128 Xmm6; 552 struct MSVCRT__SETJMP_FLOAT128 Xmm7; 553 struct MSVCRT__SETJMP_FLOAT128 Xmm8; 554 struct MSVCRT__SETJMP_FLOAT128 Xmm9; 555 struct MSVCRT__SETJMP_FLOAT128 Xmm10; 556 struct MSVCRT__SETJMP_FLOAT128 Xmm11; 557 struct MSVCRT__SETJMP_FLOAT128 Xmm12; 558 struct MSVCRT__SETJMP_FLOAT128 Xmm13; 559 struct MSVCRT__SETJMP_FLOAT128 Xmm14; 560 struct MSVCRT__SETJMP_FLOAT128 Xmm15; 561 }; 562 #elif defined(__arm__) 563 struct MSVCRT___JUMP_BUFFER 564 { 565 unsigned long Frame; 566 unsigned long R4; 567 unsigned long R5; 568 unsigned long R6; 569 unsigned long R7; 570 unsigned long R8; 571 unsigned long R9; 572 unsigned long R10; 573 unsigned long R11; 574 unsigned long Sp; 575 unsigned long Pc; 576 unsigned long Fpscr; 577 unsigned long long D[8]; 578 }; 579 #elif defined(__aarch64__) 580 struct MSVCRT___JUMP_BUFFER 581 { 582 unsigned __int64 Frame; 583 unsigned __int64 Reserved; 584 unsigned __int64 X19; 585 unsigned __int64 X20; 586 unsigned __int64 X21; 587 unsigned __int64 X22; 588 unsigned __int64 X23; 589 unsigned __int64 X24; 590 unsigned __int64 X25; 591 unsigned __int64 X26; 592 unsigned __int64 X27; 593 unsigned __int64 X28; 594 unsigned __int64 Fp; 595 unsigned __int64 Lr; 596 unsigned __int64 Sp; 597 unsigned long Fpcr; 598 unsigned long Fpsr; 599 double D[8]; 600 }; 601 #endif /* __i386__ */ 602 603 struct MSVCRT__diskfree_t { 604 unsigned int total_clusters; 605 unsigned int avail_clusters; 606 unsigned int sectors_per_cluster; 607 unsigned int bytes_per_sector; 608 }; 609 610 struct MSVCRT__finddata32_t { 611 unsigned int attrib; 612 MSVCRT___time32_t time_create; 613 MSVCRT___time32_t time_access; 614 MSVCRT___time32_t time_write; 615 MSVCRT__fsize_t size; 616 char name[260]; 617 }; 618 619 struct MSVCRT__finddata32i64_t { 620 unsigned int attrib; 621 MSVCRT___time32_t time_create; 622 MSVCRT___time32_t time_access; 623 MSVCRT___time32_t time_write; 624 __int64 DECLSPEC_ALIGN(8) size; 625 char name[260]; 626 }; 627 628 struct MSVCRT__finddata64i32_t { 629 unsigned int attrib; 630 MSVCRT___time64_t time_create; 631 MSVCRT___time64_t time_access; 632 MSVCRT___time64_t time_write; 633 MSVCRT__fsize_t size; 634 char name[260]; 635 }; 636 637 struct MSVCRT__finddata64_t { 638 unsigned int attrib; 639 MSVCRT___time64_t time_create; 640 MSVCRT___time64_t time_access; 641 MSVCRT___time64_t time_write; 642 __int64 DECLSPEC_ALIGN(8) size; 643 char name[260]; 644 }; 645 646 struct MSVCRT__wfinddata32_t { 647 unsigned int attrib; 648 MSVCRT___time32_t time_create; 649 MSVCRT___time32_t time_access; 650 MSVCRT___time32_t time_write; 651 MSVCRT__fsize_t size; 652 MSVCRT_wchar_t name[260]; 653 }; 654 655 struct MSVCRT__wfinddata32i64_t { 656 unsigned int attrib; 657 MSVCRT___time32_t time_create; 658 MSVCRT___time32_t time_access; 659 MSVCRT___time32_t time_write; 660 __int64 DECLSPEC_ALIGN(8) size; 661 MSVCRT_wchar_t name[260]; 662 }; 663 664 struct MSVCRT__wfinddata64i32_t { 665 unsigned int attrib; 666 MSVCRT___time64_t time_create; 667 MSVCRT___time64_t time_access; 668 MSVCRT___time64_t time_write; 669 MSVCRT__fsize_t size; 670 MSVCRT_wchar_t name[260]; 671 }; 672 673 struct MSVCRT__wfinddata64_t { 674 unsigned int attrib; 675 MSVCRT___time64_t time_create; 676 MSVCRT___time64_t time_access; 677 MSVCRT___time64_t time_write; 678 __int64 DECLSPEC_ALIGN(8) size; 679 MSVCRT_wchar_t name[260]; 680 }; 681 682 struct MSVCRT___utimbuf32 683 { 684 MSVCRT___time32_t actime; 685 MSVCRT___time32_t modtime; 686 }; 687 688 struct MSVCRT___utimbuf64 689 { 690 MSVCRT___time64_t actime; 691 MSVCRT___time64_t modtime; 692 }; 693 694 /* for FreeBSD */ 695 #undef st_atime 696 #undef st_ctime 697 #undef st_mtime 698 699 struct MSVCRT__stat32 { 700 MSVCRT__dev_t st_dev; 701 MSVCRT__ino_t st_ino; 702 unsigned short st_mode; 703 short st_nlink; 704 short st_uid; 705 short st_gid; 706 MSVCRT__dev_t st_rdev; 707 MSVCRT__off_t st_size; 708 MSVCRT___time32_t st_atime; 709 MSVCRT___time32_t st_mtime; 710 MSVCRT___time32_t st_ctime; 711 }; 712 713 struct MSVCRT__stat32i64 { 714 MSVCRT__dev_t st_dev; 715 MSVCRT__ino_t st_ino; 716 unsigned short st_mode; 717 short st_nlink; 718 short st_uid; 719 short st_gid; 720 MSVCRT__dev_t st_rdev; 721 __int64 DECLSPEC_ALIGN(8) st_size; 722 MSVCRT___time32_t st_atime; 723 MSVCRT___time32_t st_mtime; 724 MSVCRT___time32_t st_ctime; 725 }; 726 727 struct MSVCRT__stat64i32 { 728 MSVCRT__dev_t st_dev; 729 MSVCRT__ino_t st_ino; 730 unsigned short st_mode; 731 short st_nlink; 732 short st_uid; 733 short st_gid; 734 MSVCRT__dev_t st_rdev; 735 MSVCRT__off_t st_size; 736 MSVCRT___time64_t st_atime; 737 MSVCRT___time64_t st_mtime; 738 MSVCRT___time64_t st_ctime; 739 }; 740 741 struct MSVCRT__stat64 { 742 MSVCRT__dev_t st_dev; 743 MSVCRT__ino_t st_ino; 744 unsigned short st_mode; 745 short st_nlink; 746 short st_uid; 747 short st_gid; 748 MSVCRT__dev_t st_rdev; 749 __int64 DECLSPEC_ALIGN(8) st_size; 750 MSVCRT___time64_t st_atime; 751 MSVCRT___time64_t st_mtime; 752 MSVCRT___time64_t st_ctime; 753 }; 754 755 #ifdef _WIN64 756 #define MSVCRT__finddata_t MSVCRT__finddata64i32_t 757 #define MSVCRT__finddatai64_t MSVCRT__finddata64_t 758 #define MSVCRT__wfinddata_t MSVCRT__wfinddata64i32_t 759 #define MSVCRT__wfinddatai64_t MSVCRT__wfinddata64_t 760 #define MSVCRT__stat MSVCRT__stat64i32 761 #define MSVCRT__stati64 MSVCRT__stat64 762 #else 763 #define MSVCRT__finddata_t MSVCRT__finddata32_t 764 #define MSVCRT__finddatai64_t MSVCRT__finddata32i64_t 765 #define MSVCRT__wfinddata_t MSVCRT__wfinddata32_t 766 #define MSVCRT__wfinddatai64_t MSVCRT__wfinddata32i64_t 767 #define MSVCRT__stat MSVCRT__stat32 768 #define MSVCRT__stati64 MSVCRT__stat32i64 769 #endif 770 771 #define MSVCRT_WEOF (MSVCRT_wint_t)(0xFFFF) 772 #define MSVCRT_EOF (-1) 773 #define MSVCRT_TMP_MAX 0x7fff 774 #define MSVCRT_TMP_MAX_S 0x7fffffff 775 #define MSVCRT_RAND_MAX 0x7fff 776 #define MSVCRT_BUFSIZ 512 777 778 #define MSVCRT_SEEK_SET 0 779 #define MSVCRT_SEEK_CUR 1 780 #define MSVCRT_SEEK_END 2 781 782 #define MSVCRT_NO_CONSOLE_FD (-2) 783 #define MSVCRT_NO_CONSOLE ((HANDLE)MSVCRT_NO_CONSOLE_FD) 784 785 #define MSVCRT_STDIN_FILENO 0 786 #define MSVCRT_STDOUT_FILENO 1 787 #define MSVCRT_STDERR_FILENO 2 788 789 /* more file._flag flags, but these conflict with Unix */ 790 #define MSVCRT__IOFBF 0x0000 791 #define MSVCRT__IONBF 0x0004 792 #define MSVCRT__IOLBF 0x0040 793 794 #define MSVCRT_FILENAME_MAX 260 795 #define MSVCRT_DRIVE_MAX 3 796 #define MSVCRT_FNAME_MAX 256 797 #define MSVCRT_DIR_MAX 256 798 #define MSVCRT_EXT_MAX 256 799 #define MSVCRT_PATH_MAX 260 800 #define MSVCRT_stdin (MSVCRT__iob+MSVCRT_STDIN_FILENO) 801 #define MSVCRT_stdout (MSVCRT__iob+MSVCRT_STDOUT_FILENO) 802 #define MSVCRT_stderr (MSVCRT__iob+MSVCRT_STDERR_FILENO) 803 804 #define MSVCRT__P_WAIT 0 805 #define MSVCRT__P_NOWAIT 1 806 #define MSVCRT__P_OVERLAY 2 807 #define MSVCRT__P_NOWAITO 3 808 #define MSVCRT__P_DETACH 4 809 810 #define MSVCRT_EPERM 1 811 #define MSVCRT_ENOENT 2 812 #define MSVCRT_ESRCH 3 813 #define MSVCRT_EINTR 4 814 #define MSVCRT_EIO 5 815 #define MSVCRT_ENXIO 6 816 #define MSVCRT_E2BIG 7 817 #define MSVCRT_ENOEXEC 8 818 #define MSVCRT_EBADF 9 819 #define MSVCRT_ECHILD 10 820 #define MSVCRT_EAGAIN 11 821 #define MSVCRT_ENOMEM 12 822 #define MSVCRT_EACCES 13 823 #define MSVCRT_EFAULT 14 824 #define MSVCRT_EBUSY 16 825 #define MSVCRT_EEXIST 17 826 #define MSVCRT_EXDEV 18 827 #define MSVCRT_ENODEV 19 828 #define MSVCRT_ENOTDIR 20 829 #define MSVCRT_EISDIR 21 830 #define MSVCRT_EINVAL 22 831 #define MSVCRT_ENFILE 23 832 #define MSVCRT_EMFILE 24 833 #define MSVCRT_ENOTTY 25 834 #define MSVCRT_EFBIG 27 835 #define MSVCRT_ENOSPC 28 836 #define MSVCRT_ESPIPE 29 837 #define MSVCRT_EROFS 30 838 #define MSVCRT_EMLINK 31 839 #define MSVCRT_EPIPE 32 840 #define MSVCRT_EDOM 33 841 #define MSVCRT_ERANGE 34 842 #define MSVCRT_EDEADLK 36 843 #define MSVCRT_EDEADLOCK MSVCRT_EDEADLK 844 #define MSVCRT_ENAMETOOLONG 38 845 #define MSVCRT_ENOLCK 39 846 #define MSVCRT_ENOSYS 40 847 #define MSVCRT_ENOTEMPTY 41 848 #define MSVCRT_EILSEQ 42 849 #define MSVCRT_STRUNCATE 80 850 851 #define MSVCRT_LC_ALL 0 852 #define MSVCRT_LC_COLLATE 1 853 #define MSVCRT_LC_CTYPE 2 854 #define MSVCRT_LC_MONETARY 3 855 #define MSVCRT_LC_NUMERIC 4 856 #define MSVCRT_LC_TIME 5 857 #define MSVCRT_LC_MIN MSVCRT_LC_ALL 858 #define MSVCRT_LC_MAX MSVCRT_LC_TIME 859 860 #define MSVCRT__HEAPEMPTY -1 861 #define MSVCRT__HEAPOK -2 862 #define MSVCRT__HEAPBADBEGIN -3 863 #define MSVCRT__HEAPBADNODE -4 864 #define MSVCRT__HEAPEND -5 865 #define MSVCRT__HEAPBADPTR -6 866 867 #define MSVCRT__FREEENTRY 0 868 #define MSVCRT__USEDENTRY 1 869 870 #define MSVCRT__OUT_TO_DEFAULT 0 871 #define MSVCRT__OUT_TO_STDERR 1 872 #define MSVCRT__OUT_TO_MSGBOX 2 873 #define MSVCRT__REPORT_ERRMODE 3 874 875 /* ASCII char classification table - binary compatible */ 876 #define MSVCRT__UPPER 0x0001 /* C1_UPPER */ 877 #define MSVCRT__LOWER 0x0002 /* C1_LOWER */ 878 #define MSVCRT__DIGIT 0x0004 /* C1_DIGIT */ 879 #define MSVCRT__SPACE 0x0008 /* C1_SPACE */ 880 #define MSVCRT__PUNCT 0x0010 /* C1_PUNCT */ 881 #define MSVCRT__CONTROL 0x0020 /* C1_CNTRL */ 882 #define MSVCRT__BLANK 0x0040 /* C1_BLANK */ 883 #define MSVCRT__HEX 0x0080 /* C1_XDIGIT */ 884 #define MSVCRT__LEADBYTE 0x8000 885 #define MSVCRT__ALPHA (0x0100|MSVCRT__UPPER|MSVCRT__LOWER) /* (C1_ALPHA|_UPPER|_LOWER) */ 886 887 #define MSVCRT__IOREAD 0x0001 888 #define MSVCRT__IOWRT 0x0002 889 #define MSVCRT__IOMYBUF 0x0008 890 #define MSVCRT__IOEOF 0x0010 891 #define MSVCRT__IOERR 0x0020 892 #define MSVCRT__IOSTRG 0x0040 893 #define MSVCRT__IORW 0x0080 894 #define MSVCRT__USERBUF 0x0100 895 #define MSVCRT__IOCOMMIT 0x4000 896 897 #define MSVCRT__S_IEXEC 0x0040 898 #define MSVCRT__S_IWRITE 0x0080 899 #define MSVCRT__S_IREAD 0x0100 900 #define MSVCRT__S_IFIFO 0x1000 901 #define MSVCRT__S_IFCHR 0x2000 902 #define MSVCRT__S_IFDIR 0x4000 903 #define MSVCRT__S_IFREG 0x8000 904 #define MSVCRT__S_IFMT 0xF000 905 906 #define MSVCRT__LK_UNLCK 0 907 #define MSVCRT__LK_LOCK 1 908 #define MSVCRT__LK_NBLCK 2 909 #define MSVCRT__LK_RLCK 3 910 #define MSVCRT__LK_NBRLCK 4 911 912 #define MSVCRT__SH_COMPAT 0x00 /* Compatibility */ 913 #define MSVCRT__SH_DENYRW 0x10 /* Deny read/write */ 914 #define MSVCRT__SH_DENYWR 0x20 /* Deny write */ 915 #define MSVCRT__SH_DENYRD 0x30 /* Deny read */ 916 #define MSVCRT__SH_DENYNO 0x40 /* Deny nothing */ 917 918 #define MSVCRT__O_RDONLY 0 919 #define MSVCRT__O_WRONLY 1 920 #define MSVCRT__O_RDWR 2 921 #define MSVCRT__O_ACCMODE (MSVCRT__O_RDONLY|MSVCRT__O_WRONLY|MSVCRT__O_RDWR) 922 #define MSVCRT__O_APPEND 0x0008 923 #define MSVCRT__O_RANDOM 0x0010 924 #define MSVCRT__O_SEQUENTIAL 0x0020 925 #define MSVCRT__O_TEMPORARY 0x0040 926 #define MSVCRT__O_NOINHERIT 0x0080 927 #define MSVCRT__O_CREAT 0x0100 928 #define MSVCRT__O_TRUNC 0x0200 929 #define MSVCRT__O_EXCL 0x0400 930 #define MSVCRT__O_SHORT_LIVED 0x1000 931 #define MSVCRT__O_TEXT 0x4000 932 #define MSVCRT__O_BINARY 0x8000 933 #define MSVCRT__O_RAW MSVCRT__O_BINARY 934 #define MSVCRT__O_WTEXT 0x10000 935 #define MSVCRT__O_U16TEXT 0x20000 936 #define MSVCRT__O_U8TEXT 0x40000 937 938 /* _statusfp bit flags */ 939 #define MSVCRT__SW_INEXACT 0x00000001 /* inexact (precision) */ 940 #define MSVCRT__SW_UNDERFLOW 0x00000002 /* underflow */ 941 #define MSVCRT__SW_OVERFLOW 0x00000004 /* overflow */ 942 #define MSVCRT__SW_ZERODIVIDE 0x00000008 /* zero divide */ 943 #define MSVCRT__SW_INVALID 0x00000010 /* invalid */ 944 945 #define MSVCRT__SW_UNEMULATED 0x00000040 /* unemulated instruction */ 946 #define MSVCRT__SW_SQRTNEG 0x00000080 /* square root of a neg number */ 947 #define MSVCRT__SW_STACKOVERFLOW 0x00000200 /* FP stack overflow */ 948 #define MSVCRT__SW_STACKUNDERFLOW 0x00000400 /* FP stack underflow */ 949 950 #define MSVCRT__SW_DENORMAL 0x00080000 /* denormal status bit */ 951 952 /* fpclass constants */ 953 #define MSVCRT__FPCLASS_SNAN 0x0001 /* Signaling "Not a Number" */ 954 #define MSVCRT__FPCLASS_QNAN 0x0002 /* Quiet "Not a Number" */ 955 #define MSVCRT__FPCLASS_NINF 0x0004 /* Negative Infinity */ 956 #define MSVCRT__FPCLASS_NN 0x0008 /* Negative Normal */ 957 #define MSVCRT__FPCLASS_ND 0x0010 /* Negative Denormal */ 958 #define MSVCRT__FPCLASS_NZ 0x0020 /* Negative Zero */ 959 #define MSVCRT__FPCLASS_PZ 0x0040 /* Positive Zero */ 960 #define MSVCRT__FPCLASS_PD 0x0080 /* Positive Denormal */ 961 #define MSVCRT__FPCLASS_PN 0x0100 /* Positive Normal */ 962 #define MSVCRT__FPCLASS_PINF 0x0200 /* Positive Infinity */ 963 964 /* fpclassify constants */ 965 #define MSVCRT_FP_INFINITE 1 966 #define MSVCRT_FP_NAN 2 967 #define MSVCRT_FP_NORMAL -1 968 #define MSVCRT_FP_SUBNORMAL -2 969 #define MSVCRT_FP_ZERO 0 970 971 #define MSVCRT__MCW_EM 0x0008001f 972 #define MSVCRT__MCW_IC 0x00040000 973 #define MSVCRT__MCW_RC 0x00000300 974 #define MSVCRT__MCW_PC 0x00030000 975 #define MSVCRT__MCW_DN 0x03000000 976 977 #define MSVCRT__EM_INVALID 0x00000010 978 #define MSVCRT__EM_DENORMAL 0x00080000 979 #define MSVCRT__EM_ZERODIVIDE 0x00000008 980 #define MSVCRT__EM_OVERFLOW 0x00000004 981 #define MSVCRT__EM_UNDERFLOW 0x00000002 982 #define MSVCRT__EM_INEXACT 0x00000001 983 #define MSVCRT__IC_AFFINE 0x00040000 984 #define MSVCRT__IC_PROJECTIVE 0x00000000 985 #define MSVCRT__RC_CHOP 0x00000300 986 #define MSVCRT__RC_UP 0x00000200 987 #define MSVCRT__RC_DOWN 0x00000100 988 #define MSVCRT__RC_NEAR 0x00000000 989 #define MSVCRT__PC_24 0x00020000 990 #define MSVCRT__PC_53 0x00010000 991 #define MSVCRT__PC_64 0x00000000 992 #define MSVCRT__DN_SAVE 0x00000000 993 #define MSVCRT__DN_FLUSH 0x01000000 994 #define MSVCRT__DN_FLUSH_OPERANDS_SAVE_RESULTS 0x02000000 995 #define MSVCRT__DN_SAVE_OPERANDS_FLUSH_RESULTS 0x03000000 996 #define MSVCRT__EM_AMBIGUOUS 0x80000000 997 998 typedef struct 999 { 1000 unsigned int control; 1001 unsigned int status; 1002 } MSVCRT_fenv_t; 1003 1004 #define MSVCRT_CLOCKS_PER_SEC 1000 1005 1006 /* signals */ 1007 #define MSVCRT_SIGINT 2 1008 #define MSVCRT_SIGILL 4 1009 #define MSVCRT_SIGFPE 8 1010 #define MSVCRT_SIGSEGV 11 1011 #define MSVCRT_SIGTERM 15 1012 #define MSVCRT_SIGBREAK 21 1013 #define MSVCRT_SIGABRT 22 1014 #define MSVCRT_NSIG (MSVCRT_SIGABRT + 1) 1015 1016 typedef void (__cdecl *MSVCRT___sighandler_t)(int); 1017 1018 #define MSVCRT_SIG_DFL ((MSVCRT___sighandler_t)0) 1019 #define MSVCRT_SIG_IGN ((MSVCRT___sighandler_t)1) 1020 #define MSVCRT_SIG_ERR ((MSVCRT___sighandler_t)-1) 1021 1022 #define MSVCRT__FPE_INVALID 0x81 1023 #define MSVCRT__FPE_DENORMAL 0x82 1024 #define MSVCRT__FPE_ZERODIVIDE 0x83 1025 #define MSVCRT__FPE_OVERFLOW 0x84 1026 #define MSVCRT__FPE_UNDERFLOW 0x85 1027 #define MSVCRT__FPE_INEXACT 0x86 1028 #define MSVCRT__FPE_UNEMULATED 0x87 1029 #define MSVCRT__FPE_SQRTNEG 0x88 1030 #define MSVCRT__FPE_STACKOVERFLOW 0x8a 1031 #define MSVCRT__FPE_STACKUNDERFLOW 0x8b 1032 #define MSVCRT__FPE_EXPLICITGEN 0x8c 1033 1034 #define _MS 0x01 1035 #define _MP 0x02 1036 #define _M1 0x04 1037 #define _M2 0x08 1038 1039 #define _SBUP 0x10 1040 #define _SBLOW 0x20 1041 1042 #define _MBC_SINGLE 0 1043 #define _MBC_LEAD 1 1044 #define _MBC_TRAIL 2 1045 #define _MBC_ILLEGAL -1 1046 1047 #define _MB_CP_SBCS 0 1048 #define _MB_CP_OEM -2 1049 #define _MB_CP_ANSI -3 1050 #define _MB_CP_LOCALE -4 1051 1052 #define MSVCRT__TRUNCATE ((MSVCRT_size_t)-1) 1053 1054 #define _MAX__TIME64_T (((MSVCRT___time64_t)0x00000007 << 32) | 0x93406FFF) 1055 1056 /* _set_abort_behavior codes */ 1057 #define MSVCRT__WRITE_ABORT_MSG 1 1058 #define MSVCRT__CALL_REPORTFAULT 2 1059 1060 /* _get_output_format return code */ 1061 #define MSVCRT__TWO_DIGIT_EXPONENT 0x1 1062 1063 #define MSVCRT__NLSCMPERROR ((unsigned int)0x7fffffff) 1064 1065 void __cdecl MSVCRT_free(void*); 1066 void* __cdecl MSVCRT_malloc(MSVCRT_size_t); 1067 void* __cdecl MSVCRT_calloc(MSVCRT_size_t,MSVCRT_size_t); 1068 void* __cdecl MSVCRT_realloc(void*,MSVCRT_size_t); 1069 1070 int __cdecl MSVCRT_iswalpha(MSVCRT_wint_t); 1071 int __cdecl MSVCRT_iswspace(MSVCRT_wint_t); 1072 int __cdecl MSVCRT_iswdigit(MSVCRT_wint_t); 1073 int __cdecl MSVCRT_isleadbyte(int); 1074 int __cdecl MSVCRT__isleadbyte_l(int, MSVCRT__locale_t); 1075 int __cdecl MSVCRT__isspace_l(int, MSVCRT__locale_t); 1076 int __cdecl MSVCRT__iswspace_l(MSVCRT_wchar_t, MSVCRT__locale_t); 1077 1078 void __cdecl MSVCRT__lock_file(MSVCRT_FILE*); 1079 void __cdecl MSVCRT__unlock_file(MSVCRT_FILE*); 1080 int __cdecl MSVCRT_fgetc(MSVCRT_FILE*); 1081 int __cdecl MSVCRT__fgetc_nolock(MSVCRT_FILE*); 1082 int __cdecl MSVCRT__fputc_nolock(int,MSVCRT_FILE*); 1083 int __cdecl MSVCRT_ungetc(int,MSVCRT_FILE*); 1084 int __cdecl MSVCRT__ungetc_nolock(int,MSVCRT_FILE*); 1085 MSVCRT_wint_t __cdecl MSVCRT_fgetwc(MSVCRT_FILE*); 1086 MSVCRT_wint_t __cdecl MSVCRT__fgetwc_nolock(MSVCRT_FILE*); 1087 MSVCRT_wint_t __cdecl MSVCRT__fputwc_nolock(MSVCRT_wint_t,MSVCRT_FILE*); 1088 MSVCRT_wint_t __cdecl MSVCRT_ungetwc(MSVCRT_wint_t,MSVCRT_FILE*); 1089 MSVCRT_wint_t __cdecl MSVCRT__ungetwc_nolock(MSVCRT_wint_t, MSVCRT_FILE*); 1090 int __cdecl MSVCRT__fseeki64_nolock(MSVCRT_FILE*,__int64,int); 1091 __int64 __cdecl MSVCRT__ftelli64(MSVCRT_FILE* file); 1092 __int64 __cdecl MSVCRT__ftelli64_nolock(MSVCRT_FILE*); 1093 void __cdecl MSVCRT__exit(int); 1094 void __cdecl MSVCRT_abort(void); 1095 MSVCRT_ulong* __cdecl MSVCRT___doserrno(void); 1096 int* __cdecl MSVCRT__errno(void); 1097 char* __cdecl MSVCRT_getenv(const char*); 1098 MSVCRT_size_t __cdecl MSVCRT__fread_nolock(void*,MSVCRT_size_t,MSVCRT_size_t,MSVCRT_FILE*); 1099 MSVCRT_size_t __cdecl MSVCRT__fread_nolock_s(void*,MSVCRT_size_t,MSVCRT_size_t,MSVCRT_size_t,MSVCRT_FILE*); 1100 MSVCRT_size_t __cdecl MSVCRT__fwrite_nolock(const void*,MSVCRT_size_t,MSVCRT_size_t,MSVCRT_FILE*); 1101 int __cdecl MSVCRT_fclose(MSVCRT_FILE*); 1102 int __cdecl MSVCRT__fclose_nolock(MSVCRT_FILE*); 1103 int __cdecl MSVCRT__fflush_nolock(MSVCRT_FILE*); 1104 void __cdecl MSVCRT_terminate(void); 1105 MSVCRT_FILE* __cdecl MSVCRT__iob_func(void); 1106 MSVCRT_clock_t __cdecl MSVCRT_clock(void); 1107 MSVCRT___time32_t __cdecl MSVCRT__time32(MSVCRT___time32_t*); 1108 MSVCRT___time64_t __cdecl MSVCRT__time64(MSVCRT___time64_t*); 1109 MSVCRT_FILE* __cdecl MSVCRT__fdopen(int, const char *); 1110 MSVCRT_FILE* __cdecl MSVCRT__wfdopen(int, const MSVCRT_wchar_t *); 1111 int __cdecl MSVCRT_vsnprintf(char *str, MSVCRT_size_t len, const char *format, __ms_va_list valist); 1112 int __cdecl MSVCRT_vsnwprintf(MSVCRT_wchar_t *str, MSVCRT_size_t len, 1113 const MSVCRT_wchar_t *format, __ms_va_list valist ); 1114 int WINAPIV MSVCRT__snwprintf(MSVCRT_wchar_t*, unsigned int, const MSVCRT_wchar_t*, ...); 1115 int WINAPIV MSVCRT_sprintf(char*,const char*,...); 1116 int WINAPIV MSVCRT__snprintf(char*,unsigned int,const char*,...); 1117 int WINAPIV MSVCRT__scprintf(const char*,...); 1118 int __cdecl MSVCRT_raise(int sig); 1119 int __cdecl MSVCRT__set_printf_count_output(int); 1120 1121 #define MSVCRT__ENABLE_PER_THREAD_LOCALE 1 1122 #define MSVCRT__DISABLE_PER_THREAD_LOCALE 2 1123 1124 extern MSVCRT__locale_t MSVCRT_locale; 1125 MSVCRT_pthreadlocinfo get_locinfo(void) DECLSPEC_HIDDEN; 1126 MSVCRT_pthreadmbcinfo get_mbcinfo(void) DECLSPEC_HIDDEN; 1127 void __cdecl MSVCRT__free_locale(MSVCRT__locale_t); 1128 void free_locinfo(MSVCRT_pthreadlocinfo) DECLSPEC_HIDDEN; 1129 void free_mbcinfo(MSVCRT_pthreadmbcinfo) DECLSPEC_HIDDEN; 1130 int _setmbcp_l(int, LCID, MSVCRT_pthreadmbcinfo) DECLSPEC_HIDDEN; 1131 1132 #ifndef __WINE_MSVCRT_TEST 1133 int __cdecl MSVCRT__write(int,const void*,unsigned int); 1134 int __cdecl _getch(void); 1135 int __cdecl _ismbblead(unsigned int); 1136 int __cdecl _ismbblead_l(unsigned int, MSVCRT__locale_t); 1137 int __cdecl _ismbclegal(unsigned int c); 1138 int __cdecl _ismbstrail(const unsigned char* start, const unsigned char* str); 1139 int __cdecl MSVCRT_mbtowc(MSVCRT_wchar_t*,const char*,MSVCRT_size_t); 1140 int __cdecl MSVCRT_mbtowc_l(MSVCRT_wchar_t*,const char*,MSVCRT_size_t,MSVCRT__locale_t); 1141 MSVCRT_size_t __cdecl MSVCRT_mbstowcs(MSVCRT_wchar_t*,const char*,MSVCRT_size_t); 1142 MSVCRT_size_t __cdecl MSVCRT__mbstowcs_l(MSVCRT_wchar_t*, const char*, MSVCRT_size_t, MSVCRT__locale_t); 1143 int __cdecl MSVCRT__mbstowcs_s_l(MSVCRT_size_t*, MSVCRT_wchar_t*, 1144 MSVCRT_size_t, const char*, MSVCRT_size_t, MSVCRT__locale_t); 1145 MSVCRT_size_t __cdecl MSVCRT_wcstombs(char*,const MSVCRT_wchar_t*,MSVCRT_size_t); 1146 MSVCRT_size_t __cdecl MSVCRT__wcstombs_l(char*, const MSVCRT_wchar_t*, MSVCRT_size_t, MSVCRT__locale_t); 1147 MSVCRT_intptr_t __cdecl MSVCRT__spawnve(int,const char*,const char* const *,const char* const *); 1148 MSVCRT_intptr_t __cdecl MSVRT__spawnvpe(int,const char*,const char* const *,const char* const *); 1149 MSVCRT_intptr_t __cdecl MSVCRT__wspawnve(int,const MSVCRT_wchar_t*,const MSVCRT_wchar_t* const *,const MSVCRT_wchar_t* const *); 1150 MSVCRT_intptr_t __cdecl MSVCRT__wspawnvpe(int,const MSVCRT_wchar_t*,const MSVCRT_wchar_t* const *,const MSVCRT_wchar_t* const *); 1151 void __cdecl MSVCRT__searchenv(const char*,const char*,char*); 1152 int __cdecl MSVCRT__getdrive(void); 1153 char* __cdecl MSVCRT__strdup(const char*); 1154 char* __cdecl MSVCRT__strnset(char*,int,MSVCRT_size_t); 1155 char* __cdecl _strset(char*,int); 1156 int __cdecl _ungetch(int); 1157 int __cdecl _cputs(const char*); 1158 int WINAPIV _cprintf(const char*,...); 1159 int WINAPIV _cwprintf(const MSVCRT_wchar_t*,...); 1160 char*** __cdecl MSVCRT___p__environ(void); 1161 int* __cdecl __p___mb_cur_max(void); 1162 int* __cdecl MSVCRT___p__fmode(void); 1163 MSVCRT_wchar_t* __cdecl MSVCRT__wcsdup(const MSVCRT_wchar_t*); 1164 MSVCRT_size_t __cdecl MSVCRT_strnlen(const char *,MSVCRT_size_t); 1165 MSVCRT_size_t __cdecl MSVCRT_wcsnlen(const MSVCRT_wchar_t*,MSVCRT_size_t); 1166 MSVCRT_wchar_t*** __cdecl MSVCRT___p__wenviron(void); 1167 INT __cdecl MSVCRT_wctomb(char*,MSVCRT_wchar_t); 1168 int __cdecl MSVCRT__wctomb_l(char*, MSVCRT_wchar_t, MSVCRT__locale_t); 1169 char* __cdecl MSVCRT__strdate(char* date); 1170 char* __cdecl MSVCRT__strtime(char* date); 1171 int __cdecl _setmbcp(int); 1172 int __cdecl MSVCRT__close(int); 1173 int __cdecl MSVCRT__dup(int); 1174 int __cdecl MSVCRT__dup2(int, int); 1175 int __cdecl MSVCRT__pipe(int *, unsigned int, int); 1176 MSVCRT_wchar_t* __cdecl MSVCRT__wgetenv(const MSVCRT_wchar_t*); 1177 void __cdecl MSVCRT__wsearchenv(const MSVCRT_wchar_t*, const MSVCRT_wchar_t*, MSVCRT_wchar_t*); 1178 MSVCRT_intptr_t __cdecl MSVCRT__spawnvpe(int, const char*, const char* const*, const char* const*); 1179 void __cdecl MSVCRT__invalid_parameter(const MSVCRT_wchar_t *expr, const MSVCRT_wchar_t *func, 1180 const MSVCRT_wchar_t *file, unsigned int line, MSVCRT_uintptr_t arg); 1181 int __cdecl MSVCRT__toupper_l(int,MSVCRT__locale_t); 1182 int __cdecl MSVCRT__tolower_l(int,MSVCRT__locale_t); 1183 int __cdecl MSVCRT__towupper_l(MSVCRT_wint_t,MSVCRT__locale_t); 1184 int __cdecl MSVCRT__towlower_l(MSVCRT_wint_t,MSVCRT__locale_t); 1185 int __cdecl MSVCRT__toupper(int); /* only use on lower-case ASCII characters */ 1186 int __cdecl MSVCRT__stricmp(const char*, const char*); 1187 int __cdecl MSVCRT__strnicmp(const char*, const char*, MSVCRT_size_t); 1188 int __cdecl MSVCRT__strnicoll_l(const char*, const char*, MSVCRT_size_t, MSVCRT__locale_t); 1189 int __cdecl MSVCRT__strncoll_l(const char*, const char*, MSVCRT_size_t, MSVCRT__locale_t); 1190 int __cdecl MSVCRT_strncmp(const char*, const char*, MSVCRT_size_t); 1191 int __cdecl MSVCRT_strcmp(const char*, const char*); 1192 char* __cdecl MSVCRT_strstr(const char*, const char*); 1193 unsigned int __cdecl MSVCRT__get_output_format(void); 1194 char* __cdecl MSVCRT_strtok_s(char*, const char*, char**); 1195 double parse_double(MSVCRT_wchar_t (*)(void*), void (*)(void*), void*, MSVCRT_pthreadlocinfo, int*); 1196 1197 /* Maybe one day we'll enable the invalid parameter handlers with the full set of information (msvcrXXd) 1198 * #define MSVCRT_INVALID_PMT(x) MSVCRT_call_invalid_parameter_handler(x, __FUNCTION__, __FILE__, __LINE__, 0) 1199 * #define MSVCRT_CHECK_PMT(x) ((x) ? TRUE : MSVCRT_INVALID_PMT(#x),FALSE) 1200 * Until this is done, just keep the same semantics for CHECK_PMT(), but without generating / sending 1201 * any information 1202 * NB : MSVCRT_call_invalid_parameter_handler is a wrapper around MSVCRT__invalid_parameter in order 1203 * to do the Ansi to Unicode transformation 1204 */ 1205 #define MSVCRT_INVALID_PMT(x,err) (*MSVCRT__errno() = (err), MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0)) 1206 #define MSVCRT_CHECK_PMT_ERR(x,err) ((x) || (MSVCRT_INVALID_PMT( 0, (err) ), FALSE)) 1207 #define MSVCRT_CHECK_PMT(x) MSVCRT_CHECK_PMT_ERR((x), MSVCRT_EINVAL) 1208 #endif 1209 1210 #define MSVCRT__ARGMAX 100 1211 typedef int (*puts_clbk_a)(void*, int, const char*); 1212 typedef int (*puts_clbk_w)(void*, int, const MSVCRT_wchar_t*); 1213 typedef union _printf_arg 1214 { 1215 void *get_ptr; 1216 int get_int; 1217 LONGLONG get_longlong; 1218 double get_double; 1219 } printf_arg; 1220 typedef printf_arg (*args_clbk)(void*, int, int, __ms_va_list*); 1221 int pf_printf_a(puts_clbk_a, void*, const char*, MSVCRT__locale_t, 1222 DWORD, args_clbk, void*, __ms_va_list*) DECLSPEC_HIDDEN; 1223 int pf_printf_w(puts_clbk_w, void*, const MSVCRT_wchar_t*, MSVCRT__locale_t, 1224 DWORD, args_clbk, void*, __ms_va_list*) DECLSPEC_HIDDEN; 1225 int create_positional_ctx_a(void*, const char*, __ms_va_list) DECLSPEC_HIDDEN; 1226 int create_positional_ctx_w(void*, const MSVCRT_wchar_t*, __ms_va_list) DECLSPEC_HIDDEN; 1227 printf_arg arg_clbk_valist(void*, int, int, __ms_va_list*) DECLSPEC_HIDDEN; 1228 printf_arg arg_clbk_positional(void*, int, int, __ms_va_list*) DECLSPEC_HIDDEN; 1229 1230 #define MSVCRT_FLT_MIN 1.175494351e-38F 1231 #define MSVCRT_DBL_MIN 2.2250738585072014e-308 1232 #define MSVCRT__OVERFLOW 3 1233 #define MSVCRT__UNDERFLOW 4 1234 1235 #define MSVCRT_FP_ILOGB0 (-MSVCRT_INT_MAX - 1) 1236 #define MSVCRT_FP_ILOGBNAN MSVCRT_INT_MAX 1237 1238 typedef struct 1239 { 1240 float f; 1241 } MSVCRT__CRT_FLOAT; 1242 1243 typedef struct 1244 { 1245 double x; 1246 } MSVCRT__CRT_DOUBLE; 1247 1248 extern char* __cdecl __unDName(char *,const char*,int,malloc_func_t,free_func_t,unsigned short int); 1249 1250 /* __unDName/__unDNameEx flags */ 1251 #define UNDNAME_COMPLETE (0x0000) 1252 #define UNDNAME_NO_LEADING_UNDERSCORES (0x0001) /* Don't show __ in calling convention */ 1253 #define UNDNAME_NO_MS_KEYWORDS (0x0002) /* Don't show calling convention at all */ 1254 #define UNDNAME_NO_FUNCTION_RETURNS (0x0004) /* Don't show function/method return value */ 1255 #define UNDNAME_NO_ALLOCATION_MODEL (0x0008) 1256 #define UNDNAME_NO_ALLOCATION_LANGUAGE (0x0010) 1257 #define UNDNAME_NO_MS_THISTYPE (0x0020) 1258 #define UNDNAME_NO_CV_THISTYPE (0x0040) 1259 #define UNDNAME_NO_THISTYPE (0x0060) 1260 #define UNDNAME_NO_ACCESS_SPECIFIERS (0x0080) /* Don't show access specifier (public/protected/private) */ 1261 #define UNDNAME_NO_THROW_SIGNATURES (0x0100) 1262 #define UNDNAME_NO_MEMBER_TYPE (0x0200) /* Don't show static/virtual specifier */ 1263 #define UNDNAME_NO_RETURN_UDT_MODEL (0x0400) 1264 #define UNDNAME_32_BIT_DECODE (0x0800) 1265 #define UNDNAME_NAME_ONLY (0x1000) /* Only report the variable/method name */ 1266 #define UNDNAME_NO_ARGUMENTS (0x2000) /* Don't show method arguments */ 1267 #define UNDNAME_NO_SPECIAL_SYMS (0x4000) 1268 #define UNDNAME_NO_COMPLEX_TYPE (0x8000) 1269 1270 #define UCRTBASE_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION (0x0001) 1271 #define UCRTBASE_PRINTF_STANDARD_SNPRINTF_BEHAVIOUR (0x0002) 1272 #define UCRTBASE_PRINTF_LEGACY_WIDE_SPECIFIERS (0x0004) 1273 #define UCRTBASE_PRINTF_LEGACY_MSVCRT_COMPATIBILITY (0x0008) 1274 #define UCRTBASE_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS (0x0010) 1275 1276 #define UCRTBASE_PRINTF_MASK (0x001F) 1277 1278 #define MSVCRT_PRINTF_POSITIONAL_PARAMS (0x0100) 1279 #define MSVCRT_PRINTF_INVOKE_INVALID_PARAM_HANDLER (0x0200) 1280 1281 #define UCRTBASE_SCANF_SECURECRT (0x0001) 1282 #define UCRTBASE_SCANF_LEGACY_WIDE_SPECIFIERS (0x0002) 1283 #define UCRTBASE_SCANF_LEGACY_MSVCRT_COMPATIBILITY (0x0004) 1284 1285 #define UCRTBASE_SCANF_MASK (0x0007) 1286 1287 #define COOPERATIVE_TIMEOUT_INFINITE ((unsigned int)-1) 1288 #define COOPERATIVE_WAIT_TIMEOUT ~0 1289 1290 typedef enum { 1291 _FpCodeUnspecified, 1292 _FpCodeAdd, 1293 _FpCodeSubtract, 1294 _FpCodeMultiply, 1295 _FpCodeDivide, 1296 _FpCodeSquareRoot, 1297 _FpCodeRemainder, 1298 _FpCodeCompare, 1299 _FpCodeConvert, 1300 _FpCodeRound, 1301 _FpCodeTruncate, 1302 _FpCodeFloor, 1303 _FpCodeCeil, 1304 _FpCodeAcos, 1305 _FpCodeAsin, 1306 _FpCodeAtan, 1307 _FpCodeAtan2, 1308 _FpCodeCabs, 1309 _FpCodeCos, 1310 _FpCodeCosh, 1311 _FpCodeExp, 1312 _FpCodeFabs, 1313 _FpCodeFmod, 1314 _FpCodeFrexp, 1315 _FpCodeHypot, 1316 _FpCodeLdexp, 1317 _FpCodeLog, 1318 _FpCodeLog10, 1319 _FpCodeModf, 1320 _FpCodePow, 1321 _FpCodeSin, 1322 _FpCodeSinh, 1323 _FpCodeTan, 1324 _FpCodeTanh, 1325 _FpCodeY0, 1326 _FpCodeY1, 1327 _FpCodeYn, 1328 _FpCodeLogb, 1329 _FpCodeNextafter, 1330 _FpCodeNegate, 1331 _FpCodeFmin, 1332 _FpCodeFmax, 1333 _FpCodeConvertTrunc, 1334 _XMMIAddps, 1335 _XMMIAddss, 1336 _XMMISubps, 1337 _XMMISubss, 1338 _XMMIMulps, 1339 _XMMIMulss, 1340 _XMMIDivps, 1341 _XMMIDivss, 1342 _XMMISqrtps, 1343 _XMMISqrtss, 1344 _XMMIMaxps, 1345 _XMMIMaxss, 1346 _XMMIMinps, 1347 _XMMIMinss, 1348 _XMMICmpps, 1349 _XMMICmpss, 1350 _XMMIComiss, 1351 _XMMIUComiss, 1352 _XMMICvtpi2ps, 1353 _XMMICvtsi2ss, 1354 _XMMICvtps2pi, 1355 _XMMICvtss2si, 1356 _XMMICvttps2pi, 1357 _XMMICvttss2si, 1358 _XMMIAddsubps, 1359 _XMMIHaddps, 1360 _XMMIHsubps, 1361 _XMMI2Addpd, 1362 _XMMI2Addsd, 1363 _XMMI2Subpd, 1364 _XMMI2Subsd, 1365 _XMMI2Mulpd, 1366 _XMMI2Mulsd, 1367 _XMMI2Divpd, 1368 _XMMI2Divsd, 1369 _XMMI2Sqrtpd, 1370 _XMMI2Sqrtsd, 1371 _XMMI2Maxpd, 1372 _XMMI2Maxsd, 1373 _XMMI2Minpd, 1374 _XMMI2Minsd, 1375 _XMMI2Cmppd, 1376 _XMMI2Cmpsd, 1377 _XMMI2Comisd, 1378 _XMMI2UComisd, 1379 _XMMI2Cvtpd2pi, 1380 _XMMI2Cvtsd2si, 1381 _XMMI2Cvttpd2pi, 1382 _XMMI2Cvttsd2si, 1383 _XMMI2Cvtps2pd, 1384 _XMMI2Cvtss2sd, 1385 _XMMI2Cvtpd2ps, 1386 _XMMI2Cvtsd2ss, 1387 _XMMI2Cvtdq2ps, 1388 _XMMI2Cvttps2dq, 1389 _XMMI2Cvtps2dq, 1390 _XMMI2Cvttpd2dq, 1391 _XMMI2Cvtpd2dq, 1392 _XMMI2Addsubpd, 1393 _XMMI2Haddpd, 1394 _XMMI2Hsubpd, 1395 } _FP_OPERATION_CODE; 1396 1397 typedef enum { 1398 _FpFormatFp32, 1399 _FpFormatFp64, 1400 _FpFormatFp80, 1401 _FpFormatFp128, 1402 _FpFormatI16, 1403 _FpFormatI32, 1404 _FpFormatI64, 1405 _FpFormatU16, 1406 _FpFormatU32, 1407 _FpFormatU64, 1408 _FpFormatBcd80, 1409 _FpFormatCompare, 1410 _FpFormatString, 1411 } _FPIEEE_FORMAT; 1412 1413 typedef float _FP32; 1414 typedef double _FP64; 1415 typedef short _I16; 1416 typedef int _I32; 1417 typedef unsigned short _U16; 1418 typedef unsigned int _U32; 1419 typedef __int64 _Q64; 1420 1421 typedef struct { 1422 unsigned short W[5]; 1423 } _FP80; 1424 1425 typedef struct DECLSPEC_ALIGN(16) { 1426 MSVCRT_ulong W[4]; 1427 } _FP128; 1428 1429 typedef struct DECLSPEC_ALIGN(8) { 1430 MSVCRT_ulong W[2]; 1431 } _I64; 1432 1433 typedef struct DECLSPEC_ALIGN(8) { 1434 MSVCRT_ulong W[2]; 1435 } _U64; 1436 1437 typedef struct { 1438 unsigned short W[5]; 1439 } _BCD80; 1440 1441 typedef struct DECLSPEC_ALIGN(16) { 1442 _Q64 W[2]; 1443 } _FPQ64; 1444 1445 typedef struct { 1446 union { 1447 _FP32 Fp32Value; 1448 _FP64 Fp64Value; 1449 _FP80 Fp80Value; 1450 _FP128 Fp128Value; 1451 _I16 I16Value; 1452 _I32 I32Value; 1453 _I64 I64Value; 1454 _U16 U16Value; 1455 _U32 U32Value; 1456 _U64 U64Value; 1457 _BCD80 Bcd80Value; 1458 char *StringValue; 1459 int CompareValue; 1460 _Q64 Q64Value; 1461 _FPQ64 Fpq64Value; 1462 } Value; 1463 unsigned int OperandValid : 1; 1464 unsigned int Format : 4; 1465 } _FPIEEE_VALUE; 1466 1467 typedef struct { 1468 unsigned int Inexact : 1; 1469 unsigned int Underflow : 1; 1470 unsigned int Overflow : 1; 1471 unsigned int ZeroDivide : 1; 1472 unsigned int InvalidOperation : 1; 1473 } _FPIEEE_EXCEPTION_FLAGS; 1474 1475 typedef struct { 1476 unsigned int RoundingMode : 2; 1477 unsigned int Precision : 3; 1478 unsigned int Operation :12; 1479 _FPIEEE_EXCEPTION_FLAGS Cause; 1480 _FPIEEE_EXCEPTION_FLAGS Enable; 1481 _FPIEEE_EXCEPTION_FLAGS Status; 1482 _FPIEEE_VALUE Operand1; 1483 _FPIEEE_VALUE Operand2; 1484 _FPIEEE_VALUE Result; 1485 } _FPIEEE_RECORD, *_PFPIEEE_RECORD; 1486 1487 #define INHERIT_THREAD_PRIORITY 0xF000 1488 1489 #ifdef __REACTOS__ 1490 #define __wine_longjmp longjmp 1491 #define __wine_jmp_buf _JBTYPE 1492 1493 #ifdef _M_IX86 1494 // ASM wrapper for Wine code. See rosglue_i386.s for implementation. 1495 void 1496 WINAPI 1497 __wine__RtlUnwind( 1498 struct _EXCEPTION_REGISTRATION_RECORD* pEndFrame, 1499 PVOID targetIp, 1500 struct _EXCEPTION_RECORD* pRecord, 1501 PVOID retval); 1502 #define RtlUnwind __wine__RtlUnwind 1503 #endif /* _M_IX86 */ 1504 1505 #endif 1506 1507 #endif /* __WINE_MSVCRT_H */ 1508