8.2.3.2 SecureDECODE Structure


   SecureDECODE Structure


This structure allows you to access the SecureDECODE feature from the SecureDECODE_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
#pragma pack(push, 8)
typedef struct SD_SDK_SECURE_DECODE_PARAM
{
	uint8_t	 _use_callback;
	uint8_t  _cpu_priority_level;
	uint8_t  _reserved1;
	uint8_t  _reserved2;	// allows for forward compatibility with improved functionality
	uint32_t _reserved3;		   

	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_publickey_path  [_SD_SDK_MAXPATH_]; // The folder where the public key must exists

	void*	 _callback_p_user_data;
	HWND	 _callback_user_hwnd;
	pf_secure_decode_sdk_event_cb _sd_sdk_secure_callback_function;

	//set default params
	SD_SDK_SECURE_DECODE_PARAM()
	{
		_use_callback = 0x00;
		_cpu_priority_level = 0x00; // normal prio

        	_sd_sdk_secure_callback_function = 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_publickey_path, 0, sizeof(_wchr_publickey_path));
	};
}
SD_SDK_SECURE_DECODE_PARAMS, *P_SD_SDK_SECURE_DECODE_PARAMS;
#pragma pack(pop)



   SecureDECODE Data Members


1. Files related Data Members


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


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.


wchar_t _wchr_publickey_path [_SD_SDK_MAXPATH_];  //  The folder where the public key must exists


This file will be opened in READ MODE during SecureDECODING and it is a necessary file needed to decrypt the header information when encrypted and digitally signed using ECDSA algorithm. See more here.

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 contain 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