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.

120 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. cmd.c
  5. Abstract:
  6. This module contains the routines for handling each command.
  7. Author:
  8. Sean Selitrennikoff (v-seans) - Dec 2, 1999
  9. Brian Guarraci (briangu)
  10. Revision History:
  11. --*/
  12. #include "sac.h"
  13. #include <ntddip.h>
  14. #include <ntddtcp.h>
  15. #include <tdiinfo.h>
  16. #include <ipinfo.h>
  17. #include <stdlib.h>
  18. BOOLEAN GlobalPagingNeeded = TRUE;
  19. BOOLEAN GlobalDoThreads = FALSE;
  20. // For the APC routines, a global value is better :-)
  21. IO_STATUS_BLOCK GlobalIoStatusBlock;
  22. //
  23. // Global buffer
  24. //
  25. ULONG GlobalBufferSize = 0;
  26. char *GlobalBuffer = NULL;
  27. //
  28. // build a string table to express the reason enums
  29. // provided to use by the kernel.
  30. //
  31. // table is based on ntos\inc\ke.h _KTHREAD_STATE
  32. //
  33. // this table must be kept in sync with the _KTHREAD_STATE
  34. // enum table. Currently, there is no API that we can use
  35. // to obtain these strings, so we build our own table.
  36. //
  37. WCHAR *StateTable[] = {
  38. L"Initialized",
  39. L"Ready",
  40. L"Running",
  41. L"Standby",
  42. L"Terminated",
  43. L"Wait:",
  44. L"Transition",
  45. L"Unknown",
  46. L"Unknown",
  47. L"Unknown",
  48. L"Unknown",
  49. L"Unknown"
  50. };
  51. //
  52. // build a string table to express the reason enums
  53. // provided to use by the kernel.
  54. //
  55. // table is based on ntos\inc\ke.h _KWAIT_REASON
  56. //
  57. // NOTE/WARNING:
  58. //
  59. // this table must be kept in sync with the _KWAIT_REASON
  60. // enum table. Currently, there is no API that we can use
  61. // to obtain these strings, so we build our own table.
  62. //
  63. WCHAR *WaitTable[] = {
  64. L"Executive",
  65. L"FreePage",
  66. L"PageIn",
  67. L"PoolAllocation",
  68. L"DelayExecution",
  69. L"Suspended",
  70. L"UserRequest",
  71. L"WrExecutive",
  72. L"WrFreePage",
  73. L"WrPageIn",
  74. L"WrPoolAllocation",
  75. L"WrDelayExecution",
  76. L"WrSuspended",
  77. L"WrUserRequest",
  78. L"WrEventPair",
  79. L"WrQueue",
  80. L"WrLpcReceive",
  81. L"WrLpcReply",
  82. L"WrVirtualMemory",
  83. L"WrPageOut",
  84. L"WrRendezvous",
  85. L"Spare2",
  86. L"Spare3",
  87. L"Spare4",
  88. L"Spare5",
  89. L"Spare6",
  90. L"WrKernel",
  91. L"WrResource",
  92. L"WrPushLock",
  93. L"WrMutex",
  94. L"WrQuantumEnd",
  95. L"WrDispatchInt",
  96. L"WrPreempted",
  97. L"WrYieldExecution",
  98. L"MaximumWaitReason"
  99. };
  100. WCHAR *Empty = L" ";