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