8.3.1 SecureEncodeSDK.h
8.3.1 SecureEncodeSDK.h
SecureEncodeSDK Header file:
You need to include the SecureENCODE SDK Header file with each file that performs the SecureENCODE action.
The file is delivered by SecureSDK package and must be included in C++ source files.
See code listing:
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
/////////////////////////////////////////////////////////////////////////
//
// SecureDELTA SDK :: SecureENCODE SDK Header File
// Part of SecureDELTA SDK v2.56 (C) agersoftware srl
//
// Designed, developed and implemented by agersoftware srl and its
// technology partner, NetLUP Xtreme Technologies srl
//
// Copyright (C) 2019-2029 agersoftware srl, All Rights Reserved.
// Portions Copyright (C) 2019-2029 NetLUP Xtreme Technologies srl.
//
// NOTICE:
// All information contained herein is and remains the property of
// agersoftware srl and its suppliers or technological partners
// NetLUP Xtreme Technologies srl
//
// INTELLECTUAL PROPERTY
// The intellectual and technical concepts contained herein are also
// proprietary to agersoftware srl and its suppliers or technological
// partner NetLUP Xtreme Technologies srl and are protected by trade
// secret or copyright law.
//
// CONFIDENTIAL
// Dissemination of this information or reproduction of this material
// is strictly forbidden unless prior written permission is obtained
// from agersoftware srl or NetLUP Xtreme Technologies srl.
//
// COPYRIGHT
// This software is provided by the copyright holders and technology
// partners "as is" and any express or implied warranties, including,
// but not limited to, the implied warranties of merchantability and
// fitness for a particular purpose are disclaimed.
//
// NO LIABILITY
// In no event shall the copyright owner or technology partners be
// liable for any direct, indirect, incidental, special, exemplary, or
// consequential damages(including, but not limited to, procurement
// of substitute goods or services; loss of use, data, or profits;
// or business interruption) however caused and on any theory of
// liability, whether in contract, strict liability, or tort
// (including negligence or otherwise) arising in any way out of the
// use of this software, even if advised of the possibility of such
// damage.
//
// INFO & CONTACT
// securesdk@securedelta.eu | securesdkinfo@agersoftware.com
//
///////////////////////////////////////////////////////////////////////
//
// SecureDELTA SDK :: SecureENCODE SDK Header File
//
//
// agersoftware srl CONFIDENTIAL
// Copyright 2019-2029 agersoftware srl, All Rights Reserved.
//
// NOTICE:
//
// All information contained herein is, and remains the property of
// agersoftware srl and NetLUP Xtreme Technologies srl. The intellectual
// and technical concepts contained herein are proprietary to agersoftware srl
// and NetLUP Xtreme Technologies srl and are protected
// by trade secret, european and US copyright law(s).
//
// Dissemination of this information or reproduction of this material is strictly forbidden
// unless prior written permission is obtained from
// agersoftware srl.
//
//
#include <stdint.h>
#ifdef SECUREENCODESDK_EXPORTS
#define SECURE_ENCODE_SDK_API extern "C" __declspec(dllexport)
#else
#define SECURE_ENCODE_SDK_API extern "C" __declspec(dllimport)
#endif
#define SECURE_ENCODE_SDK_DLL_NAME_x86 L"SecureENCODE_SDK_DLL_x86.dll"
#define SECURE_ENCODE_SDK_DLL_NAME_x64 L"SecureENCODE_SDK_DLL_x64.dll"
#define SecureDELTA_SDK_DLL_SecureENCODE_Main_Func_ "SecureDELTA_SDK_SecureENCODE_Main_"
#define SecureDELTA_SDK_DLL_SecureENCODE_GetMessage_fromID_Func_ "SecureDELTA_SDK_SecureENCODE_GetMessageString_fromID_"
#define _SD_SDK_MAX_VER_ 32
#define _SD_SDK_MAXPATH_ 280
typedef enum SD_SDK_SECUREENCODE_RETURN_ID_TYPE
{
SD_SDK_ENCODE_NO_ERROR_ = 0x00,
SD_SDK_ENCODE_ERROR_INITIALIZATION_ = -1,
SD_SDK_ENCODE_ERROR_USER_CANCELED_ = -2, // During operation (Abort)
SD_SDK_ENCODE_ERROR_NO_CALLBACK_PTR_ = -3,
SD_SDK_ENCODE_ERROR_NO_USER_DEFINED_PTR_ = -4,
SD_SDK_ENCODE_ERROR_NOT_USING_CALLBACK_PTR_ = -5,
SD_SDK_ENCODE_ERROR_USER_CANCELLED_NAG_WND = -6, // Canceled the NAG screen in Trial Mode
}
SD_SDK_SECURE_ENCODE_RETURN_ID;
typedef enum
{
SD_SDK_ENCODE_SD_ENGINE_ERROR_MEMORY_INIT_NONE_ = 0x0000,
SD_SDK_ENCODE_XTREME_ENGINE_ERROR_MEMORY_INIT_NONE_ = 0x0001,
SD_SDK_ENCODE_XTREME_ENGINE_ERROR_OPERATION_CANCELED_ = 0x0003,
SD_SDK_ENCODE_SD_ENGINE_ERROR_OPERATION_CANCELED_ = 0x0004,
// File Errors
SD_SDK_ENCODE_ENGINE_INVALID_FILE_SIZE = 0xE000,
SD_SDK_ENCODE_ENGINE_COULD_NOT_OPEN_FILE = 0xE001,
SD_SDK_ENCODE_XTREME_ENGINE_INVALID_FILE_SIZE = 0xE010,
SD_SDK_ENCODE_XTREME_ENGINE_COULD_NOT_OPEN_FILE = 0xE011,
// Dictionary Errors
SD_SDK_ENCODE_ENGINE_START_CRC_CHECK = 0xE100,
SD_SDK_ENCODE_XTREME_ENGINE_START_CRC_CHECK = 0xE110,
// Dictionary Errors
SD_SDK_ENCODE_ENGINE_WRITE_HEADER = 0xE200,
SD_SDK_ENCODE_ENGINE_UPDAT_HEADER = 0xE210,
SD_SDK_ENCODE_XTREME_ENGINE_WRITE_HEADER = 0xE220,
SD_SDK_ENCODE_XTREME_ENGINE_UPDAT_HEADER = 0xE221,
// Dictionary Errors
SD_SDK_ENCODE_ENGINE_START_LOAD_DICT = 0xE300,
SD_SDK_ENCODE_ENGINE_LOAD_DICT_PERCENT = 0xE301,
SD_SDK_ENCODE_ENGINE_STARTED_DONE_LOAD_DICT_NO_ERROR = 0xE312,
SD_SDK_ENCODE_ENGINE_STARTED_DONE_LOAD_DICT_ERROR_NOT_ENOUGH_MEM = 0xE313,
SD_SDK_ENCODE_XTREME_ENGINE_START_LOAD_DICT = 0xE320,
SD_SDK_ENCODE_XTREME_ENGINE_LOAD_DICT_PERCENT = 0xE321,
SD_SDK_ENCODE_XTREME_ENGINE_STARTED_DONE_LOAD_DICT_NO_ERROR = 0xE332,
SD_SDK_ENCODE_XTREME_ENGINE_STARTED_DONE_LOAD_DICT_ERROR_NOT_ENOUGH_MEM = 0xE333,
// Performing SecureENCODE using SecureDELTA Engine
SD_SDK_ENCODE_ENGINE_START_DELTA = 0xD400,
SD_SDK_ENCODE_ENGINE_DELTA_PERCENT = 0xD401,
SD_SDK_ENCODE_ENGINE_DELTA_FINALIZING = 0xD402,
SD_SDK_ENCODE_ENGINE_DELTA_NO_ERROR = 0xD403,
SD_SDK_ENCODE_ENGINE_DELTA_CLOSING_ARCHIVE = 0xD404,
SD_SDK_ENCODE_ENGINE_DELTA_AT_END = 0xD405,
SD_SDK_ENCODE_ENGINE_DELTA_ERROR = 0xD406,
// Performing SecureENCODE using XtremeDELTA Engine
SD_SDK_ENCODE_XTREME_ENGINE_START_DELTA = 0xD500,
SD_SDK_ENCODE_XTREME_ENGINE_DELTA_PERCENT = 0xD501,
SD_SDK_ENCODE_XTREME_ENGINE_DELTA_FINALIZING = 0xD502,
SD_SDK_ENCODE_XTREME_ENGINE_DELTA_NO_ERROR = 0xD503,
SD_SDK_ENCODE_XTREME_ENGINE_DELTA_CLOSING_ARCHIVE = 0xD504,
SD_SDK_ENCODE_XTREME_ENGINE_DELTA_AT_END = 0xD505,
SD_SDK_ENCODE_XTREME_ENGINE_DELTA_ERROR = 0xD506
}
SD_SDK_SECURE_ENCODE_EVENT_ID;
#pragma pack(push, 8)
typedef struct _CB_SD_SDK_SECURE_ENCODE_EVENT_TYPE
{
SD_SDK_SECURE_ENCODE_EVENT_ID even_param_ID;
uint32_t event_param_type;
double dbl_operation_progress_indicator;
uint32_t uint_main_progress_indicator;
}
_SD_SDK_SECURE_ENCODE_CALLBACK_EVENT, *P__SD_SDK_SECURE_ENCODE_CALLBACK_EVENT;
#pragma pack(pop)
typedef const SD_SDK_SECURE_ENCODE_RETURN_ID (__stdcall *pf_secure_encode_sdk_event_cb)(_SD_SDK_SECURE_ENCODE_CALLBACK_EVENT _cb_sdk_event, void *p_sd_sdk_user_data);
#pragma pack(push, 8) // consistent
typedef struct SD_SDK_SECURE_ENCODE_PARAM
{
uint8_t _use_xtreme_mode;
uint8_t _use_callback;
uint8_t _cpu_priority_level;
uint8_t _reserved; // allow forwards compatibility. with improved functionality,
uint32_t _dwReserved; // your structure size stay the same. 'njoy!
uint32_t _dwSourceMajorFileVersion;
uint32_t _dwSourceMinorFileVersion;
uint32_t _dwTargetMajorFileVersion;
uint32_t _dwTargetMinorFileVersion;
wchar_t _wchr_sourcefile_path [_SD_SDK_MAXPATH_];
wchar_t _wchr_targetfile_path [_SD_SDK_MAXPATH_];
wchar_t _wchr_securedelta_path[_SD_SDK_MAXPATH_];
wchar_t _wchr_versionSource [_SD_SDK_MAX_VER_];
wchar_t _wchr_versionTarget [_SD_SDK_MAX_VER_];
void* _callback_p_user_data;
HWND _callback_user_hwnd;
pf_secure_encode_sdk_event_cb _sd_sdk_secure_callback_function;
SD_SDK_SECURE_ENCODE_PARAM() //set default params
{
_use_callback = 0x00;
_use_xtreme_mode = 0x00;
_cpu_priority_level = 0x00; // normal prio
_sd_sdk_secure_callback_function = 0x00;
_dwSourceMajorFileVersion = 0x00;
_dwSourceMinorFileVersion = 0x00;
_dwTargetMajorFileVersion = 0x00;
_dwTargetMinorFileVersion = 0x00;
_callback_p_user_data = 0x00;
_callback_user_hwnd = 0x00;
memset(_wchr_sourcefile_path, 0, sizeof(_wchr_sourcefile_path));
memset(_wchr_targetfile_path, 0, sizeof(_wchr_targetfile_path));
memset(_wchr_securedelta_path, 0, sizeof(_wchr_securedelta_path));
memset(_wchr_versionSource, 0, sizeof(_wchr_versionSource));
memset(_wchr_versionTarget, 0, sizeof(_wchr_versionTarget));
};
}
SD_SDK_SECURE_ENCODE_PARAMS, *P_SD_SDK_SECURE_ENCODE_PARAMS;
#pragma pack(pop)
/**
*
* Definitions of SecureENCODE function prototype
*
* @param _encode_param_struct The SD_SDK_SECURE_ENCODE_PARAMS structure which contains all data required to perform the SecureENCODE operation
*
*/
typedef int32_t(__stdcall *PF_SECUREDELTA_SDK_SECUREENCODE_MAIN)(SD_SDK_SECURE_ENCODE_PARAMS& _encode_param_struct);
typedef const wchar_t* (__stdcall *PF_SECUREDELTA_SDK_SECUREENCODE_DLL_GETMESSAGESTRING_FROM_ID_)(const SD_SDK_SECURE_ENCODE_EVENT_ID _string_enum_ID);
/**
*
* Call this function to perform the SecureENCODE operation that creates a SecureDELTA binary diff file
* from source (initial / old file) and target (destination / new file)
* You may set other options in SD_SDK_SECURE_ENCODE_PARAMS
*
* @param _encode_param_struct The SD_SDK_SECURE_ENCODE_PARAMS structure which contains all data required to perform the SecureENCODE operation
*
*/
SECURE_ENCODE_SDK_API int32_t __stdcall SecureDELTA_SDK_SecureENCODE_Main_(SD_SDK_SECURE_ENCODE_PARAMS& _encode_param_struct);
/**
*
* Call this function to extract an internally defined string from a certain _string_enum_ID
*
* @param _string_enum_ID The string ID required to extract that particular string associated with the ID
*
* @return const wchar_t* The return is constant wide array pointer
*
*/
SECURE_ENCODE_SDK_API const wchar_t* __stdcall SecureDELTA_SDK_SecureENCODE_GetMessageString_fromID_(const SD_SDK_SECURE_ENCODE_EVENT_ID _string_enum_ID);