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.

99 lines
1.6 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. proc.h
  5. Abstract:
  6. Definitions for dumping information about processes using the NT API
  7. rather than the win32 API.
  8. Environment:
  9. User mode only
  10. Revision History:
  11. 03-26-96 : Created
  12. --*/
  13. #pragma warning(disable:4200) // array[0]
  14. #pragma warning(disable:4201) // nameless struct/unions
  15. #pragma warning(disable:4214) // bit fields other than int
  16. #ifdef DBG
  17. #define dbg(x) x
  18. #define HELP_ME() printf("Reached line %4d\n", __LINE__);
  19. #else
  20. #define dbg(x) /* x */
  21. #define HELP_ME() /* printf("Reached line %4d\n", __LINE__); */
  22. #endif
  23. #define ARGUMENT_USED(x) (x == NULL)
  24. #define TEST_FLAG(Flags, Bit) ((Flags) & (Bit))
  25. typedef struct {
  26. ULONG Flag;
  27. PUCHAR Name;
  28. } FLAG_NAME, *PFLAG_NAME;
  29. #define FLAG_NAME(flag) {flag, #flag}
  30. typedef struct _COMMAND COMMAND, *PCOMMAND;
  31. struct _COMMAND {
  32. char *Name;
  33. char *Description;
  34. char *ExtendedHelp;
  35. DWORD (*Function)(PCOMMAND CommandEntry, int argc, char *argv[]);
  36. };
  37. extern COMMAND CommandArray[];
  38. VOID
  39. GetAllProcessInfo(
  40. VOID
  41. );
  42. VOID
  43. PrintProcessInfo(
  44. DWORD_PTR ProcessId
  45. );
  46. VOID
  47. FreeProcessInfo(
  48. VOID
  49. );
  50. DWORD
  51. QueryJobCommand(
  52. PCOMMAND commandEntry,
  53. int argc,
  54. char *argv[]
  55. );
  56. VOID
  57. xprintf(
  58. ULONG Depth,
  59. PTSTR Format,
  60. ...
  61. );
  62. VOID
  63. DumpFlags(
  64. ULONG Depth,
  65. PTSTR Name,
  66. ULONG Flags,
  67. PFLAG_NAME FlagTable
  68. );
  69. LPCTSTR
  70. TicksToString(
  71. LARGE_INTEGER TimeInTicks
  72. );