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.

48 lines
1.5 KiB

  1. extern HANDLE hEventLog; // handle to event log
  2. extern HANDLE hLibHeap; // dll heap
  3. extern SYSTEM_BASIC_INFORMATION BasicInfo;
  4. extern SYSTEM_PERFORMANCE_INFORMATION SysPerfInfo;
  5. extern LPWSTR wszTotal;
  6. extern DWORD dwObjOpenCount;
  7. extern DWORD dwCpuOpenCount;
  8. extern DWORD dwPageOpenCount;
  9. // perfos.c
  10. PM_QUERY_PROC QueryOsObjectData;
  11. // perfcach.c
  12. PM_LOCAL_COLLECT_PROC CollectCacheObjectData;
  13. // perfcpu.c
  14. PM_OPEN_PROC OpenProcessorObject;
  15. PM_LOCAL_COLLECT_PROC CollectProcessorObjectData;
  16. PM_CLOSE_PROC CloseProcessorObject;
  17. // perfmem.c
  18. PM_LOCAL_COLLECT_PROC CollectMemoryObjectData;
  19. // perfobj.c
  20. PM_OPEN_PROC OpenObjectsObject;
  21. PM_LOCAL_COLLECT_PROC CollectObjectsObjectData;
  22. PM_CLOSE_PROC CloseObjectsObject;
  23. // perfpage.c
  24. PM_OPEN_PROC OpenPageFileObject;
  25. PM_LOCAL_COLLECT_PROC CollectPageFileObjectData;
  26. PM_CLOSE_PROC ClosePageFileObject;
  27. // perfsys.c
  28. PM_OPEN_PROC OpenSystemObject;
  29. PM_LOCAL_COLLECT_PROC CollectSystemObjectData;
  30. PM_CLOSE_PROC CloseSystemObject;
  31. #ifdef DBG
  32. extern LONG64 clock0, clock1, freq, diff;
  33. #define TIME_LIMIT (LONG64) 250 // 250 msec
  34. #define STARTTIMING NtQueryPerformanceCounter((PLARGE_INTEGER) &clock0, NULL)
  35. #define ENDTIMING(x) NtQueryPerformanceCounter((PLARGE_INTEGER) &clock1, (PLARGE_INTEGER) &freq);\
  36. diff = (clock1 - clock0) / (freq / 1000); \
  37. if (diff > TIME_LIMIT) DbgPrint x ;
  38. #endif