]> git.saurik.com Git - wxWidgets.git/commitdiff
fix GetSize() for large files (patch 1680876)
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 15 Mar 2007 00:18:05 +0000 (00:18 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 15 Mar 2007 00:18:05 +0000 (00:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44812 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/common/filename.cpp

index 214ed1f1b7758e5ad97521fa95cc180e66ac3e58..0dc9025a390dacc3b30d9217ca5fdb1633e2aae8 100644 (file)
@@ -67,6 +67,11 @@ wxMac
 
 - Corrected top border size for wxStaticBox with empty label (nusi)
 
+wxMSW:
+
+- Fixed wxFileName::GetSize() for large files
+
+
 2.8.2
 -----
 
index 52a8dcd29625f5f8b3cb1530adfe46a42f72ee55..3c5764a6bb7a4b0061ef60eaba6fdf15ae929f2d 100644 (file)
@@ -2331,14 +2331,11 @@ wxULongLong wxFileName::GetSize(const wxString &filename)
 
     DWORD lpFileSizeHigh;
     DWORD ret = GetFileSize(f, &lpFileSizeHigh);
-    if (ret == INVALID_FILE_SIZE)
+    if ( ret == INVALID_FILE_SIZE && ::GetLastError() != NO_ERROR )
         return wxInvalidSize;
 
-    // compose the low-order and high-order byte sizes
-    return wxULongLong(ret | (lpFileSizeHigh << sizeof(WORD)*2));
-
-#else           // ! __WIN32__
-
+    return wxULongLong(lpFileSizeHigh, ret);
+#else // ! __WIN32__
     wxStructStat st;
 #ifndef wxNEED_WX_UNISTD_H
     if (wxStat( filename.fn_str() , &st) != 0)