modCheck.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * category: [core]
  3. * apply status:
  4. * edit status:
  5. * build status:
  6. * description: honor to cly.
  7. */
  8. #ifndef __MODCHECK_H__
  9. #define __MODCHECK_H__
  10. #pragma once
  11. #include "config.h"
  12. #if defined(_MSC_VER)
  13. #include<Windows.h>
  14. #else
  15. #include <winpr/wtypes.h>
  16. #endif //_MSC_VER
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. #define HPRINTF_BUFFER_SIZE (8*1024) // must be at least 2048
  21. typedef struct
  22. {
  23. /*
  24. rtp.c
  25. static LARGE_INTEGER base_time;
  26. */
  27. LARGE_INTEGER base_time;
  28. /*
  29. log.c
  30. static logmgr_t *g_mgr = 0;
  31. static int g_initialized = 0;
  32. */
  33. void *g_mgr;
  34. int g_initialized;
  35. /*
  36. DumpException.c
  37. static CHAR hprintf_buffer[HPRINTF_BUFFER_SIZE]; // wvsprintf never prints more than one K.
  38. static int hprintf_index = 0;
  39. static CHAR szCrashID[20]; // Crash ID for sending to server
  40. */
  41. CHAR hprintf_buffer[HPRINTF_BUFFER_SIZE];
  42. int hprintf_index;
  43. CHAR szCrashID[20];
  44. }toolkitResource;
  45. toolkitResource* toolkit_getResource();
  46. BOOL toolkit_setAssign(void *assign);
  47. BOOL toolkit_setThreadGroupByAssign(void *assign);
  48. //create or recreate modInfo object bcz live in singleton format
  49. TOOLKIT_API BOOL toolkit_CreateModuleInfo(const char *name);
  50. //whether the thread belongs to mod<name>
  51. TOOLKIT_API BOOL toolkit_checkThreadInName(DWORD threadId, const char *name);
  52. //destroy mod<name>
  53. TOOLKIT_API BOOL toolkit_DestoryModuleInfo(const char *name);
  54. //insert thread information into list under mod named <name>
  55. TOOLKIT_API BOOL toolkit_SetthreadGroup(DWORD threadId, const char *name);
  56. //kill the threads unser mod<name> except <exceptThreadId>
  57. TOOLKIT_API BOOL toolkit_TerminateThreadExcept(DWORD exceptThreadId, const char *name);
  58. #ifdef __cplusplus
  59. } // extern "C" {
  60. #endif
  61. #endif //__SHM_H__