SmbComNtTransactionResponse.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 abstract class SmbComNtTransactionResponse : SmbComTransactionResponse
  20. {
  21. internal override int ReadParameterWordsWireFormat(byte[] buffer, int bufferIndex
  22. )
  23. {
  24. int start = bufferIndex;
  25. buffer[bufferIndex++] = unchecked(unchecked(0x00));
  26. // Reserved
  27. buffer[bufferIndex++] = unchecked(unchecked(0x00));
  28. // Reserved
  29. buffer[bufferIndex++] = unchecked(unchecked(0x00));
  30. // Reserved
  31. TotalParameterCount = ReadInt4(buffer, bufferIndex);
  32. if (BufDataStart == 0)
  33. {
  34. BufDataStart = TotalParameterCount;
  35. }
  36. bufferIndex += 4;
  37. TotalDataCount = ReadInt4(buffer, bufferIndex);
  38. bufferIndex += 4;
  39. ParameterCount = ReadInt4(buffer, bufferIndex);
  40. bufferIndex += 4;
  41. ParameterOffset = ReadInt4(buffer, bufferIndex);
  42. bufferIndex += 4;
  43. ParameterDisplacement = ReadInt4(buffer, bufferIndex);
  44. bufferIndex += 4;
  45. DataCount = ReadInt4(buffer, bufferIndex);
  46. bufferIndex += 4;
  47. DataOffset = ReadInt4(buffer, bufferIndex);
  48. bufferIndex += 4;
  49. DataDisplacement = ReadInt4(buffer, bufferIndex);
  50. bufferIndex += 4;
  51. SetupCount = buffer[bufferIndex] & unchecked(0xFF);
  52. bufferIndex += 2;
  53. if (SetupCount != 0)
  54. {
  55. if (Log.Level >= 3)
  56. {
  57. Log.WriteLine("setupCount is not zero: " + SetupCount);
  58. }
  59. }
  60. return bufferIndex - start;
  61. }
  62. }
  63. }