This class will allow a Java program to read and write data to Named Pipes and Transact NamedPipes.
This class will allow a Java program to read and write data to Named Pipes and Transact NamedPipes.

There are three Win32 function calls provided by the Windows SDK that are important in the context of using jCIFS. They are:

  • CallNamedPipe A message-type pipe call that opens, writes to, reads from, and closes the pipe in a single operation.
  • TransactNamedPipe A message-type pipe call that writes to and reads from an existing pipe descriptor in one operation.
  • CreateFile, ReadFile, WriteFile, and CloseFile A byte-type pipe can be opened, written to, read from and closed using the standard Win32 file operations.

The jCIFS API maps all of these operations into the standard Java XxxputStream interface. A special PIPE_TYPE flags is necessary to distinguish which type of Named Pipe behavior is desired.

SmbNamedPipe Constructor Examples
Code SampleDescription
 new SmbNamedPipe( "smb://server/IPC$/PIPE/foo", SmbNamedPipe.PIPE_TYPE_RDWR | SmbNamedPipe.PIPE_TYPE_CALL ); 
Open the Named Pipe foo for reading and writing. The pipe will behave like the CallNamedPipe interface.
 new SmbNamedPipe( "smb://server/IPC$/foo", SmbNamedPipe.PIPE_TYPE_RDWR | SmbNamedPipe.PIPE_TYPE_TRANSACT ); 
Open the Named Pipe foo for reading and writing. The pipe will behave like the TransactNamedPipe interface.
 new SmbNamedPipe( "smb://server/IPC$/foo", SmbNamedPipe.PIPE_TYPE_RDWR ); 
Open the Named Pipe foo for reading and writing. The pipe will behave as though the CreateFile, ReadFile, WriteFile, and CloseFile interface was being used.

See Using jCIFS to Connect to Win32 Named Pipes for a detailed description of how to use jCIFS with Win32 Named Pipe server processes.

Inheritance: SmbFile
 /// <exception cref="SharpCifs.Smb.SmbException"></exception>
 /// <exception cref="System.UriFormatException"></exception>
 /// <exception cref="UnknownHostException"></exception>
 internal TransactNamedPipeInputStream(SmbNamedPipe pipe) : base(pipe, (pipe.PipeType
                                                                        & unchecked ((int)(0xFFFF00FF))) | SmbFile.OExcl)
 {
     _dcePipe = (pipe.PipeType & SmbNamedPipe.PipeTypeDceTransact) != SmbNamedPipe
                .PipeTypeDceTransact;
     Lock = new object();
 }
Exemplo n.º 2
0
		/// <exception cref="UnknownHostException"></exception>
		/// <exception cref="System.UriFormatException"></exception>
		/// <exception cref="SharpCifs.Dcerpc.DcerpcException"></exception>
		public DcerpcPipeHandle(string url, NtlmPasswordAuthentication auth)
		{
			Binding = ParseBinding(url);
			url = "smb://" + Binding.Server + "/IPC$/" + Runtime.Substring(Binding.Endpoint
				, 6);
			string @params = string.Empty;
			string server;
			string address;
			server = (string)Binding.GetOption("server");
			if (server != null)
			{
				@params += "&server=" + server;
			}
			address = (string)Binding.GetOption("address");
			if (server != null)
			{
				@params += "&address=" + address;
			}
			if (@params.Length > 0)
			{
				url += "?" + Runtime.Substring(@params, 1);
			}
			Pipe = new SmbNamedPipe(url, (unchecked(0x2019F) << 16) | SmbNamedPipe.PipeTypeRdwr
				 | SmbNamedPipe.PipeTypeDceTransact, auth);
		}
		/// <exception cref="SharpCifs.Smb.SmbException"></exception>
		/// <exception cref="System.UriFormatException"></exception>
		/// <exception cref="UnknownHostException"></exception>
		internal TransactNamedPipeInputStream(SmbNamedPipe pipe) : base(pipe, (pipe.PipeType
			 & unchecked((int)(0xFFFF00FF))) | SmbFile.OExcl)
		{
			_dcePipe = (pipe.PipeType & SmbNamedPipe.PipeTypeDceTransact) != SmbNamedPipe
				.PipeTypeDceTransact;
			Lock = new object();
		}
 internal TransTransactNamedPipeResponse(SmbNamedPipe pipe)
 {
     this._pipe = pipe;
 }
		internal TransCallNamedPipeResponse(SmbNamedPipe pipe)
		{
			this._pipe = pipe;
		}
 internal TransCallNamedPipeResponse(SmbNamedPipe pipe)
 {
     this._pipe = pipe;
 }
		internal TransTransactNamedPipeResponse(SmbNamedPipe pipe)
		{
			this._pipe = pipe;
		}