TransPeekNamedPipe.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 TransPeekNamedPipe : SmbComTransaction
  20. {
  21. private int _fid;
  22. internal TransPeekNamedPipe(string pipeName, int fid)
  23. {
  24. Name = pipeName;
  25. this._fid = fid;
  26. Command = SmbComTransaction;
  27. SubCommand = TransPeekNamedPipe;
  28. Timeout = unchecked((int)(0xFFFFFFFF));
  29. MaxParameterCount = 6;
  30. MaxDataCount = 1;
  31. MaxSetupCount = unchecked(unchecked(0x00));
  32. SetupCount = 2;
  33. }
  34. internal override int WriteSetupWireFormat(byte[] dst, int dstIndex)
  35. {
  36. dst[dstIndex++] = SubCommand;
  37. dst[dstIndex++] = unchecked(unchecked(0x00));
  38. // this says "Transaction priority" in netmon
  39. WriteInt2(_fid, dst, dstIndex);
  40. return 4;
  41. }
  42. internal override int ReadSetupWireFormat(byte[] buffer, int bufferIndex, int len)
  43. {
  44. return 0;
  45. }
  46. internal override int WriteParametersWireFormat(byte[] dst, int dstIndex)
  47. {
  48. return 0;
  49. }
  50. internal override int WriteDataWireFormat(byte[] dst, int dstIndex)
  51. {
  52. return 0;
  53. }
  54. internal override int ReadParametersWireFormat(byte[] buffer,
  55. int bufferIndex,
  56. int len)
  57. {
  58. return 0;
  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 "TransPeekNamedPipe["
  67. + base.ToString()
  68. + ",pipeName=" + Name + "]";
  69. }
  70. }
  71. }