目前,要想被 TSMaster 的诊断模块直接加载,该 DLL 必须实现如下三种函数接口中的一种:
【1】 接口 1:
unsigned int GenerateKeyEx( const unsigned char* ipSeedArray, /* Array for the seed [in] */ unsigned int iSeedArraySize, /* Length of the array for the seed [in] */ const unsigned int iSecurityLevel, /* Security level [in] */ const char* ipVariant, /* Name of the active variant [in] */ unsigned char* iopKeyArray, /* Array for the key [in, out] */ unsigned int iMaxKeyArraySize, /* Maximum length of the array for the key [in] */ unsigned int& oActualKeyArraySize); /* Length of the key [out] */
【2】 接口 2:
unsigned int GenerateKeyExOpt( const unsigned char* ipSeedArray, /* Array for the seed [in] */ unsigned int iSeedArraySize, /* Length of the array for the seed [in] */ const unsigned int iSecurityLevel, /* Security level [in] */ const char* ipVariant, /* Name of the active variant [in] */ const char* iPara, /* */ unsigned char* iopKeyArray, /* Array for the key [in, out] */ unsigned int iMaxKeyArraySize, /* Maximum length of the array for the key [in] */ unsigned int& oActualKeyArraySize) /* Length of the key [out] */
【3】 接口 3:
bool ASAP1A_CCP_ComputeKeyFromSeed( const unsigned char* ipSeedArray, /* Array for the seed [in] */ unsigned short iSeedArraySize, /* Length of the array for the seed [in] */ unsigned char* iopKeyArray, /* Array for the key [in, out] */ unsigned short iMaxKeyArraySize, /* Maximum length of the array for the key [in] */ unsigned short* opSizeKey) /* Length of the key [out] */
用户的 DLL 只要实现了上述任意一种函数接口,即可直接加载到 TP 层模块中。如果出现加载失败,主要检查如下情况:
1. 是否用 Release 模式发布,如果是 Debug 模式,常常会有以上失败的情况出现。
2. 是否采用 x86 平台发布,目前 TSMaster 为支持 X86 的版本,用来调试的 DLL 也必须为X86 模式。