Commit e823c389 by kevin

change project to import dll, remove no need *.h in export include files

1 parent c88e8798
...@@ -4,8 +4,13 @@ ...@@ -4,8 +4,13 @@
#include <iostream> #include <iostream>
#include <WinBase.h> #include <WinBase.h>
#ifdef __cplusplus
extern "C" {
#endif
#include "des.h" #include "des.h"
#ifdef __cplusplus
}
#endif
//#include "FucBase.h" //#include "FucBase.h"
/* /*
......
...@@ -2,10 +2,21 @@ ...@@ -2,10 +2,21 @@
#ifndef LK_SEETA_VERIFY_H #ifndef LK_SEETA_VERIFY_H
#define LK_SEETA_VERIFY_H #define LK_SEETA_VERIFY_H
#ifdef _WIN32
#ifdef SEETA_EXPORTS
#define SEETA_API __declspec(dllexport)
#else
#define SEETA_API __declspec(dllimport)
#endif
#else
#define VIPL_API __attribute__ ((visibility("default")))
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "des.h" //#include "des.h"
#include <windows.h> #include <windows.h>
typedef int(__stdcall *pConnect)(int); typedef int(__stdcall *pConnect)(int);
...@@ -16,15 +27,15 @@ typedef int(__stdcall *pSendAPDU)(int, unsigned char*, int*, unsigned char*); ...@@ -16,15 +27,15 @@ typedef int(__stdcall *pSendAPDU)(int, unsigned char*, int*, unsigned char*);
class LK_SEETA_VERIFY class LK_SEETA_VERIFY
{ {
public: public:
LK_SEETA_VERIFY(); SEETA_API LK_SEETA_VERIFY();
~LK_SEETA_VERIFY(); SEETA_API ~LK_SEETA_VERIFY();
void contrast_authenticate(); void contrast_authenticate();
void get_chip_id(unsigned char chip_id[], int &lenRcv);//get chip id from hardware SEETA_API void get_chip_id(unsigned char chip_id[], int &lenRcv);//get chip id from hardware
void write_chip_id_limit_num_to_nvm();//get chip id and limit num, then write to nvm SEETA_API void write_chip_id_limit_num_to_nvm();//get chip id and limit num, then write to nvm
void read_chip_id_limit_num_from_nvm(unsigned char chip_id_from_nvm[], int &lenRcv); SEETA_API void read_chip_id_limit_num_from_nvm(unsigned char chip_id_from_nvm[], int &lenRcv);
private: private:
HMODULE g_hDll; //̬ HMODULE g_hDll; //̬
pConnect ConnectUkey; pConnect ConnectUkey;
......
...@@ -26,26 +26,26 @@ ...@@ -26,26 +26,26 @@
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset> <PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset> <PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset> <PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset> <PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
...@@ -95,6 +95,7 @@ ...@@ -95,6 +95,7 @@
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<ImportLibrary>$(OutDir)$(TargetName)d.lib</ImportLibrary>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
...@@ -108,6 +109,7 @@ ...@@ -108,6 +109,7 @@
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<ImportLibrary>$(OutDir)$(TargetName)d.lib</ImportLibrary>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
...@@ -125,6 +127,7 @@ ...@@ -125,6 +127,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<ImportLibrary>$(OutDir)$(TargetName).lib</ImportLibrary>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!