#pragma once // 下列 ifdef 块是创建使从 DLL 导出更简单的 // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 OEMBUSUNIT_EXPORTS // 符号编译的。在使用此 DLL 的 // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将 // OEMBUSUNIT_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的 // 符号视为是被导出的。 #ifndef OEMBUSUNIT_EXPORTS #ifdef _WIN64 #ifdef _DEBUG #pragma comment(lib, "OemBusUnitX64D.lib") #else #pragma comment(lib, "OemBusUnitX64.lib") #endif #else #ifdef _DEBUG #pragma comment(lib, "OemBusUnitD.lib") #else #pragma comment(lib, "OemBusUnit.lib") #endif #endif #endif #ifdef OEMBUSUNIT_EXPORTS #define OEMBUSUNIT_API __declspec(dllexport) #define OEMBUSUNIT_C_API extern "C" __declspec(dllexport) #else #define OEMBUSUNIT_API __declspec(dllimport) #define OEMBUSUNIT_C_API extern "C" __declspec(dllimport) #endif #include "LogicDriver.h" //OEMBUSUNIT_C_API DPC* GetDPC(); //OEMBUSUNIT_C_API void ReleaseDPC(DPC *p); //class OEMBUSUNIT_API BusUnitDPC : public DPC //{ // std::string *m_pWorkpath; //public: // BusUnitDPC(void); // virtual ~BusUnitDPC(void); // // virtual bool DpcEntry(ResDataObject &Configuration); // // virtual ResDataObject GetConnectionType(); // // virtual bool Connect(ResDataObject &Connection); // // virtual bool Probe(ResDataObject &HardwareInfo); // // virtual bool SetWorkPath(const char *pWorkPath); // // virtual PVOID LoadLogicDevices(); // // virtual void UnloadLogicDevices(PVOID p); // // virtual bool DisConnect(); // //}; class OEMBUSUNIT_API BusUnitDPC : public LogicDriver { std::string *m_pWorkpath; public: BusUnitDPC(void); virtual ~BusUnitDPC(void); virtual bool DriverEntry(ResDataObject &Configuration); virtual bool SYSTEM_CALL Driver_Probe(ResDataObject& PARAM_OUT HardwareInfo); virtual bool SetDriverWorkPath(const char *pWorkPath); virtual PVOID SYSTEM_CALL LoadDriver();//无根节点 virtual void SYSTEM_CALL UnloadDriver(); //actions virtual bool Connect(); virtual void DisConnect(); //virtual bool SYSTEM_CALL GetDeviceType(GUID &DevType); virtual bool SYSTEM_CALL Device_Probe(ResDataObject& PARAM_OUT HardwareInfo); virtual bool SYSTEM_CALL SetDeviceWorkPath(const char * PARAM_IN pWorkPath); virtual PVOID LoadLogicDevices(); virtual void UnloadLogicDevices(); RET_STATUS SYSTEM_CALL GetDriverDictionary(ResDataObject& PARAM_OUT DriverInfo); }; OEMBUSUNIT_C_API DriverDPC* GetDriverDPC(); OEMBUSUNIT_C_API void ReleaseDriverDPC(DriverDPC *p);