WorkstationInfo101.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
  2. *
  3. * You can redistribute this program and/or modify it under the terms of
  4. * the GNU Lesser Public License as published by the Free Software Foundation,
  5. * either version 3 of the License, or (at your option) any later version.
  6. */
  7. using System;
  8. using System.Collections.Generic;
  9. using System.Text;
  10. using SMBLibrary.RPC;
  11. namespace SMBLibrary.Services
  12. {
  13. /// <summary>
  14. /// [MS-WKST] WKSTA_INFO_101
  15. /// </summary>
  16. public class WorkstationInfo101 : WorkstationInfoLevel
  17. {
  18. public uint PlatformID;
  19. public NDRUnicodeString ComputerName;
  20. public NDRUnicodeString LanGroup;
  21. public uint VerMajor;
  22. public uint VerMinor;
  23. public NDRUnicodeString LanRoot;
  24. public WorkstationInfo101()
  25. {
  26. ComputerName = new NDRUnicodeString();
  27. LanGroup = new NDRUnicodeString();
  28. LanRoot = new NDRUnicodeString();
  29. }
  30. public WorkstationInfo101(NDRParser parser)
  31. {
  32. Read(parser);
  33. }
  34. public override void Read(NDRParser parser)
  35. {
  36. parser.BeginStructure();
  37. PlatformID = parser.ReadUInt32();
  38. parser.ReadEmbeddedStructureFullPointer(ref ComputerName);
  39. parser.ReadEmbeddedStructureFullPointer(ref LanGroup);
  40. VerMajor = parser.ReadUInt32();
  41. VerMinor = parser.ReadUInt32();
  42. parser.ReadEmbeddedStructureFullPointer(ref LanRoot);
  43. parser.EndStructure();
  44. }
  45. public override void Write(NDRWriter writer)
  46. {
  47. writer.BeginStructure();
  48. writer.WriteUInt32(PlatformID);
  49. writer.WriteEmbeddedStructureFullPointer(ComputerName);
  50. writer.WriteEmbeddedStructureFullPointer(LanGroup);
  51. writer.WriteUInt32(VerMajor);
  52. writer.WriteUInt32(VerMinor);
  53. writer.WriteEmbeddedStructureFullPointer(LanRoot);
  54. writer.EndStructure();
  55. }
  56. public override uint Level
  57. {
  58. get
  59. {
  60. return 101;
  61. }
  62. }
  63. }
  64. }