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.

93 lines
2.7 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. (WmipProcessHeap || !GlobalCounter ) && \
  29. WmipProcessHeap != 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 WmipProcessHeap;
  39. __int64
  40. WmipGetCycleCount();
  41. void
  42. ReleaseBufferLocation(PTHREAD_LOCAL_DATA pThreadLocalData);
  43. NTSTATUS
  44. AcquireBufferLocation(PVOID *pEvent, PPTHREAD_LOCAL_DATA pThreadLocalData, PUSHORT ReqSize);
  45. typedef struct _NTDLL_EVENT_COMMON {
  46. PVOID Handle; //Handle of Heap
  47. }NTDLL_EVENT_COMMON, *PNTDLL_EVENT_COMMON;
  48. typedef struct _NTDLL_EVENT_HANDLES {
  49. RTL_CRITICAL_SECTION CriticalSection; //Critical section
  50. ULONG dwTlsIndex; //TLS Index
  51. TRACEHANDLE hRegistrationHandle; //Registration Handle used for Unregistration.
  52. TRACEHANDLE hLoggerHandle; //Handle to Trace Logger
  53. PTHREAD_LOCAL_DATA pThreadListHead; //Link List that contains all threads info invovled in tracing.
  54. }NTDLL_EVENT_HANDLES, *PNTDLL_EVENT_HANDLES, **PPNTDLL_EVENT_HANDLES;
  55. extern LONG TraceLevel;
  56. extern PNTDLL_EVENT_HANDLES NtdllTraceHandles;
  57. extern RTL_CRITICAL_SECTION UMLogCritSect;
  58. extern RTL_CRITICAL_SECTION PMCritSect;
  59. extern RTL_CRITICAL_SECTION LoaderLock;
  60. #endif //_NTDLL_WMI_TRACE_