OemBusUnit.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #pragma once
  2. // 下列 ifdef 块是创建使从 DLL 导出更简单的
  3. // 宏的标准方法。此 DLL 中的所有文件都是用命令行上定义的 OEMBUSUNIT_EXPORTS
  4. // 符号编译的。在使用此 DLL 的
  5. // 任何其他项目上不应定义此符号。这样,源文件中包含此文件的任何其他项目都会将
  6. // OEMBUSUNIT_API 函数视为是从 DLL 导入的,而此 DLL 则将用此宏定义的
  7. // 符号视为是被导出的。
  8. #ifndef OEMBUSUNIT_EXPORTS
  9. #ifdef _WIN64
  10. #ifdef _DEBUG
  11. #pragma comment(lib, "OemBusUnitX64D.lib")
  12. #else
  13. #pragma comment(lib, "OemBusUnitX64.lib")
  14. #endif
  15. #else
  16. #ifdef _DEBUG
  17. #pragma comment(lib, "OemBusUnitD.lib")
  18. #else
  19. #pragma comment(lib, "OemBusUnit.lib")
  20. #endif
  21. #endif
  22. #endif
  23. #ifdef OEMBUSUNIT_EXPORTS
  24. #define OEMBUSUNIT_API __declspec(dllexport)
  25. #define OEMBUSUNIT_C_API extern "C" __declspec(dllexport)
  26. #else
  27. #define OEMBUSUNIT_API __declspec(dllimport)
  28. #define OEMBUSUNIT_C_API extern "C" __declspec(dllimport)
  29. #endif
  30. #include "LogicDriver.h"
  31. //OEMBUSUNIT_C_API DPC* GetDPC();
  32. //OEMBUSUNIT_C_API void ReleaseDPC(DPC *p);
  33. //class OEMBUSUNIT_API BusUnitDPC : public DPC
  34. //{
  35. // std::string *m_pWorkpath;
  36. //public:
  37. // BusUnitDPC(void);
  38. // virtual ~BusUnitDPC(void);
  39. //
  40. // virtual bool DpcEntry(ResDataObject &Configuration);
  41. //
  42. // virtual ResDataObject GetConnectionType();
  43. //
  44. // virtual bool Connect(ResDataObject &Connection);
  45. //
  46. // virtual bool Probe(ResDataObject &HardwareInfo);
  47. //
  48. // virtual bool SetWorkPath(const char *pWorkPath);
  49. //
  50. // virtual PVOID LoadLogicDevices();
  51. //
  52. // virtual void UnloadLogicDevices(PVOID p);
  53. //
  54. // virtual bool DisConnect();
  55. //
  56. //};
  57. class OEMBUSUNIT_API BusUnitDPC : public LogicDriver
  58. {
  59. std::string *m_pWorkpath;
  60. public:
  61. BusUnitDPC(void);
  62. virtual ~BusUnitDPC(void);
  63. virtual bool DriverEntry(ResDataObject &Configuration);
  64. virtual bool SYSTEM_CALL Driver_Probe(ResDataObject& PARAM_OUT HardwareInfo);
  65. virtual bool SetDriverWorkPath(const char *pWorkPath);
  66. virtual PVOID SYSTEM_CALL LoadDriver();//无根节点
  67. virtual void SYSTEM_CALL UnloadDriver();
  68. //actions
  69. virtual bool Connect();
  70. virtual void DisConnect();
  71. //virtual bool SYSTEM_CALL GetDeviceType(GUID &DevType);
  72. virtual bool SYSTEM_CALL Device_Probe(ResDataObject& PARAM_OUT HardwareInfo);
  73. virtual bool SYSTEM_CALL SetDeviceWorkPath(const char * PARAM_IN pWorkPath);
  74. virtual PVOID LoadLogicDevices();
  75. virtual void UnloadLogicDevices();
  76. RET_STATUS SYSTEM_CALL GetDriverDictionary(ResDataObject& PARAM_OUT DriverInfo);
  77. };
  78. OEMBUSUNIT_C_API DriverDPC* GetDriverDPC();
  79. OEMBUSUNIT_C_API void ReleaseDriverDPC(DriverDPC *p);