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.

61 lines
1.8 KiB

  1. #ifndef _PSTAT_INCLUDED_
  2. #define _PSTAT_INCLUDED_
  3. #define MAX_EVENTS 2
  4. #define MAX_THUNK_COUNTERS 64
  5. #define MAX_PROCESSORS 32
  6. #define PSTAT_READ_STATS CTL_CODE (FILE_DEVICE_UNKNOWN, 0, METHOD_NEITHER, FILE_ANY_ACCESS)
  7. #define PSTAT_SET_CESR CTL_CODE (FILE_DEVICE_UNKNOWN, 1, METHOD_NEITHER, FILE_ANY_ACCESS)
  8. #define PSTAT_HOOK_THUNK CTL_CODE (FILE_DEVICE_UNKNOWN, 2, METHOD_NEITHER, FILE_ANY_ACCESS)
  9. #define PSTAT_REMOVE_HOOK CTL_CODE (FILE_DEVICE_UNKNOWN, 3, METHOD_NEITHER, FILE_ANY_ACCESS)
  10. #define PSTAT_QUERY_EVENTS CTL_CODE (FILE_DEVICE_UNKNOWN, 4, METHOD_NEITHER, FILE_ANY_ACCESS)
  11. #define OFFSET(type, field) ((LONG)(&((type *)0)->field))
  12. //
  13. //
  14. //
  15. typedef struct {
  16. ULONGLONG Counters[MAX_EVENTS];
  17. ULONG EventId[MAX_EVENTS];
  18. ULONGLONG TSC;
  19. ULONG reserved;
  20. ULONG SpinLockAcquires;
  21. ULONG SpinLockCollisions;
  22. ULONG SpinLockSpins;
  23. ULONG Irqls;
  24. ULONG ThunkCounters[MAX_THUNK_COUNTERS];
  25. } PSTATS, *pPSTATS;
  26. typedef struct {
  27. ULONG EventId;
  28. BOOLEAN Active;
  29. BOOLEAN UserMode;
  30. BOOLEAN KernelMode;
  31. BOOLEAN EdgeDetect;
  32. ULONG AppReserved;
  33. ULONG reserved;
  34. } SETEVENT, *PSETEVENT;
  35. typedef struct {
  36. PUCHAR SourceModule;
  37. ULONG ImageBase;
  38. PUCHAR TargetModule;
  39. PUCHAR Function;
  40. ULONG TracerId;
  41. } HOOKTHUNK, *PHOOKTHUNK;
  42. typedef struct {
  43. ULONG EventId;
  44. KPROFILE_SOURCE ProfileSource;
  45. ULONG DescriptionOffset;
  46. ULONG SuggestedIntervalBase;
  47. UCHAR Buffer[];
  48. } EVENTID, *PEVENTID;
  49. #endif /* _PSTAT_INCLUDED */