TransPeekNamedPipeResponse.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. // This code is derived from jcifs smb client library <jcifs at samba dot org>
  2. // Ported by J. Arturo <webmaster at komodosoft dot net>
  3. //
  4. // This library is free software; you can redistribute it and/or
  5. // modify it under the terms of the GNU Lesser General Public
  6. // License as published by the Free Software Foundation; either
  7. // version 2.1 of the License, or (at your option) any later version.
  8. //
  9. // This library is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. // Lesser General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Lesser General Public
  15. // License along with this library; if not, write to the Free Software
  16. // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. namespace SharpCifs.Smb
  18. {
  19. internal class TransPeekNamedPipeResponse : SmbComTransactionResponse
  20. {
  21. private SmbNamedPipe _pipe;
  22. private int _head;
  23. internal const int StatusDisconnected = 1;
  24. internal const int StatusListening = 2;
  25. internal const int StatusConnectionOk = 3;
  26. internal const int StatusServerEndClosed = 4;
  27. internal int status;
  28. internal int Available;
  29. internal TransPeekNamedPipeResponse(SmbNamedPipe pipe)
  30. {
  31. this._pipe = pipe;
  32. }
  33. internal override int WriteSetupWireFormat(byte[] dst, int dstIndex)
  34. {
  35. return 0;
  36. }
  37. internal override int WriteParametersWireFormat(byte[] dst, int dstIndex)
  38. {
  39. return 0;
  40. }
  41. internal override int WriteDataWireFormat(byte[] dst, int dstIndex)
  42. {
  43. return 0;
  44. }
  45. internal override int ReadSetupWireFormat(byte[] buffer, int bufferIndex, int len
  46. )
  47. {
  48. return 0;
  49. }
  50. internal override int ReadParametersWireFormat(byte[] buffer, int bufferIndex, int
  51. len)
  52. {
  53. Available = ReadInt2(buffer, bufferIndex);
  54. bufferIndex += 2;
  55. _head = ReadInt2(buffer, bufferIndex);
  56. bufferIndex += 2;
  57. status = ReadInt2(buffer, bufferIndex);
  58. return 6;
  59. }
  60. internal override int ReadDataWireFormat(byte[] buffer, int bufferIndex, int len)
  61. {
  62. return 0;
  63. }
  64. public override string ToString()
  65. {
  66. return "TransPeekNamedPipeResponse[" + base.ToString() + "]";
  67. }
  68. }
  69. }