SmbComOpenAndXResponse.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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 SmbComOpenAndXResponse : AndXServerMessageBlock
  20. {
  21. internal int Fid;
  22. internal int FileAttributes;
  23. internal int DataSize;
  24. internal int GrantedAccess;
  25. internal int FileType;
  26. internal int DeviceState;
  27. internal int Action;
  28. internal int ServerFid;
  29. internal long LastWriteTime;
  30. internal override int WriteParameterWordsWireFormat(byte[] dst, int dstIndex)
  31. {
  32. return 0;
  33. }
  34. internal override int WriteBytesWireFormat(byte[] dst, int dstIndex)
  35. {
  36. return 0;
  37. }
  38. internal override int ReadParameterWordsWireFormat(byte[] buffer, int bufferIndex)
  39. {
  40. int start = bufferIndex;
  41. Fid = ReadInt2(buffer, bufferIndex);
  42. bufferIndex += 2;
  43. FileAttributes = ReadInt2(buffer, bufferIndex);
  44. bufferIndex += 2;
  45. LastWriteTime = ReadUTime(buffer, bufferIndex);
  46. bufferIndex += 4;
  47. DataSize = ReadInt4(buffer, bufferIndex);
  48. bufferIndex += 4;
  49. GrantedAccess = ReadInt2(buffer, bufferIndex);
  50. bufferIndex += 2;
  51. FileType = ReadInt2(buffer, bufferIndex);
  52. bufferIndex += 2;
  53. DeviceState = ReadInt2(buffer, bufferIndex);
  54. bufferIndex += 2;
  55. Action = ReadInt2(buffer, bufferIndex);
  56. bufferIndex += 2;
  57. ServerFid = ReadInt4(buffer, bufferIndex);
  58. bufferIndex += 6;
  59. return bufferIndex - start;
  60. }
  61. internal override int ReadBytesWireFormat(byte[] buffer, int bufferIndex)
  62. {
  63. return 0;
  64. }
  65. public override string ToString()
  66. {
  67. return "SmbComOpenAndXResponse["
  68. + base.ToString()
  69. + ",fid=" + Fid
  70. + ",fileAttributes=" + FileAttributes
  71. + ",lastWriteTime=" + LastWriteTime
  72. + ",dataSize=" + DataSize
  73. + ",grantedAccess=" + GrantedAccess
  74. + ",fileType=" + FileType
  75. + ",deviceState=" + DeviceState
  76. + ",action=" + Action
  77. + ",serverFid=" + ServerFid + "]";
  78. }
  79. }
  80. }