modCheck.h 1.7 KB

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