sp_checkEntity.h 2.4 KB

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