Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

211 lines
4.4 KiB

  1. /*++
  2. Copyright (c) 1998-2000 Microsoft Corporation
  3. Module Name:
  4. tracer.h
  5. Abstract:
  6. This module contains the global definitions of Tracer.
  7. Author:
  8. Michael Tsang (MikeTs) 02-May-2000
  9. Environment:
  10. User mode
  11. Revision History:
  12. --*/
  13. #ifndef _TRACER_H
  14. #define _TRACER_H
  15. //
  16. // Constants
  17. //
  18. #define ES_STD (WS_CHILD | WS_VSCROLL | WS_VISIBLE | \
  19. ES_MULTILINE | ES_READONLY)
  20. #define MAX_LEVELS 255
  21. // gdwfTracer flag values
  22. #define TF_UNTITLED 0x00000001
  23. #define TF_LINEWRAP 0x00000002
  24. #define TF_TERMINATING 0x80000000
  25. //
  26. // Macors
  27. //
  28. #define InitializeListHead(lh) ((lh)->Flink = (lh)->Blink = (lh))
  29. #define IsListEmpty(lh) ((lh)->Flink == (lh))
  30. #define RemoveHeadList(lh) (lh)->Flink; \
  31. {RemoveEntryList((lh)->Flink)}
  32. #define RemoveEntryList(e) { \
  33. (e)->Blink->Flink = (e)->Flink; \
  34. (e)->Flink->Blink = (e)->Blink; \
  35. }
  36. #define InsertTailList(lh,e) { \
  37. (e)->Flink = (lh); \
  38. (e)->Blink = (lh)->Blink; \
  39. (lh)->Blink->Flink = (e); \
  40. (lh)->Blink = (e); \
  41. }
  42. //
  43. // Type definitions
  44. //
  45. typedef struct _SRVREQ
  46. {
  47. LONG lRequest;
  48. PVOID Context;
  49. } SRVREQ, *PSRVREQ;
  50. typedef struct _CLIENT_ENTRY
  51. {
  52. CLIENTINFO ClientInfo;
  53. SRVREQ SrvReq;
  54. HANDLE hSrvReqEvent;
  55. HPROPSHEETPAGE hPage;
  56. SETTINGS TempSettings;
  57. TRIGPT TempTrigPts[NUM_TRIGPTS];
  58. LIST_ENTRY list;
  59. char szClientName[MAX_CLIENTNAME_LEN];
  60. } CLIENT_ENTRY, *PCLIENT_ENTRY;
  61. #define SRVREQ_NONE 0x00000000
  62. #define SRVREQ_BUSY 0x00000001
  63. #define SRVREQ_GETCLIENTINFO 0x00000002
  64. #define SRVREQ_SETCLIENTINFO 0x00000003
  65. #define SRVREQ_TERMINATE 0x00000004
  66. //
  67. // Global Data
  68. //
  69. extern HANDLE ghServerThread;
  70. extern HINSTANCE ghInstance;
  71. extern PSZ gpszWinTraceClass;
  72. extern HWND ghwndTracer;
  73. extern HWND ghwndEdit;
  74. extern HWND ghwndPropSheet;
  75. extern HFONT ghFont;
  76. extern HCURSOR ghStdCursor;
  77. extern HCURSOR ghWaitCursor;
  78. extern DWORD gdwfTracer;
  79. extern LIST_ENTRY glistClients;
  80. extern char gszApp[16];
  81. extern char gszSearchText[128];
  82. extern char gszFileName[MAX_PATH + 1];
  83. extern char gszSaveFilterSpec[80];
  84. extern int giPointSize;
  85. extern LOGFONT gLogFont;
  86. extern SETTINGS gDefGlobalSettings;
  87. extern const int gTrigPtCtrlMap[NUM_TRIGPTS];
  88. extern const int gTrigPtTraceMap[NUM_TRIGPTS];
  89. extern const int gTrigPtBreakMap[NUM_TRIGPTS];
  90. extern const int gTrigPtTextMap[NUM_TRIGPTS];
  91. extern const int gTrigPtTraceTextMap[NUM_TRIGPTS];
  92. extern const int gTrigPtBreakTextMap[NUM_TRIGPTS];
  93. //
  94. // Function prototypes
  95. //
  96. // tracer.c
  97. BOOL
  98. TracerInit(
  99. IN HINSTANCE hInstance,
  100. IN int nCmdShow
  101. );
  102. BOOL
  103. RegisterTracerClass(
  104. IN HINSTANCE hInstance
  105. );
  106. LRESULT CALLBACK
  107. TracerWndProc(
  108. IN HWND hwnd,
  109. IN UINT uiMsg,
  110. IN WPARAM wParam,
  111. IN LPARAM lParam
  112. );
  113. LRESULT
  114. TracerCmdProc(
  115. IN HWND hwnd,
  116. IN WPARAM wParam,
  117. IN LPARAM lParam
  118. );
  119. INT_PTR APIENTRY
  120. GlobalSettingsDlgProc(
  121. IN HWND hwnd,
  122. IN UINT uiMsg,
  123. IN WPARAM wParam,
  124. IN LPARAM lParam
  125. );
  126. INT_PTR APIENTRY
  127. ClientSettingsDlgProc(
  128. IN HWND hwnd,
  129. IN UINT uiMsg,
  130. IN WPARAM wParam,
  131. IN LPARAM lParam
  132. );
  133. VOID
  134. EnableTrigPts(
  135. IN HWND hDlg,
  136. IN BOOL fEnable
  137. );
  138. BOOL
  139. SaveFile(
  140. IN HWND hwndParent,
  141. IN PSZ pszFileName,
  142. IN BOOL fSaveAs
  143. );
  144. UINT
  145. CreatePropertyPages(
  146. OUT HPROPSHEETPAGE *hPages
  147. );
  148. VOID
  149. SetTitle(
  150. IN PSZ pszTitle OPTIONAL
  151. );
  152. int
  153. FindTrigPtIndex(
  154. IN int iID,
  155. IN const int *IDTable
  156. );
  157. int
  158. ErrorMsg(
  159. IN ULONG ErrCode,
  160. ...
  161. );
  162. // server.c
  163. VOID __cdecl
  164. ServerThread(
  165. PVOID pv
  166. );
  167. VOID
  168. SendServerRequest(
  169. IN PCLIENT_ENTRY ClientEntry,
  170. IN LONG lRequest,
  171. IN PVOID Context
  172. );
  173. LPSTR
  174. CopyStr(
  175. OUT LPSTR pszDest,
  176. IN LPCSTR pszSrc
  177. );
  178. #endif //ifndef _TRACER_H