"Fossies" - the Fresh Open Source Software Archive

Member "src/Core/Unix/CoreServiceRequest.h" (10 Oct 2018, 3837 Bytes) of package /windows/misc/VeraCrypt_1.23-Hotfix-2_Source.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "CoreServiceRequest.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  Derived from source code of TrueCrypt 7.1a, which is
    3  Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
    4  by the TrueCrypt License 3.0.
    5 
    6  Modifications and additions to the original source code (contained in this file)
    7  and all other portions of this file are Copyright (c) 2013-2017 IDRIX
    8  and are governed by the Apache License 2.0 the full text of which is
    9  contained in the file License.txt included in VeraCrypt binary and source
   10  code distribution packages.
   11 */
   12 
   13 #ifndef TC_HEADER_Core_Unix_CoreServiceRequest
   14 #define TC_HEADER_Core_Unix_CoreServiceRequest
   15 
   16 #include "Platform/Serializable.h"
   17 #include "Core/Core.h"
   18 
   19 namespace VeraCrypt
   20 {
   21     struct CoreServiceRequest : public Serializable
   22     {
   23         CoreServiceRequest () : ElevateUserPrivileges (false), FastElevation (false) { }
   24         TC_SERIALIZABLE (CoreServiceRequest);
   25 
   26         virtual bool RequiresElevation () const { return false; }
   27 
   28         string AdminPassword;
   29         FilePath ApplicationExecutablePath;
   30         bool ElevateUserPrivileges;
   31         bool FastElevation;
   32     };
   33 
   34     struct CheckFilesystemRequest : CoreServiceRequest
   35     {
   36         CheckFilesystemRequest () { }
   37         CheckFilesystemRequest (shared_ptr <VolumeInfo> volumeInfo, bool repair)
   38             : MountedVolumeInfo (volumeInfo), Repair (repair) { }
   39         TC_SERIALIZABLE (CheckFilesystemRequest);
   40 
   41         virtual bool RequiresElevation () const;
   42 
   43         shared_ptr <VolumeInfo> MountedVolumeInfo;
   44         bool Repair;
   45     };
   46 
   47     struct DismountFilesystemRequest : CoreServiceRequest
   48     {
   49         DismountFilesystemRequest () { }
   50         DismountFilesystemRequest (const DirectoryPath &mountPoint, bool force)
   51             : Force (force), MountPoint (mountPoint) { }
   52         TC_SERIALIZABLE (DismountFilesystemRequest);
   53 
   54         virtual bool RequiresElevation () const;
   55 
   56         bool Force;
   57         DirectoryPath MountPoint;
   58     };
   59 
   60     struct DismountVolumeRequest : CoreServiceRequest
   61     {
   62         DismountVolumeRequest () { }
   63         DismountVolumeRequest (shared_ptr <VolumeInfo> volumeInfo, bool ignoreOpenFiles, bool syncVolumeInfo)
   64             : IgnoreOpenFiles (ignoreOpenFiles), MountedVolumeInfo (volumeInfo), SyncVolumeInfo (syncVolumeInfo) { }
   65         TC_SERIALIZABLE (DismountVolumeRequest);
   66 
   67         virtual bool RequiresElevation () const;
   68 
   69         bool IgnoreOpenFiles;
   70         shared_ptr <VolumeInfo> MountedVolumeInfo;
   71         bool SyncVolumeInfo;
   72     };
   73 
   74     struct GetDeviceSectorSizeRequest : CoreServiceRequest
   75     {
   76         GetDeviceSectorSizeRequest () { }
   77         GetDeviceSectorSizeRequest (const DevicePath &path) : Path (path) { }
   78         TC_SERIALIZABLE (GetDeviceSectorSizeRequest);
   79 
   80         virtual bool RequiresElevation () const;
   81 
   82         DevicePath Path;
   83     };
   84 
   85     struct GetDeviceSizeRequest : CoreServiceRequest
   86     {
   87         GetDeviceSizeRequest () { }
   88         GetDeviceSizeRequest (const DevicePath &path) : Path (path) { }
   89         TC_SERIALIZABLE (GetDeviceSizeRequest);
   90 
   91         virtual bool RequiresElevation () const;
   92 
   93         DevicePath Path;
   94     };
   95 
   96     struct GetHostDevicesRequest : CoreServiceRequest
   97     {
   98         GetHostDevicesRequest () { }
   99         GetHostDevicesRequest (bool pathListOnly) : PathListOnly (pathListOnly) { }
  100         TC_SERIALIZABLE (GetHostDevicesRequest);
  101 
  102         virtual bool RequiresElevation () const;
  103 
  104         bool PathListOnly;
  105     };
  106 
  107     struct ExitRequest : CoreServiceRequest
  108     {
  109         TC_SERIALIZABLE (ExitRequest);
  110     };
  111 
  112     struct MountVolumeRequest : CoreServiceRequest
  113     {
  114         MountVolumeRequest () { }
  115         MountVolumeRequest (MountOptions *options) : Options (options) { }
  116         TC_SERIALIZABLE (MountVolumeRequest);
  117 
  118         virtual bool RequiresElevation () const;
  119 
  120         MountOptions *Options;
  121 
  122     protected:
  123         shared_ptr <MountOptions> DeserializedOptions;
  124     };
  125 
  126 
  127     struct SetFileOwnerRequest : CoreServiceRequest
  128     {
  129         SetFileOwnerRequest () { }
  130         SetFileOwnerRequest (const FilesystemPath &path, const UserId &owner) : Owner (owner), Path (path) { }
  131         TC_SERIALIZABLE (SetFileOwnerRequest);
  132 
  133         virtual bool RequiresElevation () const;
  134 
  135         UserId Owner;
  136         FilesystemPath Path;
  137     };
  138 }
  139 
  140 #endif // TC_HEADER_Core_Unix_CoreServiceRequest