123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- #pragma once
- #ifndef _SYSMODULE_
- #define _SYSMODULE_
- #ifndef SYSMODULE
- #define SYSMODULE extern "C" _declspec(dllexport)
- #else
- #undef SYSMODULE
- #define SYSMODULE extern "C" _declspec(dllimport)
- #endif
- #define CLSID_BASEMODULE L"{DA90D68D-99EB-45D5-A969-BC3D0D12D92A}"
- #pragma pack(push,1)
- class IBaseCurl;
- class IServerList;
- class IUserinfo;
- //获取其他类的指针
- class IBaseGloablModule
- {
- public:
- virtual ~IBaseGloablModule(void) {}
- ////获取错误的消息
- //virtual LPCSTR GetLastErrorA() = 0;
- //virtual LPCWSTR GetLastErrorW() = 0;
- virtual IBaseCurl* GetBaseCurlInstance() = 0;
-
- virtual INT AddRef() = 0;
- virtual INT Release() = 0;
- };
- template<typename T>
- class IInstanceList
- {
- public:
- IInstanceList(void)
- {
- m_pNext = NULL;
- m_pPrev = NULL;
- }
- virtual ~IInstanceList(void)
- {
- Detach();
- }
- virtual void AddInstance(T* pInstance)
- {
- if (m_pNext && (m_pNext != pInstance))
- m_pNext->AddInstance(pInstance);
- else
- {
- pInstance->m_pPrev = (T*)this;
- m_pNext = pInstance;
- }
- }
- virtual void Detach()
- {
- if (m_pNext)
- m_pNext->m_pPrev = m_pPrev;
- if (m_pPrev)
- m_pPrev->m_pNext = m_pNext;
- m_pPrev = m_pNext = NULL;
- }
- T* m_pPrev;
- T* m_pNext;
- };
- struct SPROXY_NET
- {
- int sid;
- int groupid;
- char addproxy[64];
- char username[64];
- char password[64];
- char processname[64];
- char title[64];
- int port;
- int status;
- int id;
- int pid;
- int isros;
- int proxy_type;
- bool select;
- int count;
- int mid; //模拟器ID
- //查找结构体e是否存在
- bool operator == (const SPROXY_NET& e) {
- return (this->id == e.id);
- }
- //查找数值
- bool operator == (const int& id) {
- return (this->id == id);
- }
- };
- struct PROESSSHOW
- {
- char title[64];
- int pid;
- };
- struct ProcessInfo
- {
- int id;
- wchar_t gnmae[256];
- wchar_t proceessname[256];
- int select;
- };
- struct USERINFO
- {
- char username[64];
- char password[64];
- char expiretime[64];
- int id;
- int number;
- int alreadycount;
- };
- /**
- 服务器组
- */
- struct ServerGroup
- {
- int id;
- char title[64];
- };
- class IServerListCallback
- {
- public:
- virtual ~IServerListCallback(void) {};
- virtual void ServerListCallback() = 0;
- };
- class IServerList
- : public IInstanceList<IServerList>
- {
- public:
- virtual ~IServerList(void) {};
- };
- class IUserinfo
- : public IInstanceList<IUserinfo>
- {
- public:
- virtual ~IUserinfo(void) {};
- };
- enum HTTPRET
- {
- http_no = 0,
- http_f,
- http_yes,
- http_start,
- http_end,
- };
- //请求网络接口
- class IBaseCurl
- : public IInstanceList<IBaseCurl>
- {
- public:
- virtual ~IBaseCurl(void) {};
- virtual HTTPRET GetHttpConnectstatus() = 0;
- virtual LPCSTR GetLastErrorA() = 0;
- };
- SYSMODULE IBaseGloablModule* WINAPI GetBaseGlobalInstance();
- SYSMODULE BOOL WINAPI ReleaseBaseGlobalInstance();
- #pragma pack(pop)
- #endif
|