Changeset 426 for trunk/Include/Classes/System/IO/FileStream.ab
- Timestamp:
- Feb 26, 2008, 3:33:49 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Include/Classes/System/IO/FileStream.ab
r391 r426 76 76 77 77 op = options As DWord 78 If Not Environment.OSVersion.Platform = PlatformID.Win32NT Then 78 ' If (Environment.OSVersion.Platform As DWord) <> (PlatformID.Win32NT As DWord) Then 'ToDo: なぜかアクセス違反になる 79 79 op And= Not FILE_FLAG_OVERLAPPED 80 End If80 ' End If 81 81 82 82 This.handle=CreateFile(ToTCStr(path),ac,sh,ByVal NULL,mo,op,0) … … 305 305 End Sub 306 306 307 Override Function Read( 307 Override Function Read(buffer As *Byte, offset As Long, count As Long) As Long 308 308 disposedCheck() 309 309 If buffer = 0 Then 310 ' Throw ArgumentNullException("FileStream.Read: An argument is null value.", "buffer")310 Throw New ArgumentNullException("FileStream.Read: An argument is null value.", "buffer") 311 311 ElseIf Not This.CanRead() Then 312 ' Throw NotSupportedException("FileStream.Read: This stream is not readable.")312 Throw New NotSupportedException("FileStream.Read: This stream is not readable.") 313 313 End If 314 314 … … 320 320 overlapped.hEvent = CreateEvent(0, TRUE, FALSE, 0) 321 321 If overlapped.hEvent = 0 Then 322 ' Throw OutOfMemoryException("FileStream.Read: Failed to create an event object.")322 Throw New OutOfMemoryException("FileStream.Read: Failed to create an event object.") 323 323 End If 324 324 Try … … 327 327 Dim error = GetLastError() 328 328 If error <> ERROR_IO_PENDING Then 329 'Detail.ThrowWinIOException("FileStream.Read: Failed to read.", error)329 Detail.ThrowWinIOException("FileStream.Read: Failed to read.", error) 330 330 End If 331 331 End If 332 332 ret = GetOverlappedResult(This.handle, overlapped, readBytes, TRUE) 333 333 If ret = FALSE Then 334 'Detail.ThrowWinLastErrorIOException("FileStream.Read: Failed to read.")334 Detail.ThrowWinLastErrorIOException("FileStream.Read: Failed to read.") 335 335 End If 336 336 offset += Read … … 341 341 ret = ReadFile(This.handle,VarPtr(buffer[offset]),count,VarPtr(readBytes),ByVal NULL) 342 342 If ret = FALSE Then 343 'Detail.ThrowWinLastErrorIOException("FileStream.Read: Failed to read.")343 Detail.ThrowWinLastErrorIOException("FileStream.Read: Failed to read.") 344 344 End If 345 345 End If
Note:
See TracChangeset
for help on using the changeset viewer.