TransTransactNamedPipeResponse.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. using SharpCifs.Util.Sharpen;
  18. namespace SharpCifs.Smb
  19. {
  20. internal class TransTransactNamedPipeResponse : SmbComTransactionResponse
  21. {
  22. private SmbNamedPipe _pipe;
  23. internal TransTransactNamedPipeResponse(SmbNamedPipe pipe)
  24. {
  25. this._pipe = pipe;
  26. }
  27. internal override int WriteSetupWireFormat(byte[] dst, int dstIndex)
  28. {
  29. return 0;
  30. }
  31. internal override int WriteParametersWireFormat(byte[] dst, int dstIndex)
  32. {
  33. return 0;
  34. }
  35. internal override int WriteDataWireFormat(byte[] dst, int dstIndex)
  36. {
  37. return 0;
  38. }
  39. internal override int ReadSetupWireFormat(byte[] buffer, int bufferIndex, int len
  40. )
  41. {
  42. return 0;
  43. }
  44. internal override int ReadParametersWireFormat(byte[] buffer, int bufferIndex, int
  45. len)
  46. {
  47. return 0;
  48. }
  49. internal override int ReadDataWireFormat(byte[] buffer, int bufferIndex, int len)
  50. {
  51. if (_pipe.PipeIn != null)
  52. {
  53. TransactNamedPipeInputStream @in = (TransactNamedPipeInputStream)_pipe.PipeIn;
  54. lock (@in.Lock)
  55. {
  56. @in.Receive(buffer, bufferIndex, len);
  57. Runtime.Notify(@in.Lock);
  58. }
  59. }
  60. return len;
  61. }
  62. public override string ToString()
  63. {
  64. return "TransTransactNamedPipeResponse[" + base.ToString() + "]";
  65. }
  66. }
  67. }