sp_checkEntity.h 2.3 KB

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