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.

200 lines
2.8 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. tc.c
  5. Abstract:
  6. Implementation of PSX termical control
  7. Author:
  8. Ellen Aycock-Wright (ellena) 05-Aug-1991
  9. Revision History:
  10. --*/
  11. #include "psxsrv.h"
  12. BOOLEAN
  13. PsxTcGetAttr (
  14. IN PPSX_PROCESS p,
  15. IN OUT PPSX_API_MSG m
  16. )
  17. {
  18. PPSX_TCGETATTR_MSG args;
  19. PFILEDESCRIPTOR Fd;
  20. args = &m->u.TcGetAttr;
  21. Fd = FdIndexToFd(p, args->FileDes);
  22. if (!Fd) {
  23. m->Error = EBADF;
  24. return TRUE;
  25. }
  26. if (&ConVectors == Fd->SystemOpenFileDesc->IoNode->IoVectors) {
  27. m->ReturnValue = 0;
  28. return TRUE;
  29. }
  30. m->Error = ENOTTY;
  31. return TRUE;
  32. }
  33. BOOLEAN
  34. PsxTcSetAttr (
  35. IN PPSX_PROCESS p,
  36. IN OUT PPSX_API_MSG m
  37. )
  38. {
  39. PPSX_TCSETATTR_MSG args;
  40. PFILEDESCRIPTOR Fd;
  41. args = &m->u.TcSetAttr;
  42. Fd = FdIndexToFd(p, args->FileDes);
  43. if (!Fd) {
  44. m->Error = EBADF;
  45. return TRUE;
  46. }
  47. if (&ConVectors == Fd->SystemOpenFileDesc->IoNode->IoVectors) {
  48. m->ReturnValue = 0;
  49. return TRUE;
  50. }
  51. m->Error = ENOTTY;
  52. return TRUE;
  53. }
  54. BOOLEAN
  55. PsxTcSendBreak (
  56. IN PPSX_PROCESS p,
  57. IN OUT PPSX_API_MSG m
  58. )
  59. {
  60. PPSX_TCSENDBREAK_MSG args;
  61. PFILEDESCRIPTOR Fd;
  62. args = &m->u.TcSendBreak;
  63. Fd = FdIndexToFd(p, args->FileDes);
  64. if (!Fd) {
  65. m->Error = EBADF;
  66. return TRUE;
  67. }
  68. m->Error = ENOTTY;
  69. return TRUE;
  70. }
  71. BOOLEAN
  72. PsxTcDrain (
  73. IN PPSX_PROCESS p,
  74. IN OUT PPSX_API_MSG m
  75. )
  76. {
  77. PPSX_TCDRAIN_MSG args;
  78. PFILEDESCRIPTOR Fd;
  79. args = &m->u.TcDrain;
  80. Fd = FdIndexToFd(p, args->FileDes);
  81. if (!Fd) {
  82. m->Error = EBADF;
  83. return TRUE;
  84. }
  85. m->Error = ENOTTY;
  86. return TRUE;
  87. }
  88. BOOLEAN
  89. PsxTcFlush (
  90. IN PPSX_PROCESS p,
  91. IN OUT PPSX_API_MSG m
  92. )
  93. {
  94. PPSX_TCFLUSH_MSG args;
  95. PFILEDESCRIPTOR Fd;
  96. args = &m->u.TcFlush;
  97. Fd = FdIndexToFd(p, args->FileDes);
  98. if (!Fd) {
  99. m->Error = EBADF;
  100. return TRUE;
  101. }
  102. m->Error = ENOTTY;
  103. return TRUE;
  104. }
  105. BOOLEAN
  106. PsxTcFlow (
  107. IN PPSX_PROCESS p,
  108. IN OUT PPSX_API_MSG m
  109. )
  110. {
  111. PPSX_TCFLOW_MSG args;
  112. PFILEDESCRIPTOR Fd;
  113. args = &m->u.TcFlow;
  114. Fd = FdIndexToFd(p, args->FileDes);
  115. if (!Fd) {
  116. m->Error = EBADF;
  117. return TRUE;
  118. }
  119. m->Error = ENOTTY;
  120. return TRUE;
  121. }
  122. BOOLEAN
  123. PsxTcGetPGrp (
  124. IN PPSX_PROCESS p,
  125. IN OUT PPSX_API_MSG m
  126. )
  127. {
  128. PPSX_TCGETPGRP_MSG args;
  129. PFILEDESCRIPTOR Fd;
  130. args = &m->u.TcGetPGrp;
  131. Fd = FdIndexToFd(p, args->FileDes);
  132. if (!Fd) {
  133. m->Error = EBADF;
  134. return TRUE;
  135. }
  136. m->Error = ENOTTY;
  137. return TRUE;
  138. }
  139. BOOLEAN
  140. PsxTcSetPGrp (
  141. IN PPSX_PROCESS p,
  142. IN OUT PPSX_API_MSG m
  143. )
  144. {
  145. PPSX_TCSETPGRP_MSG args;
  146. PFILEDESCRIPTOR Fd;
  147. args = &m->u.TcSetPGrp;
  148. Fd = FdIndexToFd(p, args->FileDes);
  149. if (!Fd) {
  150. m->Error = EBADF;
  151. return TRUE;
  152. }
  153. m->Error = ENOTTY;
  154. return TRUE;
  155. }