コード例 #1
0
ファイル: Class164.cs プロジェクト: jollitycn/JGNet
    public int IOControl(IOControlCode iocontrolCode_0, byte[] byte_0, byte[] byte_1)
    {
        int num = 0;

        try
        {
            if (this.udpClient_0 != null)
            {
                num = this.udpClient_0.Client.IOControl(iocontrolCode_0, byte_0, byte_1);
            }
            if (this.udpClient_1 != null)
            {
                num = this.udpClient_1.Client.IOControl(iocontrolCode_0, byte_0, byte_1);
            }
        }
        catch (Exception exception)
        {
            if (this.bool_0)
            {
                this.emptyAgileLogger_0.Log(exception, "IPv6UdpClient.IOControl", ErrorLevel.Standard);
            }
        }
        return(num);
    }
コード例 #2
0
ファイル: Socket.cs プロジェクト: REALTOBIZ/mono
        internal int IOControl(	IOControlCode ioControlCode, 
									IntPtr optionInValue, 
									int inValueSize,
									IntPtr optionOutValue,
									int outValueSize) 
		{
            if (CleanedUp) {
                throw new ObjectDisposedException(this.GetType().FullName);
            }
            if ( (unchecked((int)ioControlCode)) ==IoctlSocketConstants.FIONBIO) {
                throw new InvalidOperationException(SR.GetString(SR.net_sockets_useblocking));
            }

            int realOptionLength = 0;

            // This can throw ObjectDisposedException.
            SocketError errorCode = UnsafeNclNativeMethods.OSSOCK.WSAIoctl_Blocking_Internal(
                m_Handle.DangerousGetHandle(),
                (uint)ioControlCode,
                optionInValue,
				inValueSize,
                optionOutValue,
				outValueSize,
                out realOptionLength,
                SafeNativeOverlapped.Zero,
                IntPtr.Zero);

            GlobalLog.Print("Socket#" + ValidationHelper.HashString(this) + "::IOControl() UnsafeNclNativeMethods.OSSOCK.WSAIoctl returns errorCode:" + errorCode);

            //
            // if the native call fails we'll throw a SocketException
            //
            if (errorCode==SocketError.SocketError) {
                //
                // update our internal state after this socket error and throw
                //
                SocketException socketException = new SocketException();
                UpdateStatusAfterSocketError(socketException);
                if(s_LoggingEnabled)Logging.Exception(Logging.Sockets, this, "IOControl", socketException);
                throw socketException;
            }

            return realOptionLength;
        }
コード例 #3
0
 private static extern bool DeviceIOControlNative(
     SafeFileHandle deviceHandle, IOControlCode controlCode,
     IntPtr inBuffer, int inBufferSize,
     IntPtr outBuffer, int outBufferSize,
     out int bytesReturned, IntPtr overlapped);
コード例 #4
0
ファイル: SocketPal.Windows.cs プロジェクト: vbouret/corefx
        public static SocketError IoctlInternal(SafeCloseSocket handle, IOControlCode ioControlCode, IntPtr optionInValue, int inValueLength, IntPtr optionOutValue, int outValueLength, out int optionLength)
        {
            if ((unchecked((int)ioControlCode)) == Interop.Winsock.IoctlSocketConstants.FIONBIO)
            {
                throw new InvalidOperationException(SR.net_sockets_useblocking);
            }

            SocketError errorCode = Interop.Winsock.WSAIoctl_Blocking_Internal(
                handle.DangerousGetHandle(),
                (uint)ioControlCode,
                optionInValue,
                inValueLength,
                optionOutValue,
                outValueLength,
                out optionLength,
                SafeNativeOverlapped.Zero,
                IntPtr.Zero);
            return errorCode == SocketError.SocketError ? GetLastSocketError() : SocketError.Success;
        }
コード例 #5
0
 public int IOControl(IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue)
 {
 }
コード例 #6
0
ファイル: TcpClient.cs プロジェクト: Bectinced-aeN/vrcsdk
 public static extern int WSAIoctl(IntPtr s, IOControlCode dwIoControlCode, byte[] lpvInBuffer, int cbInBuffer, IntPtr lpvOutBuffer, int cbOutBuffer, ref int lpcbBytesReturned, IntPtr lpOverlapped, IntPtr lpCompletionRoutine);
コード例 #7
0
 public int IOControl(IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue)
 {
     return(this.innerSocket.IOControl(ioControlCode, optionInValue, optionOutValue));
 }
コード例 #8
0
 public void CtrlCodeTest(IOControlCode CtrlCode, FileDevice DeviceType, uint Function, Method Method, FileAccess Access)
 => Assert.AreEqual(CtrlCode, IOControlCodeExtensions.CtrlCode(DeviceType, Function, Method, Access));
コード例 #9
0
ファイル: StreamSocket.cs プロジェクト: pkt30/OscarLib
 /// <summary>
 /// Overloaded. Sets low-level operating modes for the Socket.
 /// </summary>
 /// <param name="ioControlCode">A IOControlCode value that specifies the control code of the operation to perform.</param>
 /// <param name="optionInValue">A Byte array that contains the input data required by the operation.</param>
 /// <param name="optionOutValue">A Byte array that contains the output data returned by the operation.</param>
 /// <returns>The number of bytes in the optionOutValue parameter.</returns>
 public int IOControl(IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue) {
     return this.Socket.IOControl(ioControlCode, optionInValue, optionOutValue);
 }
コード例 #10
0
 public static Task <byte[]> InvokeIoControlAsync <V>(SafeFileHandle handle, IOControlCode controlCode, uint outputLength, V input, out int errorCode)
 {
     return(InvokeIoControlAsync(handle, controlCode, outputLength, input, out errorCode, CancellationToken.None));
 }
コード例 #11
0
 public int IOControl(IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue)
 {
 }
コード例 #12
0
 public void GetAccessTest(IOControlCode CtrlCode, FileAccess Access)
 => Assert.AreEqual(Access, CtrlCode.GetAccess());
コード例 #13
0
 public void GetMethodTest(IOControlCode CtrlCode, Method Method)
 => Assert.AreEqual(Method, CtrlCode.GetMethod());
コード例 #14
0
 public void GetFunctionTest(IOControlCode CtrlCode, uint Function)
 => Assert.AreEqual(Function, CtrlCode.GetFunction());
コード例 #15
0
 public void GetDeviceTypeTest(IOControlCode CtrlCode, FileDevice DeviceType)
 => Assert.AreEqual(DeviceType, CtrlCode.GetDeviceType());
コード例 #16
0
 public abstract int IOControl(IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue);
コード例 #17
0
ファイル: Socket.cs プロジェクト: ReedKimble/corefx
        internal int IOControl(IOControlCode ioControlCode, IntPtr optionInValue, int inValueSize, IntPtr optionOutValue, int outValueSize)
        {
            if (CleanedUp)
            {
                throw new ObjectDisposedException(this.GetType().FullName);
            }

            int realOptionLength = 0;

            // This can throw ObjectDisposedException.
            SocketError errorCode = SocketPal.IoctlInternal(_handle, ioControlCode, optionInValue, inValueSize, optionOutValue, outValueSize, out realOptionLength);

            GlobalLog.Print("Socket#" + Logging.HashString(this) + "::IOControl() Interop.Winsock.WSAIoctl returns errorCode:" + errorCode);

            // Throw an appropriate SocketException if the native call fails.
            if (errorCode != SocketError.Success)
            {
                // Update the internal state of this socket according to the error before throwing.
                SocketException socketException = new SocketException((int)errorCode);
                UpdateStatusAfterSocketError(socketException);
                if (s_loggingEnabled)
                {
                    Logging.Exception(Logging.Sockets, this, "IOControl", socketException);
                }
                throw socketException;
            }

            return realOptionLength;
        }
コード例 #18
0
 public int IOControl(IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue)
 {
   return default(int);
 }
コード例 #19
0
ファイル: Socket.cs プロジェクト: songfj/AsyncIO
        public override int IOControl(IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue)
        {
            int bytesTransferred = 0;

            if (UnsafeMethods.WSAIoctl_Blocking(Handle, (int) ioControlCode, optionInValue,
                optionInValue != null ? optionInValue.Length : 0, optionOutValue,
                optionOutValue != null ? optionOutValue.Length : 0, out bytesTransferred, IntPtr.Zero, IntPtr.Zero) !=
                SocketError.SocketError)
            {
                return bytesTransferred;
            }

            throw new SocketException();
        }
コード例 #20
0
 public int IOControl(IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue)
 {
     return(default(int));
 }
コード例 #21
0
ファイル: SrbIoControl.cs プロジェクト: juner/IoControl
 public SrbIoControl(uint HeaderLength = default, string Signagure = null, uint Timeout = default, IOControlCode ControlCode = default, uint ReturnCode = default, uint Length = default)
 => (this.HeaderLength, __Signature, this.Timeout, this.ControlCode, this.ReturnCode, this.Length)
コード例 #22
0
 public static FileDevice GetDeviceType(this IOControlCode CtrlCode) => (FileDevice)(((uint)CtrlCode & 0xffff_0000) >> 16);
コード例 #23
0
        /// <summary>
        /// Invoke DeviceIOControl with no input or output.
        /// </summary>
        /// <returns>Success</returns>
        public static bool InvokeIoControl(SafeFileHandle handle, IOControlCode controlCode)
        {
            uint returnedBytes = 0;

            return(DeviceIoControl(handle, controlCode, null, 0, null, 0, ref returnedBytes, IntPtr.Zero));
        }
 static int \u202B‭‬‭‭‭‌​‌‎‏‎‬‭‭‫‍‮‌​‏‪​‮([In] Socket obj0, [In] IOControlCode obj1, [In] byte[] obj2, [In] byte[] obj3)
 {
     // ISSUE: unable to decompile the method.
 }
コード例 #25
0
 protected abstract void SetIOControl(IOControlCode ioControlCode, byte[] inOption, byte[] outOption);
コード例 #26
0
        /// <summary>
        /// Sends a control code directly to a specified device driver, causing the corresponding device to perform the corresponding operation.
        /// </summary>
        /// <param name="deviceHandle">
        /// A handle to the device on which the operation is to be performed. The device is typically a volume, directory, file, or stream.
        /// To retrieve a device handle, use the CreateFile function.
        /// </param>
        /// <param name="controlCode">
        /// The control code for the operation. This value identifies the specific operation to be performed and the type of device on which to perform it.
        /// </param>
        public static void DeviceIOControl(SafeFileHandle deviceHandle, IOControlCode controlCode)
        {
            int bytesReturned;

            DeviceIOControlInternal(deviceHandle, controlCode, IntPtr.Zero, 0, IntPtr.Zero, 0, out bytesReturned);
        }
コード例 #27
0
		public int IOControl (IOControlCode ioControlCode,
				      byte[] optionInValue,
				      byte[] optionOutValue)
		{
			/* Probably just needs to mirror the int
			 * overload, but more investigation needed.
			 */
			throw new NotImplementedException ();
		}
コード例 #28
0
 public int IOControl(IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue)
 {
     throw new NotImplementedException();
 }
コード例 #29
0
 /// <summary>
 /// Sends a control code directly to a specified device driver, causing the corresponding device to perform the corresponding operation.
 /// </summary>
 /// <param name="deviceHandle">
 /// A handle to the device on which the operation is to be performed. The device is typically a volume, directory, file, or stream.
 /// To retrieve a device handle, use the CreateFile function.
 /// </param>
 /// <param name="controlCode">
 /// The control code for the operation. This value identifies the specific operation to be performed and the type of device on which to perform it.
 /// </param>
 public static void DeviceIOControl(SafeFileHandle deviceHandle, IOControlCode controlCode)
 => DeviceIOControlInternal(deviceHandle, controlCode, IntPtr.Zero, 0, IntPtr.Zero, 0, out _);
コード例 #30
0
ファイル: NativeSocket.cs プロジェクト: awb99/AsyncIO
 public override int IOControl(IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue)
 {
     return m_socket.IOControl(ioControlCode, optionInValue, optionOutValue);
 }
コード例 #31
0
ファイル: SocketPal.Unix.cs プロジェクト: jemmy655/corefx
 public static SocketError IoctlInternal(SafeCloseSocket handle, IOControlCode ioControlCode, IntPtr optionInValue, int inValueLength, IntPtr optionOutValue, int outValueLength, out int optionLength)
 {
     // TODO: can this be supported in some reasonable fashion?
     throw new PlatformNotSupportedException();
 }
コード例 #32
0
ファイル: AsyncSocket.cs プロジェクト: awb99/AsyncIO
 public abstract int IOControl(IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue);
コード例 #33
0
 public override int IOControl(IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue)
 {
     return(m_socket.IOControl(ioControlCode, optionInValue, optionOutValue));
 }
コード例 #34
0
ファイル: Socket.cs プロジェクト: korifey/hackathon-Ideaphone
 internal int IOControl(IOControlCode ioControlCode, IntPtr optionInValue, int inValueSize, IntPtr optionOutValue, int outValueSize)
 {
     if (this.CleanedUp)
     throw new ObjectDisposedException(this.GetType().FullName);
       if ((int) ioControlCode == -2147195266)
     throw new InvalidOperationException(SR.GetString("net_sockets_useblocking"));
       int bytesTransferred = 0;
       if (UnsafeNclNativeMethods.OSSOCK.WSAIoctl_Blocking_Internal(this.m_Handle.DangerousGetHandle(), (uint) ioControlCode, optionInValue, inValueSize, optionOutValue, outValueSize, out bytesTransferred, (SafeHandle) SafeNativeOverlapped.Zero, IntPtr.Zero) != SocketError.SocketError)
     return bytesTransferred;
       SocketException socketException = new SocketException();
       this.UpdateStatusAfterSocketError(socketException);
       if (Socket.s_LoggingEnabled)
     Logging.Exception(Logging.Sockets, (object) this, "IOControl", (Exception) socketException);
       throw socketException;
 }
コード例 #35
0
ファイル: Socket.cs プロジェクト: Profit0004/mono
		public int IOControl (IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue)
		{
			return IOControl ((int) ioControlCode, optionInValue, optionOutValue);
		}
コード例 #36
0
 public int IOControl(IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue)
 {
     return this.socket.IOControl(ioControlCode, optionInValue, optionOutValue);
 }