Changeset 1012 for trunk/src/crtdll/crtdll.cpp
- Timestamp:
- Sep 23, 1999, 11:38:06 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/crtdll/crtdll.cpp
r973 r1012 1 /* $Id: crtdll.cpp,v 1. 4 1999-09-18 15:58:34sandervl Exp $ */1 /* $Id: crtdll.cpp,v 1.5 1999-09-23 09:38:03 sandervl Exp $ */ 2 2 3 3 /* … … 38 38 #include <direct.h> 39 39 #include <malloc.h> 40 #include <drive.h> 41 #include <fcntl.h> 40 42 #include <sys\utime.h> 41 43 #include <sys\stat.h> … … 45 47 46 48 47 // DEFAULT_DEBUG_CHANNEL(crtdll) 48 49 INT CDECL CRTDLL_vfprintf( CRTDLL_FILE *file, LPSTR format, va_list args ); 49 DEFAULT_DEBUG_CHANNEL(crtdll) 50 50 51 51 … … 63 63 } 64 64 65 66 /********************************************************************* 67 * new (CRTDLL.001) 68 */ 69 VOID* CDECL CRTDLL_new(DWORD size) 70 { 71 dprintf(("CRTDLL: ??2@YAPAXI@Z\n")); 72 VOID* result; 73 if(!(result = HeapAlloc(GetProcessHeap(),0,size)) && new_handler) 74 (*new_handler)(); 75 return result; 76 } 77 78 79 /********************************************************************* 80 * delete (CRTDLL.002) 81 */ 82 VOID CDECL CRTDLL_delete(VOID* ptr) 83 { 84 dprintf(("CRTDLL: ??3@YAXPAX@Z\n")); 85 HeapFree(GetProcessHeap(),0,ptr); 86 } 87 88 89 /********************************************************************* 90 * set_new_handler(CRTDLL.003) 91 */ 92 new_handler_type CDECL CRTDLL_set_new_handler(new_handler_type func) 93 { 94 dprintf(("CRTDLL: ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z\n")); 95 new_handler_type old_handler = new_handler; 96 new_handler = func; 97 return old_handler; 98 } 99 100 65 101 /********************************************************************* 66 102 * _XcptFilter (CRTDLL.21) … … 69 105 INT CDECL CRTDLL__XcptFilter(DWORD ret) 70 106 { 71 dprintf(("CRTDLL: XcptFilter\n"));72 73 return 0;107 dprintf(("CRTDLL: XcptFilter not implemented.\n")); 108 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 109 return FALSE; 74 110 } 75 111 … … 149 185 150 186 /********************************************************************* 187 * __dllonexit (CRTDLL.25) 188 */ 189 VOID CDECL CRTDLL___dllonexit () 190 { 191 dprintf(("__dllonexit not implemented.\n")); 192 } 193 194 195 /********************************************************************* 151 196 * CRTDLL___isascii (CRTDLL.28) 152 197 */ 153 198 int CDECL CRTDLL___isascii(int i) 154 199 { 155 dprintf(("CRTDLL: __isascii \n"));200 dprintf(("CRTDLL: __isascii not implemented.\n")); 156 201 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 157 202 return FALSE; … … 164 209 int CDECL CRTDLL___iscsym(int i) 165 210 { 166 dprintf(("CRTDLL: __iscsym \n"));211 dprintf(("CRTDLL: __iscsym not implemented.\n")); 167 212 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 168 213 return FALSE; … … 175 220 int CDECL CRTDLL___iscsymf(int i) 176 221 { 177 dprintf(("CRTDLL: __iscsymf \n"));222 dprintf(("CRTDLL: __iscsymf not implemented.\n")); 178 223 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 179 224 return FALSE; … … 187 232 INT CDECL CRTDLL___mb_cur_max_dll(DWORD ret) 188 233 { 189 dprintf(("CRTDLL: __mb_cur_max_dll\n"));190 191 return 0;234 dprintf(("CRTDLL: __mb_cur_max_dll not implemented.\n")); 235 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 236 return FALSE; 192 237 } 193 238 … … 198 243 unsigned long CDECL CRTDLL___threadhandle( void ) 199 244 { 200 dprintf(("CRTDLL: __threadhandle \n"));245 dprintf(("CRTDLL: __threadhandle not implemented.\n")); 201 246 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 202 247 return FALSE; … … 209 254 int * CDECL CRTDLL___threadid(void) 210 255 { 211 dprintf(("CRTDLL: __threadid \n"));256 dprintf(("CRTDLL: __threadid not implemented.\n")); 212 257 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 213 258 return FALSE; … … 220 265 int CDECL CRTDLL__abnormal_termination(void) 221 266 { 222 dprintf(("CRTDLL: _abnormal_termination \n"));267 dprintf(("CRTDLL: _abnormal_termination not implemented.\n")); 223 268 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 224 269 return FALSE; … … 242 287 INT CDECL CRTDLL__aexit_rtn_dll(DWORD ret) 243 288 { 244 dprintf(("CRTDLL: _aexit_rtn_dll\n"));245 246 return 0;289 dprintf(("CRTDLL: _aexit_rtn_dll not implemented.\n")); 290 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 291 return FALSE; 247 292 } 248 293 … … 254 299 INT CDECL CRTDLL__amsg_exit(DWORD ret) 255 300 { 256 dprintf(("CRTDLL: _amsg_exit\n")); 257 301 dprintf(("CRTDLL: _amsg_exit not implemented.\n")); 258 302 return 0; 259 303 } … … 276 320 unsigned stack_size, void *arglist ) 277 321 { 278 dprintf(("CRTDLL: _beginthread\n")); 279 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 280 return FALSE; 322 dprintf(("CRTDLL: _beginthread not implemented.\n")); 323 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 324 return FALSE; 325 } 326 327 328 /********************************************************************* 329 * _c_exit (CRTDLL.47) 330 * 331 */ 332 void CDECL CRTDLL__c_exit(INT ret) 333 { 334 dprintf(("_c_exit(%d)\n",ret)); 335 ExitProcess(ret); 336 } 337 338 339 /********************************************************************* 340 * _cexit (CRTDLL.49) 341 * 342 */ 343 void CDECL CRTDLL__cexit(INT ret) 344 { 345 dprintf(("_cexit(%d)\n",ret)); 346 ExitProcess(ret); 281 347 } 282 348 … … 295 361 296 362 /********************************************************************* 363 * _chdrive (CRTDLL.52) 364 * 365 * newdir [I] drive to change to, A=1 366 * 367 */ 368 BOOL CDECL CRTDLL__chdrive(INT newdrive) 369 { 370 /* FIXME: generates errnos */ 371 dprintf(("CRTDLL: _chdrive\n")); 372 return DRIVE_SetCurrentDrive(newdrive-1); 373 } 374 375 376 /********************************************************************* 297 377 * CRTDLL__close (CRTDLL.57) 298 378 */ … … 381 461 { 382 462 dprintf(("CRTDLL: _except_handler2\n")); 383 384 463 return 0; 385 464 } … … 391 470 VOID CDECL CRTDLL__exit(DWORD ret) 392 471 { 393 dprintf(("CRTDLL: exit\n"));472 dprintf(("CRTDLL: _exit\n")); 394 473 ExitProcess(ret); 395 474 } … … 401 480 void * CDECL CRTDLL__expand( void *ptr, size_t size ) 402 481 { 403 dprintf(("CRTDLL: _expand \n"));482 dprintf(("CRTDLL: _expand not implemented.\n")); 404 483 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 405 484 return FALSE; … … 463 542 wint_t CDECL CRTDLL__fgetwchar( void *i ) 464 543 { 465 dprintf(("CRTDLL: _fgetwchar \n"));544 dprintf(("CRTDLL: _fgetwchar not implemented.\n")); 466 545 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 467 546 return FALSE; … … 474 553 int CDECL CRTDLL__findclose( long handle ) 475 554 { 476 dprintf(("CRTDLL: _findclose \n"));555 dprintf(("CRTDLL: _findclose not implemented.\n")); 477 556 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 478 557 return FALSE; … … 485 564 DWORD CDECL CRTDLL__findfirst(LPCSTR fname, struct find_t * x2) 486 565 { 487 dprintf(("CRTDLL: _findfirst \n"));566 dprintf(("CRTDLL: _findfirst not implemented.\n")); 488 567 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 489 568 return FALSE; … … 496 575 INT CDECL CRTDLL__findnext(DWORD hand, struct find_t * x2) 497 576 { 498 dprintf(("CRTDLL: _findnext \n"));577 dprintf(("CRTDLL: _findnext not implemented.\n")); 499 578 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 500 579 return FALSE; … … 507 586 INT CDECL CRTDLL__finite(double x) 508 587 { 509 dprintf(("CRTDLL: _finite \n"));588 dprintf(("CRTDLL: _finite not implemented.\n")); 510 589 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 511 590 return FALSE; … … 518 597 INT CDECL CRTDLL__fpreset(void) 519 598 { 520 dprintf(("CRTDLL: _fpreset \n"));599 dprintf(("CRTDLL: _fpreset not implemented.\n")); 521 600 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 522 601 return FALSE; … … 539 618 wint_t CDECL CRTDLL__fputwchar( wint_t ) 540 619 { 541 dprintf(("CRTDLL: _fputwchar \n"));620 dprintf(("CRTDLL: _fputwchar not implemented.\n")); 542 621 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 543 622 return FALSE; … … 550 629 FILE * CDECL CRTDLL__fsopen( const char *filename, const char *mode, int shflag ) 551 630 { 552 dprintf(("CRTDLL: _fsopen \n"));631 dprintf(("CRTDLL: _fsopen not implemented.\n")); 553 632 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 554 633 return FALSE; … … 561 640 int CDECL CRTDLL__fstat(int file, struct stat* buf) 562 641 { 563 dprintf(("CRTDLL: _fstat \n"));642 dprintf(("CRTDLL: _fstat not implemented.\n")); 564 643 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 565 644 return FALSE; … … 572 651 int CDECL CRTDLL__ftime( struct timeb *timeptr ) 573 652 { 574 dprintf(("CRTDLL: _ftime \n"));653 dprintf(("CRTDLL: _ftime not implemented.\n")); 575 654 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 576 655 return FALSE; … … 603 682 long CDECL CRTDLL__get_osfhandle( int posixhandle ) 604 683 { 605 dprintf(("CRTDLL: _gcvt \n"));684 dprintf(("CRTDLL: _gcvt not implemented.\n")); 606 685 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 607 686 return FALSE; … … 654 733 unsigned CDECL CRTDLL__getdiskfree( unsigned drive, struct _diskfree_t *diskspace) 655 734 { 656 dprintf(("CRTDLL: _getdiskfree \n"));735 dprintf(("CRTDLL: _getdiskfree not implemented.\n")); 657 736 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 658 737 return FALSE; … … 666 745 { 667 746 dprintf(("CRTDLL: _getdrive\n")); 668 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 669 return FALSE; 747 return DRIVE_GetCurrentDrive() + 1; 670 748 } 671 749 … … 676 754 int CDECL CRTDLL__getw( FILE *fp ) 677 755 { 678 dprintf(("CRTDLL: _getw \n"));756 dprintf(("CRTDLL: _getw not implemented.\n")); 679 757 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 680 758 return FALSE; … … 727 805 int CDECL CRTDLL__heapwalk( struct _heapinfo *entry ) 728 806 { 729 dprintf(("CRTDLL: _heapwalk \n"));807 dprintf(("CRTDLL: _heapwalk not implemented.\n")); 730 808 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 731 809 return FALSE; … … 747 825 } 748 826 return 0; 827 } 828 829 830 /********************************************************************* 831 * _isatty (CRTDLL.137) 832 */ 833 BOOL CDECL CRTDLL__isatty(DWORD x) 834 { 835 dprintf(("(%ld)\n",x)); 836 return TRUE; 749 837 } 750 838 … … 780 868 int CDECL CRTDLL__ismbbalnum( unsigned int ch ) 781 869 { 782 dprintf(("CRTDLL: _ismbbalnum \n"));870 dprintf(("CRTDLL: _ismbbalnum not implemented.\n")); 783 871 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 784 872 return FALSE; … … 791 879 int CDECL CRTDLL__ismbbalpha( unsigned int ch ) 792 880 { 793 dprintf(("CRTDLL: _ismbbalpha \n"));881 dprintf(("CRTDLL: _ismbbalpha not implemented.\n")); 794 882 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 795 883 return FALSE; … … 802 890 int CDECL CRTDLL__ismbbgraph( unsigned int ch ) 803 891 { 804 dprintf(("CRTDLL: _ismbbgraph \n"));892 dprintf(("CRTDLL: _ismbbgraph not implemented.\n")); 805 893 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 806 894 return FALSE; … … 813 901 int CDECL CRTDLL__ismbbkalnum( unsigned int ch ) 814 902 { 815 dprintf(("CRTDLL: _ismbbkalnum \n"));903 dprintf(("CRTDLL: _ismbbkalnum not implemented.\n")); 816 904 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 817 905 return FALSE; … … 824 912 int CDECL CRTDLL__ismbbkana( unsigned int ch ) 825 913 { 826 dprintf(("CRTDLL: _ismbbkana \n"));914 dprintf(("CRTDLL: _ismbbkana not implemented.\n")); 827 915 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 828 916 return FALSE; … … 835 923 int CDECL CRTDLL__ismbbkpunct( unsigned int ch ) 836 924 { 837 dprintf(("CRTDLL: _ismbbkpunct \n"));925 dprintf(("CRTDLL: _ismbbkpunct not implemented.\n")); 838 926 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 839 927 return FALSE; … … 846 934 int CDECL CRTDLL__ismbblead( unsigned int ch ) 847 935 { 848 dprintf(("CRTDLL: _ismbblead \n"));936 dprintf(("CRTDLL: _ismbblead not implemented.\n")); 849 937 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 850 938 return FALSE; … … 857 945 int CDECL CRTDLL__ismbbprint( unsigned int ch ) 858 946 { 859 dprintf(("CRTDLL: _ismbbprint \n"));947 dprintf(("CRTDLL: _ismbbprint not implemented.\n")); 860 948 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 861 949 return FALSE; … … 868 956 int CDECL CRTDLL__ismbbpunct( unsigned int ch ) 869 957 { 870 dprintf(("CRTDLL: _ismbbpunct \n"));958 dprintf(("CRTDLL: _ismbbpunct not implemented.\n")); 871 959 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 872 960 return FALSE; … … 879 967 int CDECL CRTDLL__ismbbtrail( unsigned int ch ) 880 968 { 881 dprintf(("CRTDLL: _ismbbtrail \n"));969 dprintf(("CRTDLL: _ismbbtrail not implemented.\n")); 882 970 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 883 971 return FALSE; … … 890 978 int CDECL CRTDLL__ismbcalpha( unsigned int ch ) 891 979 { 892 dprintf(("CRTDLL: _ismbcalpha \n"));980 dprintf(("CRTDLL: _ismbcalpha not implemented.\n")); 893 981 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 894 982 return FALSE; … … 901 989 int CDECL CRTDLL__ismbcdigit( unsigned int ch ) 902 990 { 903 dprintf(("CRTDLL: _ismbcdigit \n"));991 dprintf(("CRTDLL: _ismbcdigit not implemented.\n")); 904 992 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 905 993 return FALSE; … … 912 1000 int CDECL CRTDLL__ismbchira( unsigned int ch ) 913 1001 { 914 dprintf(("CRTDLL: _ismbchira \n"));1002 dprintf(("CRTDLL: _ismbchira not implemented.\n")); 915 1003 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 916 1004 return FALSE; … … 923 1011 int CDECL CRTDLL__ismbckata( unsigned int ch ) 924 1012 { 925 dprintf(("CRTDLL: _ismbckata \n"));1013 dprintf(("CRTDLL: _ismbckata not implemented.\n")); 926 1014 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 927 1015 return FALSE; … … 933 1021 int CDECL CRTDLL__ismbcl0( unsigned int ch ) 934 1022 { 935 dprintf(("CRTDLL: _ismbcl0 \n"));1023 dprintf(("CRTDLL: _ismbcl0 not implemented.\n")); 936 1024 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 937 1025 return FALSE; … … 944 1032 int CDECL CRTDLL__ismbcl1( unsigned int ch ) 945 1033 { 946 dprintf(("CRTDLL: _ismbcl1 \n"));1034 dprintf(("CRTDLL: _ismbcl1 not implemented.\n")); 947 1035 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 948 1036 return FALSE; … … 955 1043 int CDECL CRTDLL__ismbcl2( unsigned int ch ) 956 1044 { 957 dprintf(("CRTDLL: _ismbcl2 \n"));1045 dprintf(("CRTDLL: _ismbcl2 not implemented.\n")); 958 1046 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 959 1047 return FALSE; … … 966 1054 int CDECL CRTDLL__ismbclegal( unsigned int ch ) 967 1055 { 968 dprintf(("CRTDLL: _ismbclegal \n"));1056 dprintf(("CRTDLL: _ismbclegal not implemented.\n")); 969 1057 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 970 1058 return FALSE; … … 977 1065 int CDECL CRTDLL__ismbclower( unsigned int ch ) 978 1066 { 979 dprintf(("CRTDLL: _ismbclower \n"));1067 dprintf(("CRTDLL: _ismbclower not implemented.\n")); 980 1068 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 981 1069 return FALSE; … … 988 1076 int CDECL CRTDLL__ismbcprint( unsigned int ch ) 989 1077 { 990 dprintf(("CRTDLL: _ismbcprint \n"));1078 dprintf(("CRTDLL: _ismbcprint not implemented.\n")); 991 1079 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 992 1080 return FALSE; … … 999 1087 int CDECL CRTDLL__ismbcspace( unsigned int ch ) 1000 1088 { 1001 dprintf(("CRTDLL: _ismbcspace \n"));1089 dprintf(("CRTDLL: _ismbcspace not implemented.\n")); 1002 1090 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1003 1091 return FALSE; … … 1010 1098 int CDECL CRTDLL__ismbcsymbol( unsigned int ch ) 1011 1099 { 1012 dprintf(("CRTDLL: _ismbcsymbol \n"));1100 dprintf(("CRTDLL: _ismbcsymbol not implemented.\n")); 1013 1101 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1014 1102 return FALSE; … … 1021 1109 int CDECL CRTDLL__ismbcupper( unsigned int ch ) 1022 1110 { 1023 dprintf(("CRTDLL: _ismbcupper \n"));1111 dprintf(("CRTDLL: _ismbcupper not implemented.\n")); 1024 1112 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1025 1113 return FALSE; … … 1041 1129 int CDECL CRTDLL__locking(int handle,int mode,unsigned long nbyte) 1042 1130 { 1043 dprintf(("CRTDLL: _locking \n"));1131 dprintf(("CRTDLL: _locking not implemented.\n")); 1044 1132 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1045 1133 return FALSE; … … 1088 1176 1089 1177 1178 #if (__IBMCPP__ > 300) 1179 #define exception _exception 1180 #endif 1181 1090 1182 /********************************************************************* 1091 1183 * _matherr (CRTDLL.181) … … 1097 1189 } 1098 1190 1099 // unsigned int _mbbtombc( unsigned int __ch ); 1100 // unsigned int _mbctombb( unsigned int __ch ); 1191 1192 /********************************************************************* 1193 * _mbbtombc (CRTDLL.182) 1194 */ 1195 unsigned int CDECL CRTDLL__mbbtombc( unsigned int ch ) 1196 { 1197 dprintf(("CRTDLL: _mbbtombc\n")); 1198 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1199 return FALSE; 1200 } 1201 1202 1203 /********************************************************************* 1204 * _mbbtype (CRTDLL.183) 1205 */ 1206 int CDECL CRTDLL__mbbtype( unsigned char s, int i ) 1207 { 1208 dprintf(("CRTDLL: _mbbtype not implemented.\n")); 1209 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1210 return FALSE; 1211 } 1212 1213 1214 /********************************************************************* 1215 * _mbccpy (CRTDLL.184) 1216 */ 1217 void CDECL CRTDLL__mbccpy( unsigned char *dest, const unsigned char *ch ) 1218 { 1219 dprintf(("CRTDLL: _mbccpy not implemented.\n")); 1220 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1221 } 1222 1223 1224 /********************************************************************* 1225 * _mbcjistojms (CRTDLL.185) 1226 */ 1227 int CDECL CRTDLL__mbcjistojms( unsigned int ch ) 1228 { 1229 dprintf(("CRTDLL: _mbcjistojms not implemented.\n")); 1230 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1231 return FALSE; 1232 } 1233 1234 1235 /********************************************************************* 1236 * _mbcjmstojis (CRTDLL.186) 1237 */ 1238 int CDECL CRTDLL__mbcjmstojis( unsigned int ch ) 1239 { 1240 dprintf(("CRTDLL: _mbcjmstojis not implemented.\n")); 1241 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1242 return FALSE; 1243 } 1244 1245 1246 /********************************************************************* 1247 * _mbclen (CRTDLL.187) 1248 */ 1249 size_t CDECL CRTDLL__mbclen( const unsigned char *ch ) 1250 { 1251 dprintf(("CRTDLL: _mbclen not implemented.\n")); 1252 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1253 return FALSE; 1254 } 1255 1256 1257 /********************************************************************* 1258 * _mbctohira (CRTDLL.188) 1259 */ 1260 int CDECL CRTDLL__mbctohira( unsigned int ch ) 1261 { 1262 dprintf(("CRTDLL: _mbctohira not implemented.\n")); 1263 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1264 return FALSE; 1265 } 1266 1267 1268 /********************************************************************* 1269 * _mbctokata (CRTDLL.189) 1270 */ 1271 int CDECL CRTDLL__mbctokata( unsigned int ch ) 1272 { 1273 dprintf(("CRTDLL: _mbctokata not implemented.\n")); 1274 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1275 return FALSE; 1276 } 1277 1278 1279 /********************************************************************* 1280 * _mbctolower (CRTDLL.190) 1281 */ 1282 unsigned int CDECL CRTDLL__mbctolower( unsigned int ch ) 1283 { 1284 dprintf(("CRTDLL: _mbctolower not implemented.\n")); 1285 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1286 return FALSE; 1287 } 1288 1289 1290 /********************************************************************* 1291 * _mbctombb (CRTDLL.191) 1292 */ 1293 unsigned int CDECL CRTDLL__mbctombb( unsigned int ch ) 1294 { 1295 dprintf(("CRTDLL: _mbctombb not implemented.\n")); 1296 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1297 return FALSE; 1298 } 1299 1300 1301 /********************************************************************* 1302 * _mbctoupper (CRTDLL.192) 1303 */ 1304 unsigned int CDECL CRTDLL__mbctoupper( unsigned int ch ) 1305 { 1306 dprintf(("CRTDLL: _mbctoupper not implemented.\n")); 1307 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1308 return FALSE; 1309 } 1310 1311 1312 /********************************************************************* 1313 * _mbsbtype (CRTDLL.194) 1314 */ 1315 int CDECL CRTDLL__mbsbtype( const unsigned char *s1, int ch ) 1316 { 1317 dprintf(("CRTDLL: _mbsbtype not implemented.\n")); 1318 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1319 return FALSE; 1320 } 1321 1322 1323 /********************************************************************* 1324 * _mbscat (CRTDLL.195) 1325 */ 1326 unsigned char * CDECL CRTDLL__mbscat( unsigned char *s1, const unsigned char *s2 ) 1327 { 1328 dprintf(("CRTDLL: _mbscat not implemented.\n")); 1329 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1330 return FALSE; 1331 } 1332 1333 1334 /********************************************************************* 1335 * _mbschr (CRTDLL.196) 1336 */ 1337 unsigned char * CDECL CRTDLL__mbschr( const unsigned char *s, unsigned int ch ) 1338 { 1339 dprintf(("CRTDLL: _mbschr not implemented.\n")); 1340 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1341 return FALSE; 1342 } 1343 1344 1345 /********************************************************************* 1346 * _mbscmp (CRTDLL.197) 1347 */ 1348 int CDECL CRTDLL__mbscmp( const unsigned char *s1, const unsigned char *s2 ) 1349 { 1350 dprintf(("CRTDLL: _mbscmp not implemented.\n")); 1351 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1352 return FALSE; 1353 } 1354 1355 1356 /********************************************************************* 1357 * _mbscpy (CRTDLL.198) 1358 */ 1359 unsigned char * CDECL CRTDLL__mbscpy( unsigned char *s1, const unsigned char *s2 ) 1360 { 1361 dprintf(("CRTDLL: _mbscpy not implemented.\n")); 1362 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1363 return FALSE; 1364 } 1101 1365 1102 1366 … … 1106 1370 size_t CDECL CRTDLL__mbscspn( const unsigned char *s, const unsigned char *charset ) 1107 1371 { 1108 dprintf(("CRTDLL: _mbscspn\n")); 1109 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1110 return FALSE; 1111 } 1112 1372 dprintf(("CRTDLL: _mbscspn not implemented.\n")); 1373 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1374 return FALSE; 1375 } 1376 1377 1378 /********************************************************************* 1379 * CRTDLL__mbsdec (CRTDLL.200) 1380 */ 1381 unsigned char * CDECL CRTDLL__mbsdec( const unsigned char *s, const unsigned char *ch ) 1382 { 1383 dprintf(("CRTDLL: _mbsdec not implemented.\n")); 1384 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1385 return FALSE; 1386 } 1387 1388 1389 /********************************************************************* 1390 * CRTDLL__mbsdec (CRTDLL.201) 1391 */ 1392 unsigned char * CDECL CRTDLL__mbsdup( unsigned char *src ) 1393 { 1394 dprintf(("CRTDLL: _mbsdup not implemented.\n")); 1395 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1396 return FALSE; 1397 } 1398 1399 1400 /********************************************************************* 1401 * CRTDLL__mbsicmp (CRTDLL.202) 1402 */ 1403 int CDECL CRTDLL__mbsicmp( const unsigned char *x, const unsigned char *y ) 1404 { 1405 dprintf(("CRTDLL: _mbsicmp\n")); 1406 do { 1407 if (!*x) 1408 return !!*y; 1409 if (!*y) 1410 return !!*x; 1411 /* FIXME: MBCS handling... */ 1412 if (*x!=*y) 1413 return 1; 1414 x++; 1415 y++; 1416 } while (1); 1417 } 1113 1418 1114 1419 … … 1118 1423 LPSTR CDECL CRTDLL__mbsinc( LPCSTR str ) 1119 1424 { 1425 dprintf(("CRTDLL: _mbsinc\n")); 1120 1426 int len = mblen( str, MB_LEN_MAX ); 1121 1427 if (len < 1) len = 1; … … 1129 1435 INT CDECL CRTDLL__mbslen( LPCSTR str ) 1130 1436 { 1437 dprintf(("CRTDLL: _mbslen\n")); 1131 1438 INT len, total = 0; 1132 1439 while ((len = mblen( str, MB_LEN_MAX )) > 0) … … 1140 1447 1141 1448 /********************************************************************* 1142 * CRTDLL__mbsdec (CRTDLL.200)1143 */1144 unsigned char * CDECL CRTDLL__mbsdec( const unsigned char *s, const unsigned char *ch )1145 {1146 dprintf(("CRTDLL: _mbsdec\n"));1147 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);1148 return FALSE;1149 }1150 1151 1152 /*********************************************************************1153 * CRTDLL__mbsdec (CRTDLL.201)1154 */1155 unsigned char * CDECL CRTDLL__mbsdup( unsigned char *src )1156 {1157 dprintf(("CRTDLL: _mbsdup\n"));1158 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);1159 return FALSE;1160 }1161 1162 1163 /*********************************************************************1164 * CRTDLL__mbsicmp (CRTDLL.202)1165 */1166 int CDECL CRTDLL__mbsicmp( const unsigned char *s1, const unsigned char *s2 )1167 {1168 dprintf(("CRTDLL: _mbsicmp\n"));1169 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);1170 return FALSE;1171 }1172 1173 1174 /*********************************************************************1175 1449 * CRTDLL__mbslwr (CRTDLL.205) 1176 1450 */ 1177 1451 unsigned char * CDECL CRTDLL__mbslwr( unsigned char *s ) 1178 1452 { 1179 dprintf(("CRTDLL: _mbslwr \n"));1453 dprintf(("CRTDLL: _mbslwr not implemented.\n")); 1180 1454 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1181 1455 return FALSE; … … 1188 1462 unsigned char * CDECL CRTDLL__mbsnbcat( unsigned char *s1, const unsigned char *s2, size_t n ) 1189 1463 { 1190 dprintf(("CRTDLL: _mbsnbcat \n"));1464 dprintf(("CRTDLL: _mbsnbcat not implemented.\n")); 1191 1465 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1192 1466 return FALSE; … … 1199 1473 int CDECL CRTDLL__mbsnbcmp( const unsigned char *s1, const unsigned char *s2, size_t n ) 1200 1474 { 1201 dprintf(("CRTDLL: _mbsnbcmp \n"));1475 dprintf(("CRTDLL: _mbsnbcmp not implemented.\n")); 1202 1476 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1203 1477 return FALSE; … … 1210 1484 size_t CDECL CRTDLL__mbsnbcnt( const unsigned char *s, size_t n ) 1211 1485 { 1212 dprintf(("CRTDLL: _mbsnbcnt \n"));1486 dprintf(("CRTDLL: _mbsnbcnt not implemented.\n")); 1213 1487 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1214 1488 return FALSE; … … 1221 1495 unsigned char * CDECL CRTDLL__mbsnbcpy( unsigned char *s1, const unsigned char *s2, size_t n ) 1222 1496 { 1223 dprintf(("CRTDLL: _mbsnbcpy \n"));1497 dprintf(("CRTDLL: _mbsnbcpy not implemented.\n")); 1224 1498 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1225 1499 return FALSE; … … 1232 1506 int CDECL CRTDLL__mbsnbicmp( const unsigned char *s1, const unsigned char *s2, size_t n ) 1233 1507 { 1234 dprintf(("CRTDLL: _mbsnbicmp \n"));1508 dprintf(("CRTDLL: _mbsnbicmp not implemented.\n")); 1235 1509 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1236 1510 return FALSE; … … 1243 1517 unsigned char * CDECL CRTDLL__mbsnbset( unsigned char *s, unsigned int ch, size_t n ) 1244 1518 { 1245 dprintf(("CRTDLL: _mbsnbset \n"));1519 dprintf(("CRTDLL: _mbsnbset not implemented.\n")); 1246 1520 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1247 1521 return FALSE; … … 1254 1528 unsigned char * CDECL CRTDLL__mbsncat( unsigned char *s1, const unsigned char *s2, size_t n ) 1255 1529 { 1256 dprintf(("CRTDLL: _mbsncat \n"));1530 dprintf(("CRTDLL: _mbsncat not implemented.\n")); 1257 1531 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1258 1532 return FALSE; … … 1265 1539 size_t CDECL CRTDLL__mbsnccnt( const unsigned char *s, size_t n ) 1266 1540 { 1267 dprintf(("CRTDLL: _mbsnccnt \n"));1541 dprintf(("CRTDLL: _mbsnccnt not implemented.\n")); 1268 1542 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1269 1543 return FALSE; … … 1276 1550 int CDECL CRTDLL__mbsncmp( const unsigned char *s1, const unsigned char *s2, size_t n ) 1277 1551 { 1278 dprintf(("CRTDLL: _mbsncmp \n"));1552 dprintf(("CRTDLL: _mbsncmp not implemented.\n")); 1279 1553 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1280 1554 return FALSE; … … 1287 1561 unsigned char * CDECL CRTDLL__mbsncpy( unsigned char *s1, const unsigned char *s2, size_t n ) 1288 1562 { 1289 dprintf(("CRTDLL: _mbsncpy \n"));1563 dprintf(("CRTDLL: _mbsncpy not implemented.\n")); 1290 1564 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1291 1565 return FALSE; … … 1298 1572 unsigned int CDECL CRTDLL__mbsnextc( const unsigned char *s ) 1299 1573 { 1300 dprintf(("CRTDLL: _mbsnextc \n"));1574 dprintf(("CRTDLL: _mbsnextc not implemented.\n")); 1301 1575 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1302 1576 return FALSE; … … 1309 1583 int CDECL CRTDLL__mbsnicmp( const unsigned char *s1, const unsigned char *s2, size_t n ) 1310 1584 { 1311 dprintf(("CRTDLL: _mbsnicmp \n"));1585 dprintf(("CRTDLL: _mbsnicmp not implemented.\n")); 1312 1586 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1313 1587 return FALSE; … … 1320 1594 unsigned char * CDECL CRTDLL__mbsninc( const unsigned char *s, size_t count ) 1321 1595 { 1322 dprintf(("CRTDLL: _mbsninc \n"));1596 dprintf(("CRTDLL: _mbsninc not implemented.\n")); 1323 1597 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1324 1598 return FALSE; … … 1331 1605 unsigned char * CDECL CRTDLL__mbsnset( unsigned char *s, unsigned int ch, size_t n ) 1332 1606 { 1333 dprintf(("CRTDLL: _mbsnset \n"));1607 dprintf(("CRTDLL: _mbsnset not implemented.\n")); 1334 1608 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1335 1609 return FALSE; … … 1342 1616 unsigned char * CDECL CRTDLL__mbspbrk( const unsigned char *s, const unsigned char *charset ) 1343 1617 { 1344 dprintf(("CRTDLL: _mbspbrk \n"));1618 dprintf(("CRTDLL: _mbspbrk not implemented.\n")); 1345 1619 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1346 1620 return FALSE; … … 1351 1625 * CRTDLL__mbsrchr (CRTDLL.221) 1352 1626 */ 1353 unsigned char * CDECL CRTDLL__mbsrchr( const unsigned char *s, unsigned int ch)1627 LPSTR CDECL CRTDLL__mbsrchr(LPSTR s,CHAR x) 1354 1628 { 1355 1629 dprintf(("CRTDLL: _mbsrchr\n")); 1356 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1357 return FALSE;1630 /* FIXME: handle multibyte strings */ 1631 return strrchr(s,x); 1358 1632 } 1359 1633 … … 1364 1638 unsigned char * CDECL CRTDLL__mbsrev( unsigned char *s ) 1365 1639 { 1366 dprintf(("CRTDLL: _mbsrev \n"));1640 dprintf(("CRTDLL: _mbsrev not implemented.\n")); 1367 1641 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1368 1642 return FALSE; … … 1375 1649 unsigned char * CDECL CRTDLL__mbsset( unsigned char *s, unsigned int ch ) 1376 1650 { 1377 dprintf(("CRTDLL: _mbsset \n"));1651 dprintf(("CRTDLL: _mbsset not implemented.\n")); 1378 1652 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1379 1653 return FALSE; … … 1386 1660 size_t CDECL CRTDLL__mbsspn( const unsigned char *s, const unsigned char *charset ) 1387 1661 { 1388 dprintf(("CRTDLL: _mbsspn \n"));1662 dprintf(("CRTDLL: _mbsspn not implemented.\n")); 1389 1663 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1390 1664 return FALSE; … … 1397 1671 unsigned char * CDECL CRTDLL__mbsspnp( const unsigned char *s, const unsigned char *charset ) 1398 1672 { 1399 dprintf(("CRTDLL: _mbsspnp \n"));1673 dprintf(("CRTDLL: _mbsspnp not implemented.\n")); 1400 1674 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1401 1675 return FALSE; … … 1408 1682 unsigned char * CDECL CRTDLL__mbsstr( const unsigned char *s1, const unsigned char *s2 ) 1409 1683 { 1410 dprintf(("CRTDLL: _mbsstr \n"));1684 dprintf(("CRTDLL: _mbsstr not implemented.\n")); 1411 1685 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1412 1686 return FALSE; … … 1419 1693 unsigned char * CDECL CRTDLL__mbstok( unsigned char *s, const unsigned char *delim ) 1420 1694 { 1421 dprintf(("CRTDLL: _mbstok \n"));1695 dprintf(("CRTDLL: _mbstok not implemented.\n")); 1422 1696 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1423 1697 return FALSE; … … 1430 1704 unsigned char * CDECL CRTDLL__mbsupr( unsigned char *s ) 1431 1705 { 1432 dprintf(("CRTDLL: _mbsupr \n"));1706 dprintf(("CRTDLL: _mbsupr not implemented.\n")); 1433 1707 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1434 1708 return FALSE; … … 1453 1727 char * CDECL CRTDLL__mktemp( char * templt ) 1454 1728 { 1455 dprintf(("CRTDLL: _mktemp \n"));1729 dprintf(("CRTDLL: _mktemp not implemented.\n")); 1456 1730 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1457 1731 return FALSE; … … 1472 1746 * _open (CRTDLL.237) 1473 1747 */ 1474 INT CDECL CRTDLL__open(const char *path,int oflag,...) 1475 { 1476 dprintf(("CRTDLL: _open\n")); 1477 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1478 return FALSE; 1748 HFILE CDECL CRTDLL__open(LPCSTR path,INT flags) 1749 { 1750 dprintf(("CRTDLL: _open\n")); 1751 DWORD access = 0, creation = 0; 1752 HFILE ret; 1753 1754 switch(flags & 3) 1755 { 1756 case O_RDONLY: access |= GENERIC_READ; break; 1757 case O_WRONLY: access |= GENERIC_WRITE; break; 1758 case O_RDWR: access |= GENERIC_WRITE | GENERIC_READ; break; 1759 } 1760 1761 if (flags & 0x0100) /* O_CREAT */ 1762 { 1763 if (flags & 0x0400) /* O_EXCL */ 1764 creation = CREATE_NEW; 1765 else if (flags & 0x0200) /* O_TRUNC */ 1766 creation = CREATE_ALWAYS; 1767 else 1768 creation = OPEN_ALWAYS; 1769 } 1770 else /* no O_CREAT */ 1771 { 1772 if (flags & 0x0200) /* O_TRUNC */ 1773 creation = TRUNCATE_EXISTING; 1774 else 1775 creation = OPEN_EXISTING; 1776 } 1777 if (flags & 0x0008) /* O_APPEND */ 1778 dprintf(("O_APPEND not supported\n" )); 1779 if (flags & 0xf0f4) 1780 dprintf(("CRTDLL_open file unsupported flags 0x%04x\n",flags)); 1781 /* End Fixme */ 1782 1783 ret = CreateFileA( path, access, FILE_SHARE_READ | FILE_SHARE_WRITE, 1784 NULL, creation, FILE_ATTRIBUTE_NORMAL, -1 ); 1785 dprintf(("CRTDLL_open file %s mode 0x%04x got handle %d\n", path,flags,ret)); 1786 return ret; 1479 1787 } 1480 1788 … … 1486 1794 { 1487 1795 dprintf(("CRTDLL: _open_osfhandle\n")); 1488 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1489 return FALSE; 1796 HFILE handle; 1797 1798 switch (osfhandle) { 1799 case STD_INPUT_HANDLE : 1800 case 0 : 1801 handle=0; 1802 break; 1803 case STD_OUTPUT_HANDLE: 1804 case 1: 1805 handle=1; 1806 break; 1807 case STD_ERROR_HANDLE: 1808 case 2: 1809 handle=2; 1810 break; 1811 default: 1812 return (-1); 1813 } 1814 dprintf(("(handle %08lx,flags %d) return %d\n", 1815 osfhandle,flags,handle)); 1816 return handle; 1490 1817 } 1491 1818 … … 1496 1823 INT CDECL CRTDLL__pclose( FILE *fp ) 1497 1824 { 1498 dprintf(("CRTDLL: _pclose \n"));1825 dprintf(("CRTDLL: _pclose not implemented.\n")); 1499 1826 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1500 1827 return FALSE; … … 1508 1835 INT CDECL CRTDLL__pctype_dll(DWORD ret) 1509 1836 { 1510 dprintf(("CRTDLL: _pctype_dll\n")); 1511 1837 dprintf(("CRTDLL: _pctype_dll not implemented.\n")); 1512 1838 return 0; 1513 1839 } … … 1519 1845 INT CDECL CRTDLL__pipe( int *phandles, unsigned psize, int textmode ) 1520 1846 { 1521 dprintf(("CRTDLL: _pipe \n"));1847 dprintf(("CRTDLL: _pipe not implemented.\n")); 1522 1848 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1523 1849 return FALSE; … … 1530 1856 FILE * CDECL CRTDLL__popen( const char *command, const char *mode ) 1531 1857 { 1532 dprintf(("CRTDLL: _popen \n"));1858 dprintf(("CRTDLL: _popen not implemented.\n")); 1533 1859 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1534 1860 return FALSE; … … 1537 1863 /********************************************************************* 1538 1864 * _read (CRTDLL.254) 1539 *1540 * BUGS1541 * Unimplemented1542 1865 */ 1543 1866 INT CDECL CRTDLL__read(INT fd, LPVOID buf, UINT count) 1544 1867 { 1545 dprintf(("CRTDLL: _read \n"));1868 dprintf(("CRTDLL: _read not implemented.\n")); 1546 1869 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1547 1870 return FALSE; … … 1554 1877 INT CDECL CRTDLL__putw( int binint, FILE *fp ) 1555 1878 { 1556 dprintf(("CRTDLL: _putw \n"));1879 dprintf(("CRTDLL: _putw not implemented.\n")); 1557 1880 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1558 1881 return FALSE; … … 1585 1908 void CDECL CRTDLL__searchenv( const char *name, const char *env_var, char *buf ) 1586 1909 { 1587 dprintf(("CRTDLL: _searchenv \n"));1910 dprintf(("CRTDLL: _searchenv not implemented.\n")); 1588 1911 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1589 1912 } … … 1601 1924 1602 1925 /********************************************************************* 1926 * _setmode (CRTDLL.263) 1927 * FIXME: At present we ignore the request to translate CR/LF to LF. 1928 * 1929 * We allways translate when we read with fgets, we never do with fread 1930 * 1931 */ 1932 INT CDECL CRTDLL__setmode( INT fh,INT mode) 1933 { 1934 /* FIXME */ 1935 dprintf(("on fhandle %d mode %s, STUB.\n", 1936 fh,(mode=O_TEXT)?"O_TEXT": 1937 (mode=O_BINARY)?"O_BINARY":"UNKNOWN")); 1938 return -1; 1939 } 1940 1941 1942 /********************************************************************* 1943 * _sleep (CRTDLL.265) 1944 */ 1945 VOID CDECL CRTDLL__sleep(unsigned long timeout) 1946 { 1947 dprintf(("CRTDLL__sleep for %ld milliseconds\n",timeout)); 1948 Sleep((timeout)?timeout:1); 1949 } 1950 1951 1952 /********************************************************************* 1603 1953 * CRTDLL__stat (CRTDLL.278) 1604 1954 */ … … 1633 1983 * CRTDLL__strdup (CRTDLL.283) 1634 1984 */ 1635 char * CDECL CRTDLL__strdup( const char *string)1985 LPSTR CDECL CRTDLL__strdup(LPCSTR ptr) 1636 1986 { 1637 1987 dprintf(("CRTDLL: _strdup\n")); 1638 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1639 return FALSE; 1988 return HEAP_strdupA(GetProcessHeap(),0,ptr); 1640 1989 } 1641 1990 … … 1646 1995 int CDECL CRTDLL__stricoll( const char *s1, const char *s2 ) 1647 1996 { 1648 dprintf(("CRTDLL: _stricoll \n"));1997 dprintf(("CRTDLL: _stricoll not implemented.\n")); 1649 1998 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1650 1999 return FALSE; … … 1698 2047 char * CDECL CRTDLL__strnset( char *string, int c, size_t len ) 1699 2048 { 1700 dprintf(("CRTDLL: _strnset \n"));2049 dprintf(("CRTDLL: _strnset not implemented.\n")); 1701 2050 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1702 2051 return FALSE; … … 1709 2058 char * CDECL CRTDLL__strrev( char *string ) 1710 2059 { 1711 dprintf(("CRTDLL: _strrev \n"));2060 dprintf(("CRTDLL: _strrev not implemented.\n")); 1712 2061 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1713 2062 return FALSE; … … 1720 2069 char * CDECL CRTDLL__strset( char *string, int c ) 1721 2070 { 1722 dprintf(("CRTDLL: _strset \n"));2071 dprintf(("CRTDLL: _strset not implemented.\n")); 1723 2072 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1724 2073 return FALSE; … … 1777 2126 1778 2127 /********************************************************************* 2128 * _unlink (CRTDLL.312) 2129 */ 2130 INT CDECL CRTDLL__unlink(LPCSTR pathname) 2131 { 2132 dprintf(("CRTDLL: _unlink\n")); 2133 int ret=0; 2134 DOS_FULL_NAME full_name; 2135 2136 if (!DOSFS_GetFullName( pathname, FALSE, (CHAR*)&full_name )) { 2137 dprintf(("CRTDLL_unlink file %s bad name\n",pathname)); 2138 return EOF; 2139 } 2140 2141 ret=unlink(full_name.long_name); 2142 dprintf(("(%s unix %s)\n", 2143 pathname,full_name.long_name)); 2144 if(ret) 2145 dprintf((" Failed!\n")); 2146 2147 return ret; 2148 } 2149 2150 2151 /********************************************************************* 1779 2152 * CRTDLL__utime (CRTDLL.314) 1780 2153 */ … … 1791 2164 int CDECL CRTDLL__vsnwprintf( wchar_t *s1, size_t n, const wchar_t *s2, va_list arg ) 1792 2165 { 1793 dprintf(("CRTDLL: _vsnwprintf \n"));2166 dprintf(("CRTDLL: _vsnwprintf not implemented.\n")); 1794 2167 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1795 2168 return FALSE; … … 1800 2173 * CRTDLL__wcsdup (CRTDLL.317) 1801 2174 */ 1802 wchar_t * CDECL CRTDLL__wcsdup( const wchar_t *s1)2175 LPWSTR CDECL CRTDLL__wcsdup( LPCWSTR str ) 1803 2176 { 1804 2177 dprintf(("CRTDLL: _wcsdup\n")); 1805 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1806 return FALSE; 2178 LPWSTR ret = NULL; 2179 if (str) 2180 { 2181 int size = (wcslen((const wchar_t*)str) + 1) * sizeof(WCHAR); 2182 // FIXME ret = CRTDLL_malloc( size ); 2183 if (ret) memcpy( ret, str, size ); 2184 } 2185 return ret; 1807 2186 } 1808 2187 … … 1811 2190 * CRTDLL__wcsicoll (CRTDLL.319) 1812 2191 */ 1813 int CDECL CRTDLL__wcsicoll( const wchar_t *s1, const wchar_t *s2 )2192 int CDECL CRTDLL__wcsicoll( LPCWSTR str1, LPCWSTR str2 ) 1814 2193 { 1815 2194 dprintf(("CRTDLL: _wcsicoll\n")); 1816 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1817 return FALSE; 2195 return NTDLL__wcsicmp( str1, str2 ); 1818 2196 } 1819 2197 … … 1824 2202 LPWSTR CDECL CRTDLL__wcsnset( LPWSTR str, WCHAR c, INT n ) 1825 2203 { 2204 dprintf(("CRTDLL: _wcsnset\n")); 1826 2205 LPWSTR ret = str; 1827 2206 while ((n-- > 0) && *str) *str++ = c; … … 1833 2212 * CRTDLL__wcsrev (CRTDLL.323) 1834 2213 */ 1835 wchar_t * CDECL CRTDLL__wcsrev( wchar_t *s1)2214 LPWSTR CDECL CRTDLL__wcsrev( LPWSTR str ) 1836 2215 { 1837 2216 dprintf(("CRTDLL: _wcsrev\n")); 1838 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1839 return FALSE; 2217 LPWSTR ret = str; 2218 LPWSTR end = str + wcslen((const wchar_t*)str) - 1; 2219 while (end > str) 2220 { 2221 WCHAR t = *end; 2222 *end-- = *str; 2223 *str++ = t; 2224 } 2225 return ret; 1840 2226 } 1841 2227 … … 1846 2232 LPWSTR CDECL CRTDLL__wcsset( LPWSTR str, WCHAR c ) 1847 2233 { 2234 dprintf(("CRTDLL: _wcsset\n")); 1848 2235 LPWSTR ret = str; 1849 2236 while (*str) *str++ = c; … … 1851 2238 } 1852 2239 2240 2241 /********************************************************************* 2242 * _write (CRTDLL.329) 2243 */ 2244 INT CDECL CRTDLL__write(INT fd,LPCVOID buf,UINT count) 2245 { 2246 dprintf(("CRTDLL: _write\n")); 2247 INT len=0; 2248 2249 if (fd == -1) 2250 len = -1; 2251 else if (fd<=2) 2252 len = (UINT)write(fd,buf,(LONG)count); 2253 else 2254 len = _lwrite(fd,(LPCSTR)buf,count); 2255 dprintf(("%d/%d byte to dfh %d from %p,\n", 2256 len,count,fd,buf)); 2257 return len; 2258 } 2259 2260 1853 2261 /********************************************************************* 1854 2262 * isleadbyte (CRTDLL.335) … … 1860 2268 } 1861 2269 2270 1862 2271 /********************************************************************* 1863 2272 * acos (CRTDLL.336) … … 1869 2278 } 1870 2279 2280 1871 2281 /********************************************************************* 1872 2282 * asctime (CRTDLL.338) … … 1878 2288 } 1879 2289 2290 1880 2291 /********************************************************************* 1881 2292 * asin (CRTDLL.339) … … 1887 2298 } 1888 2299 2300 1889 2301 /********************************************************************* 1890 2302 * atan2 (CRTDLL.341) … … 1896 2308 } 1897 2309 2310 1898 2311 /********************************************************************* 1899 2312 * atexit (CRTDLL.342) … … 1901 2314 int CDECL CRTDLL_atexit( register void ( *func )( void ) ) 1902 2315 { 1903 dprintf(("CRTDLL: atexit\n")); 1904 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1905 return FALSE; 1906 } 2316 dprintf(("CRTDLL: atexit not implemented.\n")); 2317 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 2318 return FALSE; 2319 } 2320 1907 2321 1908 2322 /********************************************************************* … … 1915 2329 } 1916 2330 2331 1917 2332 /********************************************************************* 1918 2333 * bsearch (CRTDLL.346) … … 1921 2336 size_t size, int (*compar)(const void *pkey, const void *pbase) ) 1922 2337 { 1923 dprintf(("CRTDLL: bsearch\n")); 1924 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1925 return FALSE; 1926 } 2338 dprintf(("CRTDLL: bsearch not implemented.\n")); 2339 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 2340 return FALSE; 2341 } 2342 1927 2343 1928 2344 /********************************************************************* … … 1935 2351 } 1936 2352 2353 1937 2354 /********************************************************************* 1938 2355 * clearerr (CRTDLL.349) … … 1944 2361 } 1945 2362 2363 1946 2364 /********************************************************************* 1947 2365 * clock (CRTDLL.350) … … 1953 2371 } 1954 2372 2373 1955 2374 /********************************************************************* 1956 2375 * cosh (CRTDLL.352) … … 1962 2381 } 1963 2382 2383 1964 2384 /********************************************************************* 1965 2385 * ctime (CRTDLL.353) … … 1971 2391 } 1972 2392 2393 1973 2394 /********************************************************************* 1974 2395 * difftime (CRTDLL.354) … … 1980 2401 } 1981 2402 2403 1982 2404 /********************************************************************* 1983 2405 * div (CRTDLL.355) … … 1989 2411 } 1990 2412 2413 1991 2414 /********************************************************************* 1992 2415 * exit (CRTDLL.356) … … 1998 2421 } 1999 2422 2423 2000 2424 /********************************************************************* 2001 2425 * exp (CRTDLL.357) … … 2007 2431 } 2008 2432 2433 2009 2434 /********************************************************************* 2010 2435 * fclose (CRTDLL.359) … … 2016 2441 } 2017 2442 2443 2018 2444 /********************************************************************* 2019 2445 * feof (CRTDLL.360) … … 2025 2451 } 2026 2452 2453 2027 2454 /********************************************************************* 2028 2455 * ferror (CRTDLL.361) … … 2034 2461 } 2035 2462 2463 2036 2464 /********************************************************************* 2037 2465 * fflush (CRTDLL.362) … … 2043 2471 } 2044 2472 2473 2045 2474 /********************************************************************* 2046 2475 * fgetc (CRTDLL.363) … … 2052 2481 } 2053 2482 2483 2054 2484 /********************************************************************* 2055 2485 * fgetpos (CRTDLL.364) … … 2061 2491 } 2062 2492 2493 2063 2494 /********************************************************************* 2064 2495 * fgets (CRTDLL.365) … … 2070 2501 } 2071 2502 2503 2072 2504 /********************************************************************* 2073 2505 * fgetwc (CRTDLL.366) … … 2079 2511 } 2080 2512 2513 2081 2514 /********************************************************************* 2082 2515 * fmod (CRTDLL.368) … … 2088 2521 } 2089 2522 2523 2090 2524 /********************************************************************* 2091 2525 * fopen (CRTDLL.369) … … 2096 2530 return (fopen( filename, mode)); 2097 2531 } 2532 2098 2533 2099 2534 /********************************************************************* … … 2112 2547 } 2113 2548 2549 2114 2550 /********************************************************************* 2115 2551 * fputc (CRTDLL.371) … … 2121 2557 } 2122 2558 2559 2123 2560 /********************************************************************* 2124 2561 * fputs (CRTDLL.372) … … 2130 2567 } 2131 2568 2569 2132 2570 /********************************************************************* 2133 2571 * fputwc (CRTDLL.373) … … 2139 2577 } 2140 2578 2579 2141 2580 /********************************************************************* 2142 2581 * fread (CRTDLL.374) … … 2147 2586 return (fread(ptr, size, n, fp)); 2148 2587 } 2588 2149 2589 2150 2590 /********************************************************************* … … 2157 2597 } 2158 2598 2599 2159 2600 /********************************************************************* 2160 2601 * freopen (CRTDLL.376) … … 2166 2607 } 2167 2608 2609 2168 2610 /********************************************************************* 2169 2611 * frexp (CRTDLL.377) … … 2175 2617 } 2176 2618 2619 2177 2620 /********************************************************************* 2178 2621 * fscanf (CRTDLL.378) … … 2180 2623 int CDECL CRTDLL_fscanf( FILE*fp, const char *format, ... ) 2181 2624 { 2182 dprintf(("CRTDLL: frexp\n")); 2183 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 2184 return FALSE; 2185 } 2625 dprintf(("CRTDLL: fscanf\n")); 2626 #if 0 2627 va_list valist; 2628 INT res; 2629 2630 va_start( valist, format ); 2631 #ifdef HAVE_VFSCANF 2632 res = vfscanf( xlat_file_ptr(stream), format, valist ); 2633 #endif 2634 va_end( valist ); 2635 return res; 2636 #endif 2637 dprintf(("broken\n")); 2638 return 0; 2639 } 2640 2186 2641 2187 2642 /********************************************************************* 2188 2643 * fseek (CRTDLL.379) 2189 2644 */ 2190 int CDECL CRTDLL_fseek( FILE *f p, long int offset, int whence )2645 int CDECL CRTDLL_fseek( FILE *file, long int offset, int whence ) 2191 2646 { 2192 2647 dprintf(("CRTDLL: fseek\n")); 2193 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 2194 return FALSE; 2195 } 2648 dprintf(("file %p to 0x%08lx pos %s\n", 2649 file,offset,(whence==SEEK_SET)?"SEEK_SET": 2650 (whence==SEEK_CUR)?"SEEK_CUR": 2651 (whence==SEEK_END)?"SEEK_END":"UNKNOWN")); 2652 // FIXME if (SetFilePointer( file->handle, offset, NULL, whence ) != 0xffffffff) 2653 // FIXME return 0; 2654 dprintf((" failed!\n")); 2655 return -1; 2656 } 2657 2196 2658 2197 2659 /********************************************************************* … … 2204 2666 } 2205 2667 2668 2206 2669 /********************************************************************* 2207 2670 * ftell (CRTDLL.381) … … 2213 2676 } 2214 2677 2678 2215 2679 /********************************************************************* 2216 2680 * fwprintf (CRTDLL.382) … … 2218 2682 int CDECL CRTDLL_fwprintf( FILE *strm, const wchar_t *format, ... ) 2219 2683 { 2220 dprintf(("CRTDLL: fwprintf\n")); 2221 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 2222 return FALSE; 2223 } 2684 dprintf(("CRTDLL: fwprintf not implemented.\n")); 2685 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 2686 return FALSE; 2687 } 2688 2224 2689 2225 2690 /********************************************************************* … … 2235 2700 } 2236 2701 2702 2237 2703 /********************************************************************* 2238 2704 * fwscanf (CRTDLL.384) … … 2240 2706 int CDECL CRTDLL_fwscanf( FILE *strm, const wchar_t *format, ... ) 2241 2707 { 2242 dprintf(("CRTDLL: fwscanf\n")); 2243 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 2244 return FALSE; 2245 } 2708 dprintf(("CRTDLL: fwscanf not implemented.\n")); 2709 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 2710 return FALSE; 2711 } 2712 2246 2713 2247 2714 /********************************************************************* … … 2254 2721 } 2255 2722 2723 2256 2724 /********************************************************************* 2257 2725 * getchar (CRTDLL.386) … … 2263 2731 } 2264 2732 2733 2265 2734 /********************************************************************* 2266 2735 * getenv (CRTDLL.387) … … 2272 2741 } 2273 2742 2743 2274 2744 /********************************************************************* 2275 2745 * gets (CRTDLL.388) … … 2281 2751 } 2282 2752 2753 2283 2754 /********************************************************************* 2284 2755 * gmtime (CRTDLL.389) … … 2290 2761 } 2291 2762 2763 2292 2764 /********************************************************************* 2293 2765 * is_wctype (CRTDLL.390) … … 2300 2772 } 2301 2773 2774 2302 2775 /********************************************************************* 2303 2776 * isalnum (CRTDLL.391) … … 2309 2782 } 2310 2783 2784 2311 2785 /********************************************************************* 2312 2786 * iscntrl (CRTDLL.393) … … 2318 2792 } 2319 2793 2794 2320 2795 /********************************************************************* 2321 2796 * isgraph (CRTDLL.395) … … 2327 2802 } 2328 2803 2804 2329 2805 /********************************************************************* 2330 2806 * isleadbyte (CRTDLL.396) … … 2332 2808 int CDECL CRTDLL_isleadbyte(int i) 2333 2809 { 2334 dprintf(("CRTDLL: isleadbyte(%08xh)\n", i)); 2335 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 2336 return FALSE; 2337 } 2810 dprintf(("CRTDLL: isleadbyte(%08xh) not implemented.\n", i)); 2811 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 2812 return FALSE; 2813 } 2814 2338 2815 2339 2816 /********************************************************************* … … 2346 2823 } 2347 2824 2825 2348 2826 /********************************************************************* 2349 2827 * iswalnum (CRTDLL.402) … … 2352 2830 { 2353 2831 dprintf(("CRTDLL: iswalnum(%08xh)\n", i)); 2354 2355 2832 return (iswalnum(i)); 2356 2833 } 2357 2834 2835 2358 2836 /********************************************************************* 2359 2837 * iswascii (CRTDLL.404) … … 2361 2839 int CDECL CRTDLL_iswascii(wint_t i) 2362 2840 { 2363 dprintf(("CRTDLL: iswascii(%08xh) \n", i));2364 2365 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);2366 return FALSE; 2367 } 2841 dprintf(("CRTDLL: iswascii(%08xh) not implemented.\n", i)); 2842 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 2843 return FALSE; 2844 } 2845 2368 2846 2369 2847 /********************************************************************* … … 2373 2851 { 2374 2852 dprintf(("CRTDLL: iswcntrl(%08xh)\n", i)); 2375 2376 2853 return (iswcntrl(i)); 2377 2854 } 2378 2855 2856 2379 2857 /********************************************************************* 2380 2858 * iswdigit (CRTDLL.407) … … 2383 2861 { 2384 2862 dprintf(("CRTDLL: iswdigit(%08xh)\n", i)); 2385 2386 2863 return (iswdigit(i)); 2387 2864 } 2388 2865 2866 2389 2867 /********************************************************************* 2390 2868 * iswgraph (CRTDLL.408) … … 2393 2871 { 2394 2872 dprintf(("CRTDLL: iswgraph(%08xh)\n", i)); 2395 2396 2873 return (iswgraph(i)); 2397 2874 } 2398 2875 2876 2399 2877 /********************************************************************* 2400 2878 * iswlower (CRTDLL.409) … … 2403 2881 { 2404 2882 dprintf(("CRTDLL: iswlower(%08xh)\n", i)); 2405 2406 2883 return (iswlower(i)); 2407 2884 } 2408 2885 2886 2409 2887 /********************************************************************* 2410 2888 * iswprint (CRTDLL.410) … … 2413 2891 { 2414 2892 dprintf(("CRTDLL: iswprint(%08xh)\n", i)); 2415 2416 2893 return (iswprint(i)); 2417 2894 } 2418 2895 2896 2419 2897 /********************************************************************* 2420 2898 * iswpunct (CRTDLL.411) … … 2423 2901 { 2424 2902 dprintf(("CRTDLL: iswpunct(%08xh)\n", i)); 2425 2426 2903 return (iswpunct(i)); 2427 2904 } 2428 2905 2906 2429 2907 /********************************************************************* 2430 2908 * iswspace (CRTDLL.412) … … 2433 2911 { 2434 2912 dprintf(("CRTDLL: iswspace(%08xh)\n", i)); 2435 2436 2913 return (iswspace(i)); 2437 2914 } 2438 2915 2916 2439 2917 /********************************************************************* 2440 2918 * iswupper (CRTDLL.413) … … 2443 2921 { 2444 2922 dprintf(("CRTDLL: iswupper(%08xh)\n", i)); 2445 2446 2923 return (iswupper(i)); 2447 2924 } 2448 2925 2926 2449 2927 /********************************************************************* 2450 2928 * iswxdigit (CRTDLL.414) … … 2453 2931 { 2454 2932 dprintf(("CRTDLL: iswxdigit(%08xh)\n", i)); 2455 2456 2933 return (iswxdigit(i)); 2457 2934 } 2458 2935 2936 2459 2937 /********************************************************************* 2460 2938 * ldexp (CRTDLL.417) … … 2463 2941 { 2464 2942 dprintf(("CRTDLL: ldexp\n")); 2465 2466 2943 return (ldexp(x, exp)); 2467 2944 } 2468 2945 2946 2469 2947 /********************************************************************* 2470 2948 * ldiv (CRTDLL.418) … … 2473 2951 { 2474 2952 dprintf(("CRTDLL: ldiv\n")); 2475 2476 2953 return (ldiv(numer, denom)); 2477 2954 } 2955 2478 2956 2479 2957 /********************************************************************* … … 2486 2964 } 2487 2965 2966 2488 2967 /********************************************************************* 2489 2968 * localtime (CRTDLL.420) … … 2495 2974 } 2496 2975 2976 2497 2977 /********************************************************************* 2498 2978 * log10 (CRTDLL.422) … … 2504 2984 } 2505 2985 2986 2506 2987 /********************************************************************* 2507 2988 * longjmp (CRTDLL.423) … … 2513 2994 } 2514 2995 2996 2515 2997 /********************************************************************* 2516 2998 * malloc (CRTDLL.424) … … 2522 3004 } 2523 3005 3006 2524 3007 /********************************************************************* 2525 3008 * mblen (CRTDLL.425) … … 2531 3014 } 2532 3015 3016 2533 3017 /********************************************************************* 2534 3018 * CRTDLL_mbtowc (CRTDLL.427) … … 2536 3020 INT CDECL CRTDLL_mbtowc( WCHAR *dst, LPCSTR str, INT n ) 2537 3021 { 3022 dprintf(("CRTDLL: _mbtowc\n")); 2538 3023 wchar_t res; 2539 3024 int ret = mbtowc( &res, str, n ); … … 2542 3027 } 2543 3028 3029 2544 3030 /********************************************************************* 2545 3031 * mktime (CRTDLL.433) … … 2551 3037 } 2552 3038 3039 2553 3040 /********************************************************************* 2554 3041 * modf (CRTDLL.434) … … 2560 3047 } 2561 3048 3049 2562 3050 /********************************************************************* 2563 3051 * perror (CRTDLL.435) … … 2569 3057 } 2570 3058 3059 2571 3060 /********************************************************************* 2572 3061 * printf (CRTDLL.437) … … 2574 3063 int CDECL CRTDLL_printf( const char *format, ... ) 2575 3064 { 2576 dprintf(("CRTDLL: printf \n"));3065 dprintf(("CRTDLL: printf not implemented.\n")); 2577 3066 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 2578 3067 return FALSE; 2579 3068 } 2580 3069 3070 2581 3071 /********************************************************************* 2582 3072 * putc (CRTDLL.438) … … 2588 3078 } 2589 3079 3080 2590 3081 /********************************************************************* 2591 3082 * putchar (CRTDLL.439) … … 2597 3088 } 2598 3089 3090 2599 3091 /********************************************************************* 2600 3092 * puts (CRTDLL.440) … … 2606 3098 } 2607 3099 3100 2608 3101 /********************************************************************* 2609 3102 * raise (CRTDLL.442) … … 2615 3108 } 2616 3109 3110 2617 3111 /********************************************************************* 2618 3112 * rand (CRTDLL.443) … … 2624 3118 } 2625 3119 3120 2626 3121 /********************************************************************* 2627 3122 * realloc (CRTDLL.444) … … 2630 3125 { 2631 3126 dprintf(("CRTDLL: realloc\n")); 2632 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);2633 return FALSE; 2634 } 3127 return HeapReAlloc( GetProcessHeap(), 0, ptr, size ); 3128 } 3129 2635 3130 2636 3131 /********************************************************************* … … 2645 3140 } 2646 3141 3142 2647 3143 /********************************************************************* 2648 3144 * rename (CRTDLL.446) … … 2654 3150 } 2655 3151 3152 2656 3153 /********************************************************************* 2657 3154 * rewind (CRTDLL.447) … … 2663 3160 } 2664 3161 3162 2665 3163 /********************************************************************* 2666 3164 * scanf (CRTDLL.448) … … 2668 3166 int CDECL CRTDLL_scanf( const char *format, ... ) 2669 3167 { 2670 dprintf(("CRTDLL: scanf\n")); 2671 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 2672 return FALSE; 2673 } 3168 dprintf(("CRTDLL: scanf not implemented.\n")); 3169 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 3170 return FALSE; 3171 } 3172 2674 3173 2675 3174 /********************************************************************* … … 2682 3181 } 2683 3182 3183 2684 3184 /********************************************************************* 2685 3185 * setlocale (CRTDLL.450) … … 2691 3191 } 2692 3192 3193 2693 3194 /********************************************************************* 2694 3195 * setvbuf (CRTDLL.451) … … 2700 3201 } 2701 3202 3203 2702 3204 /********************************************************************* 2703 3205 * signal (CRTDLL.452) … … 2705 3207 void CDECL CRTDLL_signal( int sig, void (*func)(int)) 2706 3208 { 2707 dprintf(("CRTDLL: signal \n"));3209 dprintf(("CRTDLL: signal not implemented.\n")); 2708 3210 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 2709 3211 } 3212 2710 3213 2711 3214 /********************************************************************* … … 2718 3221 } 2719 3222 3223 2720 3224 /********************************************************************* 2721 3225 * srand (CRTDLL.457) … … 2727 3231 } 2728 3232 3233 2729 3234 /********************************************************************* 2730 3235 * strcoll (CRTDLL.462) … … 2736 3241 } 2737 3242 3243 2738 3244 /********************************************************************* 2739 3245 * strerror (CRTDLL.465) … … 2745 3251 } 2746 3252 3253 2747 3254 /********************************************************************* 2748 3255 * strftime (CRTDLL.466) … … 2764 3271 } 2765 3272 3273 2766 3274 /********************************************************************* 2767 3275 * strtok (CRTDLL.476) … … 2773 3281 } 2774 3282 3283 2775 3284 /********************************************************************* 2776 3285 * strtol (CRTDLL.477) … … 2782 3291 } 2783 3292 3293 2784 3294 /********************************************************************* 2785 3295 * strtoul (CRTDLL.478) … … 2791 3301 } 2792 3302 3303 2793 3304 /********************************************************************* 2794 3305 * strxfrm (CRTDLL.479) … … 2800 3311 } 2801 3312 3313 2802 3314 /********************************************************************* 2803 3315 * swscanf (CRTDLL.481) … … 2805 3317 int CDECL CRTDLL_swscanf( const wchar_t *s1, const wchar_t *s2, ... ) 2806 3318 { 2807 dprintf(("CRTDLL: swscanf\n")); 2808 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 2809 return FALSE; 2810 } 3319 dprintf(("CRTDLL: swscanf not implemented.\n")); 3320 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 3321 return FALSE; 3322 } 3323 2811 3324 2812 3325 /********************************************************************* … … 2819 3332 } 2820 3333 3334 2821 3335 /********************************************************************* 2822 3336 * tanh (CRTDLL.485) … … 2828 3342 } 2829 3343 3344 2830 3345 /********************************************************************* 2831 3346 * time (CRTDLL.485) … … 2838 3353 } 2839 3354 2840 /********************************************************************* 2841 * tmpnam (CRTDLL.486) 3355 3356 /********************************************************************* 3357 * tmpfile (CRTDLL.486) 2842 3358 */ 2843 3359 FILE * CDECL CRTDLL_tmpfile( void ) … … 2846 3362 return (tmpfile()); 2847 3363 } 3364 2848 3365 2849 3366 /********************************************************************* … … 2853 3370 { 2854 3371 dprintf(("CRTDLL: tmpnam\n")); 2855 2856 3372 return (tmpnam(s)); 2857 3373 } 2858 3374 3375 2859 3376 /********************************************************************* 2860 3377 * ungetc (CRTDLL.492) … … 2862 3379 INT CDECL CRTDLL_ungetc(int c) 2863 3380 { 2864 dprintf(("CRTDLL: ungetc\n")); 2865 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 2866 return FALSE; 2867 } 3381 dprintf(("CRTDLL: ungetc not implemented.\n")); 3382 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 3383 return FALSE; 3384 } 3385 2868 3386 2869 3387 /********************************************************************* … … 2873 3391 { 2874 3392 dprintf(("CRTDLL: ungetwc\n")); 2875 2876 3393 return (ungetwc(wc, strm)); 2877 3394 } 3395 2878 3396 2879 3397 /********************************************************************* … … 2884 3402 dprintf(("CRTDLL: vprintf\n")); 2885 3403 char buffer[2048]; /* FIXME... */ 2886 2887 3404 vsprintf( buffer, format, args ); 2888 3405 return CRTDLL_fwrite( buffer, 1, strlen(buffer), file ); 2889 3406 } 2890 3407 3408 2891 3409 /********************************************************************* 2892 3410 * vfwprintf (CRTDLL.495) … … 2894 3412 int CDECL CRTDLL_vfwprintf( FILE *F, const wchar_t *s, va_list arg ) 2895 3413 { 2896 dprintf(("CRTDLL: vfwprintf\n")); 2897 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 2898 return FALSE; 2899 } 3414 dprintf(("CRTDLL: vfwprintf not implemented.\n")); 3415 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 3416 return FALSE; 3417 } 3418 2900 3419 2901 3420 /********************************************************************* … … 2905 3424 { 2906 3425 dprintf(("CRTDLL: vprintf\n")); 2907 2908 3426 return (vprintf(format, arg)); 2909 3427 } 2910 3428 3429 2911 3430 /********************************************************************* 2912 3431 * vswprintf (CRTDLL.498) … … 2915 3434 { 2916 3435 dprintf(("CRTDLL: vswprintf\n")); 2917 2918 3436 return (vswprintf(s, t, format, arg)); 2919 3437 } 2920 3438 3439 2921 3440 /********************************************************************* 2922 3441 * vwprintf (CRTDLL.499) … … 2924 3443 int CDECL CRTDLL_vwprintf( const wchar_t *s, va_list arg) 2925 3444 { 2926 dprintf(("CRTDLL: vwprintf \n"));3445 dprintf(("CRTDLL: vwprintf not implemented.\n")); 2927 3446 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 2928 3447 return FALSE; … … 2936 3455 { 2937 3456 dprintf(("CRTDLL: wcscoll\n")); 2938 2939 3457 return (wcscoll(s1, s2)); 2940 3458 } 3459 2941 3460 2942 3461 /********************************************************************* … … 2947 3466 { 2948 3467 dprintf(("CRTDLL: wcsftime\n")); 2949 2950 3468 return (wcsftime(s, maxsize, format, timeptr)); 2951 3469 } 3470 2952 3471 2953 3472 /********************************************************************* … … 2960 3479 } 2961 3480 3481 2962 3482 /********************************************************************* 2963 3483 * wcsxfrm (CRTDLL.520) … … 2966 3486 { 2967 3487 dprintf(("CRTDLL: wcsxfrm\n")); 2968 2969 3488 return (wcsxfrm(s1, s2, n)); 2970 3489 } 2971 3490 3491 2972 3492 /********************************************************************* 2973 3493 * wcstomb (CRTDLL.521) … … 2976 3496 { 2977 3497 dprintf(("CRTDLL: wctomb\n")); 2978 2979 3498 return (wctomb(s,wchar)); 2980 3499 } 2981 3500 3501 2982 3502 /********************************************************************* 2983 3503 * wprintf (CRTDLL.522) … … 2985 3505 int CDECL CRTDLL_wprintf( const wchar_t *s, ... ) 2986 3506 { 2987 dprintf(("CRTDLL: wprintf\n")); 2988 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 2989 return FALSE; 2990 } 3507 dprintf(("CRTDLL: wprintf not implemented.\n")); 3508 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 3509 return FALSE; 3510 } 3511 2991 3512 2992 3513 /********************************************************************* … … 2995 3516 int CDECL CRTDLL_wscanf( const wchar_t *s, ... ) 2996 3517 { 2997 dprintf(("CRTDLL: wscanf\n")); 2998 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 2999 return FALSE; 3000 } 3001 3002 3518 dprintf(("CRTDLL: wscanf not implemented.\n")); 3519 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 3520 return FALSE; 3521 }
Note:
See TracChangeset
for help on using the changeset viewer.