summaryrefslogtreecommitdiff
path: root/shared/symlink_target.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:10:11 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:10:11 +0200
commitc0cdb2ad99a1e2a6ade5ce76c91177a79258e669 (patch)
tree4701a015385d9a6a5a4ba99a8f1f5d400fff26b1 /shared/symlink_target.h
parent3.13 (diff)
downloadFreeFileSync-c0cdb2ad99a1e2a6ade5ce76c91177a79258e669.tar.gz
FreeFileSync-c0cdb2ad99a1e2a6ade5ce76c91177a79258e669.tar.bz2
FreeFileSync-c0cdb2ad99a1e2a6ade5ce76c91177a79258e669.zip
3.14
Diffstat (limited to 'shared/symlink_target.h')
-rw-r--r--shared/symlink_target.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/shared/symlink_target.h b/shared/symlink_target.h
index 358f2913..6dec85a0 100644
--- a/shared/symlink_target.h
+++ b/shared/symlink_target.h
@@ -7,7 +7,7 @@
#ifndef SYMLINK_WIN_H_INCLUDED
#define SYMLINK_WIN_H_INCLUDED
-#include <boost/shared_ptr.hpp>
+#include "loki/ScopeGuard.h"
#include <boost/scoped_array.hpp>
#include "system_func.h"
#include <wx/intl.h>
@@ -67,9 +67,9 @@ Zstring getSymlinkRawTargetString(const Zstring& linkPath) //throw (FileError)
using ffs3::zToWx;
using ffs3::FileError;
#ifdef FFS_WIN
-//FSCTL_GET_REPARSE_POINT: http://msdn.microsoft.com/en-us/library/aa364571(VS.85).aspx
+ //FSCTL_GET_REPARSE_POINT: http://msdn.microsoft.com/en-us/library/aa364571(VS.85).aspx
- try //setting privileges requires admin rights! This shall not cause an error in user mode!
+ try //reading certain symlinks requires admin rights! This shall not cause an error in user mode!
{
//allow access to certain symbolic links/junctions
ffs3::Privileges::getInstance().ensureActive(SE_BACKUP_NAME); //throw FileError()
@@ -88,7 +88,8 @@ Zstring getSymlinkRawTargetString(const Zstring& linkPath) //throw (FileError)
wxString errorMessage = wxString(_("Error resolving symbolic link:")) + wxT("\n\"") + ffs3::zToWx(linkPath) + wxT("\"");
throw FileError(errorMessage + wxT("\n\n") + ffs3::getLastErrorFormatted());
}
- boost::shared_ptr<void> dummy(hLink, ::CloseHandle);
+ Loki::ScopeGuard dummy = Loki::MakeGuard(::CloseHandle, hLink);
+ (void)dummy; //silence warning "unused variable"
//respect alignment issues...
const size_t bufferSize = REPARSE_DATA_BUFFER_HEADER_SIZE + MAXIMUM_REPARSE_DATA_BUFFER_SIZE;
bgstack15