From: Frederik Carlier Date: Sun, 12 Jul 2020 03:09:37 +0000 (+0200) Subject: Remove unused DeviceIoControl P/Invoke declaration (#38877) X-Git-Tag: submit/tizen/20210909.063632~6767 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=56b696403b3f8fe6dac4a83f4d0743490e0e9ad2;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Remove unused DeviceIoControl P/Invoke declaration (#38877) --- diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CTL_CODE.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CTL_CODE.cs deleted file mode 100644 index 2137f07..0000000 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CTL_CODE.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; -using System.Data.Common; - -internal partial class Interop -{ - internal partial class Kernel32 - { - /// CTL_CODE method. - /// Identifies the device type. This value must match the value that is set in the DeviceType member of the driver's DEVICE_OBJECT structure. - /// Identifies the function to be performed by the driver. Values of less than 0x800 are reserved for Microsoft. Values of 0x800 and higher can be used by vendors. - /// Indicates how the system will pass data between the caller of DeviceIoControl (or IoBuildDeviceIoControlRequest) and the driver that handles the IRP. - /// Indicates the type of access that a caller must request when opening the file object that represents the device (see IRP_MJ_CREATE). - internal static unsafe uint CTL_CODE( - ushort deviceType, - ushort function, - byte method, - byte access) - { - // MaxFunctionCode specifies the maximum value of the FunctionCode field in the FSCTLs (or IOCTLs for IOCTL tests). The maximum possible value is 4095. - // See https://docs.microsoft.com/en-us/windows-hardware/drivers/develop/how-to-select-and-configure-the-device-fundamental-tests - if (function > 4095) - throw ADP.ArgumentOutOfRange("function"); - - return (uint)((deviceType << 16) | (access << 14) | (function << 2) | method); - } - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeviceIoControl.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeviceIoControl.cs deleted file mode 100644 index f1a8df9..0000000 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.DeviceIoControl.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Microsoft.Win32.SafeHandles; -using System; -using System.Runtime.InteropServices; - -internal partial class Interop -{ - internal partial class Kernel32 - { - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool DeviceIoControl - ( - SafeFileHandle fileHandle, - uint ioControlCode, - IntPtr inBuffer, - uint cbInBuffer, - IntPtr outBuffer, - uint cbOutBuffer, - out uint cbBytesReturned, - IntPtr overlapped - ); - } -} diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.IoControlTransferType.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.IoControlTransferType.cs deleted file mode 100644 index fd3372b..0000000 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.IoControlTransferType.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.InteropServices; - -internal partial class Interop -{ - internal partial class Kernel32 - { - /// - /// TransferType. - /// Indicates how the system will pass data between the caller of DeviceIoControl (or IoBuildDeviceIoControlRequest) and the driver that handles the IRP. - /// - public enum IoControlTransferType - { - /// - /// Specifies the buffered I/O method, which is typically used for transferring small amounts of data per request. - /// Most I/O control codes for device and intermediate drivers use this TransferType value. - /// - METHOD_BUFFERED, - - /// - /// Specifies the direct I/O method, which is typically used for reading or writing large amounts of data, using DMA or PIO, that must be transferred quickly. - /// Specify METHOD_IN_DIRECT if the caller of DeviceIoControl or IoBuildDeviceIoControlRequest will pass data to the driver. - /// - METHOD_IN_DIRECT, - - /// - /// Specifies the direct I/O method, which is typically used for reading or writing large amounts of data, using DMA or PIO, that must be transferred quickly. - /// Specify METHOD_OUT_DIRECT if the caller of DeviceIoControl or IoBuildDeviceIoControlRequest will receive data from the driver. - /// - METHOD_OUT_DIRECT, - - /// - /// Specifies neither buffered nor direct I/O. The I/O manager does not provide any system buffers or MDLs. The IRP supplies the user-mode virtual addresses - /// of the input and output buffers that were specified to DeviceIoControl or IoBuildDeviceIoControlRequest, without validating or mapping them. - /// - METHOD_NEITHER - } - } -}