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.

196 lines
3.1 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. Module Name:
  4. nullio.cpp
  5. Abstract:
  6. This module implements the NULL IoHandler.
  7. The purpose of this IoHandler is to provide a NULL
  8. channel for lockable IoHandlers. When the IoHandler
  9. is locked, the IoHandler client writes to a NULL device.
  10. Author:
  11. Brian Guarraci (briangu), 2001
  12. Revision History:
  13. --*/
  14. #include "nullio.h"
  15. CNullIoHandler::CNullIoHandler(
  16. VOID
  17. )
  18. /*++
  19. Routine Description:
  20. Constructor
  21. Arguments:
  22. None
  23. Return Value:
  24. N/A
  25. --*/
  26. {
  27. NOTHING;
  28. }
  29. CNullIoHandler::~CNullIoHandler(
  30. )
  31. /*++
  32. Routine Description:
  33. Destructor
  34. Arguments:
  35. N/A
  36. Return Value:
  37. N/A
  38. --*/
  39. {
  40. NOTHING;
  41. }
  42. BOOL
  43. CNullIoHandler::Write(
  44. IN PBYTE Buffer,
  45. IN ULONG BufferSize
  46. )
  47. /*++
  48. Routine Description:
  49. This routine impelements the write IoHandler operation.
  50. Arguments:
  51. Buffer - the data to send
  52. BufferSize - the size of the buffer in bytes
  53. Return Value:
  54. TRUE - success
  55. FALSE - otherwise
  56. --*/
  57. {
  58. UNREFERENCED_PARAMETER(Buffer);
  59. UNREFERENCED_PARAMETER(BufferSize);
  60. //
  61. // Do Nothing
  62. //
  63. return TRUE;
  64. }
  65. BOOL
  66. CNullIoHandler::Flush(
  67. VOID
  68. )
  69. /*++
  70. Routine Description:
  71. This routine implements the Flush IoHandler method.
  72. Arguments:
  73. None
  74. Return Value:
  75. TRUE - success
  76. FALSE - otherwise
  77. --*/
  78. {
  79. //
  80. // Do Nothing
  81. //
  82. return TRUE;
  83. }
  84. BOOL
  85. CNullIoHandler::Read(
  86. OUT PBYTE Buffer,
  87. IN ULONG BufferSize,
  88. OUT PULONG ByteCount
  89. )
  90. /*++
  91. Routine Description:
  92. This routine implements the Read IoHandler method.
  93. Arguments:
  94. Buffer - on success, contains the read data
  95. BufferSize - the size of the read buffer in bytes
  96. ByteCount - on success, contains the # of bytes read
  97. Return Value:
  98. TRUE - success
  99. FALSE - otherwise
  100. --*/
  101. {
  102. UNREFERENCED_PARAMETER(Buffer);
  103. UNREFERENCED_PARAMETER(BufferSize);
  104. //
  105. // No data was read
  106. //
  107. *ByteCount = 0;
  108. return TRUE;
  109. }
  110. BOOL
  111. CNullIoHandler::HasNewData(
  112. IN PBOOL InputWaiting
  113. )
  114. /*++
  115. Routine Description:
  116. This routine impelements the HasNewData IoHandler method.
  117. Arguments:
  118. InputWaiting - on success, contains the status of the channel's
  119. input buffer.
  120. Return Value:
  121. TRUE - success
  122. FALSE - otherwise
  123. --*/
  124. {
  125. //
  126. // There is no new data
  127. //
  128. *InputWaiting = FALSE;
  129. return TRUE;
  130. }