ServerInfo100.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. using Utilities;
  12. namespace SMBLibrary.Services
  13. {
  14. /// <summary>
  15. /// [MS-SRVS] SERVER_INFO_100
  16. /// </summary>
  17. public class ServerInfo100 : ServerInfoLevel
  18. {
  19. public PlatformName PlatformID;
  20. public NDRUnicodeString ServerName;
  21. public ServerInfo100()
  22. {
  23. ServerName = new NDRUnicodeString();
  24. }
  25. public ServerInfo100(NDRParser parser)
  26. {
  27. Read(parser);
  28. }
  29. public override void Read(NDRParser parser)
  30. {
  31. // If an array, structure, or union embeds a pointer, the representation of the referent of the
  32. // pointer is deferred to a position in the octet stream that follows the representation of the
  33. // embedding construction
  34. parser.BeginStructure();
  35. PlatformID = (PlatformName)parser.ReadUInt32();
  36. parser.ReadEmbeddedStructureFullPointer(ref ServerName);
  37. parser.EndStructure();
  38. }
  39. public override void Write(NDRWriter writer)
  40. {
  41. writer.BeginStructure();
  42. writer.WriteUInt32((uint)PlatformID);
  43. writer.WriteEmbeddedStructureFullPointer(ServerName);
  44. writer.EndStructure();
  45. }
  46. public override uint Level
  47. {
  48. get
  49. {
  50. return 100;
  51. }
  52. }
  53. }
  54. }