summaryrefslogtreecommitdiff
path: root/zen/dst_hack.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:19:49 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:19:49 +0200
commitc8e0e909b4a8d18319fc65434a10dc446434817c (patch)
treeeee91e7d2ce229dd043811eae8f1e2bd78061916 /zen/dst_hack.cpp
parent5.2 (diff)
downloadFreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.tar.gz
FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.tar.bz2
FreeFileSync-c8e0e909b4a8d18319fc65434a10dc446434817c.zip
5.3
Diffstat (limited to 'zen/dst_hack.cpp')
-rw-r--r--zen/dst_hack.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/zen/dst_hack.cpp b/zen/dst_hack.cpp
index 3ecfd8e9..9457b966 100644
--- a/zen/dst_hack.cpp
+++ b/zen/dst_hack.cpp
@@ -21,13 +21,9 @@ Zstring getVolumeName(const Zstring& filename)
// fsName, //__out LPTSTR lpszVolumePathName,
// BUFFER_SIZE)) //__in DWORD cchBufferLength
// ...
- // Zstring volumePath = fsName;
- // if (!volumePath.EndsWith(FILE_NAME_SEPARATOR)) //a trailing backslash is required
- // volumePath += FILE_NAME_SEPARATOR;
+ // Zstring volumePath = appendSeparator(fsName);
- Zstring nameFmt = removeLongPathPrefix(filename); //throw()
- if (!endsWith(nameFmt, FILE_NAME_SEPARATOR))
- nameFmt += FILE_NAME_SEPARATOR; //GetVolumeInformation expects trailing backslash
+ const Zstring nameFmt = appendSeparator(removeLongPathPrefix(filename)); //throw()
if (startsWith(nameFmt, Zstr("\\\\"))) //UNC path: "\\ComputerName\SharedFolder\"
{
@@ -82,8 +78,10 @@ bool dst::isFatDrive(const Zstring& fileName) //throw()
}
+/*
bool dst::isFatDrive(HANDLE hFile) //throw()
{
+Requires Windows Vista!
//dynamically load windows API function
typedef BOOL (WINAPI* GetVolumeInformationByHandleWFunc)(HANDLE hFile,
LPWSTR lpVolumeNameBuffer,
@@ -120,6 +118,7 @@ bool dst::isFatDrive(HANDLE hFile) //throw()
return fsName == Zstring(L"FAT") ||
fsName == Zstring(L"FAT32");
}
+*/
namespace
@@ -159,7 +158,7 @@ Int64 toInt64(const FILETIME& fileTime)
inline
-FILETIME utcToLocal(const FILETIME& utcTime) //throw (std::runtime_error)
+FILETIME utcToLocal(const FILETIME& utcTime) //throw std::runtime_error
{
//treat binary local time representation (which is invariant under DST time zone shift) as logical UTC:
FILETIME localTime = {};
@@ -177,7 +176,7 @@ FILETIME utcToLocal(const FILETIME& utcTime) //throw (std::runtime_error)
inline
-FILETIME localToUtc(const FILETIME& localTime) //throw (std::runtime_error)
+FILETIME localToUtc(const FILETIME& localTime) //throw std::runtime_error
{
//treat binary local time representation (which is invariant under DST time zone shift) as logical UTC:
FILETIME utcTime = {};
@@ -330,7 +329,7 @@ bool dst::fatHasUtcEncoded(const RawTime& rawTime) //"createTimeRaw" as retrieve
}
-dst::RawTime dst::fatEncodeUtcTime(const FILETIME& writeTimeRealUtc) //throw (std::runtime_error)
+dst::RawTime dst::fatEncodeUtcTime(const FILETIME& writeTimeRealUtc) //throw std::runtime_error
{
const FILETIME fatWriteTimeUtc = roundToFatWriteTime(writeTimeRealUtc); //writeTimeRealUtc may have incompatible precision (NTFS)
bgstack15