8.2.2.3 Fill in SecureENCODE Structure Parameters
8.2.2.3 Fill in SecureENCODE Structure Parameters
Fill in SecureENCODE Structure Parameters
Here are code snippets on how to perform this action:
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
SD_SDK_SECURE_ENCODE_PARAMS _secure_encode_struct;
_secure_encode_struct._use_callback = 0x01;
_secure_encode_struct._sd_sdk_secure_callback_function = _cmd_line_secure_callback;
_secure_encode_struct._callback_user_hwnd = 0x00;
_secure_encode_struct._use_xtreme_mode = 0x00;
wcsncpy_s(_secure_encode_struct._wchr_versionSource, L"v1.1", _SD_SDK_MAX_VER_);
wcsncpy_s(_secure_encode_struct._wchr_versionTarget, L"v1.2", _SD_SDK_MAX_VER_);
wcsncpy_s(_secure_encode_struct._wchr_sourcefile_path, argv[1], _SD_SDK_MAXPATH_);
wcsncpy_s(_secure_encode_struct._wchr_targetfile_path, argv[2], _SD_SDK_MAXPATH_);
if(_secure_encode_struct._use_xtreme_mode)
wcsncat_s(_wchr_delta_file, L".XtremeDELTA", _SD_SDK_MAXPATH_);
else
wcsncat_s(_wchr_delta_file, L".SecureDELTA", _SD_SDK_MAXPATH_);
wcsncpy_s(_secure_encode_struct._wchr_securedelta_path, _wchr_delta_file, _SD_SDK_MAXPATH_);
VB .NET
1
2
3
4
5
6
7
8
9
10
11
Dim _secure_encode_struct As SD_SDK_SecureENCODE_Struct_PARAM
_secure_encode_struct._use_callback = 1
_secure_encode_struct._cpu_priority_level = 0
_secure_encode_struct._callback_p_user_data = 0
_secure_encode_struct._callback_user_hwnd = Me.Handle
_secure_encode_struct._callback_function = AddressOf SecureDelta_SecureENCODE_Callback_Main
_secure_encode_struct._wchr_sourcefile_path = System.Text.Encoding.Unicode.GetBytes(SourceFile_textBox.Text)
_secure_encode_struct._wchr_new_targetfile_path = System.Text.Encoding.Unicode.GetBytes(TargetFile_textBox.Text)
_secure_encode_struct._wchr_securedelta_path = System.Text.Encoding.Unicode.GetBytes(SecureDELTA_File_textBox.Text)
C#
1
2
3
4
5
6
7
8
9
10
11
12
SD_SDK_SecureENCODE_Struct _encode_struct = new SD_SDK_SecureENCODE_Struct();
Encoding unicode = new UnicodeEncoding();
_encode_struct._use_xtreme_mode = 0x00;
_encode_struct._wchr_sourcefile_path = unicode.GetBytes(m_valueTextSourceFile);
_encode_struct._wchr_targetfile_path = unicode.GetBytes(m_valueTextTargetFile);
_encode_struct._wchr_securedelta_path = unicode.GetBytes(m_valueTextSecureDELTAFile);
_encode_struct._wchr_versionSource = unicode.GetBytes("v1.101.200");
_encode_struct._wchr_versionTarget = unicode.GetBytes("v1.100.100");
DELPHI
1
2
3
4
5
6
_secure_encode_struct._cpu_priority_level := 0;
_secure_encode_struct._use_xtreme_mode := Byte(m_useXtremeDelta = True);
StringToWideChar(sourceFilenameEncode, _secure_encode_struct._wchr_sourcefile_path, _SD_SDK_MAXPATH_ - 1);
StringToWideChar(targetFilenameEncode, _secure_encode_struct._wchr_targetfile_path, _SD_SDK_MAXPATH_ - 1);
StringToWideChar(deltaFilenameEncode, _secure_encode_struct._wchr_securedelta_path, _SD_SDK_MAXPATH_ - 1);