Imported Upstream version 5.0.0.42

Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-04-10 11:41:01 +00:00
parent 1190d13a04
commit 6bdd276d05
19939 changed files with 3099680 additions and 93811 deletions

View File

@@ -77,8 +77,8 @@ namespace System.IO.Pipes
throw new NotImplementedException ();
#else
InitializeHandle (safePipeHandle, false, false);
#endif
IsConnected = true;
#endif
}
~AnonymousPipeClientStream ()

View File

@@ -120,8 +120,10 @@ namespace System.IO.Pipes
~NamedPipeClientStream () {
Dispose (false);
}
#if !MOBILE
INamedPipeClient impl;
#endif
public void Connect ()
{
@@ -172,7 +174,11 @@ namespace System.IO.Pipes
public int NumberOfServerInstances {
get {
CheckPipePropertyOperations ();
#if MOBILE
throw new NotImplementedException ();
#else
return impl.NumberOfServerInstances;
#endif
}
}
}

View File

@@ -97,11 +97,12 @@ namespace System.IO.Pipes
public NamedPipeServerStream (string pipeName, PipeDirection direction, int maxNumberOfServerInstances, PipeTransmissionMode transmissionMode, PipeOptions options, int inBufferSize, int outBufferSize, PipeSecurity pipeSecurity, HandleInheritability inheritability, PipeAccessRights additionalAccessRights)
: base (direction, transmissionMode, outBufferSize)
{
var rights = ToAccessRights (direction) | additionalAccessRights;
// FIXME: reject some rights declarations (for ACL).
#if MOBILE
throw new NotImplementedException ();
#else
var rights = ToAccessRights (direction) | additionalAccessRights;
// FIXME: reject some rights declarations (for ACL).
if (IsWindows)
impl = new Win32NamedPipeServer (this, pipeName, maxNumberOfServerInstances, transmissionMode,
rights, options, inBufferSize, outBufferSize,

View File

@@ -110,16 +110,6 @@ namespace System.IO.Pipes
}
}
#if BOOTSTRAP_BASIC
AccessControlSections AccessControlSectionsModified {
get {
return (AccessRulesModified ? AccessControlSections.Access : 0) |
(AuditRulesModified ? AccessControlSections.Audit : 0) |
(OwnerModified ? AccessControlSections.Owner : 0) |
(GroupModified ? AccessControlSections.Group : 0);
}
}
#endif
public bool RemoveAccessRule (PipeAccessRule rule)
{
return RemoveAccessRule ((AccessRule)rule);

View File

@@ -133,10 +133,13 @@ namespace System.IO.Pipes
get {
if (!IsConnected)
throw new InvalidOperationException ("Pipe is not connected");
if (stream == null)
if (stream == null) {
#pragma warning disable 618
stream = new FileStream (handle.DangerousGetHandle (),
CanRead ? (CanWrite ? FileAccess.ReadWrite : FileAccess.Read)
: FileAccess.Write, true, buffer_size, IsAsync);
#pragma warning restore 618
}
return stream;
}
set { stream = value; }

View File

@@ -205,7 +205,7 @@ namespace System.IO.Pipes
opener = delegate {
var fs = new FileStream (name, FileMode.Open, RightsToFileAccess (desiredAccessRights), FileShare.ReadWrite);
owner.Stream = fs;
handle = new SafePipeHandle (fs.Handle, false);
handle = new SafePipeHandle (fs.SafeFileHandle.DangerousGetHandle (), false);
};
}
@@ -271,7 +271,7 @@ namespace System.IO.Pipes
// FIXME: maxNumberOfServerInstances, modes, sizes, handle inheritability
var fs = new FileStream (name, FileMode.Open, RightsToFileAccess (rights), FileShare.ReadWrite);
handle = new SafePipeHandle (fs.Handle, false);
handle = new SafePipeHandle (fs.SafeFileHandle.DangerousGetHandle (), false);
owner.Stream = fs;
should_close_handle = true;
}