sp_checkEntity.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #pragma once
  2. #include <stdio.h>
  3. #include<winpr/windows.h>
  4. #include <string>
  5. #include <list>
  6. #include <winpr/crt.h>
  7. #define ENTITY_SINGLE_GROUPNAME "group0"
  8. struct EntityInfo
  9. {
  10. std::wstring EntityName;
  11. int EntityState;
  12. EntityInfo() :EntityState(0) { EntityName.clear(); }
  13. };
  14. class EntityGloabalResource
  15. {
  16. public:
  17. EntityGloabalResource()
  18. :m_dbg(NULL)
  19. ,m_gAppID(0)
  20. {
  21. m_pfMain = m_pfExit = m_moduleBase = m_timer = m_Entity = m_Module = NULL;
  22. // memset(std::wstring)??? [Gifur@202051]
  23. //ZeroMemory(m_EntitysInfo, sizeof(EntityInfo) * 80);
  24. m_EntityCount = m_Locking = m_SkipLineNum = m_LastTouchYPos = m_LastTouchID = m_LastShiftTick = 0;
  25. m_InBrowseMode = m_InBlueScreenMode = false;
  26. }
  27. public:
  28. //global data
  29. void *m_dbg;
  30. void *m_gui;
  31. WORD m_gAppID;
  32. void *m_pfMain, *m_pfExit;
  33. void *m_moduleBase;
  34. void *m_Entity;
  35. /************************************************************************/
  36. /* // 运行实体信息
  37. struct EntityInfo
  38. {
  39. wstring EntityName;
  40. int EntityState;
  41. } gEntitysInfo[80] = {};
  42. int gEntityCount = 0;
  43. volatile unsigned int gLocking = 0;
  44. // 输出信息循环数组
  45. list<wstring> gOutputMsgs;
  46. // 信息滚动控制
  47. int gSkipLineNum = 0;
  48. bool gInBrowseMode = false;
  49. DWORD gLastTouchYPos = 0;
  50. DWORD gLastTouchID = 0;
  51. DWORD gLastShiftTick = 0;
  52. // 右侧重要错误信息
  53. list<wstring> gFatalMsgs;
  54. // 右侧当前状态信息
  55. wstring gStartupInfo;
  56. // 蓝屏控制
  57. wstring gBlueScreenMsg;
  58. bool gInBlueScreenMode = false; */
  59. /************************************************************************/
  60. EntityInfo m_EntitysInfo[80];
  61. int m_EntityCount;
  62. volatile unsigned int m_Locking;
  63. std::list<std::wstring> m_OutputMsgs;
  64. int m_SkipLineNum;
  65. bool m_InBrowseMode;
  66. DWORD m_LastTouchYPos;
  67. DWORD m_LastTouchID;
  68. DWORD m_LastShiftTick;
  69. std::list<std::wstring> m_FatalMsgs;
  70. std::wstring m_StartupInfo;
  71. std::wstring m_BlueScreenMsg;
  72. bool m_InBlueScreenMode;
  73. //Entity Resource
  74. void *m_timer;
  75. HMODULE m_Module;
  76. };
  77. bool CreateModuleInfo(const char *name);
  78. bool SetSpModule(const char *name, void *module);
  79. //terminal the threads under mod_name except current one.
  80. bool CleanModuleThread(const char *name);
  81. bool DestoryModuleInfo(const char *name);
  82. bool SetthreadGroup(DWORD threadId, const char *name);
  83. bool findThreadModule(DWORD threadId, void **module);
  84. void* findModuleByName(const char *name);
  85. bool setModuleAliasName(const char *aliasName);
  86. bool SetThreadGroupByResource(DWORD threadId, void *resource);
  87. EntityGloabalResource* getEntityResource();