-
Notifications
You must be signed in to change notification settings - Fork 50
/
MailRuCloud.dpr
235 lines (205 loc) · 8.33 KB
/
MailRuCloud.dpr
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
library MailRuCloud;
{$R *.dres}
uses
{$IFDEF DEBUG}
FastMM4 in 'FastMM\FastMM4.pas',
FastMM4Messages in 'FastMM\FastMM4Messages.pas',
{$ENDIF}
DebugHelper in 'helpers\DebugHelper.pas',
ANSIFunctions in 'types\ANSIFunctions.pas',
AccountSettings in 'models\settings\AccountSettings.pas',
Accounts in 'forms\Accounts.pas'{AccountsForm},
AccountsManager in 'models\settings\AccountsManager.pas',
AskPassword in 'forms\AskPassword.pas'{AskPasswordForm},
CMRConstants in 'types\CMRConstants.pas',
CMRDirItem in 'models\dto\CMRDirItem.pas',
CMRDirItemList in 'models\dto\CMRDirItemList.pas',
CMRFileIdentity in 'models\dto\CMRFileIdentity.pas',
CMRIncomingInvite in 'models\dto\CMRIncomingInvite.pas',
CMRIncomingInviteList in 'models\dto\CMRIncomingInviteList.pas',
CMRInvite in 'models\dto\CMRInvite.pas',
CMRInviteList in 'models\dto\CMRInviteList.pas',
CMROAuth in 'models\dto\CMROAuth.pas',
CMROperationResult in 'models\dto\CMROperationResult.pas',
CMROwner in 'models\dto\CMROwner.pas',
CMRSpace in 'models\dto\CMRSpace.pas',
LANGUAGE_STRINGS in 'types\LANGUAGE_STRINGS.pas',
CMRTwostep in 'models\dto\CMRTwostep.pas',
ChunkedFileStream in 'models\ChunkedFileStream.pas',
Classes,
CloudMailRu in 'models\CloudMailRu.pas',
CloudMailRuHTTP in 'models\http\CloudMailRuHTTP.pas',
CloudSettings in 'models\settings\CloudSettings.pas',
ConnectionManager in 'models\ConnectionManager.pas',
ConnectionSettings in 'models\settings\ConnectionSettings.pas',
DCPbase64 in 'DCPCrypt\DCPbase64.pas',
DCPblockciphers in 'DCPCrypt\DCPblockciphers.pas',
DCPconst in 'DCPCrypt\DCPconst.pas',
DCPcrypt2 in 'DCPCrypt\DCPcrypt2.pas',
DCPrijndael in 'DCPCrypt\Ciphers\DCPrijndael.pas',
DCPsha1 in 'DCPCrypt\Hashes\DCPsha1.pas',
DCPtypes in 'DCPCrypt\DCPtypes.pas',
DateUtils,
DeletedProperty in 'forms\DeletedProperty.pas'{DeletedPropertyForm},
Description in 'models\Description.pas',
FileCipher in 'models\cipher\FileCipher.pas',
FileHelper in 'helpers\FileHelper.pas',
FileSplitInfo in 'models\FileSplitInfo.pas',
HTTPManager in 'models\http\HTTPManager.pas',
HashInfo in 'models\HashInfo.pas',
IconHelper in 'helpers\IconHelper.pas',
IdSSLOpenSSLHeaders,
IniFiles,
IniFilesHelper in 'helpers\IniFilesHelper.pas',
InviteProperty in 'forms\InviteProperty.pas'{InvitePropertyForm},
JSON,
JSONHelper in 'helpers\JSONHelper.pas',
Messages,
PLUGIN_TYPES in 'types\PLUGIN_TYPES.pas',
ParsingHelper in 'helpers\ParsingHelper.pas',
PathHelper in 'helpers\PathHelper.pas',
PluginHelper in 'helpers\PluginHelper.pas',
PluginSettings in 'models\settings\PluginSettings.pas',
PluginSettingsManager in 'models\settings\PluginSettingsManager.pas',
ProxySettings in 'models\settings\ProxySettings.pas',
RealPath in 'models\dto\RealPath.pas',
Registration in 'forms\Registration.pas'{AskPasswordForm},
RemoteProperty in 'forms\RemoteProperty.pas'{PropertyForm},
SETTINGS_CONSTANTS in 'models\settings\SETTINGS_CONSTANTS.pas',
StreamingSettings in 'models\settings\StreamingSettings.pas',
StringHelper in 'helpers\StringHelper.pas',
SysUtils,
System.Generics.Collections,
SystemHelper in 'helpers\SystemHelper.pas',
TCHelper in 'helpers\TCHelper.pas',
TCLogger in 'models\TCLogger.pas',
TCPasswordManager in 'models\TCPasswordManager.pas',
TCProgress in 'models\TCProgress.pas',
TCRequest in 'models\TCRequest.pas',
Variants,
Vcl.Controls,
WSList in 'models\WSList.pas',
Windows,
WindowsHelper in 'helpers\WindowsHelper.pas',
MailRuCloudWFX in 'models\wfx\MailRuCloudWFX.pas',
WFXInterface in 'models\wfx\WFXInterface.pas',
CipherInterface in 'models\cipher\CipherInterface.pas';
{$IFDEF WIN64}
{$E wfx64}
{$ENDIF}
{$IFDEF WIN32}
{$E wfx}
{$ENDIF}
{$R *.res}
var
MailRuCloudWFX: TMailRuCloudWFX;
function FsGetBackgroundFlags: Integer; stdcall;
begin
Exit(MailRuCloudWFX.FsGetBackgroundFlags);
end;
function FsInit(PluginNr: Integer; pProgressProc: TProgressProc; pLogProc: TLogProc; pRequestProc: TRequestProc): Integer; stdcall;
begin
Result := 0;
end;
{GLORIOUS UNICODE MASTER RACE}
function FsInitW(PluginNr: Integer; pProgressProc: TProgressProcW; pLogProc: TLogProcW; pRequestProc: TRequestProcW): Integer; stdcall; //Вход в плагин.
begin
Result := MailRuCloudWFX.FsInit(PluginNr, pProgressProc, pLogProc, pRequestProc);
end;
procedure FsStatusInfoW(RemoteDir: PWideChar; InfoStartEnd, InfoOperation: Integer); stdcall; //Начало и конец операций FS
begin
MailRuCloudWFX.FsStatusInfo(RemoteDir, InfoStartEnd, InfoOperation);
end;
function FsFindFirstW(path: PWideChar; var FindData: tWIN32FINDDATAW): THandle; stdcall;
begin
Exit(MailRuCloudWFX.FsFindFirst(path, FindData));
end;
function FsFindNextW(Hdl: THandle; var FindData: tWIN32FINDDATAW): Bool; stdcall;
begin
Exit(MailRuCloudWFX.FsFindNext(Hdl, FindData));
end;
function FsFindClose(Hdl: THandle): Integer; stdcall;
begin //Завершение получения списка файлов. Result тоталом не используется (всегда равен 0)
Exit(MailRuCloudWFX.FsFindClose(Hdl));
end;
function FsExecuteFileW(MainWin: THandle; RemoteName, Verb: PWideChar): Integer; stdcall; //Запуск файла
begin
Exit(MailRuCloudWFX.FsExecuteFile(MainWin, RemoteName, Verb));
end;
function FsGetFileW(RemoteName, LocalName: PWideChar; CopyFlags: Integer; RemoteInfo: pRemoteInfo): Integer; stdcall; //Копирование файла из файловой системы плагина
begin
Exit(MailRuCloudWFX.FsGetFile(RemoteName, LocalName, CopyFlags, RemoteInfo));
end;
function FsPutFileW(LocalName, RemoteName: PWideChar; CopyFlags: Integer): Integer; stdcall;
begin
Exit(MailRuCloudWFX.FsPutFile(LocalName, RemoteName, CopyFlags));
end;
function FsDeleteFileW(RemoteName: PWideChar): Bool; stdcall; //Удаление файла из файловой системы плагина
begin
Exit(MailRuCloudWFX.FsDeleteFile(RemoteName));
end;
function FsMkDirW(path: PWideChar): Bool; stdcall;
begin
Exit(MailRuCloudWFX.FsMkDir(path));
end;
function FsRemoveDirW(RemoteName: PWideChar): Bool; stdcall;
begin
Exit(MailRuCloudWFX.FsRemoveDir(RemoteName));
end;
function FsRenMovFileW(OldName: PWideChar; NewName: PWideChar; Move: Boolean; OverWrite: Boolean; ri: pRemoteInfo): Integer; stdcall;
begin
Exit(MailRuCloudWFX.FsRenMovFile(OldName, NewName, Move, OverWrite, ri));
end;
function FsDisconnectW(DisconnectRoot: PWideChar): Bool; stdcall;
begin
Exit(MailRuCloudWFX.FsDisconnect(DisconnectRoot));
end;
{The password manager can be created only after this method is being called — it needs passed parameters}
procedure FsSetCryptCallbackW(PCryptProc: TCryptProcW; CryptoNr: Integer; Flags: Integer); stdcall;
begin
MailRuCloudWFX.FsSetCryptCallback(PCryptProc, CryptoNr, Flags);
end;
function FsContentGetSupportedField(FieldIndex: Integer; FieldName: PAnsiChar; Units: PAnsiChar; maxlen: Integer): Integer; stdcall;
begin
Exit(MailRuCloudWFX.FsContentGetSupportedField(FieldIndex, FieldName, Units, maxlen));
end;
function FsContentGetValueW(FileName: PWideChar; FieldIndex: Integer; UnitIndex: Integer; FieldValue: Pointer; maxlen: Integer; Flags: Integer): Integer; stdcall;
begin
Exit(MailRuCloudWFX.FsContentGetValue(FileName, FieldIndex, UnitIndex, FieldValue, maxlen, Flags));
end;
function FsExtractCustomIconW(RemoteName: PWideChar; ExtractFlags: Integer; var TheIcon: hicon): Integer; stdcall;
begin
Exit(MailRuCloudWFX.FsExtractCustomIcon(RemoteName, ExtractFlags, TheIcon));
end;
procedure InitPluginData;
begin
MailRuCloudWFX := TMailRuCloudWFX.Create();
end;
procedure FreePluginData();
begin
MailRuCloudWFX.Destroy;
end;
procedure DllInit(Code: Integer);
begin
case Code of
DLL_PROCESS_ATTACH:
InitPluginData;
DLL_PROCESS_DETACH:
FreePluginData();
DLL_THREAD_ATTACH:
begin
end;
DLL_THREAD_DETACH:
begin
end;
end; //case
end;
exports
FsGetDefRootName, FsInit, FsInitW, FsFindFirst, FsFindFirstW, FsFindNext, FsFindNextW, FsFindClose, FsGetFile, FsGetFileW, FsDisconnect, FsDisconnectW, FsStatusInfo, FsStatusInfoW, FsPutFile, FsPutFileW, FsDeleteFile, FsDeleteFileW, FsMkDir, FsMkDirW, FsRemoveDir, FsRemoveDirW, FsSetCryptCallback, FsSetCryptCallbackW, FsExecuteFileW, FsRenMovFile, FsRenMovFileW, FsGetBackgroundFlags, FsContentGetSupportedField, FsContentGetValue, FsContentGetValueW, FsExtractCustomIcon, FsExtractCustomIconW;
begin
{$IFDEF DEBUG}
ReportMemoryLeaksOnShutdown := true;
{$ENDIF}
DllProc := @DllInit;
DllInit(DLL_PROCESS_ATTACH);
end.