8.2.4.3 Fill in required parameters


   Loading of SecureDELTA Dynamic Link Libraries


Here are code snippets on how to perform this action:



   C++


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
SD_SDK_SECURE_DECODE_PARAMS _sdk_securedecode_param;

_sdk_securedecode_param._use_callback = 0x01;
_sdk_securedecode_param._sd_sdk_secure_callback_function = _secure_decode_callback;

wcsncpy_s(_sdk_securedecode_param._wchr_sourcefile_path, argv[1], _SD_SDK_MAXPATH_);
wcsncpy_s(_sdk_securedecode_param._wchr_securedelta_path, argv[2], _SD_SDK_MAXPATH_);
wcsncpy_s(_sdk_securedecode_param._wchr_targetfile_path, argv[3], _SD_SDK_MAXPATH_);

if (argc > 4) {
        wcsncpy_s(_sdk_securedecode_param._wchr_publickey_path, argv[4], _SD_SDK_MAXPATH_);
}



   VB .NET


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
Dim _secure_decode_struct As SD_SDK_SecureDECODE_Struct_PARAM

_secure_decode_struct._use_callback = 1
_secure_decode_struct._cpu_priority_level = 0
_secure_decode_struct._callback_p_user_data = 0
_secure_decode_struct._callback_user_hwnd = Me.Handle
_secure_decode_struct._callback_function = AddressOf SecureDelta_SecureDECODE_Callback_Main

_secure_decode_struct._wchr_sourcefile_path = System.Text.Encoding.Unicode.GetBytes(SourceFile_textBox.Text)
ReDim Preserve _secure_decode_struct._wchr_sourcefile_path(_SD_SDK_MAXPATH_ * 2)

_secure_decode_struct._wchr_new_targetfile_path = System.Text.Encoding.Unicode.GetBytes(TargetFile_textBox.Text)
ReDim Preserve _secure_decode_struct._wchr_new_targetfile_path(_SD_SDK_MAXPATH_ * 2)

_secure_decode_struct._wchr_securedelta_path = System.Text.Encoding.Unicode.GetBytes(SecureDELTA_File_textBox.Text)
ReDim Preserve _secure_decode_struct._wchr_securedelta_path(_SD_SDK_MAXPATH_ * 2)

_secure_decode_struct._wchr_publickey_path = System.Text.Encoding.Unicode.GetBytes(PublicKey_Folder_TextBox.Text)



   C#


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
SD_SDK_SecureDECODE_Struct _decode_struct = new SD_SDK_SecureDECODE_Struct();

Encoding unicode = new UnicodeEncoding();

_decode_struct._wchr_sourcefile_path = unicode.GetBytes(m_valueTextSourceFile);
_decode_struct._wchr_targetfile_path = unicode.GetBytes(m_valueTextTargetFile);
_decode_struct._wchr_securedelta_path = unicode.GetBytes(m_valueTextSecureDELTAFile);
_decode_struct._wchr_publickey_path = unicode.GetBytes(m_valueTextPublicKeyFile);

_decode_struct._use_callback = 0x01;
_decode_struct._callback_function_p_user_data = IntPtr.Zero;
_decode_struct._securedecode_callback_function = _decode_callback_proc;
_decode_struct._callback_user_hwnd = Handle;
_decode_struct._cpu_priority_level = SECURE_DECODE_PRIORITY_CLASS_ABOVE;



   DELPHI


1
2
3
4
5
6
7
8
9
StringToWideChar(sourceFilenameDecode, decodeDLLHeaderStruct._wchr_sourcefile_path, _SD_SDK_MAXPATH_ - 1);
StringToWideChar(targetFilenameDecode, decodeDLLHeaderStruct._wchr_targetfile_path, _SD_SDK_MAXPATH_ - 1);
StringToWideChar(deltaFilenameDecode, decodeDLLHeaderStruct._wchr_securedelta_path, _SD_SDK_MAXPATH_ - 1);
StringToWideChar(publicKeyFileName, decodeDLLHeaderStruct._wchr_publickey_path, _SD_SDK_MAXPATH_ - 1);

decodeDLLHeaderStruct._use_callback         := 1;
decodeDLLHeaderStruct._callback_p_user_data := Self;
decodeDLLHeaderStruct._callback_user_hwnd   := Application.MainForm.Handle;
decodeDLLHeaderStruct._callback_function    := SD_SDK_SecureCALLBACK_DECODE_Main_Func;