8.2.3.3 Using SecureDECODE Callback Structures
8.2.3.3 Using SecureDECODE callback structures
Using SecureDECODE callback structures
During the SecureDECODING process, the engine calls back a function through the function pointer _sd_sdk_secure_callback_function
Header file:
Type:
pf_secure_encode_sdk_event_cb
TypeDef:
typedef const SD_SDK_SECURE_DECODE_RETURN_ID (__stdcall *pf_secure_decode_sdk_event_cb)(_SD_SDK_SECURE_DECODE_CALLBACK_EVENT _cb_sdk_event, void *p_sd_sdk_user_data, HWND _caller_HWND);
The SecureDECODE Callback Structure and its data members:
1
2
3
4
5
6
7
8
typedef struct _CB_SD_SECURE_DECODE_EVENT_TYPE
{
SD_SDK_SECURE_DECODE_EVENT_ID even_param_ID;
uint32_t event_param_type;
double dbl_operation_progress_indicator;
uint32_t uint_main_progress_indicator;
}
_SD_SDK_SECURE_DECODE_CALLBACK_EVENT, *P__SD_SDK_SECURE_DECODE_CALLBACK_EVENT;
Using this Callback Structure, SecureDELTA engines return special event IDs along with progress indicators or other string information.
Type SD_SDK_SECURE_DECODE_EVENT_ID is also defined in the same file as (see below) and represents different stages of SecureDECODING action:
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
typedef enum
{
SD_SDK_DECODE_ENGINE_ERROR_MEMORY_INIT_NONE_ = 0x0000,
SD_SDK_DECODE_ENGINE_ERROR_OPERATION_CANCELED_ = 0x0004,
SD_SDK_DECODE_XTREME_ENGINE_ERROR_MEMORY_INIT_NONE_ = 0x0010,
SD_SDK_DECODE_XTREME_ENGINE_ERROR_OPERATION_CANCELED_ = 0x0014,
// File Errors
SD_SDK_DECODE_ENGINE_INVALID_FILE_SIZE = 0xE000,
SD_SDK_DECODE_ENGINE_COULD_NOT_OPEN_FILE = 0xE001,
SD_SDK_DECODE_XTREME_ENGINE_INVALID_FILE_SIZE = 0xE010,
SD_SDK_DECODE_XTREME_ENGINE_COULD_NOT_OPEN_FILE = 0xE011,
// Signature Verification
SD_SDL_DECODE_DIGITAL_SIGNATURE_VERIFICATION_STARTED = 0xE050,
SD_SDL_DECODE_DIGITAL_SIGNATURE_VERIFYING = 0xE051,
SD_SDL_DECODE_DIGITAL_SIGNATURE_VERIFICATION_HAS_FAILED = 0xE052,
SD_SDL_DECODE_DIGITAL_SIGNATURE_VERIFICATION_PASSED = 0xE053,
// Dictionary Errors
SD_SDK_DECODE_ENGINE_START_CRC_CHECK = 0xE100,
SD_SDK_DECODE_XTREME_ENGINE_START_CRC_CHECK = 0xE120,
// Dictionary Errors
SD_SDK_DECODE_ENGINE_READ_HEADER = 0xE200,
SD_SDK_DECODE_ENGINE_UPDAT_HEADER = 0xE200,
SD_SDK_DECODE_XTREME_ENGINE_READ_HEADER = 0xE210,
SD_SDK_DECODE_XTREME_ENGINE_UPDAT_HEADER = 0xE220,
// Dictionary Errors
SD_SDK_DECODE_ENGINE_START_LOAD_DICT = 0xE300,
SD_SDK_DECODE_ENGINE_LOAD_DICT_PERCENT = 0xE301,
SD_SDK_DECODE_ENGINE_STARTED_DONE_LOAD_DICT_NO_ERROR = 0xE302,
SD_SDK_DECODE_ENGINE_STARTED_DONE_LOAD_DICT_ERROR_NOT_ENOUGH_MEM = 0xE303,
SD_SDK_DECODE_XTREME_ENGINE_START_LOAD_DICT = 0xE400,
SD_SDK_DECODE_XTREME_ENGINE_LOAD_DICT_PERCENT = 0xE401,
SD_SDK_DECODE_XTREME_ENGINE_STARTED_DONE_LOAD_DICT_NO_ERROR = 0xE402,
SD_SDK_DECODE_XTREME_ENGINE_STARTED_DONE_LOAD_DICT_ERROR_NOT_ENOUGH_MEM = 0xE403,
// Performing SecureDECODE using SecureDELTA algorithm
SD_SDK_DECODE_ENGINE_START_DELTA = 0xD400,
SD_SDK_DECODE_ENGINE_DELTA_PERCENT = 0xD401,
SD_SDK_DECODE_ENGINE_DELTA_CRC_CALCULATION = 0xD403,
SD_SDK_DECODE_ENGINE_DELTA_CLOSING_ARCHIVE = 0xD404,
SD_SDK_DECODE_ENGINE_DELTA_FINALIZING = 0xD402,
SD_SDK_DECODE_ENGINE_DELTA_AT_END = 0xD405,
SD_SDK_DECODE_ENGINE_DELTA_NO_ERROR = 0xD406,
SD_SDK_DECODE_ENGINE_DELTA_ERROR = 0xD407,
// Performing SecureDECODE using XtremeDELTA algorithm
SD_SDK_DECODE_XTREME_ENGINE_START_DELTA = 0xD500,
SD_SDK_DECODE_XTREME_ENGINE_DELTA_PERCENT = 0xD501,
SD_SDK_DECODE_XTREME_ENGINE_DELTA_CRC_CALCULATION = 0xD503,
SD_SDK_DECODE_XTREME_ENGINE_DELTA_CLOSING_ARCHIVE = 0xD504,
SD_SDK_DECODE_XTREME_ENGINE_DELTA_FINALIZING = 0xD502,
SD_SDK_DECODE_XTREME_ENGINE_DELTA_AT_END = 0xD505,
SD_SDK_DECODE_XTREME_ENGINE_DELTA_NO_ERROR = 0xD506,
SD_SDK_DECODE_XTREME_ENGINE_DELTA_ERROR = 0xD507
}
SD_SDK_SECURE_DECODE_EVENT_ID;