summaryrefslogtreecommitdiff
path: root/zen/dst_hack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zen/dst_hack.cpp')
-rw-r--r--zen/dst_hack.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/zen/dst_hack.cpp b/zen/dst_hack.cpp
index 6e5c2230..a70ef13b 100644
--- a/zen/dst_hack.cpp
+++ b/zen/dst_hack.cpp
@@ -52,22 +52,22 @@ Zstring getVolumeName(const Zstring& filename)
bool dst::isFatDrive(const Zstring& fileName) //throw()
{
- const size_t BUFFER_SIZE = MAX_PATH + 1;
- wchar_t fsName[BUFFER_SIZE];
-
const Zstring volumePath = getVolumeName(fileName);
if (volumePath.empty())
return false;
+ const DWORD bufferSize = MAX_PATH + 1;
+ wchar_t fsName[bufferSize];
+
//suprisingly fast: ca. 0.03 ms per call!
- if (!::GetVolumeInformation(volumePath.c_str(), //__in_opt LPCTSTR lpRootPathName,
- nullptr, //__out LPTSTR lpVolumeNameBuffer,
- 0, //__in DWORD nVolumeNameSize,
- nullptr, //__out_opt LPDWORD lpVolumeSerialNumber,
- nullptr, //__out_opt LPDWORD lpMaximumComponentLength,
- nullptr, //__out_opt LPDWORD lpFileSystemFlags,
- fsName, //__out LPTSTR lpFileSystemNameBuffer,
- BUFFER_SIZE)) //__in DWORD nFileSystemNameSize
+ if (!::GetVolumeInformation(appendSeparator(volumePath).c_str(), //__in_opt LPCTSTR lpRootPathName,
+ nullptr, //__out LPTSTR lpVolumeNameBuffer,
+ 0, //__in DWORD nVolumeNameSize,
+ nullptr, //__out_opt LPDWORD lpVolumeSerialNumber,
+ nullptr, //__out_opt LPDWORD lpMaximumComponentLength,
+ nullptr, //__out_opt LPDWORD lpFileSystemFlags,
+ fsName, //__out LPTSTR lpFileSystemNameBuffer,
+ bufferSize)) //__in DWORD nFileSystemNameSize
{
assert(false); //shouldn't happen
return false;
bgstack15