瀏覽代碼

Z991239-5402 #comment 迁移VS2010的桥接适配器代码

80374374 1 年之前
父節點
當前提交
394f953b64
共有 63 個文件被更改,包括 4845 次插入0 次删除
  1. 44 0
      DevAdapter/self/dep/libCardIssuerLoader/ReadMe.txt
  2. 19 0
      DevAdapter/self/dep/libCardIssuerLoader/dllmain.cpp
  3. 828 0
      DevAdapter/self/dep/libCardIssuerLoader/libCardIssuerLoader.cpp
  4. 158 0
      DevAdapter/self/dep/libCardIssuerLoader/libCardIssuerLoader.h
  5. 103 0
      DevAdapter/self/dep/libCardIssuerLoader/libCardIssuerLoader.vcxproj
  6. 42 0
      DevAdapter/self/dep/libCardIssuerLoader/libCardIssuerLoader.vcxproj.filters
  7. 8 0
      DevAdapter/self/dep/libCardIssuerLoader/stdafx.cpp
  8. 16 0
      DevAdapter/self/dep/libCardIssuerLoader/stdafx.h
  9. 8 0
      DevAdapter/self/dep/libCardIssuerLoader/targetver.h
  10. 44 0
      DevAdapter/self/dep/libContactlessCardLoader/ReadMe.txt
  11. 19 0
      DevAdapter/self/dep/libContactlessCardLoader/dllmain.cpp
  12. 264 0
      DevAdapter/self/dep/libContactlessCardLoader/libContactlessCardLoader.cpp
  13. 48 0
      DevAdapter/self/dep/libContactlessCardLoader/libContactlessCardLoader.h
  14. 103 0
      DevAdapter/self/dep/libContactlessCardLoader/libContactlessCardLoader.vcxproj
  15. 42 0
      DevAdapter/self/dep/libContactlessCardLoader/libContactlessCardLoader.vcxproj.filters
  16. 8 0
      DevAdapter/self/dep/libContactlessCardLoader/stdafx.cpp
  17. 16 0
      DevAdapter/self/dep/libContactlessCardLoader/stdafx.h
  18. 8 0
      DevAdapter/self/dep/libContactlessCardLoader/targetver.h
  19. 44 0
      DevAdapter/self/dep/libFingerPrintLoader/ReadMe.txt
  20. 19 0
      DevAdapter/self/dep/libFingerPrintLoader/dllmain.cpp
  21. 212 0
      DevAdapter/self/dep/libFingerPrintLoader/libFingerPrintLoader.cpp
  22. 48 0
      DevAdapter/self/dep/libFingerPrintLoader/libFingerPrintLoader.h
  23. 103 0
      DevAdapter/self/dep/libFingerPrintLoader/libFingerPrintLoader.vcxproj
  24. 42 0
      DevAdapter/self/dep/libFingerPrintLoader/libFingerPrintLoader.vcxproj.filters
  25. 8 0
      DevAdapter/self/dep/libFingerPrintLoader/stdafx.cpp
  26. 16 0
      DevAdapter/self/dep/libFingerPrintLoader/stdafx.h
  27. 8 0
      DevAdapter/self/dep/libFingerPrintLoader/targetver.h
  28. 44 0
      DevAdapter/self/dep/libGPIOLoader/ReadMe.txt
  29. 19 0
      DevAdapter/self/dep/libGPIOLoader/dllmain.cpp
  30. 187 0
      DevAdapter/self/dep/libGPIOLoader/libGPIOLoader.cpp
  31. 40 0
      DevAdapter/self/dep/libGPIOLoader/libGPIOLoader.h
  32. 103 0
      DevAdapter/self/dep/libGPIOLoader/libGPIOLoader.vcxproj
  33. 42 0
      DevAdapter/self/dep/libGPIOLoader/libGPIOLoader.vcxproj.filters
  34. 8 0
      DevAdapter/self/dep/libGPIOLoader/stdafx.cpp
  35. 16 0
      DevAdapter/self/dep/libGPIOLoader/stdafx.h
  36. 8 0
      DevAdapter/self/dep/libGPIOLoader/targetver.h
  37. 44 0
      DevAdapter/self/dep/libHSPSCannerLoader/ReadMe.txt
  38. 19 0
      DevAdapter/self/dep/libHSPSCannerLoader/dllmain.cpp
  39. 228 0
      DevAdapter/self/dep/libHSPSCannerLoader/libHSPSCannerLoader.cpp
  40. 43 0
      DevAdapter/self/dep/libHSPSCannerLoader/libHSPSCannerLoader.h
  41. 103 0
      DevAdapter/self/dep/libHSPSCannerLoader/libHSPSCannerLoader.vcxproj
  42. 42 0
      DevAdapter/self/dep/libHSPSCannerLoader/libHSPSCannerLoader.vcxproj.filters
  43. 8 0
      DevAdapter/self/dep/libHSPSCannerLoader/stdafx.cpp
  44. 16 0
      DevAdapter/self/dep/libHSPSCannerLoader/stdafx.h
  45. 8 0
      DevAdapter/self/dep/libHSPSCannerLoader/targetver.h
  46. 44 0
      DevAdapter/self/dep/libIDCertificateLoader/ReadMe.txt
  47. 19 0
      DevAdapter/self/dep/libIDCertificateLoader/dllmain.cpp
  48. 418 0
      DevAdapter/self/dep/libIDCertificateLoader/libIDCertificateLoader.cpp
  49. 272 0
      DevAdapter/self/dep/libIDCertificateLoader/libIDCertificateLoader.h
  50. 103 0
      DevAdapter/self/dep/libIDCertificateLoader/libIDCertificateLoader.vcxproj
  51. 42 0
      DevAdapter/self/dep/libIDCertificateLoader/libIDCertificateLoader.vcxproj.filters
  52. 8 0
      DevAdapter/self/dep/libIDCertificateLoader/stdafx.cpp
  53. 16 0
      DevAdapter/self/dep/libIDCertificateLoader/stdafx.h
  54. 8 0
      DevAdapter/self/dep/libIDCertificateLoader/targetver.h
  55. 36 0
      DevAdapter/self/dep/libPinPadLoader/ReadMe.txt
  56. 19 0
      DevAdapter/self/dep/libPinPadLoader/dllmain.cpp
  57. 333 0
      DevAdapter/self/dep/libPinPadLoader/libPinPadLoader.cpp
  58. 93 0
      DevAdapter/self/dep/libPinPadLoader/libPinPadLoader.h
  59. 104 0
      DevAdapter/self/dep/libPinPadLoader/libPinPadLoader.vcxproj
  60. 42 0
      DevAdapter/self/dep/libPinPadLoader/libPinPadLoader.vcxproj.filters
  61. 8 0
      DevAdapter/self/dep/libPinPadLoader/stdafx.cpp
  62. 16 0
      DevAdapter/self/dep/libPinPadLoader/stdafx.h
  63. 8 0
      DevAdapter/self/dep/libPinPadLoader/targetver.h

+ 44 - 0
DevAdapter/self/dep/libCardIssuerLoader/ReadMe.txt

@@ -0,0 +1,44 @@
+========================================================================
+    动态链接库:libCardIssuerLoader 项目概述
+========================================================================
+
+应用程序向导已为您创建了此 libCardIssuerLoader DLL。
+
+本文件概要介绍组成 libCardIssuerLoader 应用程序的每个文件的内容。
+
+
+libCardIssuerLoader.vcxproj
+    这是使用应用程序向导生成的 VC++ 项目的主项目文件,
+    其中包含生成该文件的 Visual C++ 
+    的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。
+
+libCardIssuerLoader.vcxproj.filters
+    这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。 
+    它包含有关项目文件与筛选器之间的关联信息。 在 IDE 
+    中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。
+    例如,“.cpp”文件与“源文件”筛选器关联。
+
+libCardIssuerLoader.cpp
+    这是主 DLL 源文件。
+
+	此 DLL 在创建时不导出任何符号。 因此,在生成此 DLL 时
+ 	生成时不会产生 .lib 文件。 如果希望此项目
+ 	成为其他某个项目的项目依赖项,则需要
+ 	添加代码以从 DLL 导出某些符号,
+ 	以便产生一个导出库,或者,也可以在项目“属性页”对话框中的
+ 	“链接器”文件夹中,将“常规”属性页上的
+ 	“忽略输入库”属性设置为“是”。
+
+/////////////////////////////////////////////////////////////////////////////
+其他标准文件:
+
+StdAfx.h,StdAfx.cpp
+    这些文件用于生成名为 libCardIssuerLoader.pch 的预编译头 (PCH) 文件和
+    名为 StdAfx.obj 的预编译类型文件。
+
+/////////////////////////////////////////////////////////////////////////////
+其他注释:
+
+应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。
+
+/////////////////////////////////////////////////////////////////////////////

+ 19 - 0
DevAdapter/self/dep/libCardIssuerLoader/dllmain.cpp

@@ -0,0 +1,19 @@
+// dllmain.cpp : 定义 DLL 应用程序的入口点。
+#include "stdafx.h"
+
+BOOL APIENTRY DllMain( HMODULE hModule,
+                       DWORD  ul_reason_for_call,
+                       LPVOID lpReserved
+					 )
+{
+	switch (ul_reason_for_call)
+	{
+	case DLL_PROCESS_ATTACH:
+	case DLL_THREAD_ATTACH:
+	case DLL_THREAD_DETACH:
+	case DLL_PROCESS_DETACH:
+		break;
+	}
+	return TRUE;
+}
+

+ 828 - 0
DevAdapter/self/dep/libCardIssuerLoader/libCardIssuerLoader.cpp

@@ -0,0 +1,828 @@
+// libCardIssuerLoader.cpp : 定义 DLL 应用程序的导出函数。
+//
+
+#include "stdafx.h"
+#include <Windows.h>
+#include < stdio.h >
+#include "libCardIssuerLoader.h"
+
+
+typedef ErrorCodeEnum(*DevAdaptObjCreateFunc)(DeviceBaseClass*& baseObj);
+typedef ErrorCodeEnum(*DevAdaptObjReleaseFunc)(DeviceBaseClass*& pBaseObj);
+
+HINSTANCE hinstLib = NULL;
+
+DevAdaptObjCreateFunc pFuncCreateAdapt = NULL;
+DevAdaptObjReleaseFunc pFuncReleaseAdapt = NULL;
+CardIssuerClass* pDevAdapterInstance = NULL;
+
+struct DevErrorInfo errInfoInstance;
+
+void SetLastErrInfo(const char* formatStr, ...)
+{
+	va_list arg;
+	va_start(arg, formatStr);
+	sprintf_s(errInfoInstance.szErrMsg, MAX_DEV_ERROR_MSG_LEN, formatStr, arg);
+	errInfoInstance.dwErrMsgLen = strlen(errInfoInstance.szErrMsg);
+	va_end(arg);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPath)
+{
+	ErrorCodeEnum erroCode;
+	hinstLib = LoadLibraryA(libraryPath);
+	if (hinstLib != NULL) {
+		pFuncCreateAdapt = (DevAdaptObjCreateFunc)GetProcAddress(hinstLib, "CreateDevComponent");
+		if (NULL == pFuncCreateAdapt) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_MisMatched;
+		}
+		pFuncReleaseAdapt = (DevAdaptObjReleaseFunc)GetProcAddress(hinstLib, "ReleaseDevComponent");
+		if (NULL == pFuncCreateAdapt) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_NotIntegrated;
+		}
+		erroCode = pFuncCreateAdapt((DeviceBaseClass*&)pDevAdapterInstance);
+		if (erroCode != Error_Succeed) {
+			pDevAdapterInstance = NULL;
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_NoTarget;
+		}
+		if (pDevAdapterInstance == NULL) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_Null;
+		}
+
+	} else {
+		SetLastErrInfo("load library failed %d", GetLastError());
+		return Error_DevLoadFileFailed;
+	}
+	return Error_Succeed;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ReleaseDevObject()
+{
+	if (pFuncReleaseAdapt != NULL && pDevAdapterInstance != NULL) {
+		DeviceBaseClass* devBasePtr = static_cast<DeviceBaseClass*>(pDevAdapterInstance);
+		pFuncReleaseAdapt(devBasePtr);
+		pDevAdapterInstance = NULL;
+	}
+	if (hinstLib != NULL) {
+		FreeLibrary(hinstLib);
+		hinstLib = NULL;
+	}
+	return Error_Succeed;
+}
+
+//////////////////////////////////////////////////////////////////////////
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetDevCategory(DevCategoryInfo* pDevCategory)
+{
+	ErrorCodeEnum result;
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+
+	DevCategoryInfo inner;
+	memset(inner.szType, 0, sizeof(char) * MAX_DEV_TYPE_LEN);
+	memset(inner.szModel, 0, sizeof(char) * MAX_DEV_MODEL_LEN);
+	memset(inner.szVendor, 0, sizeof(char) * MAX_DEV_VENDOR_LEN);
+
+	result = pDevAdapterInstance->GetDevCategory(inner);
+	if (result == Error_Succeed) {
+
+		memset(pDevCategory->szType, 0, sizeof(char) * MAX_DEV_TYPE_LEN);
+		memset(pDevCategory->szModel, 0, sizeof(char) * MAX_DEV_MODEL_LEN);
+		memset(pDevCategory->szVendor, 0, sizeof(char) * MAX_DEV_VENDOR_LEN);
+
+		strncpy_s(pDevCategory->szType, MAX_DEV_TYPE_LEN, inner.szType, strlen(inner.szType) > MAX_DEV_TYPE_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szType));
+		strncpy_s(pDevCategory->szModel, MAX_DEV_MODEL_LEN, inner.szModel, strlen(inner.szModel) > MAX_DEV_MODEL_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szModel));
+		strncpy_s(pDevCategory->szVendor, MAX_DEV_VENDOR_LEN, inner.szVendor, strlen(inner.szVendor) > MAX_DEV_VENDOR_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szVendor));
+
+		pDevCategory->eState = inner.eState;
+		pDevCategory->version.wMajor = inner.version.wMajor;
+		pDevCategory->version.wMinor = inner.version.wMinor;
+		pDevCategory->version.wRevision = inner.version.wRevision;
+		pDevCategory->version.wBuild = inner.version.wBuild;
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Reset()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->Reset();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevClose()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->DevClose();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetLastErr(DevErrorInfo* pDevErrInfo)
+{
+	if (pDevAdapterInstance == NULL) {
+		strcpy_s(pDevErrInfo->szErrMsg, MAX_DEV_ERROR_MSG_LEN, errInfoInstance.szErrMsg);
+		pDevErrInfo->dwErrMsgLen = errInfoInstance.dwErrMsgLen;
+		return Error_Succeed;
+	}
+	DevErrorInfo inner;
+	ErrorCodeEnum result = pDevAdapterInstance->GetLastErr(inner);
+	if (result == Error_Succeed) {
+		memset(pDevErrInfo->szErrMsg, 0, sizeof(char) * MAX_DEV_ERROR_MSG_LEN);
+		strncpy_s(pDevErrInfo->szErrMsg, MAX_DEV_ERROR_MSG_LEN, inner.szErrMsg, strlen(inner.szErrMsg) > MAX_DEV_ERROR_MSG_LEN - 1 ? MAX_DEV_ERROR_MSG_LEN - 1 : strlen(inner.szErrMsg));
+		pDevErrInfo->dwErrMsgLen = inner.dwErrMsgLen;
+	}
+	return result;
+}
+
+//////////////////////////////////////////////////////////////////////////
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevOpen(DWORD dwPort, DWORD dwBaudRate)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->DevOpen(dwPort, dwBaudRate);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetDevStatus(Bridge_CardIssuerStatus* pDevStatus)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	CardIssuerStatus inner;
+	ErrorCodeEnum result = pDevAdapterInstance->GetDevStatus(inner);
+	if (result == Error_Succeed) {
+		pDevStatus->eMedia = inner.eMedia;
+		pDevStatus->eRetainBin = inner.eRetainBin;
+		pDevStatus->dwRetainCount = inner.dwRetainCount;
+		memcpy(pDevStatus->eIssuerBin, inner.eIssuerBin, 12*sizeof(int));
+		memcpy(pDevStatus->dwIssuerCount, inner.dwIssuerCount, 12 * sizeof(DWORD));
+		memcpy(pDevStatus->eKakuTape, inner.eKakuTape, 8 * sizeof(int));
+	}
+	return result;
+}
+
+//128
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetDeviceSN(char** pDevSN)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	char* inner = new char[128];
+	if (inner == NULL) return Error_Resource;
+	memset(inner, 0, sizeof(char) * 128);
+	ErrorCodeEnum result = pDevAdapterInstance->GetDeviceSN(inner);
+	if (result == Error_Succeed) {
+		strcpy_s(*pDevSN, 128, inner);
+	}
+	delete[] inner;
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_MoveCard(int eCardPos, int hopperNo)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->MoveCard((CardPosEnum)eCardPos, hopperNo);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SetCardInType(int eCardIn)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->SetCardInType((CardInEnum)eCardIn);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_MagRead(Bridge_MagTracks* pMagTracks)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	if (pMagTracks == NULL) {
+		return Error_Param;
+	}
+
+	MagTracks inner;
+	inner.eRange = (TrackRange)pMagTracks->eRange;
+	ErrorCodeEnum result = pDevAdapterInstance->MagRead(inner);
+	if (result == Error_Succeed) {
+		pMagTracks->eRange = inner.eRange;
+		for (int i = 0; i < MAX_MAG_TRACK_NUM; ++i) {
+			pMagTracks->track[i].eSource = inner.track[i].eSource;
+			pMagTracks->track[i].eStatus = inner.track[i].eStatus;
+			pMagTracks->track[i].dwSize = inner.track[i].dwSize;
+			memset(pMagTracks->track[i].data, 0, sizeof(BYTE) * MAX_MAG_TRACK_SIZE);
+			memcpy(pMagTracks->track[i].data, inner.track[i].data, sizeof(BYTE) * MAX_MAG_TRACK_SIZE);
+		}
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_MagWrite(Bridge_MagTracks magTracks, int eWriteMode)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	MagTracks inner;
+	inner.eRange = (TrackRange)magTracks.eRange;
+	for (int i = 0; i < MAX_MAG_TRACK_NUM; ++i) {
+		inner.track[i].eSource = (TrackSrcEnum)magTracks.track[i].eSource;
+		inner.track[i].eStatus = (TrackDataStateEnum)magTracks.track[i].eStatus;
+		inner.track[i].dwSize = magTracks.track[i].dwSize;
+		memset(inner.track[i].data, 0, sizeof(BYTE) * MAX_MAG_TRACK_SIZE);
+		memcpy(inner.track[i].data, magTracks.track[i].data, sizeof(BYTE) * MAX_MAG_TRACK_SIZE);
+	}
+	return pDevAdapterInstance->MagWrite(inner, (MagWriteModeEnum)eWriteMode);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SetRetractCounter(DWORD dwCount)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->SetRetractCounter(dwCount);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SetIssuerCounter(DWORD dwCount, int hopperNo)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->SetIssuerCounter(dwCount, hopperNo);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ActiveICCard()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->ActiveICCard();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ContactIC()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->ContactIC();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ReleaseIC()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->ReleaseIC();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_WarmReset()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->WarmReset();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ICCommand(Bridge_CmdInfo sendBuf, Bridge_CmdInfo* pRecvBuf)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	if (pRecvBuf == NULL) {
+		return Error_Param;
+	}
+	CmdInfo inner_sendBuf;
+	CmdInfo inner_recvBuf;
+
+	inner_sendBuf.dwSize = sendBuf.dwSize;
+	memcpy(inner_sendBuf.data, sendBuf.data, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
+
+	ErrorCodeEnum result = pDevAdapterInstance->ICCommand(inner_sendBuf, inner_recvBuf);
+	if (result == Error_Succeed) {
+		pRecvBuf->dwSize = inner_recvBuf.dwSize;
+		memcpy(pRecvBuf->data, inner_recvBuf.data, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SAMActive(BYTE vcc)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->SAMActive(vcc);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SAMDeactivate()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->SAMDeactivate();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SAMWarmReset()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->SAMWarmReset();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SAMQueryStatus(Bridge_SAMStatus* pSamStatus)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	SAMStatus inner;
+
+	ErrorCodeEnum result = pDevAdapterInstance->SAMQueryStatus(inner);
+	if (result == Error_Succeed) {
+		pSamStatus->isActive = inner.isActive;
+		pSamStatus->chosenOfSAM = inner.chosenOfSAM;
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SAMSelect(const int sn)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->SAMSelect(sn);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SAMCommand(Bridge_CmdInfo sendBuf, Bridge_CmdInfo* pRecvBuf)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	CmdInfo inner_sendBuf;
+	CmdInfo inner_recvBuf;
+
+	inner_sendBuf.dwSize = sendBuf.dwSize;
+	memcpy(inner_sendBuf.data, sendBuf.data, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
+
+	ErrorCodeEnum result = pDevAdapterInstance->SAMCommand(inner_sendBuf, inner_recvBuf);
+	if (result == Error_Succeed) {
+		pRecvBuf->dwSize = inner_recvBuf.dwSize;
+		memcpy(pRecvBuf->data, inner_recvBuf.data, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
+	}
+
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ActiveICCardATR(Bridge_CmdInfo* pAtrBuf)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	CmdInfo inner;
+
+	inner.dwSize = pAtrBuf->dwSize;
+	memcpy(inner.data, pAtrBuf->data, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
+
+	ErrorCodeEnum result = pDevAdapterInstance->ActiveICCardATR(inner);
+	if (result == Error_Succeed) {
+		pAtrBuf->dwSize = inner.dwSize;
+		memcpy(pAtrBuf->data, inner.data, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
+	}
+
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Print(BYTE** pData, const int dataSize, const int side)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	BYTE* inner = new BYTE[2048];
+	if (inner == NULL) {
+		return Error_Resource;
+	}
+	memset(inner, 0, sizeof(BYTE) * 2048);
+	memcpy(inner, *pData, 2048);
+
+	ErrorCodeEnum result = pDevAdapterInstance->Print(inner, dataSize, side);
+	
+	delete[] inner;
+
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_QueryPrinterStatus()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->QueryPrinterStatus();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ActiveContactlessICCard(char fstType, char scdType, char thdType, char* pOutType)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+
+	char inner;
+	ErrorCodeEnum result = pDevAdapterInstance->ActiveContactlessICCard(fstType, scdType, thdType, inner);
+	if (result == Error_Succeed) {
+		*pOutType = inner;
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DeactivateICCard()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->DeactivateICCard();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DeactContactlessICCard()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->DeactContactlessICCard();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_MifareCommand(int eFunType, Bridge_CmdInfo sendBuf, Bridge_CmdInfo* pRecvBuf)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	CmdInfo inner_sendBuf;
+	CmdInfo inner_recvBuf;
+
+	inner_sendBuf.dwSize = sendBuf.dwSize;
+	memcpy(inner_sendBuf.data, sendBuf.data, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
+
+	ErrorCodeEnum result = pDevAdapterInstance->MifareCommand((MifareFuctionEnum)eFunType, inner_sendBuf, inner_recvBuf);
+	if (result == Error_Succeed) {
+		pRecvBuf->dwSize = inner_recvBuf.dwSize;
+		memcpy(pRecvBuf->data, inner_recvBuf.data, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_RFTypeABCommand(Bridge_CmdInfo sendBuf, Bridge_CmdInfo* pRecvBuf)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	CmdInfo inner_sendBuf;
+	CmdInfo inner_recvBuf;
+
+	inner_sendBuf.dwSize = sendBuf.dwSize;
+	memcpy(inner_sendBuf.data, sendBuf.data, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
+
+	ErrorCodeEnum result = pDevAdapterInstance->RFTypeABCommand(inner_sendBuf, inner_recvBuf);
+	if (result == Error_Succeed) {
+		pRecvBuf->dwSize = inner_recvBuf.dwSize;
+		memcpy(pRecvBuf->data, inner_recvBuf.data, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevOpenEx(DWORD dwPort, DWORD dwBaudRate, BYTE btOpenType, const char* pDevSN, BYTE* pBtType)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+
+	BYTE inner;
+	ErrorCodeEnum result = pDevAdapterInstance->DevOpenEx(dwPort, dwBaudRate, btOpenType, pDevSN, inner);
+	if (result == Error_Succeed) {
+		*pBtType = inner;
+	}
+
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_TransferEnInit(int* iStatus, BYTE** Cr1, int* lenR1, BYTE** Cr3, int* lenR3, BYTE** dKey, int* lenKey)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	int inner_iStatus = 0;
+	int inner_lenR1 = 0;
+	int inner_lenR3 = 0;
+	int inner_lenKey = 0;
+
+	BYTE *inner_cr1 = new BYTE[256];
+	BYTE* inner_cr3 = new BYTE[256];
+	BYTE* inner_key = new BYTE[256];
+
+	if (inner_cr1 == NULL || inner_cr3 == NULL || inner_key == NULL) {
+	
+		if (inner_cr1 != NULL) delete[] inner_cr1;
+		if (inner_cr3 != NULL) delete[] inner_cr3;
+		if (inner_key != NULL) delete[] inner_key;
+		return Error_Resource;
+	}
+
+	memcpy(inner_cr1, *Cr1, 256);
+	memcpy(inner_cr3, *Cr3, 256);
+	memcpy(inner_key, *dKey, 256);
+
+	ErrorCodeEnum result = pDevAdapterInstance->TransferEnInit(inner_iStatus, inner_cr1, inner_lenR1, inner_cr3, inner_lenR3, inner_key, inner_lenKey);
+	if (result == Error_Succeed) {
+		*iStatus = inner_iStatus;
+		*lenR1 = inner_lenR1;
+		*lenR3 = inner_lenR3;
+		*lenKey = inner_lenKey;
+
+		memcpy(*Cr1, inner_cr1, 256);
+		memcpy(*Cr3, inner_cr3, 256);
+		memcpy(*dKey, inner_key, 256);
+	}
+
+	if (inner_cr1 != NULL) delete[] inner_cr1;
+	if (inner_cr3 != NULL) delete[] inner_cr3;
+	if (inner_key != NULL) delete[] inner_key;
+
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SetR2(int* iStatus, BYTE* pCr2, int lenR2)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	int inner_iStatus = *iStatus;
+	ErrorCodeEnum result = pDevAdapterInstance->SetR2(inner_iStatus, pCr2, lenR2);
+	if (result == Error_Succeed) {
+		*iStatus = inner_iStatus;
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SendWorkingKey(const char* pWorkingKey)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->SendWorkingKey(pWorkingKey);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SLLoadKey(const Bridge_SCIKeyInfo key)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	SCIKeyInfo inner;
+	memcpy(inner.key, key.key, MAX_WORKING_KEY_SIZE);
+	inner.dwSize = key.dwSize;
+	return pDevAdapterInstance->SLLoadKey(inner);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SLSetParam(int eType, int value)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->SLSetParam((SCIParamType)eType, value);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SLLock()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->SLLock();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SLUnLock(const Bridge_SCICheckCode checkCode, int bTemp)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	SCICheckCode inner;
+	inner.dwSize = checkCode.dwSize;
+	memcpy(inner.code, checkCode.code, MAX_CHECK_CODE_SIZE);
+	return pDevAdapterInstance->SLUnLock(inner, !!bTemp);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SLGetTempData(Bridge_SCITempData* pKsnData, Bridge_SCITempData* pRamData)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	SCITempData inner_ksn;
+	SCITempData inner_ram;
+
+	ErrorCodeEnum result = pDevAdapterInstance->SLGetTempData(inner_ksn, inner_ram);
+	if (result == Error_Succeed) {
+		pKsnData->dwSize = inner_ksn.dwSize;
+		memcpy(pKsnData->data, inner_ksn.data, MAX_TEMP_DATA_SIZE);
+		pRamData->dwSize = inner_ram.dwSize;
+		memcpy(pRamData->data, inner_ram.data, MAX_TEMP_DATA_SIZE);
+	}
+
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SLOpenDoor(const Bridge_SCITempData data)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	SCITempData inner;
+	inner.dwSize = data.dwSize;
+	memcpy(inner.data, data.data, MAX_TEMP_DATA_SIZE);
+	return pDevAdapterInstance->SLOpenDoor(inner);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_BluetoothControl(int eCmd)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->BluetoothControl((SCIBluetoothCMD)eCmd);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_BluetoothModifyKey(unsigned char* key)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->BluetoothModifyKey(key);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_BluetoothModifyName(unsigned char* name)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->BluetoothModifyName(name);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_BluetoothGetVersion(char** pVersion)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	char* inner = new char[256];
+	if (inner == NULL) return Error_Resource;
+	memset(inner, 0, sizeof(char) * 256);
+	ErrorCodeEnum result = pDevAdapterInstance->BluetoothGetVersion(inner);
+	if (result == Error_Succeed) {
+		strcpy_s(*pVersion, 256, inner);
+	}
+	delete[] inner;
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_BluetoothGetConnectName(unsigned char** name)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	unsigned char* inner = new unsigned char[256];
+	if (inner == NULL) return Error_Resource;
+	memset(inner, 0, sizeof(unsigned char) * 256);
+	ErrorCodeEnum result = pDevAdapterInstance->BluetoothGetConnectName(inner);
+	if (result == Error_Succeed) {
+		strcpy((char*)*name, (const char*)inner);
+	}
+	delete[] inner;
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_BluetoothGetSignalStrength(unsigned char** signal)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	unsigned char* inner = new unsigned char[256];
+	if (inner == NULL) return Error_Resource;
+	memset(inner, 0, sizeof(unsigned char) * 256);
+	ErrorCodeEnum result = pDevAdapterInstance->BluetoothGetSignalStrength(inner);
+	if (result == Error_Succeed) {
+		strcpy((char*)*signal, (const char*)inner);
+	}
+	delete[] inner;
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LightControl(int eLight, int bOnOff)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->LightControl((SCILightType)eLight, !!bOnOff);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_QueryBatteryPower(int* bat)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	int inner;
+	ErrorCodeEnum result = pDevAdapterInstance->QueryBatteryPower(inner);
+	if (result == Error_Succeed) {
+		*bat = inner;
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_MoveCardToSlot(int slot)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->MoveCardToSlot(slot);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_MoveCardFromSlot(int slot)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->MoveCardFromSlot(slot);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ReadAccount(Bridge_CardNo* pCardNo)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+
+	CardNo inner;
+
+	ErrorCodeEnum result = pDevAdapterInstance->ReadAccount(inner);
+	if (result == Error_Succeed) {
+		pCardNo->dwSize = inner.dwSize;
+		pCardNo->dwTrack2Size = inner.dwTrack2Size;
+		pCardNo->dwTrack3Size = inner.dwTrack3Size;
+		memcpy(pCardNo->account, inner.account, MAX_MAG_TRACK_SIZE);
+		memcpy(pCardNo->track2, inner.track2, MAX_MAG_TRACK_SIZE);
+		memcpy(pCardNo->track3, inner.track3, MAX_MAG_TRACK_SIZE);
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetSlotSum(int* sum)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	int inner;
+	ErrorCodeEnum result = pDevAdapterInstance->GetSlotSum(inner);
+	if (result == Error_Succeed) {
+		*sum = inner;
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_QuerySlotsStatus(Bridge_SlotStatus* slots, const int slot, int bFull)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+
+	SlotStatus inner;
+
+	ErrorCodeEnum result = pDevAdapterInstance->QuerySlotsStatus(inner, slot, !!bFull);
+	if (result == Error_Succeed) {
+		slots->dwSize = inner.dwSize;
+		memcpy(slots->status, inner.status, MAX_SLOT_BUFFER_SIZE);
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_PrintCardFaceRightNow(const Bridge_KakuPrintInfo printInfo)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+
+	KakuPrintInfo inner;
+
+	memset(inner.formPath, 0, sizeof(char) * MAX_KAKU_FILE_SIZE);
+	memset(inner.fields, 0, sizeof(char) * MAX_KAKU_FIELDS_SIZE);
+	strcpy_s(inner.formPath, printInfo.formPath);
+	strcpy_s(inner.fields, printInfo.fields);
+
+	ErrorCodeEnum result = pDevAdapterInstance->PrintCardFaceRightNow(inner);
+	return result;
+}
+

+ 158 - 0
DevAdapter/self/dep/libCardIssuerLoader/libCardIssuerLoader.h

@@ -0,0 +1,158 @@
+#pragma once
+
+#ifdef LIBCARDISSUERLOADER_EXPORTS
+#define LIBSUBDEVICELOADER_API __declspec(dllexport)
+#else
+#define LIBSUBDEVICELOADER_API __declspec(dllimport)
+#pragma comment(lib, "libCardIssuerLoader.lib")
+#endif
+
+#include "CardIssuerClass.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+	struct Bridge_CardIssuerStatus
+	{
+		int eMedia;
+		int eRetainBin;
+		DWORD dwRetainCount;
+		int eIssuerBin[12];
+		DWORD dwIssuerCount[12];
+		int eKakuTape[8];
+	};
+	struct Bridge_SAMStatus
+	{
+		int isActive;
+		int chosenOfSAM;
+	};
+
+	struct Bridge_SCIKeyInfo
+	{
+		BYTE key[MAX_WORKING_KEY_SIZE];
+		DWORD dwSize;
+	};
+	struct Bridge_SCICheckCode
+	{
+		BYTE code[MAX_CHECK_CODE_SIZE];
+		DWORD dwSize;
+	};
+	struct Bridge_SCITempData
+	{
+		BYTE data[MAX_TEMP_DATA_SIZE];
+		DWORD dwSize;
+	};
+
+	struct Bridge_KakuPrintInfo
+	{
+		char formPath[MAX_KAKU_FILE_SIZE];
+		char fields[MAX_KAKU_FIELDS_SIZE];
+	};
+
+	//////////////////////////////////////////////////////////////////////////
+
+	struct Bridge_TrackInfo
+	{
+		int eSource;
+		int eStatus;
+		DWORD dwSize;
+		BYTE data[MAX_MAG_TRACK_SIZE];
+	};
+
+	struct Bridge_MagTracks
+	{
+		int eRange;
+		Bridge_TrackInfo track[MAX_MAG_TRACK_NUM];
+	};
+
+	struct Bridge_CmdInfo
+	{
+		DWORD dwSize;
+		BYTE data[MAX_IC_BUFFER_SIZE];
+	};
+
+	struct Bridge_CardNo
+	{
+		DWORD dwSize;
+		DWORD dwTrack2Size;
+		DWORD dwTrack3Size;
+		char account[MAX_MAG_TRACK_SIZE];
+		char track2[MAX_MAG_TRACK_SIZE];
+		char track3[MAX_MAG_TRACK_SIZE];
+	};
+
+	struct Bridge_SlotStatus
+	{
+		DWORD dwSize;//sum of slots
+		BYTE status[MAX_SLOT_BUFFER_SIZE];
+	};
+
+	//////////////////////////////////////////////////////////////////////////
+
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPath);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ReleaseDevObject();
+	//////////////////////////////////////////////////////////////////////////
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetDevCategory(DevCategoryInfo* pDevCategory);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Reset();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevClose();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetLastErr(DevErrorInfo* pDevErrInfo);
+	//////////////////////////////////////////////////////////////////////////
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevOpen(DWORD dwPort, DWORD dwBaudRate);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetDevStatus(Bridge_CardIssuerStatus* pDevStatus);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetDeviceSN(char** pDevSN);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_MoveCard(int eCardPos, int hopperNo);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SetCardInType(int eCardIn);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_MagRead(Bridge_MagTracks* pMagTracks);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_MagWrite(Bridge_MagTracks magTracks, int eWriteMode);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SetRetractCounter(DWORD dwCount);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SetIssuerCounter(DWORD dwCount, int hopperNo);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ActiveICCard();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ContactIC();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ReleaseIC();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_WarmReset();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ICCommand(Bridge_CmdInfo sendBuf, Bridge_CmdInfo* pRecvBuf);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SAMActive(BYTE vcc);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SAMDeactivate();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SAMWarmReset();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SAMQueryStatus(Bridge_SAMStatus* pSamStatus);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SAMSelect(const int sn);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SAMCommand(Bridge_CmdInfo sendBuf, Bridge_CmdInfo* pRecvBuf);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ActiveICCardATR(Bridge_CmdInfo* pAtrBuf);
+
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Print(BYTE** pData, const int dataSize, const int side);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_QueryPrinterStatus();
+
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ActiveContactlessICCard(char fstType, char scdType, char thdType, char* pOutType);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DeactivateICCard();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DeactContactlessICCard();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_MifareCommand(int eFunType, Bridge_CmdInfo sendBuf, Bridge_CmdInfo* pRecvBuf);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_RFTypeABCommand(Bridge_CmdInfo sendBuf, Bridge_CmdInfo* pRecvBuf);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevOpenEx(DWORD dwPort, DWORD dwBaudRate, BYTE btOpenType, const char* pDevSN, BYTE* pBtType);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_TransferEnInit(int* iStatus, BYTE** Cr1, int* lenR1, BYTE** Cr3, int* lenR3, BYTE** dKey, int* lenKey);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SetR2(int* iStatus, BYTE* pCr2, int lenR2);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SendWorkingKey(const char* pWorkingKey);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SLLoadKey(const Bridge_SCIKeyInfo key);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SLSetParam(int eType, int value);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SLLock();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SLUnLock(const Bridge_SCICheckCode checkCode, int bTemp);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SLGetTempData(Bridge_SCITempData* pKsnData, Bridge_SCITempData* pRamData);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SLOpenDoor(const Bridge_SCITempData data);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_BluetoothControl(int eCmd);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_BluetoothModifyKey(unsigned char* key);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_BluetoothModifyName(unsigned char* name);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_BluetoothGetVersion(char** pVersion);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_BluetoothGetConnectName(unsigned char** name);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_BluetoothGetSignalStrength(unsigned char** signal);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LightControl(int eLight, int bOnOff);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_QueryBatteryPower(int* bat);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_MoveCardToSlot(int slot);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_MoveCardFromSlot(int slot);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ReadAccount(Bridge_CardNo* pCardNo);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetSlotSum(int* sum);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_QuerySlotsStatus(Bridge_SlotStatus* slots, const int slot, int bFull);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_PrintCardFaceRightNow(const Bridge_KakuPrintInfo printInfo);
+
+#ifdef __cplusplus
+} // extern "C" {
+#endif

+ 103 - 0
DevAdapter/self/dep/libCardIssuerLoader/libCardIssuerLoader.vcxproj

@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{2249E9C5-C10F-451A-A8E1-010883656A9A}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>libCardIssuerLoader</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\LocalRun.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\LocalRun.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <Import Project="..\devmake.setting" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCARDISSUERLOADER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCARDISSUERLOADER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <None Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="libCardIssuerLoader.h" />
+    <ClInclude Include="stdafx.h" />
+    <ClInclude Include="targetver.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="dllmain.cpp">
+      <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+      </PrecompiledHeader>
+      <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+      </PrecompiledHeader>
+    </ClCompile>
+    <ClCompile Include="libCardIssuerLoader.cpp" />
+    <ClCompile Include="stdafx.cpp">
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+    </ClCompile>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

+ 42 - 0
DevAdapter/self/dep/libCardIssuerLoader/libCardIssuerLoader.vcxproj.filters

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="源文件">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="头文件">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="资源文件">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="stdafx.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="targetver.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="libCardIssuerLoader.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="stdafx.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="libCardIssuerLoader.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="dllmain.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+  </ItemGroup>
+</Project>

+ 8 - 0
DevAdapter/self/dep/libCardIssuerLoader/stdafx.cpp

@@ -0,0 +1,8 @@
+// stdafx.cpp : 只包括标准包含文件的源文件
+// libCardIssuerLoader.pch 将作为预编译头
+// stdafx.obj 将包含预编译类型信息
+
+#include "stdafx.h"
+
+// TODO: 在 STDAFX.H 中
+// 引用任何所需的附加头文件,而不是在此文件中引用

+ 16 - 0
DevAdapter/self/dep/libCardIssuerLoader/stdafx.h

@@ -0,0 +1,16 @@
+// stdafx.h : 标准系统包含文件的包含文件,
+// 或是经常使用但不常更改的
+// 特定于项目的包含文件
+//
+
+#pragma once
+
+#include "targetver.h"
+
+#define WIN32_LEAN_AND_MEAN             //  从 Windows 头文件中排除极少使用的信息
+// Windows 头文件:
+#include <windows.h>
+
+
+
+// TODO: 在此处引用程序需要的其他头文件

+ 8 - 0
DevAdapter/self/dep/libCardIssuerLoader/targetver.h

@@ -0,0 +1,8 @@
+#pragma once
+
+// 包括 SDKDDKVer.h 将定义可用的最高版本的 Windows 平台。
+
+// 如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h,并将
+// WIN32_WINNT 宏设置为要支持的平台,然后再包括 SDKDDKVer.h。
+
+#include <SDKDDKVer.h>

+ 44 - 0
DevAdapter/self/dep/libContactlessCardLoader/ReadMe.txt

@@ -0,0 +1,44 @@
+========================================================================
+    动态链接库:libContactlessCardLoader 项目概述
+========================================================================
+
+应用程序向导已为您创建了此 libContactlessCardLoader DLL。
+
+本文件概要介绍组成 libContactlessCardLoader 应用程序的每个文件的内容。
+
+
+libContactlessCardLoader.vcxproj
+    这是使用应用程序向导生成的 VC++ 项目的主项目文件,
+    其中包含生成该文件的 Visual C++ 
+    的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。
+
+libContactlessCardLoader.vcxproj.filters
+    这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。 
+    它包含有关项目文件与筛选器之间的关联信息。 在 IDE 
+    中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。
+    例如,“.cpp”文件与“源文件”筛选器关联。
+
+libContactlessCardLoader.cpp
+    这是主 DLL 源文件。
+
+	此 DLL 在创建时不导出任何符号。 因此,在生成此 DLL 时
+ 	生成时不会产生 .lib 文件。 如果希望此项目
+ 	成为其他某个项目的项目依赖项,则需要
+ 	添加代码以从 DLL 导出某些符号,
+ 	以便产生一个导出库,或者,也可以在项目“属性页”对话框中的
+ 	“链接器”文件夹中,将“常规”属性页上的
+ 	“忽略输入库”属性设置为“是”。
+
+/////////////////////////////////////////////////////////////////////////////
+其他标准文件:
+
+StdAfx.h,StdAfx.cpp
+    这些文件用于生成名为 libContactlessCardLoader.pch 的预编译头 (PCH) 文件和
+    名为 StdAfx.obj 的预编译类型文件。
+
+/////////////////////////////////////////////////////////////////////////////
+其他注释:
+
+应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。
+
+/////////////////////////////////////////////////////////////////////////////

+ 19 - 0
DevAdapter/self/dep/libContactlessCardLoader/dllmain.cpp

@@ -0,0 +1,19 @@
+// dllmain.cpp : 定义 DLL 应用程序的入口点。
+#include "stdafx.h"
+
+BOOL APIENTRY DllMain( HMODULE hModule,
+                       DWORD  ul_reason_for_call,
+                       LPVOID lpReserved
+					 )
+{
+	switch (ul_reason_for_call)
+	{
+	case DLL_PROCESS_ATTACH:
+	case DLL_THREAD_ATTACH:
+	case DLL_THREAD_DETACH:
+	case DLL_PROCESS_DETACH:
+		break;
+	}
+	return TRUE;
+}
+

+ 264 - 0
DevAdapter/self/dep/libContactlessCardLoader/libContactlessCardLoader.cpp

@@ -0,0 +1,264 @@
+// libContactlessCardLoader.cpp : 定义 DLL 应用程序的导出函数。
+//
+
+#include "stdafx.h"
+#include <Windows.h>
+#include < stdio.h >
+#include "libContactlessCardLoader.h"
+
+
+
+typedef ErrorCodeEnum(*DevAdaptObjCreateFunc)(DeviceBaseClass*& baseObj);
+typedef ErrorCodeEnum(*DevAdaptObjReleaseFunc)(DeviceBaseClass*& pBaseObj);
+
+HINSTANCE hinstLib = NULL;
+
+DevAdaptObjCreateFunc pFuncCreateAdapt = NULL;
+DevAdaptObjReleaseFunc pFuncReleaseAdapt = NULL;
+RFICClass* pDevAdapterInstance = NULL;
+
+struct DevErrorInfo errInfoInstance;
+
+void SetLastErrInfo(const char* formatStr, ...)
+{
+	va_list arg;
+	va_start(arg, formatStr);
+	sprintf_s(errInfoInstance.szErrMsg, MAX_DEV_ERROR_MSG_LEN, formatStr, arg);
+	errInfoInstance.dwErrMsgLen = strlen(errInfoInstance.szErrMsg);
+	va_end(arg);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPath)
+{
+	ErrorCodeEnum erroCode;
+	hinstLib = LoadLibraryA(libraryPath);
+	if (hinstLib != NULL) {
+		pFuncCreateAdapt = (DevAdaptObjCreateFunc)GetProcAddress(hinstLib, "CreateDevComponent");
+		if (NULL == pFuncCreateAdapt) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_MisMatched;
+		}
+		pFuncReleaseAdapt = (DevAdaptObjReleaseFunc)GetProcAddress(hinstLib, "ReleaseDevComponent");
+		if (NULL == pFuncCreateAdapt) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_NotIntegrated;
+		}
+		erroCode = pFuncCreateAdapt((DeviceBaseClass*&)pDevAdapterInstance);
+		if (erroCode != Error_Succeed) {
+			pDevAdapterInstance = NULL;
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_NoTarget;
+		}
+		if (pDevAdapterInstance == NULL) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_Null;
+		}
+
+	} else {
+		SetLastErrInfo("load library failed %d", GetLastError());
+		return Error_DevLoadFileFailed;
+	}
+	return Error_Succeed;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ReleaseDevObject()
+{
+	if (pFuncReleaseAdapt != NULL && pDevAdapterInstance != NULL) {
+		DeviceBaseClass* devBasePtr = static_cast<DeviceBaseClass*>(pDevAdapterInstance);
+		pFuncReleaseAdapt(devBasePtr);
+		pDevAdapterInstance = NULL;
+	}
+	if (hinstLib != NULL) {
+		FreeLibrary(hinstLib);
+		hinstLib = NULL;
+	}
+	return Error_Succeed;
+}
+
+//////////////////////////////////////////////////////////////////////////
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetDevCategory(DevCategoryInfo* pDevCategory)
+{
+	ErrorCodeEnum result;
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+
+	DevCategoryInfo inner;
+	memset(inner.szType, 0, sizeof(char) * MAX_DEV_TYPE_LEN);
+	memset(inner.szModel, 0, sizeof(char) * MAX_DEV_MODEL_LEN);
+	memset(inner.szVendor, 0, sizeof(char) * MAX_DEV_VENDOR_LEN);
+
+	result = pDevAdapterInstance->GetDevCategory(inner);
+	if (result == Error_Succeed) {
+
+		memset(pDevCategory->szType, 0, sizeof(char) * MAX_DEV_TYPE_LEN);
+		memset(pDevCategory->szModel, 0, sizeof(char) * MAX_DEV_MODEL_LEN);
+		memset(pDevCategory->szVendor, 0, sizeof(char) * MAX_DEV_VENDOR_LEN);
+
+		strncpy_s(pDevCategory->szType, MAX_DEV_TYPE_LEN, inner.szType, strlen(inner.szType) > MAX_DEV_TYPE_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szType));
+		strncpy_s(pDevCategory->szModel, MAX_DEV_MODEL_LEN, inner.szModel, strlen(inner.szModel) > MAX_DEV_MODEL_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szModel));
+		strncpy_s(pDevCategory->szVendor, MAX_DEV_VENDOR_LEN, inner.szVendor, strlen(inner.szVendor) > MAX_DEV_VENDOR_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szVendor));
+
+		pDevCategory->eState = inner.eState;
+		pDevCategory->version.wMajor = inner.version.wMajor;
+		pDevCategory->version.wMinor = inner.version.wMinor;
+		pDevCategory->version.wRevision = inner.version.wRevision;
+		pDevCategory->version.wBuild = inner.version.wBuild;
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Reset()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->Reset();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevClose()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->DevClose();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetLastErr(DevErrorInfo* pDevErrInfo)
+{
+	if (pDevAdapterInstance == NULL) {
+		strcpy_s(pDevErrInfo->szErrMsg, MAX_DEV_ERROR_MSG_LEN, errInfoInstance.szErrMsg);
+		pDevErrInfo->dwErrMsgLen = errInfoInstance.dwErrMsgLen;
+		return Error_Succeed;
+	}
+	DevErrorInfo inner;
+	ErrorCodeEnum result = pDevAdapterInstance->GetLastErr(inner);
+	if (result == Error_Succeed) {
+		memset(pDevErrInfo->szErrMsg, 0, sizeof(char) * MAX_DEV_ERROR_MSG_LEN);
+		strncpy_s(pDevErrInfo->szErrMsg, MAX_DEV_ERROR_MSG_LEN, inner.szErrMsg, strlen(inner.szErrMsg) > MAX_DEV_ERROR_MSG_LEN - 1 ? MAX_DEV_ERROR_MSG_LEN - 1 : strlen(inner.szErrMsg));
+		pDevErrInfo->dwErrMsgLen = inner.dwErrMsgLen;
+	}
+	return result;
+}
+
+
+
+
+//////////////////////////////////////////////////////////////////////////
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevOpen(DWORD dwPort, DWORD dwBaudRate)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->DevOpen(dwPort, dwBaudRate);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetDevStatus(Bridge_RFICReaderStatus* pDevStatus)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	RFICReaderStatus inner;
+	ErrorCodeEnum result = pDevAdapterInstance->GetDevStatus(inner);
+	if (result == Error_Succeed) {
+		pDevStatus->eMediaPos = inner.eMediaPos;
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_AbortRead()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->AbortRead();
+}
+
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ActiveContactlessICCard(char fstType, char scdType, char thdType, char* pOutType)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+
+	char inner;
+	ErrorCodeEnum result = pDevAdapterInstance->ActiveContactlessICCard(fstType, scdType, thdType, inner);
+	if (result == Error_Succeed) {
+		*pOutType = inner;
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DeactContactlessICCard()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->DeactContactlessICCard();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_WarmReset()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->WarmReset();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_MifareCommand(int eFunType, Bridge_CmdInfo sendBuf, Bridge_CmdInfo* pRecvBuf)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	CmdInfo inner_sendBuf;
+	CmdInfo inner_recvBuf;
+
+	inner_sendBuf.dwSize = sendBuf.dwSize;
+	memcpy(inner_sendBuf.data, sendBuf.data, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
+
+	ErrorCodeEnum result = pDevAdapterInstance->MifareCommand((MifareFuctionEnum)eFunType, inner_sendBuf, inner_recvBuf);
+	if (result == Error_Succeed) {
+		pRecvBuf->dwSize = inner_recvBuf.dwSize;
+		memcpy(pRecvBuf->data, inner_recvBuf.data, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_RFTypeABCommand(Bridge_CmdInfo sendBuf, Bridge_CmdInfo* pRecvBuf)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	CmdInfo inner_sendBuf;
+	CmdInfo inner_recvBuf;
+
+	inner_sendBuf.dwSize = sendBuf.dwSize;
+	memcpy(inner_sendBuf.data, sendBuf.data, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
+
+	ErrorCodeEnum result = pDevAdapterInstance->RFTypeABCommand(inner_sendBuf, inner_recvBuf);
+	if (result == Error_Succeed) {
+		pRecvBuf->dwSize = inner_recvBuf.dwSize;
+		memcpy(pRecvBuf->data, inner_recvBuf.data, sizeof(BYTE) * MAX_IC_BUFFER_SIZE);
+	}
+	return result;
+}
+
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_HaltCard()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->HaltCard();
+}
+

+ 48 - 0
DevAdapter/self/dep/libContactlessCardLoader/libContactlessCardLoader.h

@@ -0,0 +1,48 @@
+#pragma once
+#ifdef LIBCONTACTLESSCARDLOADER_EXPORTS
+#define LIBSUBDEVICELOADER_API __declspec(dllexport)
+#else
+#define LIBSUBDEVICELOADER_API __declspec(dllimport)
+#pragma comment(lib, "libContactlessCardLoader.lib")
+#endif
+
+#include "RFICClass.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+	struct Bridge_RFICReaderStatus
+	{
+		int eMediaPos;	
+	};
+
+	struct Bridge_CmdInfo
+	{
+		DWORD dwSize;
+		BYTE data[MAX_IC_BUFFER_SIZE];
+	};
+
+	//////////////////////////////////////////////////////////////////////////
+
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPath);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ReleaseDevObject();
+	//////////////////////////////////////////////////////////////////////////
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetDevCategory(DevCategoryInfo* pDevCategory);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Reset();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevClose();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetLastErr(DevErrorInfo* pDevErrInfo);
+	//////////////////////////////////////////////////////////////////////////
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevOpen(DWORD dwPort, DWORD dwBaudRate);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetDevStatus(Bridge_RFICReaderStatus* pDevStatus);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_AbortRead();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ActiveContactlessICCard(char fstType, char scdType, char thdType, char* outType);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DeactContactlessICCard();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_WarmReset();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_MifareCommand(int eFunType, Bridge_CmdInfo sendBuf, Bridge_CmdInfo* pRecvBuf);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_RFTypeABCommand(Bridge_CmdInfo sendBuf, Bridge_CmdInfo* pRecvBuf);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_HaltCard();
+
+#ifdef __cplusplus
+} // extern "C" {
+#endif

+ 103 - 0
DevAdapter/self/dep/libContactlessCardLoader/libContactlessCardLoader.vcxproj

@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{988768BB-C951-4F5F-96A4-6CC956B544B0}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>libContactlessCardLoader</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\LocalRun.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\LocalRun.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <Import Project="..\devmake.setting" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBCONTACTLESSCARDLOADER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBCONTACTLESSCARDLOADER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <None Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="libContactlessCardLoader.h" />
+    <ClInclude Include="stdafx.h" />
+    <ClInclude Include="targetver.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="dllmain.cpp">
+      <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+      </PrecompiledHeader>
+      <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+      </PrecompiledHeader>
+    </ClCompile>
+    <ClCompile Include="libContactlessCardLoader.cpp" />
+    <ClCompile Include="stdafx.cpp">
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+    </ClCompile>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

+ 42 - 0
DevAdapter/self/dep/libContactlessCardLoader/libContactlessCardLoader.vcxproj.filters

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="源文件">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="头文件">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="资源文件">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="stdafx.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="targetver.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="libContactlessCardLoader.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="stdafx.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="libContactlessCardLoader.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="dllmain.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+  </ItemGroup>
+</Project>

+ 8 - 0
DevAdapter/self/dep/libContactlessCardLoader/stdafx.cpp

@@ -0,0 +1,8 @@
+// stdafx.cpp : 只包括标准包含文件的源文件
+// libContactlessCardLoader.pch 将作为预编译头
+// stdafx.obj 将包含预编译类型信息
+
+#include "stdafx.h"
+
+// TODO: 在 STDAFX.H 中
+// 引用任何所需的附加头文件,而不是在此文件中引用

+ 16 - 0
DevAdapter/self/dep/libContactlessCardLoader/stdafx.h

@@ -0,0 +1,16 @@
+// stdafx.h : 标准系统包含文件的包含文件,
+// 或是经常使用但不常更改的
+// 特定于项目的包含文件
+//
+
+#pragma once
+
+#include "targetver.h"
+
+#define WIN32_LEAN_AND_MEAN             //  从 Windows 头文件中排除极少使用的信息
+// Windows 头文件:
+#include <windows.h>
+
+
+
+// TODO: 在此处引用程序需要的其他头文件

+ 8 - 0
DevAdapter/self/dep/libContactlessCardLoader/targetver.h

@@ -0,0 +1,8 @@
+#pragma once
+
+// 包括 SDKDDKVer.h 将定义可用的最高版本的 Windows 平台。
+
+// 如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h,并将
+// WIN32_WINNT 宏设置为要支持的平台,然后再包括 SDKDDKVer.h。
+
+#include <SDKDDKVer.h>

+ 44 - 0
DevAdapter/self/dep/libFingerPrintLoader/ReadMe.txt

@@ -0,0 +1,44 @@
+========================================================================
+    动态链接库:libFingerPrintLoader 项目概述
+========================================================================
+
+应用程序向导已为您创建了此 libFingerPrintLoader DLL。
+
+本文件概要介绍组成 libFingerPrintLoader 应用程序的每个文件的内容。
+
+
+libFingerPrintLoader.vcxproj
+    这是使用应用程序向导生成的 VC++ 项目的主项目文件,
+    其中包含生成该文件的 Visual C++ 
+    的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。
+
+libFingerPrintLoader.vcxproj.filters
+    这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。 
+    它包含有关项目文件与筛选器之间的关联信息。 在 IDE 
+    中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。
+    例如,“.cpp”文件与“源文件”筛选器关联。
+
+libFingerPrintLoader.cpp
+    这是主 DLL 源文件。
+
+	此 DLL 在创建时不导出任何符号。 因此,在生成此 DLL 时
+ 	生成时不会产生 .lib 文件。 如果希望此项目
+ 	成为其他某个项目的项目依赖项,则需要
+ 	添加代码以从 DLL 导出某些符号,
+ 	以便产生一个导出库,或者,也可以在项目“属性页”对话框中的
+ 	“链接器”文件夹中,将“常规”属性页上的
+ 	“忽略输入库”属性设置为“是”。
+
+/////////////////////////////////////////////////////////////////////////////
+其他标准文件:
+
+StdAfx.h,StdAfx.cpp
+    这些文件用于生成名为 libFingerPrintLoader.pch 的预编译头 (PCH) 文件和
+    名为 StdAfx.obj 的预编译类型文件。
+
+/////////////////////////////////////////////////////////////////////////////
+其他注释:
+
+应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。
+
+/////////////////////////////////////////////////////////////////////////////

+ 19 - 0
DevAdapter/self/dep/libFingerPrintLoader/dllmain.cpp

@@ -0,0 +1,19 @@
+// dllmain.cpp : 定义 DLL 应用程序的入口点。
+#include "stdafx.h"
+
+BOOL APIENTRY DllMain( HMODULE hModule,
+                       DWORD  ul_reason_for_call,
+                       LPVOID lpReserved
+					 )
+{
+	switch (ul_reason_for_call)
+	{
+	case DLL_PROCESS_ATTACH:
+	case DLL_THREAD_ATTACH:
+	case DLL_THREAD_DETACH:
+	case DLL_PROCESS_DETACH:
+		break;
+	}
+	return TRUE;
+}
+

+ 212 - 0
DevAdapter/self/dep/libFingerPrintLoader/libFingerPrintLoader.cpp

@@ -0,0 +1,212 @@
+// libFingerPrintLoader.cpp : 定义 DLL 应用程序的导出函数。
+//
+#include "stdafx.h"
+#include <Windows.h>
+#include < stdio.h >
+#include "libFingerPrintLoader.h"
+
+
+typedef ErrorCodeEnum(*DevAdaptObjCreateFunc)(DeviceBaseClass*& baseObj);
+typedef ErrorCodeEnum(*DevAdaptObjReleaseFunc)(DeviceBaseClass*& pBaseObj);
+
+HINSTANCE hinstLib = NULL;
+
+DevAdaptObjCreateFunc pFuncCreateAdapt = NULL;
+DevAdaptObjReleaseFunc pFuncReleaseAdapt = NULL;
+FingerPrintClass* pDevAdapterInstance = NULL;
+
+struct DevErrorInfo errInfoInstance;
+
+void SetLastErrInfo(const char* formatStr, ...)
+{
+	va_list arg;
+	va_start(arg, formatStr);
+	sprintf_s(errInfoInstance.szErrMsg, MAX_DEV_ERROR_MSG_LEN, formatStr, arg);
+	errInfoInstance.dwErrMsgLen = strlen(errInfoInstance.szErrMsg);
+	va_end(arg);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPath)
+{
+	ErrorCodeEnum erroCode;
+	hinstLib = LoadLibraryA(libraryPath);
+	if (hinstLib != NULL) {
+		pFuncCreateAdapt = (DevAdaptObjCreateFunc)GetProcAddress(hinstLib, "CreateDevComponent");
+		if (NULL == pFuncCreateAdapt) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_MisMatched;
+		}
+		pFuncReleaseAdapt = (DevAdaptObjReleaseFunc)GetProcAddress(hinstLib, "ReleaseDevComponent");
+		if (NULL == pFuncCreateAdapt) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_NotIntegrated;
+		}
+		erroCode = pFuncCreateAdapt((DeviceBaseClass*&)pDevAdapterInstance);
+		if (erroCode != Error_Succeed) {
+			pDevAdapterInstance = NULL;
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_NoTarget;
+		}
+		if (pDevAdapterInstance == NULL) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_Null;
+		}
+
+	}
+	else {
+		SetLastErrInfo("load library failed %d", GetLastError());
+		return Error_DevLoadFileFailed;
+	}
+	return Error_Succeed;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ReleaseDevObject()
+{
+	if (pFuncReleaseAdapt != NULL && pDevAdapterInstance != NULL) {
+		DeviceBaseClass* devBasePtr = static_cast<DeviceBaseClass*>(pDevAdapterInstance);
+		pFuncReleaseAdapt(devBasePtr);
+		pDevAdapterInstance = NULL;
+	}
+	if (hinstLib != NULL) {
+		FreeLibrary(hinstLib);
+		hinstLib = NULL;
+	}
+	return Error_Succeed;
+}
+
+//////////////////////////////////////////////////////////////////////////
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetDevCategory(DevCategoryInfo* pDevCategory)
+{
+	ErrorCodeEnum result;
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+
+	DevCategoryInfo inner;
+	memset(inner.szType, 0, sizeof(char) * MAX_DEV_TYPE_LEN);
+	memset(inner.szModel, 0, sizeof(char) * MAX_DEV_MODEL_LEN);
+	memset(inner.szVendor, 0, sizeof(char) * MAX_DEV_VENDOR_LEN);
+
+	result = pDevAdapterInstance->GetDevCategory(inner);
+	if (result == Error_Succeed) {
+
+		memset(pDevCategory->szType, 0, sizeof(char) * MAX_DEV_TYPE_LEN);
+		memset(pDevCategory->szModel, 0, sizeof(char) * MAX_DEV_MODEL_LEN);
+		memset(pDevCategory->szVendor, 0, sizeof(char) * MAX_DEV_VENDOR_LEN);
+
+		strncpy_s(pDevCategory->szType, MAX_DEV_TYPE_LEN, inner.szType, strlen(inner.szType) > MAX_DEV_TYPE_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szType));
+		strncpy_s(pDevCategory->szModel, MAX_DEV_MODEL_LEN, inner.szModel, strlen(inner.szModel) > MAX_DEV_MODEL_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szModel));
+		strncpy_s(pDevCategory->szVendor, MAX_DEV_VENDOR_LEN, inner.szVendor, strlen(inner.szVendor) > MAX_DEV_VENDOR_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szVendor));
+
+		pDevCategory->eState = inner.eState;
+		pDevCategory->version.wMajor = inner.version.wMajor;
+		pDevCategory->version.wMinor = inner.version.wMinor;
+		pDevCategory->version.wRevision = inner.version.wRevision;
+		pDevCategory->version.wBuild = inner.version.wBuild;
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Reset()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->Reset();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevClose()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->DevClose();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetLastErr(DevErrorInfo* pDevErrInfo)
+{
+	if (pDevAdapterInstance == NULL) {
+		strcpy_s(pDevErrInfo->szErrMsg, MAX_DEV_ERROR_MSG_LEN, errInfoInstance.szErrMsg);
+		pDevErrInfo->dwErrMsgLen = errInfoInstance.dwErrMsgLen;
+		return Error_Succeed;
+	}
+	DevErrorInfo inner;
+	ErrorCodeEnum result = pDevAdapterInstance->GetLastErr(inner);
+	if (result == Error_Succeed) {
+		memset(pDevErrInfo->szErrMsg, 0, sizeof(char) * MAX_DEV_ERROR_MSG_LEN);
+		strncpy_s(pDevErrInfo->szErrMsg, MAX_DEV_ERROR_MSG_LEN, inner.szErrMsg, strlen(inner.szErrMsg) > MAX_DEV_ERROR_MSG_LEN - 1 ? MAX_DEV_ERROR_MSG_LEN - 1 : strlen(inner.szErrMsg));
+		pDevErrInfo->dwErrMsgLen = inner.dwErrMsgLen;
+	}
+	return result;
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevOpen(DWORD dwPort, DWORD dwBaudRate) {
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->DevOpen(dwPort, dwBaudRate);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Image2Feature(const char* imageName, BYTE* lpbFeature, int* iLength) {
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	BYTE* inner_lpbFeature = new BYTE[1024];
+	memset(inner_lpbFeature, 0, sizeof(BYTE) * 1024);
+	int inner_iLength = *iLength;
+	ErrorCodeEnum result = pDevAdapterInstance->Image2Feature(imageName, inner_lpbFeature, inner_iLength);
+	if (result == Error_Succeed) {
+		memcpy(lpbFeature, inner_lpbFeature, sizeof(BYTE) * 1024);
+		*iLength = inner_iLength;
+	}
+	delete[] inner_lpbFeature;
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Image2Template(const char* imagePath1, const char* imagePath2, const char* imagePath3, BYTE* lpbTemplate, int* iLength) {
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	BYTE* inner_lpbTemplate = new BYTE[1024];
+	memset(inner_lpbTemplate, 0, sizeof(BYTE) * 1024);
+	int inner_iLength = *iLength;
+	ErrorCodeEnum result = pDevAdapterInstance->Image2Template(imagePath1, imagePath2, imagePath3, inner_lpbTemplate,inner_iLength);
+	if (result == Error_Succeed) {
+		memcpy(lpbTemplate, inner_lpbTemplate, sizeof(BYTE) * 1024);
+		*iLength = inner_iLength;
+	}
+	delete[] inner_lpbTemplate;
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Match(BYTE* lpbTemplate[], int iTemplateLen[], int templateNum, BYTE* lbpFeature, int* iFeatureLen, int level) {
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	int inner_iFeatureLen = *iFeatureLen;
+	ErrorCodeEnum result = pDevAdapterInstance->Match(lpbTemplate, iTemplateLen, templateNum, lbpFeature, inner_iFeatureLen, level);
+	if (result == Error_Succeed) {
+		*iFeatureLen = inner_iFeatureLen;
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Cancel() {
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->Cancel();
+}
+

+ 48 - 0
DevAdapter/self/dep/libFingerPrintLoader/libFingerPrintLoader.h

@@ -0,0 +1,48 @@
+#pragma once
+
+#ifdef LIBFINGERPRINTLOADER_EXPORTS
+#define LIBSUBDEVICELOADER_API __declspec(dllexport)
+#else
+#define LIBSUBDEVICELOADER_API __declspec(dllimport)
+#pragma comment(lib, "libFingerPrintLoader.lib")
+#endif
+
+#include "FingerPrintClass.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+	//////////////////////////////////////////////////////////////////////////
+
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPath);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ReleaseDevObject();
+	//////////////////////////////////////////////////////////////////////////
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetDevCategory(DevCategoryInfo* pDevCategory);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Reset();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevClose();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetLastErr(DevErrorInfo* pDevErrInfo);
+	//////////////////////////////////////////////////////////////////////////
+		// Open Device
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevOpen(DWORD dwPort, DWORD dwBaudRate);
+
+	//采集指纹图片及对应特征值,imagePath保存图片名,lpbFeature保存对应特征,iLength:输入代表特征lpbFeature最大可用长度,输出为特征lpbFeature实际长度
+	//imagePath为传入的图片名,采集到的指纹图像请按此名称保存在dep目录下,lpbFeature为对应指纹图像特征
+	//Compute features
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Image2Feature(const char* imageName, BYTE* lpbFeature, int* iLength);
+
+	//生成特征模板(注册时使用)
+	//imagePath1、imagePath2、imagePath3表示生成特征需要输入的三张图片名称,由应用传入,lpbTemplate表示输出特征模板,iLength表示模板长度
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Image2Template(const char* imagePath1, const char* imagePath2, const char* imagePath3, BYTE* lpbTemplate, int* iLength);
+
+	//比对校验
+	//lpbTemplate和iTemplateLen分别表示输入的一组特征模板及其对应的长度,templateNum为数组长度(即模板个数)
+	//lbpFeature表示待校验的指纹特征,iFeatureLen表示其长度,level表示校验等级,默认取3
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Match(BYTE* lpbTemplate[], int iTemplateLen[], int templateNum, BYTE* lbpFeature, int* iFeatureLen, int level = 3);
+
+	//取消采集指纹
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Cancel();
+
+#ifdef __cplusplus
+} // extern "C" {
+#endif#pragma once

+ 103 - 0
DevAdapter/self/dep/libFingerPrintLoader/libFingerPrintLoader.vcxproj

@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{40873886-3DFC-4464-93D9-B4745627A473}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>libFingerPrintLoader</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\LocalRun.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\LocalRun.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <Import Project="..\devmake.setting" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBFINGERPRINTLOADER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBFINGERPRINTLOADER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <None Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="libFingerPrintLoader.h" />
+    <ClInclude Include="stdafx.h" />
+    <ClInclude Include="targetver.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="dllmain.cpp">
+      <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+      </PrecompiledHeader>
+      <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+      </PrecompiledHeader>
+    </ClCompile>
+    <ClCompile Include="libFingerPrintLoader.cpp" />
+    <ClCompile Include="stdafx.cpp">
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+    </ClCompile>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

+ 42 - 0
DevAdapter/self/dep/libFingerPrintLoader/libFingerPrintLoader.vcxproj.filters

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="源文件">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="头文件">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="资源文件">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="stdafx.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="targetver.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="libFingerPrintLoader.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="stdafx.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="libFingerPrintLoader.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="dllmain.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+  </ItemGroup>
+</Project>

+ 8 - 0
DevAdapter/self/dep/libFingerPrintLoader/stdafx.cpp

@@ -0,0 +1,8 @@
+// stdafx.cpp : 只包括标准包含文件的源文件
+// libFingerPrintLoader.pch 将作为预编译头
+// stdafx.obj 将包含预编译类型信息
+
+#include "stdafx.h"
+
+// TODO: 在 STDAFX.H 中
+// 引用任何所需的附加头文件,而不是在此文件中引用

+ 16 - 0
DevAdapter/self/dep/libFingerPrintLoader/stdafx.h

@@ -0,0 +1,16 @@
+// stdafx.h : 标准系统包含文件的包含文件,
+// 或是经常使用但不常更改的
+// 特定于项目的包含文件
+//
+
+#pragma once
+
+#include "targetver.h"
+
+#define WIN32_LEAN_AND_MEAN             //  从 Windows 头文件中排除极少使用的信息
+// Windows 头文件:
+#include <windows.h>
+
+
+
+// TODO: 在此处引用程序需要的其他头文件

+ 8 - 0
DevAdapter/self/dep/libFingerPrintLoader/targetver.h

@@ -0,0 +1,8 @@
+#pragma once
+
+// 包括 SDKDDKVer.h 将定义可用的最高版本的 Windows 平台。
+
+// 如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h,并将
+// WIN32_WINNT 宏设置为要支持的平台,然后再包括 SDKDDKVer.h。
+
+#include <SDKDDKVer.h>

+ 44 - 0
DevAdapter/self/dep/libGPIOLoader/ReadMe.txt

@@ -0,0 +1,44 @@
+========================================================================
+    动态链接库:libGPIOLoader 项目概述
+========================================================================
+
+应用程序向导已为您创建了此 libGPIOLoader DLL。
+
+本文件概要介绍组成 libGPIOLoader 应用程序的每个文件的内容。
+
+
+libGPIOLoader.vcxproj
+    这是使用应用程序向导生成的 VC++ 项目的主项目文件,
+    其中包含生成该文件的 Visual C++ 
+    的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。
+
+libGPIOLoader.vcxproj.filters
+    这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。 
+    它包含有关项目文件与筛选器之间的关联信息。 在 IDE 
+    中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。
+    例如,“.cpp”文件与“源文件”筛选器关联。
+
+libGPIOLoader.cpp
+    这是主 DLL 源文件。
+
+	此 DLL 在创建时不导出任何符号。 因此,在生成此 DLL 时
+ 	生成时不会产生 .lib 文件。 如果希望此项目
+ 	成为其他某个项目的项目依赖项,则需要
+ 	添加代码以从 DLL 导出某些符号,
+ 	以便产生一个导出库,或者,也可以在项目“属性页”对话框中的
+ 	“链接器”文件夹中,将“常规”属性页上的
+ 	“忽略输入库”属性设置为“是”。
+
+/////////////////////////////////////////////////////////////////////////////
+其他标准文件:
+
+StdAfx.h,StdAfx.cpp
+    这些文件用于生成名为 libGPIOLoader.pch 的预编译头 (PCH) 文件和
+    名为 StdAfx.obj 的预编译类型文件。
+
+/////////////////////////////////////////////////////////////////////////////
+其他注释:
+
+应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。
+
+/////////////////////////////////////////////////////////////////////////////

+ 19 - 0
DevAdapter/self/dep/libGPIOLoader/dllmain.cpp

@@ -0,0 +1,19 @@
+// dllmain.cpp : 定义 DLL 应用程序的入口点。
+#include "stdafx.h"
+
+BOOL APIENTRY DllMain( HMODULE hModule,
+                       DWORD  ul_reason_for_call,
+                       LPVOID lpReserved
+					 )
+{
+	switch (ul_reason_for_call)
+	{
+	case DLL_PROCESS_ATTACH:
+	case DLL_THREAD_ATTACH:
+	case DLL_THREAD_DETACH:
+	case DLL_PROCESS_DETACH:
+		break;
+	}
+	return TRUE;
+}
+

+ 187 - 0
DevAdapter/self/dep/libGPIOLoader/libGPIOLoader.cpp

@@ -0,0 +1,187 @@
+#include "stdafx.h"
+#include <Windows.h>
+#include < stdio.h >
+#include "libGPIOLoader.h"
+
+
+
+typedef ErrorCodeEnum(*DevAdaptObjCreateFunc)(DeviceBaseClass*& baseObj);
+typedef ErrorCodeEnum(*DevAdaptObjReleaseFunc)(DeviceBaseClass*& pBaseObj);
+
+HINSTANCE hinstLib = NULL;
+
+DevAdaptObjCreateFunc pFuncCreateAdapt = NULL;
+DevAdaptObjReleaseFunc pFuncReleaseAdapt = NULL;
+GpioClass* pDevAdapterInstance = NULL;
+
+struct DevErrorInfo errInfoInstance;
+
+void SetLastErrInfo(const char* formatStr, ...)
+{
+	va_list arg;
+	va_start(arg, formatStr);
+	sprintf_s(errInfoInstance.szErrMsg, MAX_DEV_ERROR_MSG_LEN, formatStr, arg);
+	errInfoInstance.dwErrMsgLen = strlen(errInfoInstance.szErrMsg);
+	va_end(arg);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPath)
+{
+	ErrorCodeEnum erroCode;
+	hinstLib = LoadLibraryA(libraryPath);
+	if (hinstLib != NULL) {
+		pFuncCreateAdapt = (DevAdaptObjCreateFunc)GetProcAddress(hinstLib, "CreateDevComponent");
+		if (NULL == pFuncCreateAdapt) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_MisMatched;
+		}
+		pFuncReleaseAdapt = (DevAdaptObjReleaseFunc)GetProcAddress(hinstLib, "ReleaseDevComponent");
+		if (NULL == pFuncCreateAdapt) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_NotIntegrated;
+		}
+		erroCode = pFuncCreateAdapt((DeviceBaseClass*&)pDevAdapterInstance);
+		if (erroCode != Error_Succeed) {
+			pDevAdapterInstance = NULL;
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_NoTarget;
+		}
+		if (pDevAdapterInstance == NULL) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_Null;
+		}
+
+	} else {
+		SetLastErrInfo("load library failed %d", GetLastError());
+		return Error_DevLoadFileFailed;
+	}
+	return Error_Succeed;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ReleaseDevObject()
+{
+	if (pFuncReleaseAdapt != NULL && pDevAdapterInstance != NULL) {
+		DeviceBaseClass* devBasePtr = static_cast<DeviceBaseClass*>(pDevAdapterInstance);
+		pFuncReleaseAdapt(devBasePtr);
+		pDevAdapterInstance = NULL;
+	}
+	if (hinstLib != NULL) {
+		FreeLibrary(hinstLib);
+		hinstLib = NULL;
+	}
+	return Error_Succeed;
+}
+
+//////////////////////////////////////////////////////////////////////////
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetDevCategory(DevCategoryInfo* pDevCategory)
+{
+	ErrorCodeEnum result;
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+
+	DevCategoryInfo inner;
+	memset(inner.szType, 0, sizeof(char) * MAX_DEV_TYPE_LEN);
+	memset(inner.szModel, 0, sizeof(char) * MAX_DEV_MODEL_LEN);
+	memset(inner.szVendor, 0, sizeof(char) * MAX_DEV_VENDOR_LEN);
+
+	result = pDevAdapterInstance->GetDevCategory(inner);
+	if (result == Error_Succeed) {
+
+		memset(pDevCategory->szType, 0, sizeof(char) * MAX_DEV_TYPE_LEN);
+		memset(pDevCategory->szModel, 0, sizeof(char) * MAX_DEV_MODEL_LEN);
+		memset(pDevCategory->szVendor, 0, sizeof(char) * MAX_DEV_VENDOR_LEN);
+
+		strncpy_s(pDevCategory->szType, MAX_DEV_TYPE_LEN, inner.szType, strlen(inner.szType) > MAX_DEV_TYPE_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szType));
+		strncpy_s(pDevCategory->szModel, MAX_DEV_MODEL_LEN, inner.szModel, strlen(inner.szModel) > MAX_DEV_MODEL_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szModel));
+		strncpy_s(pDevCategory->szVendor, MAX_DEV_VENDOR_LEN, inner.szVendor, strlen(inner.szVendor) > MAX_DEV_VENDOR_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szVendor));
+
+		pDevCategory->eState = inner.eState;
+		pDevCategory->version.wMajor = inner.version.wMajor;
+		pDevCategory->version.wMinor = inner.version.wMinor;
+		pDevCategory->version.wRevision = inner.version.wRevision;
+		pDevCategory->version.wBuild = inner.version.wBuild;
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Reset()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->Reset();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevClose()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->DevClose();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetLastErr(DevErrorInfo* pDevErrInfo)
+{
+	if (pDevAdapterInstance == NULL) {
+		strcpy_s(pDevErrInfo->szErrMsg, MAX_DEV_ERROR_MSG_LEN, errInfoInstance.szErrMsg);
+		pDevErrInfo->dwErrMsgLen = errInfoInstance.dwErrMsgLen;
+		return Error_Succeed;
+	}
+	DevErrorInfo inner;
+	ErrorCodeEnum result = pDevAdapterInstance->GetLastErr(inner);
+	if (result == Error_Succeed) {
+		memset(pDevErrInfo->szErrMsg, 0, sizeof(char) * MAX_DEV_ERROR_MSG_LEN);
+		strncpy_s(pDevErrInfo->szErrMsg, MAX_DEV_ERROR_MSG_LEN, inner.szErrMsg, strlen(inner.szErrMsg) > MAX_DEV_ERROR_MSG_LEN - 1 ? MAX_DEV_ERROR_MSG_LEN - 1 : strlen(inner.szErrMsg));
+		pDevErrInfo->dwErrMsgLen = inner.dwErrMsgLen;
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevOpen(Bridge_GpioInitParam initParam)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	GpioInitParam inner;
+	inner.dwPort = initParam.dwPort;
+	inner.dwBaudRate = initParam.dwBaudRate;
+	inner.dwPortNum = initParam.dwPortNum;
+	for (int i = 0; i < MAX_PORT_NUM; ++i) {
+		inner.dir[i] = !!initParam.dir[i];
+	}
+
+	return pDevAdapterInstance->DevOpen(inner);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_WritePort(DWORD dwPort, BYTE btData)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->WritePort(dwPort, btData);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ReadPort(DWORD dwPort, BYTE* btStatus)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+
+	BYTE inner = *btStatus;
+	ErrorCodeEnum result = pDevAdapterInstance->ReadPort(dwPort, inner);
+	*btStatus = inner;
+	return result;
+}
+
+//////////////////////////////////////////////////////////////////////////
+

+ 40 - 0
DevAdapter/self/dep/libGPIOLoader/libGPIOLoader.h

@@ -0,0 +1,40 @@
+#pragma once
+#ifdef LIBGPIOLOADER_EXPORTS
+#define LIBSUBDEVICELOADER_API __declspec(dllexport)
+#else
+#define LIBSUBDEVICELOADER_API __declspec(dllimport)
+#pragma comment(lib, "libGPIOLoader.lib")
+#endif
+
+#include "GPIOClass.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+	struct Bridge_GpioInitParam
+	{
+		DWORD dwPort;	//com x
+		DWORD dwBaudRate;
+		DWORD dwPortNum;
+		char dir[MAX_PORT_NUM];	
+	};
+
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPath);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ReleaseDevObject();
+	//////////////////////////////////////////////////////////////////////////
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetDevCategory(DevCategoryInfo* pDevCategory);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Reset();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevClose();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetLastErr(DevErrorInfo* pDevErrInfo);
+	//////////////////////////////////////////////////////////////////////////
+
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevOpen(Bridge_GpioInitParam initParam);
+
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_WritePort(DWORD dwPort, BYTE btData);
+
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ReadPort(DWORD dwPort, BYTE* btStatus);
+
+#ifdef __cplusplus
+} // extern "C" {
+#endif

+ 103 - 0
DevAdapter/self/dep/libGPIOLoader/libGPIOLoader.vcxproj

@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{AB38400D-A26E-4D47-8A85-0A5E7D574783}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>libGPIOLoader</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\LocalRun.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\LocalRun.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <Import Project="..\devmake.setting" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBGPIOLOADER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBGPIOLOADER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <None Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="libGPIOLoader.h" />
+    <ClInclude Include="stdafx.h" />
+    <ClInclude Include="targetver.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="dllmain.cpp">
+      <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+      </PrecompiledHeader>
+      <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+      </PrecompiledHeader>
+    </ClCompile>
+    <ClCompile Include="libGPIOLoader.cpp" />
+    <ClCompile Include="stdafx.cpp">
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+    </ClCompile>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

+ 42 - 0
DevAdapter/self/dep/libGPIOLoader/libGPIOLoader.vcxproj.filters

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="源文件">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="头文件">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="资源文件">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="stdafx.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="targetver.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="libGPIOLoader.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="stdafx.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="libGPIOLoader.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="dllmain.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+  </ItemGroup>
+</Project>

+ 8 - 0
DevAdapter/self/dep/libGPIOLoader/stdafx.cpp

@@ -0,0 +1,8 @@
+// stdafx.cpp : 只包括标准包含文件的源文件
+// libGPIOLoader.pch 将作为预编译头
+// stdafx.obj 将包含预编译类型信息
+
+#include "stdafx.h"
+
+// TODO: 在 STDAFX.H 中
+// 引用任何所需的附加头文件,而不是在此文件中引用

+ 16 - 0
DevAdapter/self/dep/libGPIOLoader/stdafx.h

@@ -0,0 +1,16 @@
+// stdafx.h : 标准系统包含文件的包含文件,
+// 或是经常使用但不常更改的
+// 特定于项目的包含文件
+//
+
+#pragma once
+
+#include "targetver.h"
+
+#define WIN32_LEAN_AND_MEAN             //  从 Windows 头文件中排除极少使用的信息
+// Windows 头文件:
+#include <windows.h>
+
+
+
+// TODO: 在此处引用程序需要的其他头文件

+ 8 - 0
DevAdapter/self/dep/libGPIOLoader/targetver.h

@@ -0,0 +1,8 @@
+#pragma once
+
+// 包括 SDKDDKVer.h 将定义可用的最高版本的 Windows 平台。
+
+// 如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h,并将
+// WIN32_WINNT 宏设置为要支持的平台,然后再包括 SDKDDKVer.h。
+
+#include <SDKDDKVer.h>

+ 44 - 0
DevAdapter/self/dep/libHSPSCannerLoader/ReadMe.txt

@@ -0,0 +1,44 @@
+========================================================================
+    动态链接库:libHSPSCannerLoader 项目概述
+========================================================================
+
+应用程序向导已为您创建了此 libHSPSCannerLoader DLL。
+
+本文件概要介绍组成 libHSPSCannerLoader 应用程序的每个文件的内容。
+
+
+libHSPSCannerLoader.vcxproj
+    这是使用应用程序向导生成的 VC++ 项目的主项目文件,
+    其中包含生成该文件的 Visual C++ 
+    的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。
+
+libHSPSCannerLoader.vcxproj.filters
+    这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。 
+    它包含有关项目文件与筛选器之间的关联信息。 在 IDE 
+    中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。
+    例如,“.cpp”文件与“源文件”筛选器关联。
+
+libHSPSCannerLoader.cpp
+    这是主 DLL 源文件。
+
+	此 DLL 在创建时不导出任何符号。 因此,在生成此 DLL 时
+ 	生成时不会产生 .lib 文件。 如果希望此项目
+ 	成为其他某个项目的项目依赖项,则需要
+ 	添加代码以从 DLL 导出某些符号,
+ 	以便产生一个导出库,或者,也可以在项目“属性页”对话框中的
+ 	“链接器”文件夹中,将“常规”属性页上的
+ 	“忽略输入库”属性设置为“是”。
+
+/////////////////////////////////////////////////////////////////////////////
+其他标准文件:
+
+StdAfx.h,StdAfx.cpp
+    这些文件用于生成名为 libHSPSCannerLoader.pch 的预编译头 (PCH) 文件和
+    名为 StdAfx.obj 的预编译类型文件。
+
+/////////////////////////////////////////////////////////////////////////////
+其他注释:
+
+应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。
+
+/////////////////////////////////////////////////////////////////////////////

+ 19 - 0
DevAdapter/self/dep/libHSPSCannerLoader/dllmain.cpp

@@ -0,0 +1,19 @@
+// dllmain.cpp : 定义 DLL 应用程序的入口点。
+#include "stdafx.h"
+
+BOOL APIENTRY DllMain( HMODULE hModule,
+                       DWORD  ul_reason_for_call,
+                       LPVOID lpReserved
+					 )
+{
+	switch (ul_reason_for_call)
+	{
+	case DLL_PROCESS_ATTACH:
+	case DLL_THREAD_ATTACH:
+	case DLL_THREAD_DETACH:
+	case DLL_PROCESS_DETACH:
+		break;
+	}
+	return TRUE;
+}
+

+ 228 - 0
DevAdapter/self/dep/libHSPSCannerLoader/libHSPSCannerLoader.cpp

@@ -0,0 +1,228 @@
+// libHSPSCannerLoader.cpp : 定义 DLL 应用程序的导出函数。
+//
+
+#include "stdafx.h"
+#include <Windows.h>
+#include < stdio.h >
+#include "libHSPSCannerLoader.h"
+
+
+
+typedef ErrorCodeEnum(*DevAdaptObjCreateFunc)(DeviceBaseClass*& baseObj);
+typedef ErrorCodeEnum(*DevAdaptObjReleaseFunc)(DeviceBaseClass*& pBaseObj);
+
+HINSTANCE hinstLib = NULL;
+
+DevAdaptObjCreateFunc pFuncCreateAdapt = NULL;
+DevAdaptObjReleaseFunc pFuncReleaseAdapt = NULL;
+CHSPSClass* pDevAdapterInstance = NULL;
+
+struct DevErrorInfo errInfoInstance;
+
+void SetLastErrInfo(const char* formatStr, ...)
+{
+	va_list arg;
+	va_start(arg, formatStr);
+	sprintf_s(errInfoInstance.szErrMsg, MAX_DEV_ERROR_MSG_LEN, formatStr, arg);
+	errInfoInstance.dwErrMsgLen = strlen(errInfoInstance.szErrMsg);
+	va_end(arg);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPath)
+{
+	ErrorCodeEnum erroCode;
+	hinstLib = LoadLibraryA(libraryPath);
+	if (hinstLib != NULL) {
+		pFuncCreateAdapt = (DevAdaptObjCreateFunc)GetProcAddress(hinstLib, "CreateDevComponent");
+		if (NULL == pFuncCreateAdapt) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_MisMatched;
+		}
+		pFuncReleaseAdapt = (DevAdaptObjReleaseFunc)GetProcAddress(hinstLib, "ReleaseDevComponent");
+		if (NULL == pFuncCreateAdapt) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_NotIntegrated;
+		}
+		erroCode = pFuncCreateAdapt((DeviceBaseClass*&)pDevAdapterInstance);
+		if (erroCode != Error_Succeed) {
+			pDevAdapterInstance = NULL;
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_NoTarget;
+		}
+		if (pDevAdapterInstance == NULL) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_Null;
+		}
+
+	} else {
+		SetLastErrInfo("load library failed %d", GetLastError());
+		return Error_DevLoadFileFailed;
+	}
+	return Error_Succeed;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ReleaseDevObject()
+{
+	if (pFuncReleaseAdapt != NULL && pDevAdapterInstance != NULL) {
+		DeviceBaseClass* devBasePtr = static_cast<DeviceBaseClass*>(pDevAdapterInstance);
+		pFuncReleaseAdapt(devBasePtr);
+		pDevAdapterInstance = NULL;
+	}
+	if (hinstLib != NULL) {
+		FreeLibrary(hinstLib);
+		hinstLib = NULL;
+	}
+	return Error_Succeed;
+}
+
+//////////////////////////////////////////////////////////////////////////
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetDevCategory(DevCategoryInfo* pDevCategory)
+{
+	ErrorCodeEnum result;
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+
+	DevCategoryInfo inner;
+	memset(inner.szType, 0, sizeof(char) * MAX_DEV_TYPE_LEN);
+	memset(inner.szModel, 0, sizeof(char) * MAX_DEV_MODEL_LEN);
+	memset(inner.szVendor, 0, sizeof(char) * MAX_DEV_VENDOR_LEN);
+
+	result = pDevAdapterInstance->GetDevCategory(inner);
+	if (result == Error_Succeed) {
+
+		memset(pDevCategory->szType, 0, sizeof(char) * MAX_DEV_TYPE_LEN);
+		memset(pDevCategory->szModel, 0, sizeof(char) * MAX_DEV_MODEL_LEN);
+		memset(pDevCategory->szVendor, 0, sizeof(char) * MAX_DEV_VENDOR_LEN);
+
+		strncpy_s(pDevCategory->szType, MAX_DEV_TYPE_LEN, inner.szType, strlen(inner.szType) > MAX_DEV_TYPE_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szType));
+		strncpy_s(pDevCategory->szModel, MAX_DEV_MODEL_LEN, inner.szModel, strlen(inner.szModel) > MAX_DEV_MODEL_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szModel));
+		strncpy_s(pDevCategory->szVendor, MAX_DEV_VENDOR_LEN, inner.szVendor, strlen(inner.szVendor) > MAX_DEV_VENDOR_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szVendor));
+
+		pDevCategory->eState = inner.eState;
+		pDevCategory->version.wMajor = inner.version.wMajor;
+		pDevCategory->version.wMinor = inner.version.wMinor;
+		pDevCategory->version.wRevision = inner.version.wRevision;
+		pDevCategory->version.wBuild = inner.version.wBuild;
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Reset()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->Reset();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevClose()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->DevClose();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetLastErr(DevErrorInfo* pDevErrInfo)
+{
+	if (pDevAdapterInstance == NULL) {
+		strcpy_s(pDevErrInfo->szErrMsg, MAX_DEV_ERROR_MSG_LEN, errInfoInstance.szErrMsg);
+		pDevErrInfo->dwErrMsgLen = errInfoInstance.dwErrMsgLen;
+		return Error_Succeed;
+	}
+	DevErrorInfo inner;
+	ErrorCodeEnum result = pDevAdapterInstance->GetLastErr(inner);
+	if (result == Error_Succeed) {
+		memset(pDevErrInfo->szErrMsg, 0, sizeof(char) * MAX_DEV_ERROR_MSG_LEN);
+		strncpy_s(pDevErrInfo->szErrMsg, MAX_DEV_ERROR_MSG_LEN, inner.szErrMsg, strlen(inner.szErrMsg) > MAX_DEV_ERROR_MSG_LEN - 1 ? MAX_DEV_ERROR_MSG_LEN - 1 : strlen(inner.szErrMsg));
+		pDevErrInfo->dwErrMsgLen = inner.dwErrMsgLen;
+	}
+	return result;
+}
+
+//////////////////////////////////////////////////////////////////////////
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevOpen()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->DevOpen();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SetParam(int type, int value)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->SetParam((ParamType)type, (ParamTypeValue)value);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SetPreview(short nValue)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->SetPreview(nValue);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ScanImage(const char* pszFileName)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->ScanImage(pszFileName);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ScanImageEx(BYTE* pBtImg, int* pBtLen, const char* pszFileName)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	int inner = *pBtLen;
+	ErrorCodeEnum result = pDevAdapterInstance->ScanImageEx(pBtImg, inner, pszFileName);
+	*pBtLen = inner;
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SetViewPos(int nX, int nY, int nWidth)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->SetViewPos(nX, nY, nWidth);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SetProperty()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->SetProperty();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetDevStatus(Bridge_HspsDevStatus* status)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	HspsDevStatus inner;
+	ErrorCodeEnum result = pDevAdapterInstance->GetDevStatus(inner);
+	if (result == Error_Succeed) {
+		status->isConnected = inner.isConnected;
+		status->inPreview = inner.inPreview;
+		status->inShow = inner.inShow;
+	}
+	return result;
+}
+

+ 43 - 0
DevAdapter/self/dep/libHSPSCannerLoader/libHSPSCannerLoader.h

@@ -0,0 +1,43 @@
+#pragma once
+#ifdef LIBHSPSCANNERLOADER_EXPORTS
+#define LIBSUBDEVICELOADER_API __declspec(dllexport)
+#else
+#define LIBSUBDEVICELOADER_API __declspec(dllimport)
+#pragma comment(lib, "libHSPSCannerLoader.lib")
+#endif
+
+#include "HSPScannerClass.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+	struct Bridge_HspsDevStatus
+	{
+		short isConnected;
+		short inPreview;
+		short inShow;
+	};
+
+	//////////////////////////////////////////////////////////////////////////
+
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPath);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ReleaseDevObject();
+	//////////////////////////////////////////////////////////////////////////
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetDevCategory(DevCategoryInfo* pDevCategory);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Reset();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevClose();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetLastErr(DevErrorInfo* pDevErrInfo);
+	//////////////////////////////////////////////////////////////////////////
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevOpen();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SetParam(int type, int value);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SetPreview(short nValue);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ScanImage(const char* pszFileName);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ScanImageEx(BYTE* pBtImg, int* pBtLen, const char* pszFileName);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SetViewPos(int nX, int nY, int nWidth);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_SetProperty();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetDevStatus(Bridge_HspsDevStatus* status);
+
+#ifdef __cplusplus
+} // extern "C" {
+#endif

+ 103 - 0
DevAdapter/self/dep/libHSPSCannerLoader/libHSPSCannerLoader.vcxproj

@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{22E8C841-CCB8-4EC7-8122-8EA6FAC31366}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>libHSPSCannerLoader</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\LocalRun.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\LocalRun.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <Import Project="..\devmake.setting" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBHSPSCANNERLOADER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBHSPSCANNERLOADER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <None Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="libHSPSCannerLoader.h" />
+    <ClInclude Include="stdafx.h" />
+    <ClInclude Include="targetver.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="dllmain.cpp">
+      <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+      </PrecompiledHeader>
+      <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+      </PrecompiledHeader>
+    </ClCompile>
+    <ClCompile Include="libHSPSCannerLoader.cpp" />
+    <ClCompile Include="stdafx.cpp">
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+    </ClCompile>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

+ 42 - 0
DevAdapter/self/dep/libHSPSCannerLoader/libHSPSCannerLoader.vcxproj.filters

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="源文件">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="头文件">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="资源文件">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="stdafx.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="targetver.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="libHSPSCannerLoader.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="stdafx.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="libHSPSCannerLoader.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="dllmain.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+  </ItemGroup>
+</Project>

+ 8 - 0
DevAdapter/self/dep/libHSPSCannerLoader/stdafx.cpp

@@ -0,0 +1,8 @@
+// stdafx.cpp : 只包括标准包含文件的源文件
+// libHSPSCannerLoader.pch 将作为预编译头
+// stdafx.obj 将包含预编译类型信息
+
+#include "stdafx.h"
+
+// TODO: 在 STDAFX.H 中
+// 引用任何所需的附加头文件,而不是在此文件中引用

+ 16 - 0
DevAdapter/self/dep/libHSPSCannerLoader/stdafx.h

@@ -0,0 +1,16 @@
+// stdafx.h : 标准系统包含文件的包含文件,
+// 或是经常使用但不常更改的
+// 特定于项目的包含文件
+//
+
+#pragma once
+
+#include "targetver.h"
+
+#define WIN32_LEAN_AND_MEAN             //  从 Windows 头文件中排除极少使用的信息
+// Windows 头文件:
+#include <windows.h>
+
+
+
+// TODO: 在此处引用程序需要的其他头文件

+ 8 - 0
DevAdapter/self/dep/libHSPSCannerLoader/targetver.h

@@ -0,0 +1,8 @@
+#pragma once
+
+// 包括 SDKDDKVer.h 将定义可用的最高版本的 Windows 平台。
+
+// 如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h,并将
+// WIN32_WINNT 宏设置为要支持的平台,然后再包括 SDKDDKVer.h。
+
+#include <SDKDDKVer.h>

+ 44 - 0
DevAdapter/self/dep/libIDCertificateLoader/ReadMe.txt

@@ -0,0 +1,44 @@
+========================================================================
+    动态链接库:libIDCertificateLoader 项目概述
+========================================================================
+
+应用程序向导已为您创建了此 libIDCertificateLoader DLL。
+
+本文件概要介绍组成 libIDCertificateLoader 应用程序的每个文件的内容。
+
+
+libIDCertificateLoader.vcxproj
+    这是使用应用程序向导生成的 VC++ 项目的主项目文件,
+    其中包含生成该文件的 Visual C++ 
+    的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。
+
+libIDCertificateLoader.vcxproj.filters
+    这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。 
+    它包含有关项目文件与筛选器之间的关联信息。 在 IDE 
+    中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。
+    例如,“.cpp”文件与“源文件”筛选器关联。
+
+libIDCertificateLoader.cpp
+    这是主 DLL 源文件。
+
+	此 DLL 在创建时不导出任何符号。 因此,在生成此 DLL 时
+ 	生成时不会产生 .lib 文件。 如果希望此项目
+ 	成为其他某个项目的项目依赖项,则需要
+ 	添加代码以从 DLL 导出某些符号,
+ 	以便产生一个导出库,或者,也可以在项目“属性页”对话框中的
+ 	“链接器”文件夹中,将“常规”属性页上的
+ 	“忽略输入库”属性设置为“是”。
+
+/////////////////////////////////////////////////////////////////////////////
+其他标准文件:
+
+StdAfx.h,StdAfx.cpp
+    这些文件用于生成名为 libIDCertificateLoader.pch 的预编译头 (PCH) 文件和
+    名为 StdAfx.obj 的预编译类型文件。
+
+/////////////////////////////////////////////////////////////////////////////
+其他注释:
+
+应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。
+
+/////////////////////////////////////////////////////////////////////////////

+ 19 - 0
DevAdapter/self/dep/libIDCertificateLoader/dllmain.cpp

@@ -0,0 +1,19 @@
+// dllmain.cpp : 定义 DLL 应用程序的入口点。
+#include "stdafx.h"
+
+BOOL APIENTRY DllMain( HMODULE hModule,
+                       DWORD  ul_reason_for_call,
+                       LPVOID lpReserved
+					 )
+{
+	switch (ul_reason_for_call)
+	{
+	case DLL_PROCESS_ATTACH:
+	case DLL_THREAD_ATTACH:
+	case DLL_THREAD_DETACH:
+	case DLL_PROCESS_DETACH:
+		break;
+	}
+	return TRUE;
+}
+

+ 418 - 0
DevAdapter/self/dep/libIDCertificateLoader/libIDCertificateLoader.cpp

@@ -0,0 +1,418 @@
+// libIDCertificateLoader.cpp : 定义 DLL 应用程序的导出函数。
+//
+
+#include "stdafx.h"
+#include <stdio.h>
+#include "libIDCertificateLoader.h"
+typedef ErrorCodeEnum(*DevAdaptObjCreateFunc)(DeviceBaseClass*& baseObj);
+typedef ErrorCodeEnum(*DevAdaptObjReleaseFunc)(DeviceBaseClass*& pBaseObj);
+
+HINSTANCE hinstLib = NULL;
+
+DevAdaptObjCreateFunc pFuncCreateAdapt = NULL;
+DevAdaptObjReleaseFunc pFuncReleaseAdapt = NULL;
+IDCerClass* pDevAdapterInstance = NULL;
+
+struct DevErrorInfo errInfoInstance;
+
+void SetLastErrInfo(const char* formatStr, ...)
+{
+	va_list arg;
+	va_start(arg, formatStr);
+	sprintf_s(errInfoInstance.szErrMsg, MAX_DEV_ERROR_MSG_LEN, formatStr, arg);
+	errInfoInstance.dwErrMsgLen = strlen(errInfoInstance.szErrMsg);
+	va_end(arg);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPath)
+{
+	ErrorCodeEnum erroCode;
+	hinstLib = LoadLibraryA(libraryPath);
+	if (hinstLib != NULL) {
+		pFuncCreateAdapt = (DevAdaptObjCreateFunc)GetProcAddress(hinstLib, "CreateDevComponent");
+		if (NULL == pFuncCreateAdapt) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_MisMatched;
+		}
+		pFuncReleaseAdapt = (DevAdaptObjReleaseFunc)GetProcAddress(hinstLib, "ReleaseDevComponent");
+		if (NULL == pFuncCreateAdapt) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_NotIntegrated;
+		}
+		erroCode = pFuncCreateAdapt((DeviceBaseClass*&)pDevAdapterInstance);
+		if (erroCode != Error_Succeed) {
+			pDevAdapterInstance = NULL;
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_NoTarget;
+		}
+		if (pDevAdapterInstance == NULL) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_Null;
+		}
+
+	}
+	else {
+		SetLastErrInfo("load library failed %d", GetLastError());
+		return Error_DevLoadFileFailed;
+	}
+	return Error_Succeed;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ReleaseDevObject()
+{
+	if (pFuncReleaseAdapt != NULL && pDevAdapterInstance != NULL) {
+		DeviceBaseClass* devBasePtr = static_cast<DeviceBaseClass*>(pDevAdapterInstance);
+		pFuncReleaseAdapt(devBasePtr);
+		pDevAdapterInstance = NULL;
+	}
+	if (hinstLib != NULL) {
+		FreeLibrary(hinstLib);
+		hinstLib = NULL;
+	}
+	return Error_Succeed;
+}
+
+//////////////////////////////////////////////////////////////////////////
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetDevCategory(DevCategoryInfo* pDevCategory)
+{
+	ErrorCodeEnum result;
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+
+	DevCategoryInfo inner;
+	memset(inner.szType, 0, sizeof(char) * MAX_DEV_TYPE_LEN);
+	memset(inner.szModel, 0, sizeof(char) * MAX_DEV_MODEL_LEN);
+	memset(inner.szVendor, 0, sizeof(char) * MAX_DEV_VENDOR_LEN);
+
+	result = pDevAdapterInstance->GetDevCategory(inner);
+	if (result == Error_Succeed) {
+
+		memset(pDevCategory->szType, 0, sizeof(char) * MAX_DEV_TYPE_LEN);
+		memset(pDevCategory->szModel, 0, sizeof(char) * MAX_DEV_MODEL_LEN);
+		memset(pDevCategory->szVendor, 0, sizeof(char) * MAX_DEV_VENDOR_LEN);
+
+		strncpy_s(pDevCategory->szType, MAX_DEV_TYPE_LEN, inner.szType, strlen(inner.szType) > MAX_DEV_TYPE_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szType));
+		strncpy_s(pDevCategory->szModel, MAX_DEV_MODEL_LEN, inner.szModel, strlen(inner.szModel) > MAX_DEV_MODEL_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szModel));
+		strncpy_s(pDevCategory->szVendor, MAX_DEV_VENDOR_LEN, inner.szVendor, strlen(inner.szVendor) > MAX_DEV_VENDOR_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szVendor));
+
+		pDevCategory->eState = inner.eState;
+		pDevCategory->version.wMajor = inner.version.wMajor;
+		pDevCategory->version.wMinor = inner.version.wMinor;
+		pDevCategory->version.wRevision = inner.version.wRevision;
+		pDevCategory->version.wBuild = inner.version.wBuild;
+	}
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Reset()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->Reset();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevClose()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->DevClose();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetLastErr(DevErrorInfo* pDevErrInfo)
+{
+	if (pDevAdapterInstance == NULL) {
+		strcpy_s(pDevErrInfo->szErrMsg, MAX_DEV_ERROR_MSG_LEN, errInfoInstance.szErrMsg);
+		pDevErrInfo->dwErrMsgLen = errInfoInstance.dwErrMsgLen;
+		return Error_Succeed;
+	}
+	DevErrorInfo inner;
+	ErrorCodeEnum result = pDevAdapterInstance->GetLastErr(inner);
+	if (result == Error_Succeed) {
+		memset(pDevErrInfo->szErrMsg, 0, sizeof(char) * MAX_DEV_ERROR_MSG_LEN);
+		strncpy_s(pDevErrInfo->szErrMsg, MAX_DEV_ERROR_MSG_LEN, inner.szErrMsg, strlen(inner.szErrMsg) > MAX_DEV_ERROR_MSG_LEN - 1 ? MAX_DEV_ERROR_MSG_LEN - 1 : strlen(inner.szErrMsg));
+		pDevErrInfo->dwErrMsgLen = inner.dwErrMsgLen;
+	}
+	return result;
+}
+
+//////////////////////////////////////////////////////////////////////////
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevOpen(DWORD dwPort)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->DevOpen(dwPort);
+}
+
+LIBSUBDEVICELOADER_API	ErrorCodeEnum Bridge_IDCerRFControl(int bControl)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->IDCerRFControl(!!bControl);
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_IDCerAuthenticate()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->IDCerAuthenticate();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_IDCerGetData(Bridge_IDCerInfo* idCerInfo) 
+{ 
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+
+	IDCerInfo inner;
+	memset(&inner, 0, sizeof(inner));
+
+	ErrorCodeEnum result = pDevAdapterInstance->IDCerGetData(inner);
+	if (result == Error_Succeed)
+	{
+		memcpy(idCerInfo->name.data, inner.name.data, MAX_IDCER_INFO_SIZE);
+		idCerInfo->name.dwSize = inner.name.dwSize;
+
+		memcpy(idCerInfo->sex.data, inner.sex.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfo->sex.dwSize = inner.sex.dwSize;
+
+		memcpy(idCerInfo->nation.data, inner.nation.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfo->nation.dwSize = inner.nation.dwSize;
+
+		memcpy(idCerInfo->birthday.data, inner.birthday.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfo->birthday.dwSize = inner.birthday.dwSize;
+
+		memcpy(idCerInfo->address.data, inner.address.data, MAX_IDCER_INFO_SIZE);
+		idCerInfo->address.dwSize = inner.address.dwSize;
+
+		memcpy(idCerInfo->idno.data, inner.idno.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfo->idno.dwSize = inner.idno.dwSize;
+
+		memcpy(idCerInfo->department.data, inner.department.data, MAX_IDCER_INFO_SIZE);
+		idCerInfo->department.dwSize = inner.department.dwSize;
+
+		memcpy(idCerInfo->startDate.data, inner.startDate.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfo->startDate.dwSize = inner.startDate.dwSize;
+
+		memcpy(idCerInfo->endDate.data, inner.endDate.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfo->endDate.dwSize = inner.endDate.dwSize;
+
+		memcpy(idCerInfo->newAddress.data, inner.newAddress.data, MAX_IDCER_INFO_SIZE);
+		idCerInfo->newAddress.dwSize = inner.newAddress.dwSize;
+
+		memcpy(idCerInfo->photoPath.data, inner.photoPath.data, MAX_IDCER_PHOTO_PATH);
+		idCerInfo->photoPath.dwSize = inner.photoPath.dwSize;
+	}
+
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_IDCerGetDataEx(Bridge_IDCerInfoEx* idCerInfoEx)
+{ 
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+
+	IDCerInfoEx inner;
+	memset(&inner, 0, sizeof(inner));
+
+	ErrorCodeEnum result = pDevAdapterInstance->IDCerGetDataEx(inner);
+	if (result == Error_Succeed)
+	{
+		memcpy(idCerInfoEx->name.data, inner.name.data, MAX_IDCER_INFO_SIZE);
+		idCerInfoEx->name.dwSize = inner.name.dwSize;
+
+		memcpy(idCerInfoEx->sex.data, inner.sex.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx->sex.dwSize = inner.sex.dwSize;
+
+		memcpy(idCerInfoEx->nation.data, inner.nation.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx->nation.dwSize = inner.nation.dwSize;
+
+		memcpy(idCerInfoEx->birthday.data, inner.birthday.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx->birthday.dwSize = inner.birthday.dwSize;
+
+		memcpy(idCerInfoEx->address.data, inner.address.data, MAX_IDCER_INFO_SIZE);
+		idCerInfoEx->address.dwSize = inner.address.dwSize;
+
+		memcpy(idCerInfoEx->idno.data, inner.idno.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx->idno.dwSize = inner.idno.dwSize;
+
+		memcpy(idCerInfoEx->department.data, inner.department.data, MAX_IDCER_INFO_SIZE);
+		idCerInfoEx->department.dwSize = inner.department.dwSize;
+
+		memcpy(idCerInfoEx->startDate.data, inner.startDate.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx->startDate.dwSize = inner.startDate.dwSize;
+
+		memcpy(idCerInfoEx->endDate.data, inner.endDate.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx->endDate.dwSize = inner.endDate.dwSize;
+
+		memcpy(idCerInfoEx->newAddress.data, inner.newAddress.data, MAX_IDCER_INFO_SIZE);
+		idCerInfoEx->newAddress.dwSize = inner.newAddress.dwSize;
+
+		memcpy(idCerInfoEx->photoPath.data, inner.photoPath.data, MAX_IDCER_PHOTO_PATH);
+		idCerInfoEx->photoPath.dwSize = inner.photoPath.dwSize;
+
+		memcpy(idCerInfoEx->englishName.data, inner.englishName.data, MAX_IDCER_INFO_SIZE);
+		idCerInfoEx->englishName.dwSize = inner.englishName.dwSize;
+
+		memcpy(idCerInfoEx->nationality.data, inner.nationality.data, IDCER_EIGHT_BYTE_SIZE);
+		idCerInfoEx->nationality.dwSize = inner.nationality.dwSize;
+
+		memcpy(idCerInfoEx->idVersion.data, inner.idVersion.data, IDCER_EIGHT_BYTE_SIZE);
+		idCerInfoEx->idVersion.dwSize = inner.idVersion.dwSize;
+
+		memcpy(idCerInfoEx->idType.data, inner.idType.data, IDCER_EIGHT_BYTE_SIZE);
+		idCerInfoEx->idType.dwSize = inner.idType.dwSize;
+
+		memcpy(idCerInfoEx->reserved.data, inner.reserved.data, IDCER_EIGHT_BYTE_SIZE);
+		idCerInfoEx->reserved.dwSize = inner.reserved.dwSize;
+
+		memcpy(idCerInfoEx->txzCode.data, inner.txzCode.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx->txzCode.dwSize = inner.txzCode.dwSize;
+
+		memcpy(idCerInfoEx->issuedSN.data, inner.issuedSN.data, IDCER_EIGHT_BYTE_SIZE);
+		idCerInfoEx->issuedSN.dwSize = inner.issuedSN.dwSize;
+
+		memcpy(idCerInfoEx->reserved2.data, inner.reserved2.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx->reserved2.dwSize = inner.reserved2.dwSize;
+
+		memcpy(idCerInfoEx->reserved3.data, inner.reserved3.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx->reserved3.dwSize = inner.reserved3.dwSize;
+
+		memcpy(idCerInfoEx->reserved4.data, inner.reserved4.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx->reserved4.dwSize = inner.reserved4.dwSize;
+
+		memcpy(idCerInfoEx->reserved5.data, inner.reserved5.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx->reserved5.dwSize = inner.reserved5.dwSize;
+	}
+
+	return result;
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ForceIDEject() 
+{ 
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->ForceIDEject();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ScanIDAndSaveImage() 
+{ 
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->ScanIDAndSaveImage();
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_QueryCardPos(int* pos) 
+{ 
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+
+	int inner;
+	ErrorCodeEnum result = pDevAdapterInstance->QueryCardPos(inner);
+	if (result == Error_Succeed)
+	{
+		*pos = inner;
+	}
+	return result; 
+}
+
+LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_IDCerGetDataEx2(Bridge_IDCerInfoEx2* idCerInfoEx2)
+{ 
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+
+	IDCerInfoEx2 inner;
+	memset(&inner, 0, sizeof(inner));
+
+	ErrorCodeEnum result = pDevAdapterInstance->IDCerGetDataEx2(inner);
+	if (result == Error_Succeed)
+	{
+		memcpy(idCerInfoEx2->name.data, inner.name.data, MAX_IDCER_INFO_SIZE);
+		idCerInfoEx2->name.dwSize = inner.name.dwSize;
+
+		memcpy(idCerInfoEx2->sex.data, inner.sex.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx2->sex.dwSize = inner.sex.dwSize;
+
+		memcpy(idCerInfoEx2->nation.data, inner.nation.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx2->nation.dwSize = inner.nation.dwSize;
+
+		memcpy(idCerInfoEx2->birthday.data, inner.birthday.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx2->birthday.dwSize = inner.birthday.dwSize;
+
+		memcpy(idCerInfoEx2->address.data, inner.address.data, MAX_IDCER_INFO_SIZE);
+		idCerInfoEx2->address.dwSize = inner.address.dwSize;
+
+		memcpy(idCerInfoEx2->idno.data, inner.idno.data, 2 * MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx2->idno.dwSize = inner.idno.dwSize;
+
+		memcpy(idCerInfoEx2->department.data, inner.department.data, MAX_IDCER_INFO_SIZE);
+		idCerInfoEx2->department.dwSize = inner.department.dwSize;
+
+		memcpy(idCerInfoEx2->startDate.data, inner.startDate.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx2->startDate.dwSize = inner.startDate.dwSize;
+
+		memcpy(idCerInfoEx2->endDate.data, inner.endDate.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx2->endDate.dwSize = inner.endDate.dwSize;
+
+		memcpy(idCerInfoEx2->newAddress.data, inner.newAddress.data, MAX_IDCER_INFO_SIZE);
+		idCerInfoEx2->newAddress.dwSize = inner.newAddress.dwSize;
+
+		memcpy(idCerInfoEx2->photoPath.data, inner.photoPath.data, MAX_IDCER_PHOTO_PATH);
+		idCerInfoEx2->photoPath.dwSize = inner.photoPath.dwSize;
+
+		memcpy(idCerInfoEx2->englishName.data, inner.englishName.data, MAX_IDCER_INFO_SIZE);
+		idCerInfoEx2->englishName.dwSize = inner.englishName.dwSize;
+
+		memcpy(idCerInfoEx2->nationality.data, inner.nationality.data, IDCER_EIGHT_BYTE_SIZE);
+		idCerInfoEx2->nationality.dwSize = inner.nationality.dwSize;
+
+		memcpy(idCerInfoEx2->idVersion.data, inner.idVersion.data, IDCER_EIGHT_BYTE_SIZE);
+		idCerInfoEx2->idVersion.dwSize = inner.idVersion.dwSize;
+
+		memcpy(idCerInfoEx2->idType.data, inner.idType.data, IDCER_EIGHT_BYTE_SIZE);
+		idCerInfoEx2->idType.dwSize = inner.idType.dwSize;
+
+		memcpy(idCerInfoEx2->reserved.data, inner.reserved.data, IDCER_EIGHT_BYTE_SIZE);
+		idCerInfoEx2->reserved.dwSize = inner.reserved.dwSize;
+
+		memcpy(idCerInfoEx2->txzCode.data, inner.txzCode.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx2->txzCode.dwSize = inner.txzCode.dwSize;
+
+		memcpy(idCerInfoEx2->issuedSN.data, inner.issuedSN.data, IDCER_EIGHT_BYTE_SIZE);
+		idCerInfoEx2->issuedSN.dwSize = inner.issuedSN.dwSize;
+
+		memcpy(idCerInfoEx2->reserved2.data, inner.reserved2.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx2->reserved2.dwSize = inner.reserved2.dwSize;
+
+		memcpy(idCerInfoEx2->reserved3.data, inner.reserved3.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx2->reserved3.dwSize = inner.reserved3.dwSize;
+
+		memcpy(idCerInfoEx2->reserved4.data, inner.reserved4.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx2->reserved4.dwSize = inner.reserved4.dwSize;
+
+		memcpy(idCerInfoEx2->reserved5.data, inner.reserved5.data, MAX_IDCER_SIMPLE_INFO_SIZE);
+		idCerInfoEx2->reserved5.dwSize = inner.reserved5.dwSize;
+	}
+
+	return result;
+}
+

+ 272 - 0
DevAdapter/self/dep/libIDCertificateLoader/libIDCertificateLoader.h

@@ -0,0 +1,272 @@
+#pragma once
+
+#ifdef LIBIDCERTIFICATELOADER_EXPORTS
+#define LIBSUBDEVICELOADER_API __declspec(dllexport)
+#else
+#define LIBSUBDEVICELOADER_API __declspec(dllimport)
+#pragma comment(lib, "libIDCertificateLoader.lib")
+#endif
+
+#include <windows.h>
+#include "IDCerClass.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+	//二代身份证信息结构(需要支持外国人永久居留证请使用IDCerInfoEx)
+//请务必按照各字段指定格式返回数据
+	struct Bridge_IDCerInfo
+	{
+		struct Name {
+			CHAR data[MAX_IDCER_INFO_SIZE];
+			DWORD dwSize;
+		}name;
+		struct Sex {
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}sex;
+		struct Nation {
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}nation;
+		struct Birthday {//format:1986年10月07日
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}birthday;
+		struct Address {
+			CHAR data[MAX_IDCER_INFO_SIZE];
+			DWORD dwSize;
+		}address;
+		struct Idno {
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}idno;
+		struct Department {
+			CHAR data[MAX_IDCER_INFO_SIZE];
+			DWORD dwSize;
+		}department;
+		struct StartDate {//format:2010.08.09
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}startDate;
+		struct EndDate {	//format:2020.08.09
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}endDate;
+		struct NewAddress {
+			CHAR data[MAX_IDCER_INFO_SIZE];
+			DWORD dwSize;
+		}newAddress;
+		struct PhotoPath {
+			CHAR data[MAX_IDCER_PHOTO_PATH];
+			DWORD dwSize;
+		}photoPath;
+	};
+
+	//二代证信息结构(支持外国人永久居留证)
+	//请务必按照各字段指定格式返回数据
+	struct Bridge_IDCerInfoEx
+	{
+		struct Name {//中文姓名
+			CHAR data[MAX_IDCER_INFO_SIZE];
+			DWORD dwSize;
+		}name;
+		struct Sex {//性别
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}sex;
+		struct Nation {//民族(二代证专用)
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}nation;
+		struct Birthday {//出生日期,格式:1986年10月07日
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}birthday;
+		struct Address {//住址(二代证专用)
+			CHAR data[MAX_IDCER_INFO_SIZE];
+			DWORD dwSize;
+		}address;
+		struct Idno {//证件号码,二代证指身份证号,外国人指永久居留证号
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}idno;
+		struct Department {//二代证指签发机关,外国人指当次申请受理机关代码
+			CHAR data[MAX_IDCER_INFO_SIZE];
+			DWORD dwSize;
+		}department;
+		struct StartDate {//有效期起始日(签发日)格式:2010.08.09
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}startDate;
+		struct EndDate {	//有效期截止日(终止日)格式:2020.08.09
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}endDate;
+		struct NewAddress {//最新地址,二代证专用
+			CHAR data[MAX_IDCER_INFO_SIZE];
+			DWORD dwSize;
+		}newAddress;
+		struct PhotoPath {
+			CHAR data[MAX_IDCER_PHOTO_PATH];
+			DWORD dwSize;
+		}photoPath;
+		struct EnglishName {//英文姓名,外国人专用
+			CHAR data[MAX_IDCER_INFO_SIZE];
+			DWORD dwSize;
+		}englishName;
+		struct Nationality {//国籍或地区代码,外国人专用
+			CHAR data[IDCER_EIGHT_BYTE_SIZE];
+			DWORD dwSize;
+		}nationality;
+		struct IdVersion {//证件版本号,外国人专用
+			CHAR data[IDCER_EIGHT_BYTE_SIZE];
+			DWORD dwSize;
+		}idVersion;
+		struct IdType {//证件类型标识,外国人取值'I',二代证为空
+			CHAR data[IDCER_EIGHT_BYTE_SIZE];
+			DWORD dwSize;
+		}idType;
+		struct Reserved {//保留字段,外国人专用
+			CHAR data[IDCER_EIGHT_BYTE_SIZE];
+			DWORD dwSize;
+		}reserved;
+		struct TXZCode {//通行证号码(港澳台居住证)
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}txzCode;
+		struct IssuedSN {//签发次数(港澳台居住证)
+			CHAR data[IDCER_EIGHT_BYTE_SIZE];
+			DWORD dwSize;
+		}issuedSN;
+		struct Reserved2 {//备用2(港澳台居住证)
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}reserved2;
+		struct Reserved3 {//备用3(港澳台居住证)
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}reserved3;
+		struct Reserved4 {//备用4(港澳台居住证)
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}reserved4;
+		struct Reserved5 {//备用5(港澳台居住证)
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}reserved5;
+	};
+
+	struct Bridge_IDCerInfoEx2
+	{
+		struct Name {//中文姓名
+			CHAR data[MAX_IDCER_INFO_SIZE];
+			DWORD dwSize;
+		}name;
+		struct Sex {//性别
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}sex;
+		struct Nation {//民族(二代证专用)
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}nation;
+		struct Birthday {//出生日期,原始格式:19861007
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}birthday;
+		struct Address {//住址(二代证专用)
+			CHAR data[MAX_IDCER_INFO_SIZE];
+			DWORD dwSize;
+		}address;
+		struct Idno {//证件号码,二代证指身份证号,外国人指永久居留证号
+			CHAR data[2 * MAX_IDCER_SIMPLE_INFO_SIZE]; //拓展至64字节
+			DWORD dwSize;
+		}idno;
+		struct Department {//二代证指签发机关,外国人指当次申请受理机关代码
+			CHAR data[MAX_IDCER_INFO_SIZE];
+			DWORD dwSize;
+		}department;
+		struct StartDate {//有效期起始日(签发日)原始格式:20200809
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}startDate;
+		struct EndDate {//有效期截止日(终止日)原始格式:20200809
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}endDate;
+		struct NewAddress {//最新地址,二代证专用
+			CHAR data[MAX_IDCER_INFO_SIZE];
+			DWORD dwSize;
+		}newAddress;
+		struct PhotoPath {
+			CHAR data[MAX_IDCER_PHOTO_PATH];
+			DWORD dwSize;
+		}photoPath;
+		struct EnglishName {//英文姓名,外国人专用
+			CHAR data[MAX_IDCER_INFO_SIZE];
+			DWORD dwSize;
+		}englishName;
+		struct Nationality {//国籍或地区代码,外国人专用
+			CHAR data[IDCER_EIGHT_BYTE_SIZE];
+			DWORD dwSize;
+		}nationality;
+		struct IdVersion {//证件版本号,外国人专用
+			CHAR data[IDCER_EIGHT_BYTE_SIZE];
+			DWORD dwSize;
+		}idVersion;
+		struct IdType {//证件类型标识,外国人取值'I',二代证为空
+			CHAR data[IDCER_EIGHT_BYTE_SIZE];
+			DWORD dwSize;
+		}idType;
+		struct Reserved {//保留字段,外国人专用
+			CHAR data[IDCER_EIGHT_BYTE_SIZE];
+			DWORD dwSize;
+		}reserved;
+		struct TXZCode {//通行证号码(港澳台居住证)
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}txzCode;
+		struct IssuedSN {//签发次数(港澳台居住证)
+			CHAR data[IDCER_EIGHT_BYTE_SIZE];
+			DWORD dwSize;
+		}issuedSN;
+		struct Reserved2 {//备用2(港澳台居住证)
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}reserved2;
+		struct Reserved3 {//备用3(港澳台居住证)
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}reserved3;
+		struct Reserved4 {//备用4(港澳台居住证)
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}reserved4;
+		struct Reserved5 {//备用5(港澳台居住证)
+			CHAR data[MAX_IDCER_SIMPLE_INFO_SIZE];
+			DWORD dwSize;
+		}reserved5;
+	};
+
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPath);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ReleaseDevObject();
+	//////////////////////////////////////////////////////////////////////////
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetDevCategory(DevCategoryInfo* pDevCategory);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_Reset();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevClose();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_GetLastErr(DevErrorInfo* pDevErrInfo);
+	//////////////////////////////////////////////////////////////////////////
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_DevOpen(DWORD dwPort);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_IDCerRFControl(int bControl);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_IDCerAuthenticate();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_IDCerGetData(Bridge_IDCerInfo* idCerInfo);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_IDCerGetDataEx(Bridge_IDCerInfoEx* idCerInfoEx);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ForceIDEject();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_ScanIDAndSaveImage();
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_QueryCardPos(int* pos);
+	LIBSUBDEVICELOADER_API ErrorCodeEnum Bridge_IDCerGetDataEx2(Bridge_IDCerInfoEx2* idCerInfoEx2);
+#ifdef __cplusplus
+} // extern "C" {
+#endif

+ 103 - 0
DevAdapter/self/dep/libIDCertificateLoader/libIDCertificateLoader.vcxproj

@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{99DCAE93-89D7-43C1-8F04-73E615EE493B}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>libIDCertificateLoader</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\LocalRun.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\LocalRun.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <Import Project="..\devmake.setting" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBIDCERTIFICATELOADER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBIDCERTIFICATELOADER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <None Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="libIDCertificateLoader.h" />
+    <ClInclude Include="stdafx.h" />
+    <ClInclude Include="targetver.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="dllmain.cpp">
+      <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+      </PrecompiledHeader>
+      <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+      </PrecompiledHeader>
+    </ClCompile>
+    <ClCompile Include="libIDCertificateLoader.cpp" />
+    <ClCompile Include="stdafx.cpp">
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+    </ClCompile>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

+ 42 - 0
DevAdapter/self/dep/libIDCertificateLoader/libIDCertificateLoader.vcxproj.filters

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="源文件">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="头文件">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="资源文件">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="stdafx.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="targetver.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="libIDCertificateLoader.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="stdafx.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="libIDCertificateLoader.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="dllmain.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+  </ItemGroup>
+</Project>

+ 8 - 0
DevAdapter/self/dep/libIDCertificateLoader/stdafx.cpp

@@ -0,0 +1,8 @@
+// stdafx.cpp : 只包括标准包含文件的源文件
+// libIDCertificateLoader.pch 将作为预编译头
+// stdafx.obj 将包含预编译类型信息
+
+#include "stdafx.h"
+
+// TODO: 在 STDAFX.H 中
+// 引用任何所需的附加头文件,而不是在此文件中引用

+ 16 - 0
DevAdapter/self/dep/libIDCertificateLoader/stdafx.h

@@ -0,0 +1,16 @@
+// stdafx.h : 标准系统包含文件的包含文件,
+// 或是经常使用但不常更改的
+// 特定于项目的包含文件
+//
+
+#pragma once
+
+#include "targetver.h"
+
+#define WIN32_LEAN_AND_MEAN             //  从 Windows 头文件中排除极少使用的信息
+// Windows 头文件:
+#include <windows.h>
+
+
+
+// TODO: 在此处引用程序需要的其他头文件

+ 8 - 0
DevAdapter/self/dep/libIDCertificateLoader/targetver.h

@@ -0,0 +1,8 @@
+#pragma once
+
+// 包括 SDKDDKVer.h 将定义可用的最高版本的 Windows 平台。
+
+// 如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h,并将
+// WIN32_WINNT 宏设置为要支持的平台,然后再包括 SDKDDKVer.h。
+
+#include <SDKDDKVer.h>

+ 36 - 0
DevAdapter/self/dep/libPinPadLoader/ReadMe.txt

@@ -0,0 +1,36 @@
+========================================================================
+    动态链接库:libPinPadLoader 项目概述
+========================================================================
+
+应用程序向导已为您创建了此 libPinPadLoader DLL。
+
+本文件概要介绍组成 libPinPadLoader 应用程序的每个文件的内容。
+
+
+libPinPadLoader.vcxproj
+    这是使用应用程序向导生成的 VC++ 项目的主项目文件,
+    其中包含生成该文件的 Visual C++ 
+    的版本信息,以及有关使用应用程序向导选择的平台、配置和项目功能的信息。
+
+libPinPadLoader.vcxproj.filters
+    这是使用“应用程序向导”生成的 VC++ 项目筛选器文件。 
+    它包含有关项目文件与筛选器之间的关联信息。 在 IDE 
+    中,通过这种关联,在特定节点下以分组形式显示具有相似扩展名的文件。
+    例如,“.cpp”文件与“源文件”筛选器关联。
+
+libPinPadLoader.cpp
+    这是主 DLL 源文件。
+
+/////////////////////////////////////////////////////////////////////////////
+其他标准文件:
+
+StdAfx.h,StdAfx.cpp
+    这些文件用于生成名为 libPinPadLoader.pch 的预编译头 (PCH) 文件和
+    名为 StdAfx.obj 的预编译类型文件。
+
+/////////////////////////////////////////////////////////////////////////////
+其他注释:
+
+应用程序向导使用“TODO:”注释来指示应添加或自定义的源代码部分。
+
+/////////////////////////////////////////////////////////////////////////////

+ 19 - 0
DevAdapter/self/dep/libPinPadLoader/dllmain.cpp

@@ -0,0 +1,19 @@
+// dllmain.cpp : 定义 DLL 应用程序的入口点。
+#include "stdafx.h"
+
+BOOL APIENTRY DllMain( HMODULE hModule,
+                       DWORD  ul_reason_for_call,
+                       LPVOID lpReserved
+					 )
+{
+	switch (ul_reason_for_call)
+	{
+	case DLL_PROCESS_ATTACH:
+	case DLL_THREAD_ATTACH:
+	case DLL_THREAD_DETACH:
+	case DLL_PROCESS_DETACH:
+		break;
+	}
+	return TRUE;
+}
+

+ 333 - 0
DevAdapter/self/dep/libPinPadLoader/libPinPadLoader.cpp

@@ -0,0 +1,333 @@
+// libPinPadLoader.cpp : 定义 DLL 应用程序的导出函数。
+//
+
+#include "stdafx.h"
+#include <Windows.h>
+#include < stdio.h >
+#include "libPinPadLoader.h"
+
+typedef ErrorCodeEnum(*DevAdaptObjCreateFunc)(DeviceBaseClass*& baseObj);
+typedef ErrorCodeEnum(*DevAdaptObjReleaseFunc)(DeviceBaseClass*& pBaseObj);
+
+HINSTANCE hinstLib = NULL;
+
+DevAdaptObjCreateFunc pFuncCreateAdapt = NULL;
+DevAdaptObjReleaseFunc pFuncReleaseAdapt = NULL;
+PinPadClass* pDevAdapterInstance = NULL;
+
+struct DevErrorInfo errInfoInstance;
+
+void SetLastErrInfo(const char* formatStr, ...)
+{
+	va_list arg;
+	va_start(arg, formatStr);
+	sprintf_s(errInfoInstance.szErrMsg, MAX_DEV_ERROR_MSG_LEN, formatStr, arg);
+	errInfoInstance.dwErrMsgLen = strlen(errInfoInstance.szErrMsg);
+	va_end(arg);
+}
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char* libraryPath)
+{
+	ErrorCodeEnum erroCode;
+	hinstLib = LoadLibraryA(libraryPath);
+	if (hinstLib != NULL) {
+		pFuncCreateAdapt = (DevAdaptObjCreateFunc)GetProcAddress(hinstLib, "CreateDevComponent");
+		if (NULL == pFuncCreateAdapt) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_MisMatched;
+		}
+		pFuncReleaseAdapt = (DevAdaptObjReleaseFunc)GetProcAddress(hinstLib, "ReleaseDevComponent");
+		if (NULL == pFuncCreateAdapt) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_NotIntegrated;
+		}
+		erroCode = pFuncCreateAdapt((DeviceBaseClass*&)pDevAdapterInstance);
+		if (erroCode != Error_Succeed) {
+			pDevAdapterInstance = NULL;
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_NoTarget;
+		}
+		if (pDevAdapterInstance == NULL) {
+			FreeLibrary(hinstLib);
+			pFuncCreateAdapt = NULL;
+			pFuncReleaseAdapt = NULL;
+			return Error_Null;
+		}
+
+	} else {
+		SetLastErrInfo("load library failed %d", GetLastError());
+		return Error_DevLoadFileFailed;
+	}
+	return Error_Succeed;
+}
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_ReleaseDevObject()
+{
+	if (pFuncReleaseAdapt != NULL && pDevAdapterInstance != NULL) {
+		DeviceBaseClass* devBasePtr = static_cast<DeviceBaseClass*>(pDevAdapterInstance);
+		pFuncReleaseAdapt(devBasePtr);
+		pDevAdapterInstance = NULL;
+	}
+	if (hinstLib != NULL) {
+		FreeLibrary(hinstLib);
+		hinstLib = NULL;
+	}
+	return Error_Succeed;
+}
+
+//////////////////////////////////////////////////////////////////////////
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_GetDevCategory(DevCategoryInfo* pDevCategory)
+{
+	ErrorCodeEnum result;
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+
+	DevCategoryInfo inner;
+	memset(inner.szType, 0, sizeof(char)* MAX_DEV_TYPE_LEN);
+	memset(inner.szModel, 0, sizeof(char) * MAX_DEV_MODEL_LEN);
+	memset(inner.szVendor, 0, sizeof(char) * MAX_DEV_VENDOR_LEN);
+
+	result = pDevAdapterInstance->GetDevCategory(inner);
+	if (result == Error_Succeed) {
+
+		memset(pDevCategory->szType, 0, sizeof(char) * MAX_DEV_TYPE_LEN);
+		memset(pDevCategory->szModel, 0, sizeof(char) * MAX_DEV_MODEL_LEN);
+		memset(pDevCategory->szVendor, 0, sizeof(char) * MAX_DEV_VENDOR_LEN);
+
+		strncpy_s(pDevCategory->szType, MAX_DEV_TYPE_LEN, inner.szType, strlen(inner.szType) > MAX_DEV_TYPE_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szType));
+		strncpy_s(pDevCategory->szModel, MAX_DEV_MODEL_LEN, inner.szModel, strlen(inner.szModel) > MAX_DEV_MODEL_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szModel));
+		strncpy_s(pDevCategory->szVendor, MAX_DEV_VENDOR_LEN, inner.szVendor, strlen(inner.szVendor) > MAX_DEV_VENDOR_LEN - 1 ? MAX_DEV_TYPE_LEN - 1 : strlen(inner.szVendor));
+
+		pDevCategory->eState = inner.eState;
+		pDevCategory->version.wMajor = inner.version.wMajor;
+		pDevCategory->version.wMinor = inner.version.wMinor;
+		pDevCategory->version.wRevision = inner.version.wRevision;
+		pDevCategory->version.wBuild = inner.version.wBuild;
+	}
+	return result;
+}
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_Reset()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->Reset();
+}
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_DevClose()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->DevClose();
+}
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_GetLastErr(DevErrorInfo* pDevErrInfo)
+{
+	if (pDevAdapterInstance == NULL) {
+		strcpy_s(pDevErrInfo->szErrMsg, MAX_DEV_ERROR_MSG_LEN, errInfoInstance.szErrMsg);
+		pDevErrInfo->dwErrMsgLen = errInfoInstance.dwErrMsgLen;
+		return Error_Succeed;
+	}
+	DevErrorInfo inner;
+	ErrorCodeEnum result = pDevAdapterInstance->GetLastErr(inner);
+	if (result == Error_Succeed) {
+		memset(pDevErrInfo->szErrMsg, 0, sizeof(char) * MAX_DEV_ERROR_MSG_LEN);
+		strncpy_s(pDevErrInfo->szErrMsg, MAX_DEV_ERROR_MSG_LEN, inner.szErrMsg,  strlen(inner.szErrMsg) > MAX_DEV_ERROR_MSG_LEN - 1 ? MAX_DEV_ERROR_MSG_LEN - 1 : strlen(inner.szErrMsg));
+		pDevErrInfo->dwErrMsgLen = inner.dwErrMsgLen;
+	}
+	return result;
+}
+
+//////////////////////////////////////////////////////////////////////////
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_DevOpen(DWORD dwPort, DWORD dwBaudRate)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->DevOpen(dwPort, dwBaudRate);
+}
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_KeyRead(BYTE* pKeyChar)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->KeyRead(*pKeyChar);
+}
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_SetParam(int eType, int eValue)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->SetParam((SetParamTypeEnum)eType, (SetParamValueEnum)eValue);
+}
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_SetAccNo(Bridge_AccountInfo accInfo)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	AccountInfo inner;
+	inner.dwAccLen = accInfo.dwAccLen;
+	memcpy(inner.account, accInfo.account, MAX_ACCOUNT_LEN);
+	ErrorCodeEnum result = pDevAdapterInstance->SetAccNo(inner);
+	return result;
+}
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_LoadMasterKey(Bridge_MasterKeyParam masterKey)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	MasterKeyParam inner;
+	inner.smFlag = masterKey.smFlag;
+	inner.dwSN = masterKey.dwSN;
+	memcpy(inner.key, masterKey.key, MAX_MASTER_KEY_SIZE);
+	ErrorCodeEnum result = pDevAdapterInstance->LoadMasterKey(inner);
+	return result;
+}
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_LoadWorkingKey(Bridge_WorkKeyParam wkKey)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	WorkKeyParam inner;
+	inner.smFlag = wkKey.smFlag;
+	inner.dwMasterSN = wkKey.dwMasterSN;
+	inner.dwWorkingSN = wkKey.dwWorkingSN;
+	memcpy(inner.key, wkKey.key, MAX_WORKING_KEY_SIZE);
+	ErrorCodeEnum result = pDevAdapterInstance->LoadWorkingKey(inner);
+	return result;
+}
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_ActiveWorkingKey(DWORD dwMkSN, DWORD dwWkSN)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	ErrorCodeEnum result = pDevAdapterInstance->ActiveWorkingKey(dwMkSN, dwWkSN);
+	return result;
+}
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_StartPinInput(BYTE byLen)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	ErrorCodeEnum result = pDevAdapterInstance->StartPinInput(byLen);
+	return result;
+}
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_StartPinInputConfirm(BYTE byLen)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	ErrorCodeEnum result = pDevAdapterInstance->StartPinInputConfirm(byLen);
+	return result;
+}
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_StartPlainInput()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	ErrorCodeEnum result = pDevAdapterInstance->StartPlainInput();
+	return result;
+}
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_StopInput()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	ErrorCodeEnum result = pDevAdapterInstance->StopInput();
+	return result;
+}
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_GetPinBlock(Bridge_PinBlock* pPinBlock)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	PinBlock inner;
+	ErrorCodeEnum result = pDevAdapterInstance->GetPinBlock(inner);
+	if (result == Error_Succeed) {
+		pPinBlock->dwSize = inner.dwSize;
+		memcpy(pPinBlock->data, inner.data, MAX_PIN_BLOCK_SIZE);
+	}
+	return result;
+}
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_EncryptData(Bridge_EnDecryptInfo srcInfo, Bridge_EnDecryptInfo* pDestInfo)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+
+	EnDecryptInfo inner;
+	EnDecryptInfo inner2;
+
+	inner.dwSize = srcInfo.dwSize;
+	memcpy(inner.data, srcInfo.data, MAX_EN_DECRYPT_DATA_SIZE);
+
+	ErrorCodeEnum result = pDevAdapterInstance->EncryptData(inner, inner2);
+	if (result == Error_Succeed) {
+		pDestInfo->dwSize = inner2.dwSize;
+		memcpy(pDestInfo->data, inner2.data, MAX_EN_DECRYPT_DATA_SIZE);
+	}
+	return result;
+}
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_MacEncrypt(Bridge_EnDecryptInfo srcInfo, Bridge_EnDecryptInfo* pDestInfo)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	EnDecryptInfo inner;
+	EnDecryptInfo inner2;
+
+	inner.dwSize = srcInfo.dwSize;
+	memcpy(inner.data, srcInfo.data, MAX_EN_DECRYPT_DATA_SIZE);
+
+	ErrorCodeEnum result = pDevAdapterInstance->MacEncrypt(inner, inner2);
+	if (result == Error_Succeed) {
+		pDestInfo->dwSize = inner2.dwSize;
+		memcpy(pDestInfo->data, inner2.data, MAX_EN_DECRYPT_DATA_SIZE);
+	}
+	return result;
+}
+
+LIBPINPADLOADER_API int Bridge_GetEncryptFunc()
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	return pDevAdapterInstance->GetEncryptFunc();
+}
+
+LIBPINPADLOADER_API ErrorCodeEnum Bridge_LoadMasterKeyEx(Bridge_MasterKeyParamEx enMasterKey)
+{
+	if (pDevAdapterInstance == NULL) {
+		return Error_NotInit;
+	}
+	MasterKeyParamEx inner;
+	inner.smFlag = enMasterKey.smFlag;
+	inner.dwSN = enMasterKey.dwSN;
+	memcpy(inner.key, enMasterKey.key, MAX_EN_DECRYPT_DATA_SIZE);
+	ErrorCodeEnum result = pDevAdapterInstance->LoadMasterKeyEx(inner);
+	return result;
+}

+ 93 - 0
DevAdapter/self/dep/libPinPadLoader/libPinPadLoader.h

@@ -0,0 +1,93 @@
+#pragma once
+
+#ifdef LIBPINPADLOADER_EXPORTS
+#define LIBPINPADLOADER_API __declspec(dllexport)
+#else
+#define LIBPINPADLOADER_API __declspec(dllimport)
+#pragma comment(lib, "libPinPadLoader.lib")
+#endif
+
+#include "PinPadClass.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+	struct Bridge_PinPadInitParam
+	{
+		DWORD dwPort;
+		DWORD dwBaudRate;
+	};
+
+	struct Bridge_PinReadData
+	{
+		DWORD dwSize;
+		BYTE data[MAX_PIN_READ_SIZE];
+	};
+
+	struct Bridge_MasterKeyParam
+	{
+		int smFlag;
+		DWORD dwSN;
+		BYTE key[MAX_MASTER_KEY_SIZE];
+	};
+
+	struct Bridge_MasterKeyParamEx
+	{
+		int smFlag;
+		DWORD dwSN;
+		BYTE key[MAX_EN_DECRYPT_DATA_SIZE];
+	};
+
+	struct Bridge_WorkKeyParam
+	{
+		int smFlag;
+		DWORD dwMasterSN;
+		DWORD dwWorkingSN;
+		BYTE key[MAX_WORKING_KEY_SIZE];
+	};
+
+	struct Bridge_PinBlock
+	{
+		DWORD dwSize;
+		BYTE data[MAX_PIN_BLOCK_SIZE];
+	};
+	struct Bridge_AccountInfo
+	{
+		DWORD dwAccLen;
+		BYTE account[MAX_ACCOUNT_LEN];
+	};
+	struct Bridge_EnDecryptInfo
+	{
+		DWORD dwSize;
+		BYTE data[MAX_EN_DECRYPT_DATA_SIZE];
+	};
+
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_LoadDevObject(const char *libraryPath);
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_ReleaseDevObject();
+	//////////////////////////////////////////////////////////////////////////
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_GetDevCategory(DevCategoryInfo* pDevCategory);
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_Reset();
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_DevClose();
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_GetLastErr(DevErrorInfo* pDevErrInfo);
+	//////////////////////////////////////////////////////////////////////////
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_DevOpen(DWORD dwPort, DWORD dwBaudRate);
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_KeyRead(BYTE* pKeyChar);
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_SetParam(int eType, int eValue);
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_SetAccNo(Bridge_AccountInfo accInfo);
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_LoadMasterKey(Bridge_MasterKeyParam masterKey);
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_LoadWorkingKey(Bridge_WorkKeyParam wkKey);
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_ActiveWorkingKey(DWORD dwMkSN, DWORD dwWkSN);
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_StartPinInput(BYTE byLen);
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_StartPinInputConfirm(BYTE byLen);
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_StartPlainInput();
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_StopInput();
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_GetPinBlock(Bridge_PinBlock* pPinBlock);
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_EncryptData(Bridge_EnDecryptInfo srcInfo, Bridge_EnDecryptInfo* pDestInfo);
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_MacEncrypt(Bridge_EnDecryptInfo srcInfo, Bridge_EnDecryptInfo* pDestInfo);
+	LIBPINPADLOADER_API int Bridge_GetEncryptFunc();
+	LIBPINPADLOADER_API ErrorCodeEnum Bridge_LoadMasterKeyEx(Bridge_MasterKeyParamEx enMasterKey);
+
+#ifdef __cplusplus
+} // extern "C" {
+#endif

+ 104 - 0
DevAdapter/self/dep/libPinPadLoader/libPinPadLoader.vcxproj

@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{918AE7E3-ECA0-4AB5-8757-B92910776E0B}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>libPinPadLoader</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\LocalRun.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\LocalRun.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <Import Project="..\devmake.setting" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBPINPADLOADER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>$(DevAdapterHead);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>Use</PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBPINPADLOADER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Windows</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <None Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="libPinPadLoader.h" />
+    <ClInclude Include="stdafx.h" />
+    <ClInclude Include="targetver.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="dllmain.cpp">
+      <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+      </PrecompiledHeader>
+      <CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+      </PrecompiledHeader>
+    </ClCompile>
+    <ClCompile Include="libPinPadLoader.cpp" />
+    <ClCompile Include="stdafx.cpp">
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+    </ClCompile>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

+ 42 - 0
DevAdapter/self/dep/libPinPadLoader/libPinPadLoader.vcxproj.filters

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="源文件">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="头文件">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="资源文件">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="ReadMe.txt" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="stdafx.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="targetver.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+    <ClInclude Include="libPinPadLoader.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="stdafx.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="libPinPadLoader.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+    <ClCompile Include="dllmain.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
+  </ItemGroup>
+</Project>

+ 8 - 0
DevAdapter/self/dep/libPinPadLoader/stdafx.cpp

@@ -0,0 +1,8 @@
+// stdafx.cpp : 只包括标准包含文件的源文件
+// libPinPadLoader.pch 将作为预编译头
+// stdafx.obj 将包含预编译类型信息
+
+#include "stdafx.h"
+
+// TODO: 在 STDAFX.H 中
+// 引用任何所需的附加头文件,而不是在此文件中引用

+ 16 - 0
DevAdapter/self/dep/libPinPadLoader/stdafx.h

@@ -0,0 +1,16 @@
+// stdafx.h : 标准系统包含文件的包含文件,
+// 或是经常使用但不常更改的
+// 特定于项目的包含文件
+//
+
+#pragma once
+
+#include "targetver.h"
+
+#define WIN32_LEAN_AND_MEAN             //  从 Windows 头文件中排除极少使用的信息
+// Windows 头文件:
+#include <windows.h>
+
+
+
+// TODO: 在此处引用程序需要的其他头文件

+ 8 - 0
DevAdapter/self/dep/libPinPadLoader/targetver.h

@@ -0,0 +1,8 @@
+#pragma once
+
+// 包括 SDKDDKVer.h 将定义可用的最高版本的 Windows 平台。
+
+// 如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h,并将
+// WIN32_WINNT 宏设置为要支持的平台,然后再包括 SDKDDKVer.h。
+
+#include <SDKDDKVer.h>