Changeset 562 for trunk


Ignore:
Timestamp:
Jul 21, 2008, 6:43:29 PM (16 years ago)
Author:
イグトランス (egtra)
Message:

9xなどで実行できなくなるので、GetFileSizeExをコメントアウト

Location:
trunk/ab5.0/ablib/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/ablib/src/Classes/System/IO/FileInfo.ab

    r523 r562  
    6464        End If
    6565
    66         Dim length As QWord
    67         If GetFileSizeEx(hFile, VarPtr(length)) Then
    68             CloseHandle(hFile)
    69             Return length
    70         Else
    71             CloseHandle(hFile)
    72             Throw New IOException("FileInfo.Length: Failed to GetFileSize")
     66        Dim pLength = VarPtr(Length) As *ULARGE_INTEGER
     67        pLength->LowPart = GetFileSize(hFile, VarPtr(pLength->HighPart))
     68        CloseHandle(hFile)
     69
     70        Dim error = GetLastError()
     71        If pLength->LowPart = INVALID_FILE_SIZE And error <> NO_ERROR Then
     72            Throw New IOException("FileInfo.Length: Failed to GetFileSize", HRESULT_FROM_WIN32(error))
    7373        End If
    7474    End Function
  • trunk/ab5.0/ablib/src/api_system.sbp

    r556 r562  
    559559) As BOOL
    560560Declare Function GetFileSize Lib "kernel32" (hFile As HANDLE, pFileSizeHigh As *DWord) As DWord
    561 Declare Function GetFileSizeEx Lib "kernel32" (hFile As HANDLE, pFileSizeHigh As *QWord) As Boolean
     561'Declare Function GetFileSizeEx Lib "kernel32" (hFile As HANDLE, pFileSizeHigh As *QWord) As Boolean
    562562Declare Function GetFileTime Lib "kernel32" (hFile As HANDLE, ByRef lpCreationTime As FILETIME, ByRef lpLastAccessTime As FILETIME, ByRef lpLastWriteTime As FILETIME) As BOOL
    563563
Note: See TracChangeset for help on using the changeset viewer.