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.

129 lines
3.2 KiB

  1. /* command.h - This file has all the defines and data structures needed
  2. * for command.com/command.dll communication.
  3. *
  4. * Sudeepb 17-Sep-1991 Created
  5. */
  6. /* ASM
  7. include bop.inc
  8. CMDSVC macro func
  9. BOP BOP_CMD
  10. db func
  11. endm
  12. */
  13. #define SVC_CMDEXITVDM 0
  14. #define SVC_CMDGETNEXTCMD 1
  15. #define SVC_CMDCOMSPEC 2
  16. #define SVC_CMDSAVEWORLD 3
  17. #define SVC_CMDGETCURDIR 4
  18. #define SVC_CMDSETINFO 5
  19. #define SVC_GETSTDHANDLE 6
  20. #define SVC_CMDCHECKBINARY 7
  21. #define SVC_CMDEXEC 8
  22. #define SVC_CMDINITCONSOLE 9
  23. #define SVC_EXECCOMSPEC32 10
  24. #define SVC_RETURNEXITCODE 11
  25. #define SVC_GETCONFIGSYS 12
  26. #define SVC_GETAUTOEXECBAT 13
  27. #define SVC_GETKBDLAYOUT 14
  28. #define SVC_GETINITENVIRONMENT 15
  29. #define SVC_GETSTARTINFO 16
  30. #define SVC_SETWINTITLE 17
  31. #define SVC_GETCURSORPOS 30
  32. #define SVC_CMDLASTSVC 31
  33. #define ALL_HANDLES 7
  34. #define HANDLE_STDIN 0
  35. #define HANDLE_STDOUT 1
  36. #define HANDLE_STDERR 2
  37. #define MASK_STDIN 1
  38. #define MASK_STDOUT 2
  39. #define MASK_STDERR 4
  40. // define extention type for command.com.
  41. // these value must be in sync with 16bits. Please refer to
  42. // tmisc1.asm in mvdm\dos\v86\cmd\command
  43. #define BAD_EXTENTION 0 // never returned from 32 bits
  44. #define BAT_EXTENTION 2
  45. #define EXE_EXTENTION 4
  46. #define COM_EXTENTION 8
  47. #define MAX_STD_EXTENTION COM_EXTENTION
  48. // THIS VALUE IS VERY IMPORTANT.
  49. // 0(zero) means there is no such a program file and command.com would spit out
  50. // well-known "bad command or file name".
  51. // Give it to any value larger than than MAX_STD_EXTENTION) makes command.com
  52. // by-passing any other checking and passing down the program file as is
  53. // to DOS which doesn't have tight executable file extention convention.
  54. // The reason that we allow program file with "non-standard" extention to
  55. // pass through command.com and reach DOS is we receive the program pathname
  56. // from CreateProcess which doesn't limit any file extention.
  57. //
  58. #define UNKNOWN_EXTENTION MAX_STD_EXTENTION + 1
  59. /* XLATOFF */
  60. typedef struct _SAVEWORLD {
  61. USHORT ax;
  62. USHORT bx;
  63. USHORT cx;
  64. USHORT dx;
  65. USHORT cs;
  66. USHORT ss;
  67. USHORT ds;
  68. USHORT es;
  69. USHORT si;
  70. USHORT di;
  71. USHORT bp;
  72. USHORT sp;
  73. USHORT ip;
  74. USHORT flag;
  75. ULONG ImageSize;
  76. } SAVEWORLD, *PSAVEWORLD;
  77. extern VOID CMDInit (VOID);
  78. extern BOOL CMDRebootVDM (void);
  79. extern BOOL fEnableInt10;
  80. /* XLATON */
  81. /** CMDINFO - Communication record of command.com **/
  82. /* XLATOFF */
  83. #pragma pack(2)
  84. /* XLATON */
  85. typedef struct _CMDINFO { /**/
  86. USHORT EnvSeg;
  87. USHORT EnvSize;
  88. USHORT CurDrive;
  89. USHORT NumDrives;
  90. USHORT CmdLineSeg;
  91. USHORT CmdLineOff;
  92. USHORT CmdLineSize;
  93. USHORT ReturnCode;
  94. USHORT bStdHandles;
  95. ULONG pRdrInfo;
  96. USHORT CodePage;
  97. USHORT fTSRExit;
  98. USHORT fBatStatus;
  99. USHORT ExecPathSeg;
  100. USHORT ExecPathOff;
  101. USHORT ExecPathSize;
  102. USHORT ExecExtType;
  103. } CMDINFO;
  104. typedef CMDINFO UNALIGNED *PCMDINFO;
  105. /* XLATOFF */
  106. #pragma pack()
  107. /* XLATON */
  108. BOOL CmdDispatch (ULONG);