Leaked source code of windows server 2003
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.

97 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 1997-2000 Microsoft Corporation
  3. Module Name:
  4. NtdllTracer.h
  5. Abstract:
  6. This file contains structures and functions definitions used in Ntdll
  7. events tracing
  8. --*/
  9. #ifndef _NTDLL_WMI_TRACE_
  10. #define _NTDLL_WMI_TRACE_
  11. #define MEMORY_FROM_LOOKASIDE 1 //Activity from LookAside
  12. #define MEMORY_FROM_LOWFRAG 2 //Activity from Low Frag Heap
  13. #define MEMORY_FROM_MAINPATH 3 //Activity from Main Code Path
  14. #define MEMORY_FROM_SLOWPATH 4 //Activity from Slow Code Path
  15. #define LOG_LOOKASIDE 0x00000001 //Bit for LookAside trace
  16. #define FAILED_TLSINDEX -1
  17. #define MAX_PID 10
  18. #ifndef UserSharedData
  19. #define UserSharedData USER_SHARED_DATA
  20. #endif
  21. #define IsCritSecLogging(CriticalSection) ((USER_SHARED_DATA->TraceLogging & ENABLECRITSECTRACE) \
  22. && CriticalSection != &UMLogCritSect \
  23. && CriticalSection != &PMCritSect \
  24. && CriticalSection != &NtdllTraceHandles->CriticalSection)
  25. extern
  26. ULONG GlobalCounter;
  27. #define IsHeapLogging(HeapHandle) (USER_SHARED_DATA->TraceLogging & ENABLEHEAPTRACE && \
  28. (EtwpProcessHeap || !GlobalCounter ) && \
  29. EtwpProcessHeap != HeapHandle)
  30. typedef struct _THREAD_LOCAL_DATA THREAD_LOCAL_DATA, *PTHREAD_LOCAL_DATA, **PPTHREAD_LOCAL_DATA;
  31. typedef struct _THREAD_LOCAL_DATA {
  32. PTHREAD_LOCAL_DATA FLink; //Forward Link
  33. PTHREAD_LOCAL_DATA BLink; //Backward Link
  34. PWMI_BUFFER_HEADER pBuffer; //Pointer to thread buffer info.
  35. LONG ReferenceCount;
  36. } THREAD_LOCAL_DATA, *PTHREAD_LOCAL_DATA, **PPTHREAD_LOCAL_DATA;
  37. extern
  38. PVOID EtwpProcessHeap;
  39. #ifndef EtwpGetCycleCount
  40. __int64
  41. EtwpGetCycleCount();
  42. #endif // EtwpGetCycleCount
  43. void
  44. ReleaseBufferLocation(PTHREAD_LOCAL_DATA pThreadLocalData);
  45. NTSTATUS
  46. AcquireBufferLocation(PVOID *pEvent, PPTHREAD_LOCAL_DATA pThreadLocalData, PUSHORT ReqSize);
  47. typedef struct _NTDLL_EVENT_COMMON {
  48. PVOID Handle; //Handle of Heap
  49. }NTDLL_EVENT_COMMON, *PNTDLL_EVENT_COMMON;
  50. typedef struct _NTDLL_EVENT_HANDLES {
  51. RTL_CRITICAL_SECTION CriticalSection; //Critical section
  52. ULONG dwTlsIndex; //TLS Index
  53. TRACEHANDLE hRegistrationHandle; //Registration Handle used for Unregistration.
  54. TRACEHANDLE hLoggerHandle; //Handle to Trace Logger
  55. PTHREAD_LOCAL_DATA pThreadListHead; //Link List that contains all threads info invovled in tracing.
  56. }NTDLL_EVENT_HANDLES, *PNTDLL_EVENT_HANDLES, **PPNTDLL_EVENT_HANDLES;
  57. extern LONG TraceLevel;
  58. extern PNTDLL_EVENT_HANDLES NtdllTraceHandles;
  59. extern RTL_CRITICAL_SECTION UMLogCritSect;
  60. extern RTL_CRITICAL_SECTION PMCritSect;
  61. extern RTL_CRITICAL_SECTION LoaderLock;
  62. #endif //_NTDLL_WMI_TRACE_