- Timestamp:
- Aug 22, 2000, 4:45:41 AM (25 years ago)
- Location:
- trunk/src/msvcrt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/msvcrt/msvcrt.cpp
r3734 r4067 1 /* $Id: msvcrt.cpp,v 1.1 2 2000-06-21 17:33:37phaller Exp $ */1 /* $Id: msvcrt.cpp,v 1.13 2000-08-22 02:45:40 phaller Exp $ */ 2 2 3 3 /* … … 14 14 #include <wchar.h> 15 15 #include <math.h> 16 #include <string.h> 17 16 18 #include <heapstring.h> 17 19 #include <crtdll.h> 20 21 #include <win/winbase.h> 22 #include <win/winnt.h> 18 23 #include "msvcrt.h" 19 24 … … 611 616 * FIXME - Could not find anything about it 612 617 */ 613 INT CDECL MSVCRT__CxxThrowException(DWORD ret) 614 { 615 dprintf(("MSVCRT: _CxxThrowException not implemented.\n")); 616 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 617 return FALSE; 618 619 static EXCEPTION_RECORD cxxExceptionFrame = 620 { 0x0e06d763, // Exception Code 621 0x00000001, // Exception Flags 622 0x00000000, // Exception Record Pointer 623 0x00000000, // Exception Address 624 0x00000003, // Number Of Parameters 625 0x19930520, // Parameter #1 626 0x00000000, // Parameter #2 627 0x00000000 // Parameter #3 628 }; 629 630 VOID CDECL MSVCRT__CxxThrowException(DWORD arg1, 631 DWORD arg2) 632 { 633 EXCEPTION_RECORD er; 634 635 dprintf(("MSVCRT: _CxxThrowException %08xh %08xh\n", 636 arg1, 637 arg2)); 638 639 //memcpy(er, cxxExceptionFrame, sizeof(er)); 640 // PH: optimization - why copying values when they're overwritten anyway... 641 memcpy(&er, &cxxExceptionFrame, 6); 642 643 // Note: er.ExceptionInformation[0] is already set! 644 er.ExceptionInformation[1] = arg1; 645 er.ExceptionInformation[2] = arg2; 646 647 RaiseException(er.ExceptionCode, 648 er.ExceptionFlags, 649 er.NumberParameters, 650 &er.ExceptionInformation[0]); 618 651 } 619 652 … … 1218 1251 1219 1252 /********************************************************************* 1253 * _unlock (MSVCRT.480) 1254 */ 1255 // Note: PH 2000/08/22 array size is probably larger than 0x12! 1256 static CRITICAL_SECTION* arrpCriticalSections[0x12] = {0}; 1257 1258 #define CRITSEC_TABLE_LOCK 0x11 1259 1260 VOID CDECL MSVCRT__unlock(unsigned long ulIndex) 1261 { 1262 dprintf(("MSVCRT: _unlock\n")); 1263 1264 CRITICAL_SECTION *pCS = arrpCriticalSections[ulIndex]; 1265 LeaveCriticalSection(pCS); 1266 } 1267 1268 1269 /********************************************************************* 1270 * _lock (MSVCRT.318) 1271 */ 1272 // Prototype from CRTDLL.CPP 1273 VOID CDECL amsg_exit(int errnum); 1274 1275 VOID CDECL MSVCRT__lock(unsigned long ulIndex) 1276 { 1277 dprintf(("MSVCRT: _lock\n")); 1278 1279 CRITICAL_SECTION *pCS = arrpCriticalSections[ulIndex]; 1280 if (pCS == NULL) 1281 { 1282 CRITICAL_SECTION *pCSNew; 1283 1284 pCSNew = (CRITICAL_SECTION*)malloc( sizeof(CRITICAL_SECTION) ); 1285 if (pCSNew == NULL) 1286 amsg_exit(0x11); // yield error message 1287 1288 MSVCRT__lock(CRITSEC_TABLE_LOCK); // lock table 1289 if (pCS != NULL) // has been modified meanwhile by other thread ? 1290 free(pCSNew); 1291 else 1292 { 1293 InitializeCriticalSection(pCSNew); 1294 arrpCriticalSections[ulIndex] = pCSNew; 1295 } 1296 1297 MSVCRT__unlock(CRITSEC_TABLE_LOCK); // unlock table 1298 } 1299 1300 EnterCriticalSection(pCS); 1301 } 1302 1303 1304 /********************************************************************* 1220 1305 * _lseeki64 (MSVCRT.326) 1221 1306 */ -
trunk/src/msvcrt/msvcrt.def
r3734 r4067 1 ; $Id: msvcrt.def,v 1.1 7 2000-06-21 17:33:37phaller Exp $1 ; $Id: msvcrt.def,v 1.18 2000-08-22 02:45:41 phaller Exp $ 2 2 3 3 ; … … 329 329 _loaddll = _CRTDLL__loaddll @316 330 330 _local_unwind2 = _CRTDLL__local_unwind2 @317 331 ; _lock@318331 _lock = _MSVCRT__lock @318 332 332 _locking = _CRTDLL__locking @319 333 333 _logb = _CRTDLL__logb @320 … … 493 493 _unlink = _CRTDLL__unlink @478 494 494 _unloaddll = _CRTDLL__unloaddll @479 495 ; _unlock@480495 _unlock = _MSVCRT__unlock @480 496 496 _utime = _CRTDLL__utime @481 497 497 _vsnprintf = _CRTDLL__vsnprintf @482
Note:
See TracChangeset
for help on using the changeset viewer.