- Timestamp:
- Oct 25, 2001, 3:19:05 PM (24 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/exceptions.cpp
r7109 r7202 1 /* $Id: exceptions.cpp,v 1.5 6 2001-10-18 13:27:39sandervl Exp $ */1 /* $Id: exceptions.cpp,v 1.57 2001-10-25 13:19:04 sandervl Exp $ */ 2 2 3 3 /* … … 82 82 //Global Process Unhandled exception filter 83 83 static LPTOP_LEVEL_EXCEPTION_FILTER CurrentUnhExceptionFlt = NULL; 84 static UINT CurrentErrorMode = SEM_FAILCRITICALERRORS;84 static UINT CurrentErrorMode = 0; 85 85 static PEXCEPTION_HANDLER StartupCodeHandler = NULL; 86 86 -
trunk/src/kernel32/hmcomm.cpp
r5587 r7202 1 /* $Id: hmcomm.cpp,v 1.1 0 2001-04-26 13:22:43sandervl Exp $ */1 /* $Id: hmcomm.cpp,v 1.11 2001-10-25 13:19:05 sandervl Exp $ */ 2 2 3 3 /* … … 187 187 188 188 //AH: TODO parse Win32 security handles 189 OSLibDosDisableHardError(TRUE);189 ULONG oldmode = SetErrorMode(SEM_FAILCRITICALERRORS); 190 190 pHMHandleData->hHMHandle = OSLibDosOpen(comname, 191 191 OSLIB_ACCESS_READWRITE | 192 192 OSLIB_ACCESS_SHAREDENYREAD | 193 193 OSLIB_ACCESS_SHAREDENYWRITE); 194 OSLibDosDisableHardError(FALSE);194 SetErrorMode(oldmode); 195 195 if (pHMHandleData->hHMHandle != 0) 196 196 { -
trunk/src/kernel32/hmdisk.cpp
r6987 r7202 1 /* $Id: hmdisk.cpp,v 1.1 7 2001-10-10 15:06:06 phallerExp $ */1 /* $Id: hmdisk.cpp,v 1.18 2001-10-25 13:19:05 sandervl Exp $ */ 2 2 3 3 /* … … 104 104 //Disable error popus. NT allows an app to open a cdrom/dvd drive without a disk inside 105 105 //OS/2 fails in that case with error ERROR_NOT_READY 106 OSLibDosDisableHardError(TRUE);106 ULONG oldmode = SetErrorMode(SEM_FAILCRITICALERRORS); 107 107 hFile = OSLibDosCreateFile((LPSTR)lpFileName, 108 108 pHMHandleData->dwAccess, … … 112 112 pHMHandleData->dwFlags, 113 113 hTemplate); 114 OSLibDosDisableHardError(FALSE);114 SetErrorMode(oldmode); 115 115 116 116 if (hFile != INVALID_HANDLE_ERROR || GetLastError() == ERROR_NOT_READY) … … 503 503 *lpBytesReturned = 0; 504 504 } 505 506 char temp; 507 ULONG bytesread, oldmode; 508 APIRET rc; 509 510 //Applications can use this IOCTL to check if the floppy has been changed 511 //OSLibDosGetDiskGeometry won't fail when that happens so we read one 512 //byte from the disk and return ERROR_MEDIA_CHANGED if it fails with 513 //ERROR_WRONG_DISK 514 oldmode = SetErrorMode(SEM_FAILCRITICALERRORS); 515 rc = OSLibDosRead(pHMHandleData->hHMHandle, (PVOID)&temp, 516 1, &bytesread); 517 SetErrorMode(oldmode); 518 if(rc == FALSE) { 519 dprintf(("IOCTL_DISK_GET_DRIVE_GEOMETRY: DosRead failed with rc %d", GetLastError())); 520 if(GetLastError() == ERROR_WRONG_DISK) { 521 SetLastError(ERROR_MEDIA_CHANGED); 522 return FALSE; 523 } 524 } 525 else OSLibDosSetFilePtr(pHMHandleData->hHMHandle, -1, OSLIB_SETPTR_FILE_CURRENT); 526 505 527 if(OSLibDosGetDiskGeometry(pHMHandleData->hHMHandle, drvInfo->driveLetter, pGeom) == FALSE) { 506 528 return FALSE; -
trunk/src/kernel32/oslibdos.cpp
r7060 r7202 1 /* $Id: oslibdos.cpp,v 1. 79 2001-10-15 05:51:34 phallerExp $ */1 /* $Id: oslibdos.cpp,v 1.80 2001-10-25 13:19:05 sandervl Exp $ */ 2 2 /* 3 3 * Wrappers for OS/2 Dos* API … … 1550 1550 } 1551 1551 //****************************************************************************** 1552 //******************************************************************************1553 void OSLibDosDisableHardError(BOOL fTurnOff)1554 {1555 DosError((fTurnOff) ? FERR_DISABLEHARDERR : FERR_ENABLEHARDERR);1556 }1557 //******************************************************************************1558 1552 //Returns time spent in kernel & user mode in milliseconds 1559 1553 //****************************************************************************** … … 2190 2184 result.achName[0] = 0; 2191 2185 2192 DosError(FERR_DISABLEHARDERR | FERR_DISABLEEXCEPTION);2186 ULONG oldmode = SetErrorMode(SEM_FAILCRITICALERRORS_W); 2193 2187 APIRET rc = DosFindFirst((PSZ)lpFileName,&hDir,attrs,&result,sizeof(result),&searchCount,FIL_STANDARD); 2194 //PH: DosError(FERR_ENABLEHARDERR | FERR_ENABLEEXCEPTION);2195 2188 2196 2189 //check root: skip "." and ".." (HPFS, not on FAT) … … 2202 2195 { 2203 2196 result.achName[0] = 0; 2204 //PH: DosError(FERR_DISABLEHARDERR | FERR_DISABLEEXCEPTION);2205 2197 searchCount = 1; 2206 2198 APIRET rc = DosFindNext(hDir,&result,sizeof(result),&searchCount); 2207 //PH: DosError(FERR_ENABLEHARDERR | FERR_ENABLEEXCEPTION);2208 2199 if (rc) 2209 2200 { … … 2211 2202 SetLastError(error2WinError(rc)); 2212 2203 2213 DosError(FERR_ENABLEHARDERR | FERR_ENABLEEXCEPTION);2204 SetErrorMode(oldmode); 2214 2205 return INVALID_HANDLE_VALUE_W; 2215 2206 } … … 2218 2209 2219 2210 // enable i/o kernel exceptions again 2220 DosError(FERR_ENABLEHARDERR | FERR_ENABLEEXCEPTION);2211 SetErrorMode(oldmode); 2221 2212 2222 2213 if(rc) … … 2243 2234 result = (FILEFINDBUF3*)malloc(searchCount*sizeof(FILEFINDBUF3)); 2244 2235 2245 DosError(FERR_DISABLEHARDERR | FERR_DISABLEEXCEPTION);2236 ULONG oldmode = SetErrorMode(SEM_FAILCRITICALERRORS_W); 2246 2237 APIRET rc = DosFindFirst((PSZ)lpFileName,&hDir,attrs,result,searchCount*sizeof(FILEFINDBUF3),&searchCount,FIL_STANDARD); 2247 DosError(FERR_ENABLEHARDERR | FERR_ENABLEEXCEPTION);2238 SetErrorMode(oldmode); 2248 2239 if (rc) 2249 2240 { … … 2347 2338 drv[0] = (char)('A' + drive - 1); 2348 2339 2349 DosError(FERR_DISABLEHARDERR);2340 ULONG oldmode = SetErrorMode(SEM_FAILCRITICALERRORS_W); 2350 2341 rc = DosQueryFSAttach(drv, 1, FSAIL_QUERYNAME, fsinfo, &cb); 2351 DosError(FERR_ENABLEHARDERR);2342 SetErrorMode(oldmode); 2352 2343 2353 2344 switch(rc) { … … 2391 2382 APIRET rc; 2392 2383 2393 DosError(FERR_DISABLEHARDERR);2384 ULONG oldmode = SetErrorMode(SEM_FAILCRITICALERRORS_W); 2394 2385 rc = DosQueryFSInfo(drive, FSIL_VOLSER, &fsi, sizeof(fsi)); 2395 DosError(FERR_ENABLEHARDERR);2386 SetErrorMode(oldmode); 2396 2387 2397 2388 switch(rc) { … … 2440 2431 diskNum = 0; 2441 2432 2442 DosError(FERR_DISABLEHARDERR);2433 ULONG oldmode = SetErrorMode(SEM_FAILCRITICALERRORS_W); 2443 2434 rc = DosQueryFSInfo(diskNum, FSIL_ALLOC, &fsAlloc, sizeof(fsAlloc)); 2444 DosError(FERR_ENABLEHARDERR);2435 SetErrorMode(oldmode); 2445 2436 2446 2437 if(rc == 0) … … 2467 2458 APIRET rc; 2468 2459 2460 dprintf(("OSLibDosGetDiskGeometry %x %d %x", hDisk, cDisk, pdiskgeom)); 2469 2461 param[1] = cDisk - 'A'; 2470 2462 rc = DosDevIOCtl((hDisk) ? hDisk : -1, IOCTL_DISK, DSK_GETDEVICEPARAMS, param, 2, &parsize, &bpb, sizeof(bpb), &datasize); … … 2509 2501 return TRUE; 2510 2502 } 2503 dprintf(("OSLibDosGetDiskGeometry: error %d -> %d", rc, error2WinError(rc))); 2511 2504 SetLastError(error2WinError(rc)); 2512 2505 return FALSE; -
trunk/src/kernel32/oslibdos.h
r6397 r7202 1 /* $Id: oslibdos.h,v 1.3 5 2001-07-28 18:03:38sandervl Exp $ */1 /* $Id: oslibdos.h,v 1.36 2001-10-25 13:19:05 sandervl Exp $ */ 2 2 3 3 /* … … 149 149 #endif 150 150 151 void OSLibDosDisableHardError(BOOL fTurnOff);152 151 BOOL OSLibDosQueryProcTimes(DWORD procid, ULONG *kerneltime, ULONG *usertime); 153 152
Note:
See TracChangeset
for help on using the changeset viewer.