NamedPipeShare.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* Copyright (C) 2014-2017 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.IO;
  10. using SMBLibrary.RPC;
  11. using SMBLibrary.Services;
  12. namespace SMBLibrary.Server
  13. {
  14. public class NamedPipeShare : ISMBShare
  15. {
  16. // A pipe share, as defined by the SMB Protocol, MUST always have the name "IPC$".
  17. public const string NamedPipeShareName = "IPC$";
  18. private NamedPipeStore m_store;
  19. public NamedPipeShare(List<string> shareList)
  20. {
  21. List<RemoteService> services = new List<RemoteService>();
  22. services.Add(new ServerService(Environment.MachineName, shareList));
  23. services.Add(new WorkstationService(Environment.MachineName, Environment.MachineName));
  24. m_store = new NamedPipeStore(services);
  25. }
  26. public string Name
  27. {
  28. get
  29. {
  30. return NamedPipeShareName;
  31. }
  32. }
  33. public INTFileStore FileStore
  34. {
  35. get
  36. {
  37. return m_store;
  38. }
  39. }
  40. }
  41. }