MCPcopy Create free account
hub / github.com/bailey27/cppcryptfs / MountPointManager

Class MountPointManager

cppcryptfs/dokan/MountPointManager.h:34–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32class CryptThreadData;
33
34class MountPointManager {
35
36private:
37 unordered_map<wstring, CryptThreadData*> m_tdatas;
38 MountPointManager() {}
39public:
40 // disallow copying
41 MountPointManager(MountPointManager const&) = delete;
42 void operator=(MountPointManager const&) = delete;
43
44 virtual ~MountPointManager();
45
46 static MountPointManager& getInstance() {
47 static MountPointManager instance;
48
49 return instance;
50 }
51
52
53
54private:
55 bool destroy(const wchar_t *mountpoint);
56 BOOL wait_multiple_and_destroy(int count, HANDLE handles[], wstring mountpoints[]);
57 bool unmount_all(bool wait);
58 BOOL wait_and_destroy(const WCHAR* mountpoint);
59 BOOL wait_all_and_destroy();
60 // MountPointManager becomes owner of tdata
61 bool add(const wchar_t *mountpoint, CryptThreadData* tdata);
62
63 CryptThreadData *get(const wchar_t *mountpoint);
64
65 void apply(function<bool(const wchar_t *mountpoint, CryptThreadData *tdata)> f );
66public:
67 bool empty() const { return m_tdatas.empty(); }
68 bool get_path (const WCHAR *mountpoint, wstring& path) const;
69 // returns actual mount point (in case used to mount it
70 // which is how the key is stored
71 bool find (const WCHAR *mountpoint, wstring& mpstr) const;
72 void get_mount_points(vector<wstring>& mps, function<bool(const wchar_t *)> filter = NULL) const;
73 int get_open_handle_count(const wchar_t *mountpoint = nullptr);
74
75 // these functions in cryptdokan use the private methods of MountPointManager()
76
77 friend int mount_crypt_fs(const WCHAR* mountpoint, const WCHAR *path,
78 const WCHAR *config_path, const WCHAR *password,
79 wstring &mes, bool reverse, bool readonly, const CryptMountOptions& opts);
80 friend BOOL unmount_crypt_fs(const WCHAR* mountpoint, bool wait, wstring& mes);
81 friend bool unmount_all(bool wait);
82 friend BOOL wait_for_all_unmounted();
83 friend BOOL list_files(const WCHAR *path, list<FindDataPair> &findDatas,
84 wstring &err_mes);
85 friend BOOL write_volume_name_if_changed(WCHAR dl, wstring& mes);
86 friend bool get_fs_info(const wchar_t *mountpoint, FsInfo& info);
87 friend std::wstring transform_path(const wchar_t* path, wstring& mes);
88};
89

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected