Jelajahi Sumber

Further removal of unused MFC code

(Neither CTime nor CString throws any CException)

Source commit: d4432854a7b73218a52cd92a9542d7f18e02ea27
Martin Prikryl 2 bulan lalu
induk
melakukan
a23e73c987

+ 9 - 121
libs/mfc/include/afx.h

@@ -19,55 +19,11 @@
 
 #include <afxver_.h>        // Target version control
 
-/////////////////////////////////////////////////////////////////////////////
-// Classes declared in this file
-//   in addition to standard primitive data types and various helper macros
-
-class CObject;                        // the root of all objects classes
-
-	class CException;                 // the root of all exceptions
-		class CFileException;         // file exception
-
-	class CFile;                      // raw binary file
-
-// Non CObject classes
-struct CFileStatus;                   // file status information
-
 /////////////////////////////////////////////////////////////////////////////
 // Other includes from standard "C" runtimes
 
-#ifndef _INC_STRING
-	#include <string.h>
-#endif
-#ifndef _INC_STDIO
-	#include <stdio.h>
-#endif
-#ifndef _INC_STDLIB
-	#include <stdlib.h>
-#endif
-#ifndef _INC_TIME
-	#include <time.h>
-#endif
-#ifndef _INC_LIMITS
-	#include <limits.h>
-#endif
-#ifndef _INC_STDDEF
-	#include <stddef.h>
-#endif
 #include <System.hpp>
 
-/////////////////////////////////////////////////////////////////////////////
-// Basic types
-
-// Standard constants
-#undef FALSE
-#undef TRUE
-#undef NULL
-
-#define FALSE   0
-#define TRUE    1
-#define NULL    0
-
 /////////////////////////////////////////////////////////////////////////////
 // Diagnostic support
 
@@ -247,9 +203,9 @@ public:
 	// simple formatting
 
 	// printf-like formatting using passed string
-	void AFX_CDECL Format(LPCTSTR lpszFormat, ...);
+	void Format(LPCTSTR lpszFormat, ...);
 	// printf-like formatting using referenced string resource
-	void AFX_CDECL Format(UINT nFormatID, ...);
+	void Format(UINT nFormatID, ...);
 	// printf-like formatting using variable arguments parameter
 	void FormatV(LPCTSTR lpszFormat, va_list argList);
 
@@ -272,48 +228,10 @@ bool AFXAPI operator<(const CString& s1, const CString& s2);
 bool AFXAPI operator<(const CString& s1, LPCTSTR s2);
 bool AFXAPI operator<(LPCTSTR s1, const CString& s2);
 
-/////////////////////////////////////////////////////////////////////////////
-// class CObject is the root of all compliant objects
-
-class CObject
-{
-public:
-
-// Object model (types, destruction, allocation)
-	virtual ~CObject();  // virtual destructors are necessary
-
-	// Disable the copy constructor and assignment by default so you will get
-	//   compiler errors instead of unexpected behaviour if you pass objects
-	//   by value or assign objects.
-protected:
-	CObject();
-private:
-	CObject(const CObject& objectSrc);              // no implementation
-	void operator=(const CObject& objectSrc);       // no implementation
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// Exceptions
-
-class CException : public CObject
-{
-public:
-// Constructors
-	CException();
-
-// Operations
-	virtual BOOL GetErrorMessage(LPTSTR lpszError, UINT nMaxError,
-		PUINT pnHelpContext = NULL);
-
-// Implementation
-public:
-	virtual ~CException();
-};
-
 /////////////////////////////////////////////////////////////////////////////
 // Standard Exception classes
 
-class CFileException : public CException
+class CFileException
 {
 public:
 	enum {
@@ -345,15 +263,14 @@ public:
 
 // Operations
 	// convert a OS dependent error code to a Cause
-	static int PASCAL OsErrorToException(LONG lOsError);
+	static int OsErrorToException(LONG lOsError);
 
 	// helper functions to throw exception after converting to a Cause
-	static void PASCAL ThrowOsError(LONG lOsError, LPCTSTR lpszFileName = NULL);
+	static void ThrowOsError(LONG lOsError, LPCTSTR lpszFileName = NULL);
 
 // Implementation
 public:
-	virtual ~CFileException();
-	virtual BOOL GetErrorMessage(LPTSTR lpszError, UINT nMaxError,
+	BOOL GetErrorMessage(LPTSTR lpszError, UINT nMaxError,
 		PUINT pnHelpContext = NULL);
 };
 
@@ -366,7 +283,7 @@ void AFXAPI AfxThrowFileException(int cause, LONG lOsError = -1,
 /////////////////////////////////////////////////////////////////////////////
 // File - raw unbuffered disk file I/O
 
-class CFile : public CObject
+class CFile
 {
 public:
 // Flag values
@@ -386,21 +303,10 @@ public:
 		typeBinary =   (int)0x8000 // derived classes only
 		};
 
-	enum Attribute {
-		normal =    0x00,
-		readOnly =  0x01,
-		hidden =    0x02,
-		system =    0x04,
-		volume =    0x08,
-		directory = 0x10,
-		archive =   0x20
-		};
-
 	enum { hFileNull = -1 };
 
 // Constructors
 	CFile();
-        void PASCAL operator delete(void * p);
 
 // Attributes
 	UINT m_hFile;
@@ -409,8 +315,7 @@ public:
 	BOOL Open(LPCTSTR lpszFileName, UINT nOpenFlags,
 		CFileException* pError = NULL);
 
-	static BOOL PASCAL GetStatus(LPCTSTR lpszFileName,
-				CFileStatus& rStatus);
+	static BOOL IsValid(LPCTSTR lpszFileName);
 
 // Overridables
 	UINT Read(void* lpBuf, UINT nCount);
@@ -459,7 +364,7 @@ class CTime
 public:
 
 // Constructors
-	static CTime PASCAL GetCurrentTime();
+	static CTime GetCurrentTime();
 
 	CTime();
 	CTime(time_t time);
@@ -492,23 +397,6 @@ private:
 	time_t m_time;
 };
 
-/////////////////////////////////////////////////////////////////////////////
-// File status
-
-struct CFileStatus
-{
-	CTime m_ctime;          // creation date/time of file
-	CTime m_mtime;          // last modification date/time of file
-	CTime m_atime;          // last access date/time of file
-	LONG m_size;            // logical size of file in bytes
-	BYTE m_attribute;       // logical OR of CFile::Attribute enum values
-	BYTE _m_padding;        // pad the structure to a WORD
-	TCHAR m_szFullName[_MAX_PATH]; // absolute path name
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// Special include for Win32s compatibility
-
 /////////////////////////////////////////////////////////////////////////////
 // Inline function declarations
 

+ 0 - 12
libs/mfc/include/afx.inl

@@ -12,21 +12,9 @@
 
 #ifdef _AFX_INLINE
 
-// CObject
-_AFX_INLINE CObject::CObject()
-	{ }
-_AFX_INLINE CObject::~CObject()
-	{ }
-
-// exceptions
-_AFX_INLINE CException::~CException()
-	{ }
-
 _AFX_INLINE CFileException::CFileException(int cause, LONG lOsError,
 	LPCTSTR pstrFileName /* = NULL */)
 	{ m_cause = cause; m_lOsError = lOsError; m_strFileName = pstrFileName; }
-_AFX_INLINE CFileException::~CFileException()
-	{ }
 
 // CString
 _AFX_INLINE CString::CString()

+ 0 - 4
libs/mfc/include/afxconv.h

@@ -11,10 +11,6 @@
 #ifndef __AFXCONV_H__
 #define __AFXCONV_H__
 
-#ifndef _OBJBASE_H_
-#include <objbase.h>
-#endif
-
 /////////////////////////////////////////////////////////////////////////////
 // Global UNICODE<>ANSI translation helpers
 

+ 1 - 3
libs/mfc/include/afxres.rc

@@ -11,9 +11,7 @@
 #ifndef __AFXRES_RC__
 #define __AFXRES_RC__
 
-#ifndef __AFXRES_H__
-	#include <afxres.h>
-#endif
+#include <afxres.h>
 
 /////////////////////////////////////////////////////////////////////////////
 // Strings

+ 0 - 17
libs/mfc/include/afxv_w32.h

@@ -48,23 +48,6 @@
 #pragma warning(disable: 4201)  // winnt.h uses nameless structs
 #endif
 
-#define _WIN32_WINDOWS 0x0500
 #include <windows.h>
 
-#ifndef EXPORT
-#define EXPORT
-#endif
-
-#ifndef _INC_TCHAR
-	#include <tchar.h>      // used for ANSI v.s. UNICODE abstraction
-#endif
-#ifdef _MBCS
-#ifndef _INC_MBCTYPE
-	#include <mbctype.h>
-#endif
-#ifndef _INC_MBSTRING
-	#include <mbstring.h>
-#endif
-#endif
-
 /////////////////////////////////////////////////////////////////////////////

+ 0 - 32
libs/mfc/include/afxver_.h

@@ -10,14 +10,6 @@
 
 // afxver_.h - target version/configuration control
 
-/////////////////////////////////////////////////////////////////////////////
-// Master version numbers
-
-#define _AFX     1      // Microsoft Application Framework Classes
-#ifndef _MFC_VER
-#define _MFC_VER 0x0600 // Microsoft Foundation Classes version 6.00, VC++ 6.0
-#endif
-
 /////////////////////////////////////////////////////////////////////////////
 
 #define _AFX_ENABLE_INLINES
@@ -35,33 +27,9 @@
 // Standard preprocessor symbols if not already defined
 /////////////////////////////////////////////////////////////////////////////
 
-// PASCAL is used for static member functions
-#ifndef PASCAL
-	#define PASCAL  __stdcall
-#endif
-
-// FASTCALL is used for static member functions with little or no params
-#ifndef FASTCALL
-	#define FASTCALL __fastcall
-#endif
-
-// CDECL and EXPORT are defined in case WINDOWS.H doesn't
-#ifndef CDECL
-	#define CDECL __cdecl
-#endif
-
-#ifndef EXPORT
-	#define EXPORT
-#endif
-
 // AFXAPI is used on global public functions
 #ifndef AFXAPI
 	#define AFXAPI __stdcall
 #endif
 
-// AFX_CDECL is used for rare functions taking variable arguments
-#ifndef AFX_CDECL
-	#define AFX_CDECL __cdecl
-#endif
-
 /////////////////////////////////////////////////////////////////////////////

+ 0 - 2
libs/mfc/include/atlconv.h

@@ -15,9 +15,7 @@
 	#error ATL requires C++ compilation (use a .cpp suffix)
 #endif
 
-#ifndef _INC_MALLOC
 #include <malloc.h>
-#endif // _INC_MALLOC
 
 #pragma pack(push,8)
 

+ 3 - 23
libs/mfc/source/borland.mak

@@ -1,22 +1,11 @@
 !include ../../Makefile.inc
 
 #############################################################################
-# Lib Path
-LPATH=..\..\lib;..\..\lib\psdk
-
-# MFC Include directory base
-MFCINCL=..\include
-
-# BC Include directory
-BCINCL=..\..\include;..\..\include\atl
+INCL=..\include
 
 BASE=W
 MODEL=U
-TARGDEFS=_UNICODE;UNICODE;WINSCP
-TARGDEFS=$(TARGDEFS);_MBCS;_MT=1;_X86_
-
-LFLAGS=$(LFLAGS) /j$(LPATH) /L$(LPATH)
-LFLAGS=$(LFLAGS) /w-
+DEFS=_UNICODE;UNICODE;WINSCP;_WINDOWS
 
 #
 # Object File Directory
@@ -31,23 +20,16 @@ GOAL=$(MODEL)afxc$(BASE)
 # -VF4 Support MFC 4.0
 CL_OPT=-VF4 -w-
 
-DEFS=_declspec=__declspec;_WCHAR_T_DEFINED;__MSC;_ANONYMOUS_STRUCT;_MSC_VER=1200;_WINDOWS
-DEFS=$(DEFS)$(DEBDEFS);$(TARGDEFS)
-
 #############################################################################
 # Library Components
 
-OBJECT = except.obj
-	
 FILES = filecore.obj filex.obj filest.obj
 
 MISC = strcore.obj strex.obj timecore.obj
 
 WINMISC = winstr.obj
 
-INLINES =
-
-CPP_OBJS=$(OBJECT) $(FILES)  $(MISC) $(WINMISC)
+CPP_OBJS=$(FILES) $(MISC) $(WINMISC)
 
 OBJS=$(CPP_OBJS)
 
@@ -61,8 +43,6 @@ OBJS=$(CPP_OBJS)
 
 CPPFLAGS=$(CFLAG_COMMON) $(CL_OPT) -D$(DEFS:;= -D)
 
-INCL=$(BCINCL);$(MFCINCL)
-
 BORFLAGS=$(CPPFLAGS) -I$(INCL:;= -I)
 
 .SUFFIXES: .cpp

+ 0 - 32
libs/mfc/source/except.cpp

@@ -1,32 +0,0 @@
-// This is a part of the Microsoft Foundation Classes C++ library.
-// Copyright (C) 1992-1998 Microsoft Corporation
-// All rights reserved.
-//
-// This source code is only intended as a supplement to the
-// Microsoft Foundation Classes Reference and related
-// electronic documentation provided with the library.
-// See these sources for detailed information regarding the
-// Microsoft Foundation Classes product.
-
-#include "stdafx.h"
-
-/////////////////////////////////////////////////////////////////////////////
-// CException
-
-CException::CException()
-{
-}
-
-BOOL CException::GetErrorMessage(LPTSTR lpszError, UINT nMaxError,
-	PUINT pnHelpContext /* = NULL */ )
-{
-	if (pnHelpContext != NULL)
-		*pnHelpContext = 0;
-
-	if (nMaxError != 0 && lpszError != NULL)
-		*lpszError = '\0';
-
-	return FALSE;
-}
-
-/////////////////////////////////////////////////////////////////////////////

+ 0 - 8
libs/mfc/source/filecore.cpp

@@ -26,14 +26,6 @@ CFile::~CFile()
 		Close();
 }
 
-// MFC allocates CObject (ancestor of CFile) with new, but deallocates with free,
-// what codeguard dislikes, this is fix, not sure if it is necessary for
-// release version, but probably causes no harm
-void PASCAL CFile::operator delete(void * p)
-{
-  delete p;
-}
-
 BOOL CFile::Open(LPCTSTR lpszFileName, UINT nOpenFlags,
 	CFileException* pException)
 {

+ 3 - 29
libs/mfc/source/filest.cpp

@@ -9,21 +9,15 @@
 // Microsoft Foundation Classes product.
 
 #include "stdafx.h"
-#include <errno.h>
-#include <io.h>
-#include <sys\types.h>
-#include <sys\stat.h>
 
 ////////////////////////////////////////////////////////////////////////////
-// Status information for all file classes
-// In this file so everyone doesn't get the CTime package
 
-BOOL PASCAL CFile::GetStatus(LPCTSTR lpszFileName, CFileStatus& rStatus)
+BOOL CFile::IsValid(LPCTSTR lpszFileName)
 {
 	// attempt to fully qualify path first
-	if (!AfxFullPath(rStatus.m_szFullName, lpszFileName))
+	TCHAR m_szFullName[_MAX_PATH];
+	if (!AfxFullPath(m_szFullName, lpszFileName))
 	{
-		rStatus.m_szFullName[0] = '\0';
 		return FALSE;
 	}
 
@@ -31,26 +25,6 @@ BOOL PASCAL CFile::GetStatus(LPCTSTR lpszFileName, CFileStatus& rStatus)
 	HANDLE hFind = FindFirstFile((LPTSTR)lpszFileName, &findFileData);
 	if (hFind == INVALID_HANDLE_VALUE)
 		return FALSE;
-	VERIFY(FindClose(hFind));
-
-	// strip attribute of NORMAL bit, our API doesn't have a "normal" bit.
-	rStatus.m_attribute = (BYTE)
-		(findFileData.dwFileAttributes & ~FILE_ATTRIBUTE_NORMAL);
-
-	// get just the low DWORD of the file size
-	ASSERT(findFileData.nFileSizeHigh == 0);
-	rStatus.m_size = (LONG)findFileData.nFileSizeLow;
-
-	// convert times as appropriate
-	rStatus.m_ctime = CTime(findFileData.ftCreationTime);
-	rStatus.m_atime = CTime(findFileData.ftLastAccessTime);
-	rStatus.m_mtime = CTime(findFileData.ftLastWriteTime);
-
-	if (rStatus.m_ctime.GetTime() == 0)
-		rStatus.m_ctime = rStatus.m_mtime;
-
-	if (rStatus.m_atime.GetTime() == 0)
-		rStatus.m_atime = rStatus.m_mtime;
 
 	return TRUE;
 }

+ 2 - 3
libs/mfc/source/filex.cpp

@@ -9,12 +9,11 @@
 // Microsoft Foundation Classes product.
 
 #include "stdafx.h"
-#include <errno.h>
 
 /////////////////////////////////////////////////////////////////////////////
 // CFileException
 
-void PASCAL CFileException::ThrowOsError(LONG lOsError,
+void CFileException::ThrowOsError(LONG lOsError,
 	LPCTSTR lpszFileName /* = NULL */)
 {
 	if (lOsError != 0)
@@ -50,7 +49,7 @@ void AFXAPI AfxThrowFileException(int cause, LONG lOsError,
 	throw new CFileException(cause, lOsError, lpszFileName);
 }
 
-int PASCAL CFileException::OsErrorToException(LONG lOsErr)
+int CFileException::OsErrorToException(LONG lOsErr)
 {
 	// NT Error codes
 	switch ((UINT)lOsErr)

+ 0 - 37
libs/mfc/source/stdafx.h

@@ -11,9 +11,6 @@
 // STDAFX.H is the header that includes the standard includes that are used
 //  for most of the project.  These are compiled into a pre-compiled header
 
-// MFC inline constructors (including compiler generated) can get deep
-#pragma inline_depth(16)
-
 // core headers
 #include "afx.h"
 
@@ -30,39 +27,5 @@ BOOL AFXAPI AfxFullPath(LPTSTR lpszPathOut, LPCTSTR lpszFileIn);
 #include <stddef.h>
 #include <limits.h>
 #include <malloc.h>
-#include <new.h>
-
-// MFC does not rely on auto-delete semantics of the TRY..CATCH macros,
-//  therefore those macros are mapped to something closer to the native
-//  C++ exception handling mechanism when building MFC itself.
-
-#undef TRY
-#define TRY { try {
-
-#undef CATCH
-#define CATCH(class, e) } catch (class* e) \
-	{ ASSERT(e->IsKindOf(RUNTIME_CLASS(class))); UNUSED(e);
-
-#undef AND_CATCH
-#define AND_CATCH(class, e) } catch (class* e) \
-	{ ASSERT(e->IsKindOf(RUNTIME_CLASS(class))); UNUSED(e);
-
-#undef CATCH_ALL
-#define CATCH_ALL(e) } catch (CException* e) \
-	{ { ASSERT(e->IsKindOf(RUNTIME_CLASS(CException))); UNUSED(e);
-
-#undef AND_CATCH_ALL
-#define AND_CATCH_ALL(e) } catch (CException* e) \
-	{ { ASSERT(e->IsKindOf(RUNTIME_CLASS(CException))); UNUSED(e);
-
-#undef END_TRY
-#define END_TRY } catch (CException* e) \
-	{ ASSERT(e->IsKindOf(RUNTIME_CLASS(CException))); e->Delete(); } }
-
-#undef THROW_LAST
-#define THROW_LAST() throw
-
-// Because of the above definitions of TRY...CATCH it is necessary to
-//  explicitly delete exception objects at the catch site.
 
 /////////////////////////////////////////////////////////////////////////////

+ 2 - 2
libs/mfc/source/strex.cpp

@@ -189,7 +189,7 @@ void CString::FormatV(LPCTSTR lpszFormat, va_list argList)
 }
 
 // formatting (using wsprintf style formatting)
-void AFX_CDECL CString::Format(LPCTSTR lpszFormat, ...)
+void CString::Format(LPCTSTR lpszFormat, ...)
 {
 	ASSERT(AfxIsValidString(lpszFormat));
 
@@ -199,7 +199,7 @@ void AFX_CDECL CString::Format(LPCTSTR lpszFormat, ...)
 	va_end(argList);
 }
 
-void AFX_CDECL CString::Format(UINT nFormatID, ...)
+void CString::Format(UINT nFormatID, ...)
 {
 	CString strFormat;
 	VERIFY(strFormat.LoadString(nFormatID) != 0);

+ 1 - 1
libs/mfc/source/timecore.cpp

@@ -72,7 +72,7 @@ CTime::CTime(const FILETIME& fileTime, int nDST)
 	*this = timeT;
 }
 
-CTime PASCAL CTime::GetCurrentTime()
+CTime CTime::GetCurrentTime()
 // return the current system time
 {
 	return CTime(::time(NULL));

+ 1 - 2
source/filezilla/AsyncSslSocketLayer.cpp

@@ -736,9 +736,8 @@ int CAsyncSslSocketLayer::InitSSLConnection(bool clientMode,
         // https://www.mail-archive.com/[email protected]/msg86186.html
         SSL_CTX_set_session_cache_mode(m_ssl_ctx, SSL_SESS_CACHE_CLIENT | SSL_SESS_CACHE_NO_INTERNAL_STORE | SSL_SESS_CACHE_NO_AUTO_CLEAR);
         SSL_CTX_sess_set_new_cb(m_ssl_ctx, NewSessionCallback);
-        CFileStatus Dummy;
         if (!m_CertStorage.IsEmpty() &&
-            CFile::GetStatus((LPCTSTR)m_CertStorage, Dummy))
+            CFile::IsValid((LPCTSTR)m_CertStorage))
         {
           SSL_CTX_load_verify_locations(m_ssl_ctx, T2CA(m_CertStorage), 0);
         }

+ 5 - 20
source/filezilla/FtpControlSocket.cpp

@@ -5012,13 +5012,13 @@ int CFtpControlSocket::CheckOverwriteFile()
   CFileTransferData *pData = reinterpret_cast<CFileTransferData *>(m_Operation.pData);
 
   int nReplyError = 0;
-  CFileStatus64 status;
+  CFileStatus status;
   if ((pData->transferfile.OnTransferOut != NULL) ||
       (pData->transferfile.OnTransferIn != NULL))
   {
     m_Operation.nOpState = FILETRANSFER_TYPE;
   }
-  else if (!GetStatus64(pData->transferfile.localfile, status))
+  else if (!GetFileStatus(pData->transferfile.localfile, status))
   {
     if (!pData->transferfile.get)
     {
@@ -5047,22 +5047,8 @@ int CFtpControlSocket::CheckOverwriteFile()
 
 
       CTime *localtime = NULL;
-      try
-      {
-        if (status.m_has_mtime && status.m_mtime != -1)
-          localtime = new CTime(status.m_mtime);
-      }
-      catch (CException* e)
-      {
-        TCHAR buffer[1024];
-        CString str =L"Exception creating CTime object: ";
-        if (e->GetErrorMessage(buffer, 1024, NULL))
-          str += buffer;
-        else
-          str += L"Unknown exception";
-        LogMessageRaw(FZ_LOG_WARNING, str);
-        localtime = NULL;
-      }
+      if (status.m_mtime != -1)
+        localtime = new CTime(status.m_mtime);
       BOOL bRemoteFileExists = FALSE;
       __int64 remotesize = -1;
       t_directory::t_direntry::t_date remotetime;
@@ -5171,8 +5157,7 @@ void CFtpControlSocket::SetFileExistsAction(int nAction, COverwriteRequestData *
   case FILEEXISTS_RENAME:
     if (pTransferData->transferfile.get)
     {
-      CFileStatus64 status;
-      if (GetStatus64(pData->FileName1, status))
+      if (CFile::IsValid(pData->FileName1))
       {
         ShowStatus(IDS_ERRORMSG_NAMEINUSE, FZ_LOG_ERROR);
         nReplyError=  FZ_REPLY_CRITICALERROR;

+ 4 - 63
source/filezilla/MFC64bitFix.cpp

@@ -23,7 +23,7 @@ BOOL GetLength64(CString filename, _int64 &size)
   return TRUE;
 }
 
-BOOL PASCAL GetStatus64(LPCTSTR lpszFileName, CFileStatus64& rStatus)
+BOOL PASCAL GetFileStatus(LPCTSTR lpszFileName, CFileStatus& rStatus)
 {
   WIN32_FIND_DATA findFileData;
   HANDLE hFind = FindFirstFile((LPTSTR)lpszFileName, &findFileData);
@@ -37,71 +37,12 @@ BOOL PASCAL GetStatus64(LPCTSTR lpszFileName, CFileStatus64& rStatus)
   rStatus.m_attribute = (BYTE)
     (findFileData.dwFileAttributes & ~FILE_ATTRIBUTE_NORMAL);
 
-  rStatus.m_size = ((_int64)findFileData.nFileSizeHigh<<32)+findFileData.nFileSizeLow;
-
   // convert times as appropriate
-  try
-  {
-    rStatus.m_ctime = CTime(findFileData.ftCreationTime);
-    rStatus.m_has_ctime = true;
-  }
-  catch (CException*)
-  {
-    rStatus.m_has_ctime = false;
-  }
-
-  try
-  {
-    rStatus.m_atime = CTime(findFileData.ftLastAccessTime);
-    rStatus.m_has_atime = true;
-  }
-  catch (CException*)
-  {
-    rStatus.m_has_atime = false;
-  }
-
-  try
-  {
-    rStatus.m_mtime = CTime(findFileData.ftLastWriteTime);
-    rStatus.m_has_mtime = true;
-  }
-  catch (CException*)
-  {
-    rStatus.m_has_mtime = false;
-  }
-
-  if (!rStatus.m_has_ctime || rStatus.m_ctime.GetTime() == 0)
-  {
-    if (rStatus.m_has_mtime)
-    {
-      rStatus.m_ctime = rStatus.m_mtime;
-      rStatus.m_has_ctime = true;
-    }
-    else
-      rStatus.m_has_ctime = false;
-  }
-
-
-  if (!rStatus.m_has_atime || rStatus.m_atime.GetTime() == 0)
-  {
-    if (rStatus.m_has_mtime)
-    {
-      rStatus.m_atime = rStatus.m_mtime;
-      rStatus.m_has_atime = true;
-    }
-    else
-      rStatus.m_has_atime = false;
-  }
+  rStatus.m_mtime = CTime(findFileData.ftLastWriteTime);
 
-  if (!rStatus.m_has_mtime || rStatus.m_mtime.GetTime() == 0)
+  if (rStatus.m_mtime.GetTime() == 0)
   {
-    if (rStatus.m_has_ctime)
-    {
-      rStatus.m_mtime = rStatus.m_ctime;
-      rStatus.m_has_mtime = true;
-    }
-    else
-      rStatus.m_has_mtime = false;
+    rStatus.m_mtime = CTime(findFileData.ftCreationTime);
   }
 
   return TRUE;

+ 2 - 9
source/filezilla/MFC64bitFix.h

@@ -5,19 +5,12 @@
 __int64 GetLength64(CFile & file);
 BOOL GetLength64(CString filename, _int64 & size);
 //---------------------------------------------------------------------------
-struct CFileStatus64
+struct CFileStatus
 {
-  bool m_has_ctime;
-  bool m_has_mtime;
-  bool m_has_atime;
-  CTime m_ctime;    // creation date/time of file
   CTime m_mtime;    // last modification date/time of file
-  CTime m_atime;    // last access date/time of file
-  _int64 m_size;    // logical size of file in bytes
   BYTE m_attribute; // logical OR of CFile::Attribute enum values
-  BYTE _m_padding;  // pad the structure to a WORD
 };
 //---------------------------------------------------------------------------
-BOOL PASCAL GetStatus64(LPCTSTR lpszFileName, CFileStatus64 & rStatus);
+BOOL PASCAL GetFileStatus(LPCTSTR lpszFileName, CFileStatus & rStatus);
 //---------------------------------------------------------------------------
 #endif // MFC64bitFixH

+ 1 - 1
source/filezilla/TransferSocket.cpp

@@ -1155,7 +1155,7 @@ int CTransferSocket::ReadDataFromFile(char *buffer, int len)
     }
     return read;
   }
-  catch (CException* e)
+  catch (CFileException* e)
   {
     TCHAR error[BUFSIZE];
     if (e->GetErrorMessage(error, BUFSIZE))