sp_checkEntity.h 2.5 KB

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