8.2.1.2 SecureENCODE Structure


   SecureENCODE Structure


This structure allows you to access the SecureENCODE feature from the SecureENCODE_SDK_DLL


 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
#pragma pack(push, 8) 
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)



   SecureENCODE Data Members


1. Files related Data Members


These variables define the filename full paths needed by the SecureDELTA engines to work.


wchar_t _wchr_sourcefile_path [_SD_SDK_MAXPATH_];


Contains the string value in wide characters for the source file path. This is the file that gets updated.

This file will be opened in READ ONLY MODE during SecureENCODING and SecureDECODING action.


wchar_t _wchr_targetfile_path [_SD_SDK_MAXPATH_];


This file will be opened in READ ONLY MODE during SecureENCODING action and in CREATE/READ/WRITE mode during SecureDECODING.

Contains the string value in wide characters for the target file path. This is the file that gets created on the remote machine, during the decoding phase, SecureDECODE.


wchar_t _wchr_securedelta_path [_SD_SDK_MAXPATH_];  //  _SD_SDK_MAXPATH_ is defined as 280 wide chars


This file will be opened in CREATE/READ/WRITE MODE during SecureENCODING action and in READ MODE mode during SecureDECODING.

Contains the string value in wide characters for the source file path. This is the binary differencing file that gets created during the encoding phase, SecureENCODE.


See more about filing required information here.


2. Versioning related Data Members


2.1 Native versioning information

 

These variables define the versioning information you may want to associate with the Source and Target files.


uint32_t _dwSourceMajorFileVersion;

uint32_t _dwSourceMinorFileVersion;


These variables define the versioning information you may want to associate with the Source file.


uint32_t _dwTargetMajorFileVersion;

uint32_t _dwTargetMinorFileVersion;  


These variables define the versioning information you may want to associate with the Target file.


2.2. Custom Versioning Information


wchar_t _wchr_versionSource [_SD_SDK_MAX_VER_];

wchar_t _wchr_versionTarget [_SD_SDK_MAX_VER_];


See how you can use the versioning information here.



3. User-related Data Members


These variables may be used for various user-related data.


3.1 User Data Pointer for Callback


void*        _callback_p_user_data;


A developer may pass any user own data pointer in a void-pointer cast or simply pass the "this" pointer (when working object oriented): _delta_param_struct_to_encode._callback_p_user_data = this;



3.2 Window Handle for callback


HWND        _callback_user_hwnd;


Attach any HWND variable that you may want to use to display information from the callback structure.



3.3 Type definition for a pointer to a Callback Function, with all its signature



pf_secure_encode_sdk_event_cb _sd_sdk_secure_callback_function;


A developer may pass a pointer for a locally defined callback function: _sdk_securestructure_param._sd_sdk_secure_callback_function = _secure_callback;


See declaration examples of a Secure Callback function here