123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- #pragma once
- #include <stdio.h>
- #include<winpr/windows.h>
- #include <string>
- #include <list>
- #include <winpr/crt.h>
- #define ENTITY_SINGLE_GROUPNAME "group0"
- struct EntityInfo
- {
- std::wstring EntityName;
- int EntityState;
- EntityInfo() :EntityState(0) { EntityName.clear(); }
- };
- class EntityGloabalResource
- {
- public:
- EntityGloabalResource()
- :m_dbg(NULL)
- ,m_gAppID(0)
- {
- m_pfMain = m_pfExit = m_moduleBase = m_timer = m_Entity = m_Module = NULL;
- // memset(std::wstring)??? [Gifur@202051]
- //ZeroMemory(m_EntitysInfo, sizeof(EntityInfo) * 80);
- m_EntityCount = m_Locking = m_SkipLineNum = m_LastTouchYPos = m_LastTouchID = m_LastShiftTick = 0;
- m_InBrowseMode = m_InBlueScreenMode = false;
-
- }
- public:
- //global data
- void *m_dbg;
- void *m_gui;
- WORD m_gAppID;
- void *m_pfMain, *m_pfExit;
- void *m_moduleBase;
- void *m_Entity;
-
- /************************************************************************/
- /* // 运行实体信息
- struct EntityInfo
- {
- wstring EntityName;
- int EntityState;
- } gEntitysInfo[80] = {};
- int gEntityCount = 0;
- volatile unsigned int gLocking = 0;
- // 输出信息循环数组
- list<wstring> gOutputMsgs;
- // 信息滚动控制
- int gSkipLineNum = 0;
- bool gInBrowseMode = false;
- DWORD gLastTouchYPos = 0;
- DWORD gLastTouchID = 0;
- DWORD gLastShiftTick = 0;
- // 右侧重要错误信息
- list<wstring> gFatalMsgs;
- // 右侧当前状态信息
- wstring gStartupInfo;
- // 蓝屏控制
- wstring gBlueScreenMsg;
- bool gInBlueScreenMode = false; */
- /************************************************************************/
- EntityInfo m_EntitysInfo[80];
- int m_EntityCount;
- volatile unsigned int m_Locking;
- std::list<std::wstring> m_OutputMsgs;
- int m_SkipLineNum;
- bool m_InBrowseMode;
- DWORD m_LastTouchYPos;
- DWORD m_LastTouchID;
- DWORD m_LastShiftTick;
- std::list<std::wstring> m_FatalMsgs;
- std::wstring m_StartupInfo;
- std::wstring m_BlueScreenMsg;
- bool m_InBlueScreenMode;
- //Entity Resource
- void *m_timer;
- HMODULE m_Module;
- };
- bool CreateModuleInfo(const char *name);
- bool SetSpModule(const char *name, void *module);
- //terminal the threads under mod_name except current one.
- bool CleanModuleThread(const char *name);
- bool DestoryModuleInfo(const char *name);
- bool SetthreadGroup(DWORD threadId, const char *name);
- bool findThreadModule(DWORD threadId, void **module);
- void* findModuleByName(const char *name);
- bool setModuleAliasName(const char *aliasName);
- bool SetThreadGroupByResource(DWORD threadId, void *resource);
- EntityGloabalResource* getEntityResource();
|