Merge pull request #3769 from evincarofautumn/fix-verify-before-allocs
[mono.git] / mcs / class / System.Runtime.Remoting / System.Runtime.Remoting.Channels.Ipc.Win32 / NamedPipeHelper.cs
index 089cd330b62162234109a3cec01b7df9f256053b..974caaaaa8b76eae21cd74f42d81abe1c68d169c 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-
-using System;
 using System.Runtime.InteropServices;
 using System.Text;
+using System.Threading;
 
 namespace System.Runtime.Remoting.Channels.Ipc.Win32
 {
@@ -89,6 +88,7 @@ namespace System.Runtime.Remoting.Channels.Ipc.Win32
         public const uint OPEN_EXISTING     = 3;
         public const uint OPEN_ALWAYS       = 4;
         public const uint TRUNCATE_EXISTING = 5;
+           public const uint FILE_FLAG_OVERLAPPED = 0x40000000;
         
         // Access flags
         public const uint GENERIC_READ = 0x80000000;
@@ -103,6 +103,7 @@ namespace System.Runtime.Remoting.Channels.Ipc.Win32
         public const int ERROR_PIPE_NOT_CONNECTED = 233;
         public const int ERROR_PIPE_CONNECTED = 535;
         public const int ERROR_PIPE_LISTENING = 536;
+           public const int ERROR_IO_PENDING = 997;
 
         public const int INVALID_HANDLE_VALUE = -1;
 
@@ -121,7 +122,7 @@ namespace System.Runtime.Remoting.Channels.Ipc.Win32
         [DllImport("kernel32.dll", SetLastError = true)]
         public static extern bool ConnectNamedPipe(
             IntPtr hPipe,
-            IntPtr lpOverlapped
+            [In] ref NativeOverlapped lpOverlapped
             );
 
         [DllImport("kernel32.dll", SetLastError = true)]