-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathcppcryptfs.h
More file actions
executable file
·120 lines (89 loc) · 3.78 KB
/
Copy pathcppcryptfs.h
File metadata and controls
executable file
·120 lines (89 loc) · 3.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*
cppcryptfs : user-mode cryptographic virtual overlay filesystem.
Copyright (C) 2016-2026 Bailey Brown (github.com/bailey27/cppcryptfs)
cppcryptfs is based on the design of gocryptfs (github.com/rfjakob/gocryptfs)
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
// cppcryptfs.h : main header file for the PROJECT_NAME application
//
#pragma once
#include "stdafx.h"
#ifndef __AFXWIN_H__
#error "include 'stdafx.h' before including this file for PCH"
#endif
#include "resource.h" // main symbols
#include <unordered_map>
#include <string>
#include <memory>
#include "crypt/cryptdefs.h"
#include <vector>
using namespace std;
#define CPPCRYPTFS_COPYDATA_CMDLINE_OLD 0x574cd9d1
#define CPPCRYPTFS_COPYDATA_PIPE 0x574cd9d2
#define CPPCRYPTFS_COPYDATA_CMDLINE_MAXLEN (64*1024) // keep small because of VirtualLock()
#define CPPCRYPTFS_REG_PATH L"Software\\cppcryptfs\\cppcryptfs\\"
#define CPPCRYPTFS_FOLDERS_SECTION L"Folders"
#define CPPCRYPTFS_CONFIGPATHS_SECTION L"ConfigPaths"
#define CPPCRYPTFS_MOUNTPOINTS_SECTION L"MountPoints"
typedef struct struct_CopyDataCmdLine {
HANDLE hPipe; // handle of named pipe to read command line from
} CopyDataCmdLine;
// CcppcryptfsApp:
// See cppcryptfs.cpp for the implementation of this class
//
class CMenuTrayIcon;
// Structure for linking the system language ID and its text name
struct LanguageOption {
WORD langID;
CString name;
};
class CcppcryptfsApp : public CWinApp
{
public:
// List of all languages found in EXE resources
std::vector<LanguageOption> m_vAvailableLangs;
// Localization management methods
void ScanResourcesForLanguages();
bool IsLanguageAvailable(WORD wLangID);
CString GetStringForLang(HMODULE hInst, UINT nID, WORD wLang);
// Working with the registry
void SaveLanguageToRegistry(WORD wLangID);
WORD LoadLanguageFromRegistry();
private:
bool m_bIsRunningAsAdministrator = false;
bool m_bIsReallyAdministrator = false;
public:
void SendCmdArgsToSelf(HANDLE hPipe);
public:
CcppcryptfsApp();
HICON m_hIcon = NULL;
DWORD m_mountedLetters = 0; // used for tracking mounted (by cpppcryptfs) drive letters
std::shared_ptr<CMenuTrayIcon> m_system_tray_icon;
// Overrides
public:
virtual BOOL InitInstance() override;
virtual BOOL WriteProfileInt(LPCWSTR section, LPCWSTR entry, INT val) override;
virtual BOOL WriteProfileString(LPCWSTR section, LPCWSTR entry, LPCWSTR val) override;
virtual BOOL WriteProfileBinary(LPCWSTR section, LPCWSTR entry, LPBYTE pData, UINT nBytes) override;
void RecreateSystemTrayIcon();
bool IsRunningAsAdministrator() { return m_bIsRunningAsAdministrator; }
bool IsReallyAdministrator() { return m_bIsReallyAdministrator; }
// Implementation
DECLARE_MESSAGE_MAP()
};
extern CcppcryptfsApp theApp;