Source code of Windows XP (NT5)
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.

87 lines
2.5 KiB

  1. /*
  2. * cmddisp.c - SVC dispatch module of command
  3. *
  4. * Modification History:
  5. *
  6. * Sudeepb 17-Sep-1991 Created
  7. */
  8. #include "cmd.h"
  9. #include <cmdsvc.h>
  10. #include <softpc.h>
  11. //'cmdSetWinTitle' and 'cmdGetCursorPos' are not available in NON-DBCS builds.
  12. #ifndef DBCS
  13. #define cmdSetWinTitle cmdIllegalFunc
  14. #endif
  15. #ifndef NEC_98
  16. #define cmdGetCursorPos cmdIllegalFunc
  17. #endif
  18. PFNSVC apfnSVCCmd [] = {
  19. cmdExitVDM, //SVC_CMDEXITVDM
  20. cmdGetNextCmd, //SVC_CMDGETNEXTCMD
  21. cmdComSpec, //SVC_CMDCOMSPEC
  22. cmdSaveWorld, //SVC_CMDSAVEWORLD
  23. cmdGetCurrentDir, //SVC_CMDGETCURDIR
  24. cmdSetInfo, //SVC_CMDSETINFO
  25. cmdGetStdHandle, //SVC_GETSTDHANDLE
  26. cmdCheckBinary, //SVC_CMDCHECKBINARY
  27. cmdExec, //SVC_CMDEXEC
  28. cmdInitConsole, //SVC_CMDINITCONSOLE
  29. cmdExecComspec32, //SVC_EXECCOMSPEC32
  30. cmdReturnExitCode, //SVC_RETURNEXITCODE
  31. cmdGetConfigSys, //SVC_GETCONFIGSYS
  32. cmdGetAutoexecBat, //SVC_GETAUTOEXECBAT
  33. cmdGetKbdLayout, //SVC_GETKBDLAYOUT
  34. cmdGetInitEnvironment, //SVC_GETINITENVIRONMENT
  35. cmdGetStartInfo, //SVC_GETSTARTINFO
  36. cmdSetWinTitle, //SVC_CHANGEWINTITLE
  37. cmdIllegalFunc, // 18
  38. cmdIllegalFunc, // 19
  39. cmdIllegalFunc, // 20
  40. cmdIllegalFunc, // 21
  41. cmdIllegalFunc, // 22
  42. cmdIllegalFunc, // 23
  43. cmdIllegalFunc, // 24
  44. cmdIllegalFunc, // 25
  45. cmdIllegalFunc, // 26
  46. cmdIllegalFunc, // 27
  47. cmdIllegalFunc, // 28
  48. cmdIllegalFunc, // 29
  49. cmdGetCursorPos //SVC_GETCURSORPOS
  50. };
  51. /* cmdDispatch - Dispatch SVC call to right command handler.
  52. *
  53. * Entry - iSvc (SVC byte following SVCop)
  54. *
  55. * Exit - None
  56. *
  57. */
  58. BOOL CmdDispatch (ULONG iSvc)
  59. {
  60. #if DBG
  61. if (iSvc >= SVC_CMDLASTSVC){
  62. DbgPrint("Unimplemented SVC index for COMMAND %x\n",iSvc);
  63. setCF(1);
  64. return FALSE;
  65. }
  66. #endif
  67. (apfnSVCCmd [iSvc])();
  68. return TRUE;
  69. }
  70. BOOL cmdIllegalFunc ()
  71. {
  72. #if DBG
  73. DbgPrint("Unimplemented SVC index for COMMAND\n");
  74. #endif
  75. setCF(1);
  76. return FALSE;
  77. }