|
@@ -15,15 +15,14 @@
|
|
|
#include "fileutil.h"
|
|
|
|
|
|
#if defined(_MSC_VER)
|
|
|
-
|
|
|
#pragma comment(lib, "Version.lib")
|
|
|
-
|
|
|
typedef ErrorCodeEnum(*DevAdaptObjCreateFunc)(DeviceBaseClass*& baseObj);
|
|
|
typedef ErrorCodeEnum(*DevAdaptObjReleaseFunc)(DeviceBaseClass*& pBaseObj);
|
|
|
#else //C/C++ Compiler
|
|
|
using DevAdaptObjCreateFunc = ErrorCodeEnum(*)(DeviceBaseClass*& pOutDevAptObj);
|
|
|
using DevAdaptObjReleaseFunc = ErrorCodeEnum(*)(DeviceBaseClass*& pInDevAptObj);
|
|
|
#endif //_MSC_VER
|
|
|
+typedef ErrorCodeEnum(*GetDevAdapterVersionFunc)(DevSoftVersion& retVersion);
|
|
|
|
|
|
#define HARDWARE_ENTITY_RESET_ENTITYID(ent, entityID) \
|
|
|
do{\
|
|
@@ -173,6 +172,9 @@ private:
|
|
|
for (int i = 0; i < strTest.GetLength(); ++i) {
|
|
|
if (strTest[i] >= 'A' && strTest[i] <= 'Z') strTest[i] = strTest[i] + ('a' - 'A');
|
|
|
}
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("strTest:%s", strPath.GetData());
|
|
|
+
|
|
|
+
|
|
|
if (strTest.IndexOf("pinpad") != -1) {
|
|
|
replaceAdapterName = "PinPad.self.1.1.dll";
|
|
|
result = true;
|
|
@@ -207,8 +209,33 @@ private:
|
|
|
DWORD d3;
|
|
|
DWORD d4;
|
|
|
|
|
|
+ if (!ExistsFileA(strFullLibPath)) {
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ /** Test Gifur@2024322]*/
|
|
|
GetDllVersionInfo(strFullLibPath, d1, d2, d3, d4);
|
|
|
DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("dll version: %d.%d.%d.%d", d1, d2, d3, d4);
|
|
|
+
|
|
|
+ do
|
|
|
+ {
|
|
|
+ toolkit_lib_t libHandle;
|
|
|
+ int res = toolkit_dlopen(strFullLibPath, &libHandle);
|
|
|
+ if (res != 0) {
|
|
|
+ DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_SYSTEM)("tmp: toolkit_dlopen[%s] failed with error %s.", strFullLibPath.GetData(), toolkit_dlerror(&libHandle));
|
|
|
+ toolkit_dlclose(&libHandle);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("tmp: try to get GetDevAdapterVersion pointer address...");
|
|
|
+ if ((res = toolkit_dlsym(&libHandle, "GetDevAdapterVersion", (void**)&pFuncGetDevAdapterVer)) != 0) {
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("try to get 'GetDevAdapterVersion' Func address failed with error: %s", toolkit_dlerror(&libHandle));
|
|
|
+ toolkit_dlclose(&libHandle);
|
|
|
+ } else {
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("get 'GetDevAdapterVersion' Func address succ, seem it as built with vs2019, skip latter procedure");
|
|
|
+ toolkit_dlclose(&libHandle);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ } while (false);
|
|
|
+
|
|
|
CSimpleStringA strTest = strFullLibPath.GetData();
|
|
|
CSimpleStringA strSelf(true);
|
|
|
if (CheckAndGetMapAdatperName(strTest, strSelf)) {
|
|
@@ -462,6 +489,7 @@ private:
|
|
|
toolkit_lib_t m_lib;
|
|
|
DevAdaptObjCreateFunc pFuncCreateAdapt;
|
|
|
DevAdaptObjReleaseFunc pFuncReleaseAdapt;
|
|
|
+ GetDevAdapterVersionFunc pFuncGetDevAdapterVer;
|
|
|
|
|
|
TSubAdpt* m_AdptObjPtr;
|
|
|
bool m_VS2010BridgeMode;
|