1 2 #include <windef.h> 3 #include <stubs.h> 4 5 #undef UNIMPLEMENTED 6 #define UNIMPLEMENTED __wine_spec_unimplemented_stub("msvcrt.dll", __FUNCTION__) 7 8 int __get_app_type() 9 { 10 UNIMPLEMENTED; 11 return 0; 12 } 13 14 int _fileinfo = -1; 15 16 void * 17 __p__fileinfo() 18 { 19 return &_fileinfo; 20 } 21 22 unsigned char _mbcasemap[1]; 23 24 void * 25 __p__mbcasemap() 26 { 27 return _mbcasemap; 28 } 29 30 int _atodbl( 31 void * value, 32 char * str) 33 { 34 UNIMPLEMENTED; 35 return 0; 36 } 37 38 int _ismbbkprint( 39 unsigned int c) 40 { 41 UNIMPLEMENTED; 42 return 0; 43 } 44 45 size_t _heapused( size_t *pUsed, size_t *pCommit ) 46 { 47 UNIMPLEMENTED; 48 return( 0 ); 49 } 50 51 #ifdef _M_IX86 52 int MSVCRT__inp( 53 unsigned short port) 54 { 55 return _inp(port); 56 } 57 58 unsigned short MSVCRT__inpw( 59 unsigned short port) 60 { 61 return _inpw(port); 62 } 63 64 unsigned long MSVCRT__inpd( 65 unsigned short port) 66 { 67 return _inpd(port); 68 } 69 70 71 int MSVCRT__outp( 72 unsigned short port, 73 int databyte) 74 { 75 return _outp(port, databyte); 76 } 77 78 unsigned short MSVCRT__outpw( 79 unsigned short port, 80 unsigned short dataword) 81 { 82 return _outpw(port, dataword); 83 } 84 85 unsigned long MSVCRT__outpd( 86 unsigned short port, 87 unsigned long dataword) 88 { 89 return _outpd(port, dataword); 90 } 91 #endif 92 93 typedef struct __crt_locale_data_public 94 { 95 unsigned short const* _locale_pctype; 96 _Field_range_(1, 2) int _locale_mb_cur_max; 97 unsigned int _locale_lc_codepage; 98 } __crt_locale_data_public; 99 100 static 101 __crt_locale_data_public* 102 __CRTDECL 103 __acrt_get_locale_data_prefix( 104 void const volatile* const _LocalePointers) 105 { 106 _locale_t const _TypedLocalePointers = (_locale_t)_LocalePointers; 107 return (__crt_locale_data_public*)_TypedLocalePointers->locinfo; 108 } 109 110 static 111 int 112 __CRTDECL 113 __acrt_locale_get_ctype_array_value( 114 _In_reads_(_Char_value + 1) unsigned short const * const locale_pctype_array, 115 _In_range_(-1, 255) int const c, 116 _In_ int const mask 117 ) 118 { 119 if (c >= -1 && c <= 255) 120 { 121 return locale_pctype_array[c] & mask; 122 } 123 return 0; 124 } 125 126 const unsigned short* __cdecl __pctype_func(void); 127 128 #if defined _CRT_DISABLE_PERFCRIT_LOCKS && !defined _DLL 129 #define __PCTYPE_FUNC _pctype 130 #else 131 #define __PCTYPE_FUNC __pctype_func() 132 #endif 133 134 #ifdef _DEBUG 135 _ACRTIMP int __cdecl _chvalidator(_In_ int c, _In_ int mask); 136 #define __chvalidchk(a, b) _chvalidator(a, b) 137 #else 138 #define __chvalidchk(a, b) (__acrt_locale_get_ctype_array_value(__PCTYPE_FUNC, (a), (b))) 139 #endif 140 141 static 142 int 143 __CRTDECL 144 _chvalidchk_l( 145 _In_ int const c, 146 _In_ int const mask, 147 _In_opt_ _locale_t const locale 148 ) 149 { 150 #ifdef _DEBUG 151 return _chvalidator_l(locale, c, mask); 152 #else 153 if (locale) 154 { 155 return __acrt_locale_get_ctype_array_value(__acrt_get_locale_data_prefix(locale)->_locale_pctype, c, mask); 156 } 157 158 return __chvalidchk(c, mask); 159 #endif 160 } 161 162 static 163 int 164 __CRTDECL 165 _ischartype_l( 166 _In_ int const c, 167 _In_ int const mask, 168 _In_opt_ _locale_t const locale) 169 { 170 if (locale) 171 { 172 if (c >= -1 && c <= 255) 173 { 174 return __acrt_get_locale_data_prefix(locale)->_locale_pctype[c] & mask; 175 } 176 177 if (__acrt_get_locale_data_prefix(locale)->_locale_mb_cur_max > 1) 178 { 179 return _isctype_l(c, mask, locale); 180 } 181 182 return 0; // >0xFF and SBCS locale 183 } 184 185 return _chvalidchk_l(c, mask, 0); 186 } 187 188 //#undef _isalnum_l 189 _Check_return_ 190 _CRTIMP 191 int 192 __cdecl 193 _isalnum_l( 194 _In_ int c, 195 _In_opt_ _locale_t locale) 196 { 197 return _ischartype_l(c, _ALPHA | _DIGIT, locale); 198 } 199 200 #undef _isalpha_l 201 _Check_return_ 202 _CRTIMP 203 int 204 __cdecl 205 _isalpha_l( 206 _In_ int c, 207 _In_opt_ _locale_t locale) 208 { 209 return _ischartype_l(c, _ALPHA, locale); 210 } 211 212 #undef _iscntrl_l 213 _Check_return_ 214 _CRTIMP 215 int 216 __cdecl 217 _iscntrl_l( 218 _In_ int c, 219 _In_opt_ _locale_t locale) 220 { 221 return _ischartype_l(c, _CONTROL, locale); 222 } 223 224 #undef _isdigit_l 225 _Check_return_ 226 _CRTIMP 227 int 228 __cdecl 229 _isdigit_l( 230 _In_ int c, 231 _In_opt_ _locale_t locale) 232 { 233 return _ischartype_l(c, _DIGIT, locale); 234 } 235 236 #undef _isgraph_l 237 _Check_return_ 238 _CRTIMP 239 int 240 __cdecl 241 _isgraph_l( 242 _In_ int c, 243 _In_opt_ _locale_t locale) 244 { 245 return _ischartype_l(c, _PUNCT | _ALPHA | _DIGIT, locale); 246 } 247 248 #undef _islower_l 249 _Check_return_ 250 _CRTIMP 251 int 252 __cdecl 253 _islower_l( 254 _In_ int c, 255 _In_opt_ _locale_t locale) 256 { 257 return _ischartype_l(c, _LOWER, locale); 258 } 259 260 #undef _isprint_l 261 _Check_return_ 262 _CRTIMP 263 int 264 __cdecl 265 _isprint_l( 266 _In_ int c, 267 _In_opt_ _locale_t locale) 268 { 269 return _ischartype_l(c, _BLANK | _PUNCT | _ALPHA | _DIGIT, locale); 270 } 271 272 #undef _isspace_l 273 _Check_return_ 274 _CRTIMP 275 int 276 __cdecl 277 _isspace_l( 278 _In_ int c, 279 _In_opt_ _locale_t locale) 280 { 281 return _ischartype_l(c, _SPACE, locale); 282 } 283 284 #undef _isupper_l 285 _Check_return_ 286 _CRTIMP 287 int 288 __cdecl 289 _isupper_l( 290 _In_ int c, 291 _In_opt_ _locale_t locale) 292 { 293 return _ischartype_l(c, _UPPER, locale); 294 } 295 296 #undef _iswalnum_l 297 _Check_return_ 298 _CRTIMP 299 int 300 __cdecl 301 _iswalnum_l( 302 _In_ wint_t c, 303 _In_opt_ _locale_t locale) 304 { 305 return _iswctype_l(c, _ALPHA|_DIGIT, locale); 306 } 307 308 #undef _iswalpha_l 309 _Check_return_ 310 _CRTIMP 311 int 312 __cdecl 313 _iswalpha_l( 314 _In_ wint_t c, 315 _In_opt_ _locale_t locale) 316 { 317 return _iswctype_l(c, _ALPHA, locale); 318 } 319 320 #undef _iswcntrl_l 321 _Check_return_ 322 _CRTIMP 323 int 324 __cdecl 325 _iswcntrl_l( 326 _In_ wint_t c, 327 _In_opt_ _locale_t locale) 328 { 329 UNIMPLEMENTED; 330 return _iswctype_l(c, _CONTROL, locale); 331 } 332 333 _Check_return_ 334 _CRTIMP 335 int 336 __cdecl 337 _iswctype_l( 338 _In_ wint_t c, 339 _In_ wctype_t type, 340 _In_opt_ _locale_t locale) 341 { 342 UNIMPLEMENTED; 343 return 0; 344 } 345 346 #undef _iswdigit_l 347 _Check_return_ 348 _CRTIMP 349 int 350 __cdecl 351 _iswdigit_l( 352 _In_ wint_t c, 353 _In_opt_ _locale_t locale) 354 { 355 return _iswctype_l(c, _DIGIT, locale); 356 } 357 358 #undef _iswgraph_l 359 _Check_return_ 360 _CRTIMP 361 int 362 __cdecl 363 _iswgraph_l( 364 _In_ wint_t c, 365 _In_opt_ _locale_t locale) 366 { 367 return _iswctype_l(c, _PUNCT | _ALPHA | _DIGIT, locale); 368 } 369 370 #undef _iswlower_l 371 _Check_return_ 372 _CRTIMP 373 int 374 __cdecl 375 _iswlower_l( 376 _In_ wint_t c, 377 _In_opt_ _locale_t locale) 378 { 379 return _iswctype_l(c , _LOWER, locale); 380 } 381 382 #undef _iswprint_l 383 _Check_return_ 384 _CRTIMP 385 int 386 __cdecl 387 _iswprint_l( 388 _In_ wint_t c, 389 _In_opt_ _locale_t locale) 390 { 391 return _iswctype_l(c, _BLANK | _PUNCT | _ALPHA | _DIGIT, locale); 392 } 393 394 #undef _iswpunct_l 395 _Check_return_ 396 _CRTIMP 397 int 398 __cdecl 399 _iswpunct_l( 400 _In_ wint_t c, 401 _In_opt_ _locale_t locale) 402 { 403 return _iswctype_l(c, _PUNCT, locale); 404 } 405 406 #undef _iswspace_l 407 _Check_return_ 408 _CRTIMP 409 int 410 __cdecl 411 _iswspace_l( 412 _In_ wint_t c, 413 _In_opt_ _locale_t locale) 414 { 415 return _iswctype_l(c, _SPACE, locale); 416 } 417 418 #undef _iswupper_l 419 _Check_return_ 420 _CRTIMP 421 int 422 __cdecl 423 _iswupper_l( 424 _In_ wint_t c, 425 _In_opt_ _locale_t locale) 426 { 427 return _iswctype_l(c, _UPPER, locale); 428 } 429 430 #undef _iswxdigit_l 431 _Check_return_ 432 _CRTIMP 433 int 434 __cdecl 435 _iswxdigit_l( 436 _In_ wint_t c, 437 _In_opt_ _locale_t locale) 438 { 439 return _iswctype_l(c, _HEX, locale); 440 } 441 442 #undef _isxdigit_l 443 _Check_return_ 444 _CRTIMP 445 int 446 __cdecl 447 _isxdigit_l( 448 _In_ int c, 449 _In_opt_ _locale_t locale) 450 { 451 return _ischartype_l(c, _HEX, locale); 452 } 453 454 _Must_inspect_result_ 455 _CRTIMP 456 int 457 __cdecl 458 _memicmp_l( 459 _In_reads_bytes_opt_(size) const void *buf1, 460 _In_reads_bytes_opt_(size) const void *buf2, 461 _In_ size_t size, 462 _In_opt_ _locale_t locale) 463 { 464 UNIMPLEMENTED; 465 return 0; 466 } 467 468 _Check_return_ 469 _CRTIMP 470 int 471 __cdecl 472 _strcoll_l( 473 _In_z_ const char *str1, 474 _In_z_ const char *str2, 475 _In_opt_ _locale_t locale) 476 { 477 UNIMPLEMENTED; 478 return 0; 479 } 480 481 _Check_return_ 482 _CRTIMP 483 int 484 __cdecl 485 _stricmp_l( 486 _In_z_ const char *str1, 487 _In_z_ const char *str2, 488 _In_opt_ _locale_t locale) 489 { 490 UNIMPLEMENTED; 491 return 0; 492 } 493 494 _Check_return_ 495 _CRTIMP 496 int 497 __cdecl 498 _stricoll_l( 499 _In_z_ const char *str1, 500 _In_z_ const char *str2, 501 _In_opt_ _locale_t locale) 502 { 503 UNIMPLEMENTED; 504 return 0; 505 } 506 507 _Check_return_wat_ 508 _CRTIMP 509 errno_t 510 __cdecl 511 _strlwr_s( 512 _Inout_updates_z_(size) char *str, 513 _In_ size_t size) 514 { 515 UNIMPLEMENTED; 516 return 0; 517 } 518 519 _Check_return_wat_ 520 _CRTIMP 521 errno_t 522 __cdecl 523 _strlwr_s_l( 524 _Inout_updates_z_(size) char *str, 525 _In_ size_t size, 526 _In_opt_ _locale_t locale) 527 { 528 UNIMPLEMENTED; 529 return 0; 530 } 531 532 _Check_return_ 533 _CRTIMP 534 int 535 __cdecl 536 _strncoll_l( 537 _In_z_ const char *str1, 538 _In_z_ const char *str2, 539 _In_ size_t maxcount, 540 _In_opt_ _locale_t locale) 541 { 542 UNIMPLEMENTED; 543 return 0; 544 } 545 546 _Check_return_ 547 _CRTIMP 548 int 549 __cdecl 550 _strnicmp_l( 551 _In_reads_or_z_(maxcount) const char *str1, 552 _In_reads_or_z_(maxcount) const char *str2, 553 _In_ size_t maxcount, 554 _In_opt_ _locale_t locale) 555 { 556 UNIMPLEMENTED; 557 return 0; 558 } 559 560 _Check_return_ 561 _CRTIMP 562 int 563 __cdecl 564 _strnicoll_l( 565 _In_z_ const char *str1, 566 _In_z_ const char *str2, 567 _In_ size_t maxcount, 568 _In_opt_ _locale_t locale) 569 { 570 UNIMPLEMENTED; 571 return 0; 572 } 573 574 _Check_return_wat_ 575 _CRTIMP 576 errno_t 577 __cdecl 578 _strnset_s( 579 _Inout_updates_z_(size) char *str, 580 _In_ size_t size, 581 _In_ int val, 582 _In_ size_t _MaxCount) 583 { 584 UNIMPLEMENTED; 585 return 0; 586 } 587 588 _CRTIMP 589 char* 590 _strupr_l( 591 char *str, 592 _locale_t locale) 593 { 594 UNIMPLEMENTED; 595 return 0; 596 } 597 598 _Check_return_ 599 _CRTIMP 600 wint_t 601 __cdecl 602 _towlower_l( 603 _In_ wint_t c, 604 _In_opt_ _locale_t locale) 605 { 606 UNIMPLEMENTED; 607 return 0; 608 } 609 610 _Check_return_ 611 _CRTIMP 612 wint_t 613 __cdecl 614 _towupper_l( 615 _In_ wint_t c, 616 _In_opt_ _locale_t locale) 617 { 618 UNIMPLEMENTED; 619 return 0; 620 } 621 622 _CRTIMP 623 wchar_t* 624 _wcslwr_l( 625 wchar_t *str, 626 _locale_t locale) 627 { 628 UNIMPLEMENTED; 629 return 0; 630 } 631 632 _CRTIMP 633 wchar_t* 634 _wcsupr_l( 635 wchar_t *str, 636 _locale_t locale) 637 { 638 UNIMPLEMENTED; 639 return 0; 640 } 641 642 _Check_return_opt_ 643 _CRTIMP 644 size_t 645 __cdecl 646 _wcsxfrm_l( 647 _Out_writes_opt_(maxcount) _Post_maybez_ wchar_t *dst, 648 _In_z_ const wchar_t *src, 649 _In_ size_t maxcount, 650 _In_opt_ _locale_t locale) 651 { 652 UNIMPLEMENTED; 653 return 0; 654 } 655 656 _Check_return_wat_ 657 _CRTIMP 658 errno_t 659 __cdecl 660 _strset_s( 661 _Inout_updates_z_(size) char *dst, 662 _In_ size_t size, 663 _In_ int val) 664 { 665 UNIMPLEMENTED; 666 return 0; 667 } 668 669 _Check_return_wat_ 670 _CRTIMP 671 errno_t 672 __cdecl 673 _strupr_s( 674 _Inout_updates_z_(size) char *str, 675 _In_ size_t size) 676 { 677 return _strupr_s_l(str, size, 0); 678 } 679 680 _Check_return_wat_ 681 _CRTIMP 682 errno_t 683 __cdecl 684 _strupr_s_l( 685 _Inout_updates_z_(_Size) char *str, 686 _In_ size_t size, 687 _locale_t locale) 688 { 689 UNIMPLEMENTED; 690 return ENOTSUP; 691 } 692 693 _Check_return_ 694 _CRTIMP 695 int 696 __cdecl 697 _tolower_l( 698 _In_ int c, 699 _In_opt_ _locale_t locale) 700 { 701 UNIMPLEMENTED; 702 return 0; 703 } 704 705 _Check_return_ 706 _CRTIMP 707 int 708 __cdecl 709 _toupper_l( 710 _In_ int c, 711 _In_opt_ _locale_t locale) 712 { 713 UNIMPLEMENTED; 714 return 0; 715 } 716 717 _Check_return_ 718 _CRTIMP 719 int 720 __cdecl 721 _wcscoll_l( 722 _In_z_ const wchar_t *str1, 723 _In_z_ const wchar_t *str2, 724 _In_opt_ _locale_t locale) 725 { 726 UNIMPLEMENTED; 727 return 0; 728 } 729 730 _Check_return_ 731 _CRTIMP 732 int 733 __cdecl 734 _wcsicmp_l( 735 _In_z_ const wchar_t *str1, 736 _In_z_ const wchar_t *str2, 737 _In_opt_ _locale_t locale) 738 { 739 UNIMPLEMENTED; 740 return 0; 741 } 742 743 _Check_return_ 744 _CRTIMP 745 int 746 __cdecl 747 _wcsicoll_l( 748 _In_z_ const wchar_t *str1, 749 _In_z_ const wchar_t *str2, 750 _In_opt_ _locale_t locale) 751 { 752 UNIMPLEMENTED; 753 return 0; 754 } 755 756 _Check_return_wat_ 757 _CRTIMP 758 errno_t 759 __cdecl 760 _wcslwr_s( 761 _Inout_updates_z_(sizeInWords) wchar_t *str, 762 _In_ size_t sizeInWords) 763 { 764 return _wcslwr_s_l(str, sizeInWords, NULL); 765 } 766 767 _Check_return_wat_ 768 _CRTIMP 769 errno_t 770 __cdecl 771 _wcslwr_s_l( 772 _Inout_updates_z_(sizeInWords) wchar_t *str, 773 _In_ size_t sizeInWords, 774 _In_opt_ _locale_t locale) 775 { 776 UNIMPLEMENTED; 777 return ENOTSUP; 778 } 779 780 typedef size_t rsize_t; 781 782 _Check_return_wat_ 783 _CRTIMP // _ACRTIMP 784 errno_t 785 __cdecl 786 strncat_s( 787 _Inout_updates_z_(size) char* dest, 788 _In_ rsize_t size, 789 _In_reads_or_z_(maxCount) char const* src, 790 _In_ rsize_t maxCount) 791 { 792 UNIMPLEMENTED; 793 return ENOTSUP; 794 } 795 796 _Check_return_opt_ 797 _CRTIMP 798 _CRT_INSECURE_DEPRECATE(vsnprintf_s) 799 int 800 __cdecl 801 vsnprintf_( 802 _Out_writes_(maxCount) char *dst, 803 _In_ size_t maxCount, 804 _In_z_ _Printf_format_string_ const char *format, 805 va_list argptr) 806 { 807 UNIMPLEMENTED; 808 return 0; 809 } 810 811 _Check_return_ 812 _CRTIMP 813 int 814 __cdecl 815 _wcsnicoll_l( 816 _In_z_ const wchar_t *str1, 817 _In_z_ const wchar_t *str2, 818 _In_ size_t maxCount, 819 _In_opt_ _locale_t locale) 820 { 821 UNIMPLEMENTED; 822 return 0; 823 } 824 825 _Check_return_ 826 _CRTIMP 827 int 828 __cdecl 829 _wcsnicmp_l( 830 _In_reads_or_z_(_MaxCount) const wchar_t *str1, 831 _In_reads_or_z_(_MaxCount) const wchar_t *str2, 832 _In_ size_t maxCount, 833 _In_opt_ _locale_t locale) 834 { 835 UNIMPLEMENTED; 836 return 0; 837 } 838 839 _Check_return_ 840 _CRTIMP 841 int 842 __cdecl 843 _wcsncoll_l( 844 _In_z_ const wchar_t *str1, 845 _In_z_ const wchar_t *str2, 846 _In_ size_t maxCount, 847 _In_opt_ _locale_t locale) 848 { 849 UNIMPLEMENTED; 850 return 0; 851 } 852 853 _Check_return_wat_ 854 _CRTIMP 855 errno_t 856 __cdecl 857 _strerror_s( 858 _Out_writes_z_(_SizeInBytes) char *buf, 859 _In_ size_t sizeInBytes, 860 _In_opt_z_ const char *errMsg) 861 { 862 UNIMPLEMENTED; 863 return 0; 864 } 865 866 _Check_return_wat_ 867 _CRTIMP 868 errno_t 869 __cdecl 870 _wcsnset_s( 871 _Inout_updates_z_(_DstSizeInWords) wchar_t *dst, 872 _In_ size_t sizeInWords, 873 _In_ wchar_t val, 874 _In_ size_t maxCount) 875 { 876 UNIMPLEMENTED; 877 return 0; 878 } 879 880 _Check_return_wat_ 881 _CRTIMP 882 errno_t 883 __cdecl 884 _wcsset_s( 885 _Inout_updates_z_(_SizeInWords) wchar_t *str, 886 _In_ size_t sizeInWords, 887 _In_ wchar_t val) 888 { 889 UNIMPLEMENTED; 890 return 0; 891 } 892 893 _Check_return_wat_ 894 _CRTIMP 895 errno_t 896 __cdecl 897 _wcsupr_s_l( 898 _Inout_updates_z_(_Size) wchar_t *str, 899 _In_ size_t size, 900 _In_opt_ _locale_t locale) 901 { 902 UNIMPLEMENTED; 903 return 0; 904 } 905 906 _Check_return_opt_ 907 _CRTIMP 908 _CRT_INSECURE_DEPRECATE(vsnprintf_s) 909 int 910 __cdecl 911 vsnprintf( 912 _Out_writes_(_MaxCount) char *dest, 913 _In_ size_t maxCount, 914 _In_z_ _Printf_format_string_ const char *format, 915 va_list argptr) 916 { 917 UNIMPLEMENTED; 918 return 0; 919 } 920 921 922 923