8.2.2.2 Retrieve SecureENCODE DLL Exported Functions


   Retrieve SecureENCODE SDK Exported Functions


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
// SecureEncodeSDK.h
typedef int32_t(__stdcall *PF_SECUREDELTA_SDK_SECUREENCODE_MAIN)(SD_SDK_SECURE_ENCODE_PARAMS& _encode_param_struct);

// C++ file code
PF_SECUREDELTA_SDK_SECUREENCODE_MAIN lpfnSecureENCODE_Dll_MainEncodeFnct = nullptr;    // DLL Exported Function pointer

//
// Retrieve SecureENCODE DLL function pointer...
//
lpfnSecureENCODE_Dll_MainEncodeFnct = (PF_SECUREDELTA_SDK_SECUREENCODE_MAIN)GetProcAddress(h_SecureEncodeSDK_DLL_x86, SecureDELTA_SDK_DLL_SecureENCODE_Main_Func_);
if (!lpfnSecureENCODE_Dll_MainEncodeFnct)
{
        // handle the error
        FreeLibrary(h_SecureEncodeSDK_DLL_x86);
        return 0x02;
}



   VB .NET


1
Dim secureEncodeMain As SecureDelta_SecureENCODE_Main = DirectCast(Marshal.GetDelegateForFunctionPointer(SecureENCODE_FunctionHandle, GetType(SecureDelta_SecureENCODE_Main)), SecureDelta_SecureENCODE_Main)



   C#



1
2
3
4
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate Int32 SecureDELTA_SDK_SecureENCODE_Main_(ref SD_SDK_SecureENCODE_Struct _encode_struct);

SecureDELTA_SDK_SecureENCODE_Main_ _encode_main_proc = (SecureDELTA_SDK_SecureENCODE_Main_) Marshal.GetDelegateForFunctionPointer(ipSD_EncodeMain, typeof(SecureDELTA_SDK_SecureENCODE_Main_));



   DELPHI


1
2
3
4
5
6
7
8
9
type
TSD_SDK_SecureCallback_Encode_Main_Func = function(SD_SDK_SECURE_ENCODE_CALLBACK_PARAM : struct_CB_SD_SECURE_ENCODE_CALLBACK_TYPE; pVoidPtr : Pointer ) : SD_SDK_SECURE_ENCODE_CALLBACK_EVENT_ID; stdcall;

var
SD_SDK_SecureENCODE_Main_Func : TSD_SDK_SecureENCODE_Main_Func;

[...]

@SD_SDK_SecureENCODE_Main_Func := GetProcAddress(SecureENCODE_DLL_Handle, SecureDELTA_DLL_Record.SecureENCODE_DLL_Main_Ptr);