コード例 #1
0
ファイル: IPCBus.cs プロジェクト: Glimmers/PosixSharp
        public IPCBus(string path)
        {
            _downstream = new System.IO.Pipes.NamedPipeClientStream("com.h3m3.posix.sockets." + System.Diagnostics.Process.GetCurrentProcess().Id);
            _upstream   = new System.IO.Pipes.NamedPipeServerStream("com.h3m3.posix.sockets.SockServ");
            System.IO.Pipes.PipeSecurity downstreamACL = new System.IO.Pipes.PipeSecurity();

            downstreamACL.AddAccessRule(new System.IO.Pipes.PipeAccessRule(Environment.UserName, System.IO.Pipes.PipeAccessRights.FullControl, System.Security.AccessControl.AccessControlType.Allow));

            _downstream.SetAccessControl(downstreamACL);
        }
コード例 #2
0
        private static System.IO.Pipes.NamedPipeServerStream GetPipeServer(string aPipeName, System.IO.Pipes.PipeDirection aDir)
        {
            //Get "Everyone" for localized OS: http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/0737f978-a998-453d-9a6a-c348285d7ea3/
            System.Security.Principal.SecurityIdentifier sid = new System.Security.Principal.SecurityIdentifier(System.Security.Principal.WellKnownSidType.WorldSid, null);
            System.Security.Principal.NTAccount acct = sid.Translate(typeof(System.Security.Principal.NTAccount)) as System.Security.Principal.NTAccount;

            System.IO.Pipes.PipeSecurity ps = new System.IO.Pipes.PipeSecurity();
            System.IO.Pipes.PipeAccessRule par = new System.IO.Pipes.PipeAccessRule(acct,
                System.IO.Pipes.PipeAccessRights.ReadWrite,
                System.Security.AccessControl.AccessControlType.Allow);
            ps.AddAccessRule(par);
            return new System.IO.Pipes.NamedPipeServerStream(aPipeName, aDir, 1,
                System.IO.Pipes.PipeTransmissionMode.Message,
                System.IO.Pipes.PipeOptions.None, 4096, 4096, ps);
        }
コード例 #3
0
ファイル: MyServer.cs プロジェクト: Joebu/NamedPipeWrapper
        public MyServer(string pipeName)
        {
            var rule     = new System.IO.Pipes.PipeAccessRule("Everyone", System.IO.Pipes.PipeAccessRights.FullControl, System.Security.AccessControl.AccessControlType.Allow);
            var security = new System.IO.Pipes.PipeSecurity();

            security.AddAccessRule(rule);
            var server = new NamedPipeServer <MyMessage>(pipeName, security);

            server.ClientConnected    += OnClientConnected;
            server.ClientDisconnected += OnClientDisconnected;
            server.ClientMessage      += OnClientMessage;
            server.Error += OnError;
            server.Start();
            while (KeepRunning)
            {
                // Do nothing - wait for user to press 'q' key
            }
            server.Stop();
        }
コード例 #4
0
 public static void SetAccessControl(this System.IO.Pipes.PipeStream stream, System.IO.Pipes.PipeSecurity pipeSecurity)
 {
 }
コード例 #5
0
ファイル: PipeServer.cs プロジェクト: ZlayaZhaba/XervBackup
            private System.IO.Pipes.NamedPipeServerStream GetPipeServer(System.IO.Pipes.PipeDirection aDir)
            {
                System.IO.Pipes.PipeSecurity ps = new System.IO.Pipes.PipeSecurity();
                System.IO.Pipes.PipeAccessRule par = new System.IO.Pipes.PipeAccessRule("Everyone",
                    System.IO.Pipes.PipeAccessRights.ReadWrite,
                    System.Security.AccessControl.AccessControlType.Allow);
                ps.AddAccessRule(par);

                return new System.IO.Pipes.NamedPipeServerStream("XervBackup.Pipe." + aDir.ToString(),
                    aDir, 1,
                    System.IO.Pipes.PipeTransmissionMode.Message,
                    System.IO.Pipes.PipeOptions.Asynchronous, 4096, 4096, ps);
            }
コード例 #6
0
 public static System.IO.Pipes.NamedPipeServerStream Create(string pipeName, System.IO.Pipes.PipeDirection direction, int maxNumberOfServerInstances, System.IO.Pipes.PipeTransmissionMode transmissionMode, System.IO.Pipes.PipeOptions options, int inBufferSize, int outBufferSize, System.IO.Pipes.PipeSecurity pipeSecurity, System.IO.HandleInheritability inheritability = System.IO.HandleInheritability.None, System.IO.Pipes.PipeAccessRights additionalAccessRights = default)
 {
     throw null;
 }
コード例 #7
0
 public static System.IO.Pipes.AnonymousPipeServerStream Create(System.IO.Pipes.PipeDirection direction, System.IO.HandleInheritability inheritability, int bufferSize, System.IO.Pipes.PipeSecurity pipeSecurity)
 {
     throw null;
 }