12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- /* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
- *
- * You can redistribute this program and/or modify it under the terms of
- * the GNU Lesser Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- */
- using System;
- using System.Collections.Generic;
- using System.Text;
- using SMBLibrary.RPC;
- using Utilities;
- namespace SMBLibrary.Services
- {
- /// <summary>
- /// [MS-SRVS] SHARE_INFO_1_CONTAINER
- /// </summary>
- public class ShareInfo1Container : IShareInfoContainer
- {
- public NDRConformantArray<ShareInfo1Entry> Entries;
- public ShareInfo1Container()
- {
- }
- public ShareInfo1Container(NDRParser parser)
- {
- Read(parser);
- }
- public void Read(NDRParser parser)
- {
- parser.BeginStructure();
- uint count = parser.ReadUInt32();
- parser.ReadEmbeddedStructureFullPointer<NDRConformantArray<ShareInfo1Entry>>(ref Entries);
- parser.EndStructure();
- }
- public void Write(NDRWriter writer)
- {
- writer.BeginStructure();
- writer.WriteUInt32((uint)this.Count);
- writer.WriteEmbeddedStructureFullPointer(Entries);
- writer.EndStructure();
- }
- public uint Level
- {
- get
- {
- return 1;
- }
- }
- public int Count
- {
- get
- {
- if (Entries != null)
- {
- return Entries.Count;
- }
- else
- {
- return 0;
- }
- }
- }
- public void Add(ShareInfo1Entry entry)
- {
- if (Entries == null)
- {
- Entries = new NDRConformantArray<ShareInfo1Entry>();
- }
- Entries.Add(entry);
- }
- }
- }
|