Last active
July 5, 2024 12:47
-
-
Save mattifestation/844d01bd5c378f9b1f52d76219deaf0f to your computer and use it in GitHub Desktop.
Parsing binary values using bit math in PowerShell - Parsing an IO control code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Version 3 | |
# -shr and [PSCustomObject] are only available in PSv3+ | |
function ConvertFrom-IOControlCode { | |
<# | |
.SYNOPSIS | |
Converts an IO control code to its respective arguments. | |
Author: Matthew Graeber (@mattifestation) | |
License: BSD 3-Clause | |
.DESCRIPTION | |
ConvertFrom-IOControlCode performs the same function as the OSR online IOCTL decoder. | |
.PARAMETER IOControlCode | |
Specifies an IO control code. | |
.EXAMPLE | |
ConvertFrom-IOControlCode -IOControlCode 2415928348 | |
.EXAMPLE | |
1198084 | ConvertFrom-IOControlCode | |
#> | |
Param ( | |
[Parameter(Mandatory = $True, Position = 0, ValueFromPipeline = $True)] | |
[Int32] | |
$IOControlCode | |
) | |
# These enums could also be defined using PSReflect or PSv5 classes. | |
$TypeDef = @' | |
using System; | |
namespace IOControlCode { | |
public enum DeviceType : ushort { | |
FILE_DEVICE_BEEP = 0x0001, | |
FILE_DEVICE_CD_ROM = 0x0002, | |
FILE_DEVICE_CD_ROM_FILE_SYSTEM = 0x0003, | |
FILE_DEVICE_CONTROLLER = 0x0004, | |
FILE_DEVICE_DATALINK = 0x0005, | |
FILE_DEVICE_DFS = 0x0006, | |
FILE_DEVICE_DISK = 0x0007, | |
FILE_DEVICE_DISK_FILE_SYSTEM = 0x0008, | |
FILE_DEVICE_FILE_SYSTEM = 0x0009, | |
FILE_DEVICE_INPORT_PORT = 0x000a, | |
FILE_DEVICE_KEYBOARD = 0x000b, | |
FILE_DEVICE_MAILSLOT = 0x000c, | |
FILE_DEVICE_MIDI_IN = 0x000d, | |
FILE_DEVICE_MIDI_OUT = 0x000e, | |
FILE_DEVICE_MOUSE = 0x000f, | |
FILE_DEVICE_MULTI_UNC_PROVIDER = 0x0010, | |
FILE_DEVICE_NAMED_PIPE = 0x0011, | |
FILE_DEVICE_NETWORK = 0x0012, | |
FILE_DEVICE_NETWORK_BROWSER = 0x0013, | |
FILE_DEVICE_NETWORK_FILE_SYSTEM = 0x0014, | |
FILE_DEVICE_NULL = 0x0015, | |
FILE_DEVICE_PARALLEL_PORT = 0x0016, | |
FILE_DEVICE_PHYSICAL_NETCARD = 0x0017, | |
FILE_DEVICE_PRINTER = 0x0018, | |
FILE_DEVICE_SCANNER = 0x0019, | |
FILE_DEVICE_SERIAL_MOUSE_PORT = 0x001a, | |
FILE_DEVICE_SERIAL_PORT = 0x001b, | |
FILE_DEVICE_SCREEN = 0x001c, | |
FILE_DEVICE_SOUND = 0x001d, | |
FILE_DEVICE_STREAMS = 0x001e, | |
FILE_DEVICE_TAPE = 0x001f, | |
FILE_DEVICE_TAPE_FILE_SYSTEM = 0x0020, | |
FILE_DEVICE_TRANSPORT = 0x0021, | |
FILE_DEVICE_UNKNOWN = 0x0022, | |
FILE_DEVICE_VIDEO = 0x0023, | |
FILE_DEVICE_VIRTUAL_DISK = 0x0024, | |
FILE_DEVICE_WAVE_IN = 0x0025, | |
FILE_DEVICE_WAVE_OUT = 0x0026, | |
FILE_DEVICE_8042_PORT = 0x0027, | |
FILE_DEVICE_NETWORK_REDIRECTOR = 0x0028, | |
FILE_DEVICE_BATTERY = 0x0029, | |
FILE_DEVICE_BUS_EXTENDER = 0x002a, | |
FILE_DEVICE_MODEM = 0x002b, | |
FILE_DEVICE_VDM = 0x002c, | |
FILE_DEVICE_MASS_STORAGE = 0x002d, | |
FILE_DEVICE_SMB = 0x002e, | |
FILE_DEVICE_KS = 0x002f, | |
FILE_DEVICE_CHANGER = 0x0030, | |
FILE_DEVICE_SMARTCARD = 0x0031, | |
FILE_DEVICE_ACPI = 0x0032, | |
FILE_DEVICE_DVD = 0x0033, | |
FILE_DEVICE_FULLSCREEN_VIDEO = 0x0034, | |
FILE_DEVICE_DFS_FILE_SYSTEM = 0x0035, | |
FILE_DEVICE_DFS_VOLUME = 0x0036, | |
FILE_DEVICE_SERENUM = 0x0037, | |
FILE_DEVICE_TERMSRV = 0x0038, | |
FILE_DEVICE_KSEC = 0x0039, | |
FILE_DEVICE_FIPS = 0x003A, | |
FILE_DEVICE_INFINIBAND = 0x003B, | |
FILE_DEVICE_VMBUS = 0x003E, | |
FILE_DEVICE_CRYPT_PROVIDER = 0x003F, | |
FILE_DEVICE_WPD = 0x0040, | |
FILE_DEVICE_BLUETOOTH = 0x0041, | |
FILE_DEVICE_MT_COMPOSITE = 0x0042, | |
FILE_DEVICE_MT_TRANSPORT = 0x0043, | |
FILE_DEVICE_BIOMETRIC = 0x0044, | |
FILE_DEVICE_PMI = 0x0045, | |
FILE_DEVICE_EHSTOR = 0x0046, | |
FILE_DEVICE_DEVAPI = 0x0047, | |
FILE_DEVICE_GPIO = 0x0048, | |
FILE_DEVICE_USBEX = 0x0049, | |
FILE_DEVICE_CONSOLE = 0x0050, | |
FILE_DEVICE_NFP = 0x0051, | |
FILE_DEVICE_SYSENV = 0x0052, | |
FILE_DEVICE_VIRTUAL_BLOCK = 0x0053, | |
FILE_DEVICE_POINT_OF_SERVICE = 0x0054 | |
}; | |
public enum TransferType : byte { | |
METHOD_BUFFERED, | |
METHOD_IN_DIRECT, | |
METHOD_OUT_DIRECT, | |
METHOD_NEITHER | |
}; | |
[Flags] | |
public enum RequiredAccess : byte { | |
FILE_ANY_ACCESS, | |
FILE_READ_ACCESS, | |
FILE_WRITE_ACCESS | |
}; | |
// Obtained from http://www.ioctls.net/ | |
public enum FriendlyName : uint { | |
IOCTL_1394_CLASS = 0x0022021D, | |
IOCTL_1394_TOGGLE_ENUM_TEST_OFF = 0x00220224, | |
IOCTL_1394_TOGGLE_ENUM_TEST_ON = 0x00220220, | |
IOCTL_61883_CLASS = 0x00220245, | |
IOCTL_AACS_END_SESSION = 0x003350CC, | |
IOCTL_AACS_GENERATE_BINDING_NONCE = 0x0033D0F0, | |
IOCTL_AACS_GET_CERTIFICATE = 0x003350D4, | |
IOCTL_AACS_GET_CHALLENGE_KEY = 0x003350D8, | |
IOCTL_AACS_READ_BINDING_NONCE = 0x003350EC, | |
IOCTL_AACS_READ_MEDIA_ID = 0x003350E8, | |
IOCTL_AACS_READ_MEDIA_KEY_BLOCK = 0x003350C4, | |
IOCTL_AACS_READ_MEDIA_KEY_BLOCK_SIZE = 0x003350C0, | |
IOCTL_AACS_READ_SERIAL_NUMBER = 0x003350E4, | |
IOCTL_AACS_READ_VOLUME_ID = 0x003350E0, | |
IOCTL_AACS_SEND_CERTIFICATE = 0x003350D0, | |
IOCTL_AACS_SEND_CHALLENGE_KEY = 0x003350DC, | |
IOCTL_AACS_START_SESSION = 0x003350C8, | |
IOCTL_ABORT_PIPE = 0x80002004, | |
IOCTL_ACPI_ACQUIRE_GLOBAL_LOCK = 0x0032C010, | |
IOCTL_ACPI_ASYNC_EVAL_METHOD = 0x0032C000, | |
IOCTL_ACPI_ASYNC_EVAL_METHOD_EX = 0x0032C01C, | |
IOCTL_ACPI_ENUM_CHILDREN = 0x0032C020, | |
IOCTL_ACPI_EVAL_METHOD = 0x0032C004, | |
IOCTL_ACPI_EVAL_METHOD_EX = 0x0032C018, | |
IOCTL_ACPI_RELEASE_GLOBAL_LOCK = 0x0032C014, | |
IOCTL_ARP_SEND_REQUEST = 0x00000067, | |
IOCTL_ATA_MINIPORT = 0x0004D034, | |
IOCTL_ATA_PASS_THROUGH = 0x0004D02C, | |
IOCTL_ATA_PASS_THROUGH_DIRECT = 0x0004D030, | |
IOCTL_AVCSTRM_CLASS = 0x0022024D, | |
IOCTL_AVC_BUS_RESET = 0x002A0008, | |
IOCTL_AVC_CLASS = 0x00220248, | |
IOCTL_AVC_REMOVE_VIRTUAL_SUBUNIT_INFO = 0x002A0004, | |
IOCTL_AVC_UPDATE_VIRTUAL_SUBUNIT_INFO = 0x002A0000, | |
IOCTL_AVIO_ALLOCATE_STREAM = 0x00FF0004, | |
IOCTL_AVIO_FREE_STREAM = 0x00FF0008, | |
IOCTL_AVIO_MODIFY_STREAM = 0x00FF000C, | |
IOCTL_BATTERY_QUERY_INFORMATION = 0x00294044, | |
IOCTL_BATTERY_QUERY_STATUS = 0x0029404C, | |
IOCTL_BATTERY_QUERY_TAG = 0x00294040, | |
IOCTL_BATTERY_SET_INFORMATION = 0x00298048, | |
IOCTL_BEEP_SET = 0x00010000, | |
IOCTL_BIOMETRIC_CALIBRATE = 0x0044000C, | |
IOCTL_BIOMETRIC_CAPTURE_DATA = 0x00440014, | |
IOCTL_BIOMETRIC_GET_ATTRIBUTES = 0x00440004, | |
IOCTL_BIOMETRIC_GET_INDICATOR = 0x00440020, | |
IOCTL_BIOMETRIC_GET_SENSOR_STATUS = 0x00440010, | |
IOCTL_BIOMETRIC_GET_SUPPORTED_ALGORITHMS = 0x0044001C, | |
IOCTL_BIOMETRIC_RESET = 0x00440008, | |
IOCTL_BIOMETRIC_SET_INDICATOR = 0x00440024, | |
IOCTL_BIOMETRIC_UPDATE_FIRMWARE = 0x00440018, | |
IOCTL_BIOMETRIC_VENDOR = 0x00442000, | |
IOCTL_BTH_DISCONNECT_DEVICE = 0x0041000C, | |
IOCTL_BTH_EIR_GET_RECORDS = 0x00410040, | |
IOCTL_BTH_EIR_REMOVE_RECORD = 0x0041004C, | |
IOCTL_BTH_EIR_SUBMIT_RECORD = 0x00410044, | |
IOCTL_BTH_EIR_UPDATE_RECORD = 0x00410048, | |
IOCTL_BTH_GET_DEVICE_INFO = 0x00410008, | |
IOCTL_BTH_GET_DEVICE_RSSI = 0x00410014, | |
IOCTL_BTH_GET_LOCAL_INFO = 0x00410000, | |
IOCTL_BTH_GET_RADIO_INFO = 0x00410004, | |
IOCTL_BTH_HCI_VENDOR_COMMAND = 0x00410050, | |
IOCTL_BTH_SDP_ATTRIBUTE_SEARCH = 0x0041020C, | |
IOCTL_BTH_SDP_CONNECT = 0x00410200, | |
IOCTL_BTH_SDP_DISCONNECT = 0x00410204, | |
IOCTL_BTH_SDP_REMOVE_RECORD = 0x00410218, | |
IOCTL_BTH_SDP_SERVICE_ATTRIBUTE_SEARCH = 0x00410210, | |
IOCTL_BTH_SDP_SERVICE_SEARCH = 0x00410208, | |
IOCTL_BTH_SDP_SUBMIT_RECORD = 0x00410214, | |
IOCTL_BTH_SDP_SUBMIT_RECORD_WITH_INFO = 0x0041021C, | |
IOCTL_CANCEL_DEVICE_WAKE = 0x00298008, | |
IOCTL_CANCEL_GET_SEND_MESSAGE = 0x002B0038, | |
IOCTL_CANCEL_IO = 0x80002004, | |
IOCTL_CDROM_CHECK_VERIFY = 0x00024800, | |
IOCTL_CDROM_CURRENT_POSITION = 0x00000001, | |
IOCTL_CDROM_DISK_TYPE = 0x00020040, | |
IOCTL_CDROM_EJECT_MEDIA = 0x00024808, | |
IOCTL_CDROM_ENABLE_STREAMING = 0x00024068, | |
IOCTL_CDROM_EXCLUSIVE_ACCESS = 0x0002C05C, | |
IOCTL_CDROM_FIND_NEW_DEVICES = 0x00024818, | |
IOCTL_CDROM_GET_CONFIGURATION = 0x00024058, | |
IOCTL_CDROM_GET_CONTROL = 0x00024034, | |
IOCTL_CDROM_GET_DRIVE_GEOMETRY = 0x0002404C, | |
IOCTL_CDROM_GET_DRIVE_GEOMETRY_EX = 0x00024050, | |
IOCTL_CDROM_GET_INQUIRY_DATA = 0x00024064, | |
IOCTL_CDROM_GET_LAST_SESSION = 0x00024038, | |
IOCTL_CDROM_GET_PERFORMANCE = 0x00024070, | |
IOCTL_CDROM_GET_VOLUME = 0x00024014, | |
IOCTL_CDROM_LOAD_MEDIA = 0x0002480C, | |
IOCTL_CDROM_MEDIA_CATALOG = 0x00000002, | |
IOCTL_CDROM_MEDIA_REMOVAL = 0x00024804, | |
IOCTL_CDROM_PAUSE_AUDIO = 0x0002400C, | |
IOCTL_CDROM_PLAY_AUDIO_MSF = 0x00024018, | |
IOCTL_CDROM_RAW_READ = 0x0002403E, | |
IOCTL_CDROM_READ_Q_CHANNEL = 0x0002402C, | |
IOCTL_CDROM_READ_TOC = 0x00024000, | |
IOCTL_CDROM_READ_TOC_EX = 0x00024054, | |
IOCTL_CDROM_RELEASE = 0x00024814, | |
IOCTL_CDROM_RESERVE = 0x00024810, | |
IOCTL_CDROM_RESUME_AUDIO = 0x00024010, | |
IOCTL_CDROM_SEEK_AUDIO_MSF = 0x00024004, | |
IOCTL_CDROM_SEND_OPC_INFORMATION = 0x0002C06C, | |
IOCTL_CDROM_SET_SPEED = 0x00024060, | |
IOCTL_CDROM_SET_VOLUME = 0x00024028, | |
IOCTL_CDROM_SIMBAD = 0x0002400C, | |
IOCTL_CDROM_STOP_AUDIO = 0x00024008, | |
IOCTL_CDROM_SUB_Q_CHANNEL = 0x00000000, | |
IOCTL_CDROM_TRACK_ISRC = 0x00000003, | |
IOCTL_CDROM_UNLOAD_DRIVER = 0x00025008, | |
IOCTL_CHANGER_EXCHANGE_MEDIUM = 0x00304020, | |
IOCTL_CHANGER_GET_ELEMENT_STATUS = 0x0030C014, | |
IOCTL_CHANGER_GET_PARAMETERS = 0x00304000, | |
IOCTL_CHANGER_GET_PRODUCT_DATA = 0x00304008, | |
IOCTL_CHANGER_GET_STATUS = 0x00304004, | |
IOCTL_CHANGER_INITIALIZE_ELEMENT_STATUS = 0x00304018, | |
IOCTL_CHANGER_MOVE_MEDIUM = 0x00304024, | |
IOCTL_CHANGER_QUERY_VOLUME_TAGS = 0x0030C02C, | |
IOCTL_CHANGER_REINITIALIZE_TRANSPORT = 0x00304028, | |
IOCTL_CHANGER_SET_ACCESS = 0x0030C010, | |
IOCTL_CHANGER_SET_POSITION = 0x0030401C, | |
IOCTL_DISK_CHECK_VERIFY = 0x00074800, | |
IOCTL_DISK_CONTROLLER_NUMBER = 0x00070044, | |
IOCTL_DISK_COPY_DATA = 0x0007C064, | |
IOCTL_DISK_CREATE_DISK = 0x0007C058, | |
IOCTL_DISK_DELETE_DRIVE_LAYOUT = 0x0007C100, | |
IOCTL_DISK_EJECT_MEDIA = 0x00074808, | |
IOCTL_DISK_FIND_NEW_DEVICES = 0x00074818, | |
IOCTL_DISK_FORMAT_DRIVE = 0x0007C3CC, | |
IOCTL_DISK_FORMAT_TRACKS = 0x0007C018, | |
IOCTL_DISK_FORMAT_TRACKS_EX = 0x0007C02C, | |
IOCTL_DISK_GET_CACHE_INFORMATION = 0x000740D4, | |
IOCTL_DISK_GET_CACHE_SETTING = 0x000740E0, | |
IOCTL_DISK_GET_DISK_ATTRIBUTES = 0x000700F0, | |
IOCTL_DISK_GET_DRIVE_GEOMETRY = 0x00070000, | |
IOCTL_DISK_GET_DRIVE_GEOMETRY_EX = 0x000700A0, | |
IOCTL_DISK_GET_DRIVE_LAYOUT = 0x0007400C, | |
IOCTL_DISK_GET_DRIVE_LAYOUT_EX = 0x00070050, | |
IOCTL_DISK_GET_LENGTH_INFO = 0x0007405C, | |
IOCTL_DISK_GET_MEDIA_TYPES = 0x00070C00, | |
IOCTL_DISK_GET_PARTITION_ATTRIBUTES = 0x000700E8, | |
IOCTL_DISK_GET_PARTITION_INFO = 0x00074004, | |
IOCTL_DISK_GET_PARTITION_INFO_EX = 0x00070048, | |
IOCTL_DISK_GET_SAN_SETTINGS = 0x00074200, | |
IOCTL_DISK_GET_SNAPSHOT_INFO = 0x00074208, | |
IOCTL_DISK_GET_WRITE_CACHE_STATE = 0x000740DC, | |
IOCTL_DISK_GROW_PARTITION = 0x0007C0D0, | |
IOCTL_DISK_HISTOGRAM_DATA = 0x00070034, | |
IOCTL_DISK_HISTOGRAM_RESET = 0x00070038, | |
IOCTL_DISK_HISTOGRAM_STRUCTURE = 0x00070030, | |
IOCTL_DISK_INTERNAL_CLEAR_VERIFY = 0x00070407, | |
IOCTL_DISK_INTERNAL_SET_NOTIFY = 0x00070408, | |
IOCTL_DISK_INTERNAL_SET_VERIFY = 0x00070403, | |
IOCTL_DISK_IS_CLUSTERED = 0x000700F8, | |
IOCTL_DISK_IS_WRITABLE = 0x00070024, | |
IOCTL_DISK_LOAD_MEDIA = 0x0007480C, | |
IOCTL_DISK_LOGGING = 0x00070028, | |
IOCTL_DISK_MEDIA_REMOVAL = 0x00074804, | |
IOCTL_DISK_PERFORMANCE = 0x00070020, | |
IOCTL_DISK_PERFORMANCE_OFF = 0x00070060, | |
IOCTL_DISK_REASSIGN_BLOCKS = 0x0007C01C, | |
IOCTL_DISK_REASSIGN_BLOCKS_EX = 0x0007C0A4, | |
IOCTL_DISK_RELEASE = 0x00074814, | |
IOCTL_DISK_REQUEST_DATA = 0x00070040, | |
IOCTL_DISK_REQUEST_STRUCTURE = 0x0007003C, | |
IOCTL_DISK_RESERVE = 0x00074810, | |
IOCTL_DISK_RESET_SNAPSHOT_INFO = 0x0007C210, | |
IOCTL_DISK_SENSE_DEVICE = 0x000703E0, | |
IOCTL_DISK_SET_CACHE_INFORMATION = 0x0007C0D8, | |
IOCTL_DISK_SET_CACHE_SETTING = 0x0007C0E4, | |
IOCTL_DISK_SET_DISK_ATTRIBUTES = 0x0007C0F4, | |
IOCTL_DISK_SET_DRIVE_LAYOUT = 0x0007C010, | |
IOCTL_DISK_SET_DRIVE_LAYOUT_EX = 0x0007C054, | |
IOCTL_DISK_SET_PARTITION_ATTRIBUTES = 0x0007C0EC, | |
IOCTL_DISK_SET_PARTITION_INFO = 0x0007C008, | |
IOCTL_DISK_SET_PARTITION_INFO_EX = 0x0007C04C, | |
IOCTL_DISK_SET_SAN_SETTINGS = 0x0007C204, | |
IOCTL_DISK_SET_SNAPSHOT_INFO = 0x0007C20C, | |
IOCTL_DISK_SIMBAD = 0x0007D000, | |
IOCTL_DISK_UPDATE_DRIVE_SIZE = 0x0007C0C8, | |
IOCTL_DISK_UPDATE_PROPERTIES = 0x00070140, | |
IOCTL_DISK_VERIFY = 0x00070014, | |
IOCTL_DOT4_ADD_ACTIVITY_BROADCAST = 0x003A2014, | |
IOCTL_DOT4_CLOSE_CHANNEL = 0x003A2008, | |
IOCTL_DOT4_CREATE_SOCKET = 0x003A2022, | |
IOCTL_DOT4_DESTROY_SOCKET = 0x003A202A, | |
IOCTL_DOT4_LAST = 0x0000080A, | |
IOCTL_DOT4_OPEN_CHANNEL = 0x003A2006, | |
IOCTL_DOT4_READ = 0x003A200E, | |
IOCTL_DOT4_REMOVE_ACTIVITY_BROADCAST = 0x003A2018, | |
IOCTL_DOT4_WAIT_ACTIVITY_BROADCAST = 0x003A201E, | |
IOCTL_DOT4_WAIT_FOR_CHANNEL = 0x003A2026, | |
IOCTL_DOT4_WRITE = 0x003A2011, | |
IOCTL_DVD_END_SESSION = 0x0033500C, | |
IOCTL_DVD_GET_REGION = 0x00335014, | |
IOCTL_DVD_READ_KEY = 0x00335004, | |
IOCTL_DVD_READ_STRUCTURE = 0x00335140, | |
IOCTL_DVD_SEND_KEY = 0x00335008, | |
IOCTL_DVD_SEND_KEY2 = 0x0033D018, | |
IOCTL_DVD_SET_READ_AHEAD = 0x00335010, | |
IOCTL_DVD_START_SESSION = 0x00335000, | |
IOCTL_EHSTOR_DEVICE_ENUMERATE_PDOS = 0x002D1410, | |
IOCTL_EHSTOR_DEVICE_GET_AUTHZ_STATE = 0x002D1408, | |
IOCTL_EHSTOR_DEVICE_SET_AUTHZ_STATE = 0x002D1404, | |
IOCTL_EHSTOR_DEVICE_SILO_COMMAND = 0x002D140C, | |
IOCTL_ENTER_PRIORITY_RECEIVE = 0x00000000, | |
IOCTL_FSVIDEO_COPY_FRAME_BUFFER = 0x00340800, | |
IOCTL_FSVIDEO_REVERSE_MOUSE_POINTER = 0x00340808, | |
IOCTL_FSVIDEO_SET_CURRENT_MODE = 0x0034080C, | |
IOCTL_FSVIDEO_SET_CURSOR_POSITION = 0x00340814, | |
IOCTL_FSVIDEO_SET_SCREEN_INFORMATION = 0x00340810, | |
IOCTL_FSVIDEO_WRITE_TO_FRAME_BUFFER = 0x00340804, | |
IOCTL_GET_CHANNEL_ALIGN_RQST = 0x80002014, | |
IOCTL_GET_DEVICE_DESCRIPTOR = 0x80002018, | |
IOCTL_GET_HCD_DRIVERKEY_NAME = 0x00220424, | |
IOCTL_GET_NUM_DEVICE_INPUT_BUFFERS = 0x000B01A0, | |
IOCTL_GET_PHYSICAL_DESCRIPTOR = 0x000B019A, | |
IOCTL_GET_PIPE_CONFIGURATION = 0x80002028, | |
IOCTL_GET_PROCESSOR_OBJ_INFO = 0x00294180, | |
IOCTL_GET_SYS_BUTTON_CAPS = 0x00294140, | |
IOCTL_GET_SYS_BUTTON_EVENT = 0x00294144, | |
IOCTL_GET_TUPLE_DATA = 0x00042EE0, | |
IOCTL_GET_USB_DESCRIPTOR = 0x80002020, | |
IOCTL_GET_VERSION = 0x80002000, | |
IOCTL_HID_ACTIVATE_DEVICE = 0x000B001F, | |
IOCTL_HID_DEACTIVATE_DEVICE = 0x000B0023, | |
IOCTL_HID_DISABLE_SECURE_READ = 0x000B020F, | |
IOCTL_HID_ENABLE_SECURE_READ = 0x000B020B, | |
IOCTL_HID_FLUSH_QUEUE = 0x000B0197, | |
IOCTL_HID_GET_COLLECTION_DESCRIPTOR = 0x000B0193, | |
IOCTL_HID_GET_COLLECTION_INFORMATION = 0x000B01A8, | |
IOCTL_HID_GET_DEVICE_ATTRIBUTES = 0x000B0027, | |
IOCTL_HID_GET_DEVICE_DESCRIPTOR = 0x000B0003, | |
IOCTL_HID_GET_DRIVER_CONFIG = 0x000B0190, | |
IOCTL_HID_GET_FEATURE = 0x000B0192, | |
IOCTL_HID_GET_FRIENDLY_NAME = 0x00000000, | |
IOCTL_HID_GET_HARDWARE_ID = 0x000B019E, | |
IOCTL_HID_GET_INDEXED_STRING = 0x000B01E2, | |
IOCTL_HID_GET_INPUT_REPORT = 0x000B01A2, | |
IOCTL_HID_GET_MANUFACTURER_STRING = 0x000B01BA, | |
IOCTL_HID_GET_MS_GENRE_DESCRIPTOR = 0x000B01E6, | |
IOCTL_HID_GET_POLL_FREQUENCY_MSEC = 0x000B0198, | |
IOCTL_HID_GET_PRODUCT_STRING = 0x000B01BE, | |
IOCTL_HID_GET_REPORT_DESCRIPTOR = 0x000B0007, | |
IOCTL_HID_GET_SERIALNUMBER_STRING = 0x000B01C2, | |
IOCTL_HID_GET_STRING = 0x000B0013, | |
IOCTL_HID_READ_REPORT = 0x000B000B, | |
IOCTL_HID_SEND_IDLE_NOTIFICATION_REQUEST = 0x000B002B, | |
IOCTL_HID_SET_DRIVER_CONFIG = 0x000B0194, | |
IOCTL_HID_SET_FEATURE = 0x000B0191, | |
IOCTL_HID_SET_OUTPUT_REPORT = 0x000B0195, | |
IOCTL_HID_SET_POLL_FREQUENCY_MSEC = 0x000B019C, | |
IOCTL_HID_WRITE_REPORT = 0x000B000F, | |
IOCTL_IDE_PASS_THROUGH = 0x0004D028, | |
IOCTL_IEEE1284_GET_MODE = 0x00160014, | |
IOCTL_IEEE1284_NEGOTIATE = 0x00160018, | |
IOCTL_IEEE1394_API_REQUEST = 0x00220400, | |
IOCTL_INTERNAL_BTHENUM_GET_DEVINFO = 0x0041000B, | |
IOCTL_INTERNAL_BTHENUM_GET_ENUMINFO = 0x00410007, | |
IOCTL_INTERNAL_BTH_SUBMIT_BRB = 0x00410003, | |
IOCTL_INTERNAL_DESELECT_DEVICE = 0x00160060, | |
IOCTL_INTERNAL_DISABLE_END_OF_CHAIN_BUS_RESCAN = 0x001600D8, | |
IOCTL_INTERNAL_DISCONNECT_IDLE = 0x00160080, | |
IOCTL_INTERNAL_ENABLE_END_OF_CHAIN_BUS_RESCAN = 0x001600DC, | |
IOCTL_INTERNAL_GET_MORE_PARALLEL_PORT_INFO = 0x00160044, | |
IOCTL_INTERNAL_GET_PARALLEL_PNP_INFO = 0x00160054, | |
IOCTL_INTERNAL_GET_PARALLEL_PORT_INFO = 0x00160030, | |
IOCTL_INTERNAL_GET_PARPORT_FDO = 0x00160074, | |
IOCTL_INTERNAL_I8042_CONTROLLER_WRITE_BUFFER = 0x000B3FCB, | |
IOCTL_INTERNAL_I8042_HOOK_KEYBOARD = 0x000B3FC3, | |
IOCTL_INTERNAL_I8042_HOOK_MOUSE = 0x000F3FC3, | |
IOCTL_INTERNAL_I8042_KEYBOARD_START_INFORMATION = 0x000B3FCF, | |
IOCTL_INTERNAL_I8042_KEYBOARD_WRITE_BUFFER = 0x000B3FC7, | |
IOCTL_INTERNAL_I8042_MOUSE_START_INFORMATION = 0x000F3FCF, | |
IOCTL_INTERNAL_I8042_MOUSE_WRITE_BUFFER = 0x000F3FC7, | |
IOCTL_INTERNAL_INIT_1284_3_BUS = 0x00160058, | |
IOCTL_INTERNAL_KEYBOARD_CONNECT = 0x000B0203, | |
IOCTL_INTERNAL_KEYBOARD_DISABLE = 0x000B1003, | |
IOCTL_INTERNAL_KEYBOARD_DISCONNECT = 0x000B0403, | |
IOCTL_INTERNAL_KEYBOARD_ENABLE = 0x000B0803, | |
IOCTL_INTERNAL_LOCK_PORT = 0x00160094, | |
IOCTL_INTERNAL_LOCK_PORT_NO_SELECT = 0x001600D0, | |
IOCTL_INTERNAL_MOUSE_CONNECT = 0x000F0203, | |
IOCTL_INTERNAL_MOUSE_DISABLE = 0x000F1003, | |
IOCTL_INTERNAL_MOUSE_DISCONNECT = 0x000F0403, | |
IOCTL_INTERNAL_MOUSE_ENABLE = 0x000F0803, | |
IOCTL_INTERNAL_PARALLEL_CLEAR_CHIP_MODE = 0x00160050, | |
IOCTL_INTERNAL_PARALLEL_CONNECT_INTERRUPT = 0x00160034, | |
IOCTL_INTERNAL_PARALLEL_DISCONNECT_INTERRUPT = 0x00160038, | |
IOCTL_INTERNAL_PARALLEL_PORT_ALLOCATE = 0x0016002C, | |
IOCTL_INTERNAL_PARALLEL_PORT_FREE = 0x001600A0, | |
IOCTL_INTERNAL_PARALLEL_SET_CHIP_MODE = 0x0016004C, | |
IOCTL_INTERNAL_PARCHIP_CONNECT = 0x00160048, | |
IOCTL_INTERNAL_PARCLASS_CONNECT = 0x00160078, | |
IOCTL_INTERNAL_PARCLASS_DISCONNECT = 0x0016007C, | |
IOCTL_INTERNAL_PARDOT3_CONNECT = 0x001600A4, | |
IOCTL_INTERNAL_PARDOT3_DISCONNECT = 0x001600A8, | |
IOCTL_INTERNAL_PARDOT3_RESET = 0x001600AC, | |
IOCTL_INTERNAL_PARDOT3_SIGNAL = 0x001600B0, | |
IOCTL_INTERNAL_REGISTER_FOR_REMOVAL_RELATIONS = 0x001600C8, | |
IOCTL_INTERNAL_RELEASE_PARALLEL_PORT_INFO = 0x0016003C, | |
IOCTL_INTERNAL_SELECT_DEVICE = 0x0016005C, | |
IOCTL_INTERNAL_SERENUM_REMOVE_SELF = 0x00370207, | |
IOCTL_INTERNAL_UNLOCK_PORT = 0x00160098, | |
IOCTL_INTERNAL_UNLOCK_PORT_NO_DESELECT = 0x001600D4, | |
IOCTL_INTERNAL_UNREGISTER_FOR_REMOVAL_RELATIONS = 0x001600CC, | |
IOCTL_INTERNAL_USB_CYCLE_PORT = 0x0022001F, | |
IOCTL_INTERNAL_USB_ENABLE_PORT = 0x00220017, | |
IOCTL_INTERNAL_USB_GET_BUSGUID_INFO = 0x00220428, | |
IOCTL_INTERNAL_USB_GET_BUS_INFO = 0x00220420, | |
IOCTL_INTERNAL_USB_GET_CONTROLLER_NAME = 0x00220424, | |
IOCTL_INTERNAL_USB_GET_DEVICE_CONFIG_INFO = 0x0022044F, | |
IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE = 0x00220433, | |
IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE_EX = 0x00220437, | |
IOCTL_INTERNAL_USB_GET_HUB_COUNT = 0x0022001B, | |
IOCTL_INTERNAL_USB_GET_HUB_NAME = 0x00220020, | |
IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO = 0x0022042C, | |
IOCTL_INTERNAL_USB_GET_PORT_STATUS = 0x00220013, | |
IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO = 0x0022000F, | |
IOCTL_INTERNAL_USB_GET_TOPOLOGY_ADDRESS = 0x0022043F, | |
IOCTL_INTERNAL_USB_GET_TT_DEVICE_HANDLE = 0x0022043B, | |
IOCTL_INTERNAL_USB_NOTIFY_IDLE_READY = 0x00220443, | |
IOCTL_INTERNAL_USB_RECORD_FAILURE = 0x0022002B, | |
IOCTL_INTERNAL_USB_REQ_GLOBAL_RESUME = 0x0022044B, | |
IOCTL_INTERNAL_USB_REQ_GLOBAL_SUSPEND = 0x00220447, | |
IOCTL_INTERNAL_USB_RESET_PORT = 0x00220007, | |
IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION = 0x00220027, | |
IOCTL_INTERNAL_USB_SUBMIT_URB = 0x00220003, | |
IOCTL_IP_ADDCHANGE_NOTIFY_REQUEST = 0x00000066, | |
IOCTL_IP_GET_BEST_INTERFACE = 0x00000069, | |
IOCTL_IP_INTERFACE_INFO = 0x00000068, | |
IOCTL_IP_RTCHANGE_NOTIFY_REQUEST = 0x00000065, | |
IOCTL_IP_SET_FIREWALL_HOOK = 0x00128030, | |
IOCTL_IP_UNIDIRECTIONAL_ADAPTER_ADDRESS = 0x0000006A, | |
IOCTL_IR_ENTER_PRIORITY_RECEIVE = 0x0F608028, | |
IOCTL_IR_ENTER_PRIORITY_RECEIVE_PARAMS = 0x00000000, | |
IOCTL_IR_EXIT_PRIORITY_RECEIVE = 0x0F60802C, | |
IOCTL_IR_FLASH_RECEIVER = 0x0F60800C, | |
IOCTL_IR_GET_DEVCAPS = 0x00000000, | |
IOCTL_IR_GET_DEV_CAPS = 0x0F604004, | |
IOCTL_IR_GET_EMITTERS = 0x0F604008, | |
IOCTL_IR_HANDSHAKE = 0x0F600024, | |
IOCTL_IR_PRIORITY_RECEIVE = 0x0F604022, | |
IOCTL_IR_RECEIVE = 0x0F60401A, | |
IOCTL_IR_RESET_DEVICE = 0x0F608010, | |
IOCTL_IR_SET_WAKE_PATTERN = 0x0F608038, | |
IOCTL_IR_TRANSMIT = 0x0F608015, | |
IOCTL_IR_USER_CLOSE = 0x0F608034, | |
IOCTL_IR_USER_OPEN = 0x0F608030, | |
IOCTL_KEYBOARD_INSERT_DATA = 0x000B0100, | |
IOCTL_KEYBOARD_QUERY_ATTRIBUTES = 0x000B0000, | |
IOCTL_KEYBOARD_QUERY_IME_STATUS = 0x000B1000, | |
IOCTL_KEYBOARD_QUERY_INDICATORS = 0x000B0040, | |
IOCTL_KEYBOARD_QUERY_INDICATOR_TRANSLATION = 0x000B0080, | |
IOCTL_KEYBOARD_QUERY_TYPEMATIC = 0x000B0020, | |
IOCTL_KEYBOARD_SET_IME_STATUS = 0x000B1004, | |
IOCTL_KEYBOARD_SET_INDICATORS = 0x000B0008, | |
IOCTL_KEYBOARD_SET_TYPEMATIC = 0x000B0004, | |
IOCTL_KS_DISABLE_EVENT = 0x002F000B, | |
IOCTL_KS_ENABLE_EVENT = 0x002F0007, | |
IOCTL_KS_HANDSHAKE = 0x002F001F, | |
IOCTL_KS_METHOD = 0x002F000F, | |
IOCTL_KS_PROPERTY = 0x002F0003, | |
IOCTL_KS_READ_STREAM = 0x002F4017, | |
IOCTL_KS_RESET_STATE = 0x002F001B, | |
IOCTL_KS_WRITE_STREAM = 0x002F8013, | |
IOCTL_LMR_ARE_FILE_OBJECTS_ON_SAME_SERVER = 0x001400F0, | |
IOCTL_MINIPORT_PROCESS_SERVICE_IRP = 0x0004D038, | |
IOCTL_MODEM_CHECK_FOR_MODEM = 0x002B002C, | |
IOCTL_MODEM_GET_DLE = 0x002B0010, | |
IOCTL_MODEM_GET_MESSAGE = 0x002B0020, | |
IOCTL_MODEM_GET_PASSTHROUGH = 0x002B0004, | |
IOCTL_MODEM_SEND_GET_MESSAGE = 0x002B0024, | |
IOCTL_MODEM_SEND_LOOPBACK_MESSAGE = 0x002B0028, | |
IOCTL_MODEM_SEND_MESSAGE = 0x002B001C, | |
IOCTL_MODEM_SET_DLE_MONITORING = 0x002B000C, | |
IOCTL_MODEM_SET_DLE_SHIELDING = 0x002B0014, | |
IOCTL_MODEM_SET_MIN_POWER = 0x002B0030, | |
IOCTL_MODEM_SET_PASSTHROUGH = 0x002B0008, | |
IOCTL_MODEM_STOP_WAVE_RECEIVE = 0x002B0018, | |
IOCTL_MODEM_WATCH_FOR_RESUME = 0x002B0034, | |
IOCTL_MOUNTDEV_LINK_CREATED = 0x004DC010, | |
IOCTL_MOUNTDEV_LINK_DELETED = 0x004DC014, | |
IOCTL_MOUNTDEV_QUERY_DEVICE_NAME = 0x004D0008, | |
IOCTL_MOUNTDEV_QUERY_STABLE_GUID = 0x004D0018, | |
IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME = 0x004D000C, | |
IOCTL_MOUNTDEV_QUERY_UNIQUE_ID = 0x004D0000, | |
IOCTL_MOUNTMGR_AUTO_DL_ASSIGNMENTS = 0x006DC014, | |
IOCTL_MOUNTMGR_BOOT_DL_ASSIGNMENT = 0x006DC044, | |
IOCTL_MOUNTMGR_CHANGE_NOTIFY = 0x006D4020, | |
IOCTL_MOUNTMGR_CHECK_UNPROCESSED_VOLUMES = 0x006D4028, | |
IOCTL_MOUNTMGR_CREATE_POINT = 0x006DC000, | |
IOCTL_MOUNTMGR_DELETE_POINTS = 0x006DC004, | |
IOCTL_MOUNTMGR_DELETE_POINTS_DBONLY = 0x006DC00C, | |
IOCTL_MOUNTMGR_KEEP_LINKS_WHEN_OFFLINE = 0x006DC024, | |
IOCTL_MOUNTMGR_NEXT_DRIVE_LETTER = 0x006DC010, | |
IOCTL_MOUNTMGR_QUERY_AUTO_MOUNT = 0x006D003C, | |
IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATH = 0x006D0030, | |
IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATHS = 0x006D0034, | |
IOCTL_MOUNTMGR_QUERY_POINTS = 0x006D0008, | |
IOCTL_MOUNTMGR_SCRUB_REGISTRY = 0x006DC038, | |
IOCTL_MOUNTMGR_SET_AUTO_MOUNT = 0x006DC040, | |
IOCTL_MOUNTMGR_TRACELOG_CACHE = 0x006D4048, | |
IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION = 0x006D402C, | |
IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_CREATED = 0x006DC018, | |
IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_DELETED = 0x006DC01C, | |
IOCTL_MOUSE_INSERT_DATA = 0x000F0004, | |
IOCTL_MOUSE_QUERY_ATTRIBUTES = 0x000F0000, | |
IOCTL_MPDSM_DEREGISTER = 0x736DC008, | |
IOCTL_MPDSM_REGISTER = 0x736DC004, | |
IOCTL_MPIO_PASS_THROUGH_PATH = 0x0004D03C, | |
IOCTL_MPIO_PASS_THROUGH_PATH_DIRECT = 0x0004D040, | |
IOCTL_MTP_CUSTOM_COMMAND = 0x3150544D, | |
IOCTL_NDIS_ADD_TDI_DEVICE = 0x00170014, | |
IOCTL_NDIS_DO_PNP_OPERATION = 0x00170008, | |
IOCTL_NDIS_ENUMERATE_INTERFACES = 0x00170010, | |
IOCTL_NDIS_GET_LOG_DATA = 0x0017001E, | |
IOCTL_NDIS_GET_VERSION = 0x00170020, | |
IOCTL_NDIS_QUERY_ALL_STATS = 0x00170006, | |
IOCTL_NDIS_QUERY_GLOBAL_STATS = 0x00170002, | |
IOCTL_NDIS_QUERY_SELECTED_STATS = 0x0017000E, | |
IOCTL_NDIS_RESERVED1 = 0x00170024, | |
IOCTL_NDIS_RESERVED10 = 0x00170048, | |
IOCTL_NDIS_RESERVED11 = 0x0017004C, | |
IOCTL_NDIS_RESERVED12 = 0x00170050, | |
IOCTL_NDIS_RESERVED13 = 0x00170054, | |
IOCTL_NDIS_RESERVED14 = 0x00170058, | |
IOCTL_NDIS_RESERVED15 = 0x0017005C, | |
IOCTL_NDIS_RESERVED16 = 0x00170060, | |
IOCTL_NDIS_RESERVED17 = 0x00170064, | |
IOCTL_NDIS_RESERVED18 = 0x00170068, | |
IOCTL_NDIS_RESERVED19 = 0x0017006C, | |
IOCTL_NDIS_RESERVED2 = 0x00170028, | |
IOCTL_NDIS_RESERVED20 = 0x00170070, | |
IOCTL_NDIS_RESERVED21 = 0x00170074, | |
IOCTL_NDIS_RESERVED22 = 0x00170078, | |
IOCTL_NDIS_RESERVED3 = 0x0017002C, | |
IOCTL_NDIS_RESERVED4 = 0x00170030, | |
IOCTL_NDIS_RESERVED5 = 0x00170034, | |
IOCTL_NDIS_RESERVED6 = 0x00178038, | |
IOCTL_NDIS_RESERVED7 = 0x0017003E, | |
IOCTL_NDIS_RESERVED8 = 0x00170040, | |
IOCTL_NDIS_RESERVED9 = 0x00170044, | |
IOCTL_NOTIFY_SWITCH_EVENT = 0x00294100, | |
IOCTL_PAR_ECP_HOST_RECOVERY = 0x00160034, | |
IOCTL_PAR_GET_DEFAULT_MODES = 0x00160028, | |
IOCTL_PAR_GET_DEVICE_CAPS = 0x00160024, | |
IOCTL_PAR_GET_READ_ADDRESS = 0x00160038, | |
IOCTL_PAR_GET_WRITE_ADDRESS = 0x0016003C, | |
IOCTL_PAR_IS_PORT_FREE = 0x00160054, | |
IOCTL_PAR_PING = 0x0016002C, | |
IOCTL_PAR_QUERY_DEVICE_ID = 0x0016000C, | |
IOCTL_PAR_QUERY_DEVICE_ID_SIZE = 0x00160010, | |
IOCTL_PAR_QUERY_INFORMATION = 0x00160004, | |
IOCTL_PAR_QUERY_LOCATION = 0x00160058, | |
IOCTL_PAR_QUERY_RAW_DEVICE_ID = 0x00160030, | |
IOCTL_PAR_SET_INFORMATION = 0x00160008, | |
IOCTL_PAR_SET_READ_ADDRESS = 0x00160020, | |
IOCTL_PAR_SET_WRITE_ADDRESS = 0x0016001C, | |
IOCTL_PAR_TEST = 0x00160050, | |
IOCTL_PCMCIA_HIDE_DEVICE = 0x0004AF08, | |
IOCTL_PCMCIA_REVEAL_DEVICE = 0x0004AF0C, | |
IOCTL_PF_SET_EXTENSION_POINTER = 0x00128058, | |
IOCTL_PMI_GET_CAPABILITIES = 0x00454000, | |
IOCTL_PMI_GET_CONFIGURATION = 0x00454004, | |
IOCTL_PMI_GET_MEASUREMENT = 0x0045400C, | |
IOCTL_PMI_REGISTER_EVENT_NOTIFY = 0x0045C010, | |
IOCTL_PMI_SET_CONFIGURATION = 0x00458008, | |
IOCTL_QUERY_DEVICE_POWER_STATE = 0x00294000, | |
IOCTL_QUERY_LID = 0x002940C0, | |
IOCTL_READ_REGISTERS = 0x8000200C, | |
IOCTL_REDIR_QUERY_PATH = 0x0014018F, | |
IOCTL_REDIR_QUERY_PATH_EX = 0x00140193, | |
IOCTL_RESET_PIPE = 0x8000201C, | |
IOCTL_RUN_ACTIVE_COOLING_METHOD = 0x00298088, | |
IOCTL_SCSISCAN_CMD = 0x00190012, | |
IOCTL_SCSISCAN_GET_INFO = 0x00190022, | |
IOCTL_SCSISCAN_LOCKDEVICE = 0x00190016, | |
IOCTL_SCSISCAN_SET_TIMEOUT = 0x0019001C, | |
IOCTL_SCSISCAN_UNLOCKDEVICE = 0x0019001A, | |
IOCTL_SCSI_EXECUTE_IN = 0x001B0011, | |
IOCTL_SCSI_EXECUTE_NONE = 0x001B0013, | |
IOCTL_SCSI_EXECUTE_OUT = 0x001B0012, | |
IOCTL_SCSI_FREE_DUMP_POINTERS = 0x00041024, | |
IOCTL_SCSI_GET_ADDRESS = 0x00041018, | |
IOCTL_SCSI_GET_CAPABILITIES = 0x00041010, | |
IOCTL_SCSI_GET_DUMP_POINTERS = 0x00041020, | |
IOCTL_SCSI_GET_INQUIRY_DATA = 0x0004100C, | |
IOCTL_SCSI_MINIPORT = 0x0004D008, | |
IOCTL_SCSI_MINIPORT_DISABLE_SMART = 0x001B0505, | |
IOCTL_SCSI_MINIPORT_ENABLE_DISABLE_AUTOSAVE = 0x001B0507, | |
IOCTL_SCSI_MINIPORT_ENABLE_DISABLE_AUTO_OFFLINE = 0x001B050A, | |
IOCTL_SCSI_MINIPORT_ENABLE_SMART = 0x001B0504, | |
IOCTL_SCSI_MINIPORT_EXECUTE_OFFLINE_DIAGS = 0x001B0509, | |
IOCTL_SCSI_MINIPORT_IDENTIFY = 0x001B0501, | |
IOCTL_SCSI_MINIPORT_NOT_CLUSTER_CAPABLE = 0x001B0521, | |
IOCTL_SCSI_MINIPORT_NOT_QUORUM_CAPABLE = 0x001B0520, | |
IOCTL_SCSI_MINIPORT_NVCACHE = 0x001B0600, | |
IOCTL_SCSI_MINIPORT_READ_SMART_ATTRIBS = 0x001B0502, | |
IOCTL_SCSI_MINIPORT_READ_SMART_LOG = 0x001B050B, | |
IOCTL_SCSI_MINIPORT_READ_SMART_THRESHOLDS = 0x001B0503, | |
IOCTL_SCSI_MINIPORT_RETURN_STATUS = 0x001B0506, | |
IOCTL_SCSI_MINIPORT_SAVE_ATTRIBUTE_VALUES = 0x001B0508, | |
IOCTL_SCSI_MINIPORT_SMART_VERSION = 0x001B0500, | |
IOCTL_SCSI_MINIPORT_WRITE_SMART_LOG = 0x001B050C, | |
IOCTL_SCSI_PASS_THROUGH = 0x0004D004, | |
IOCTL_SCSI_PASS_THROUGH_DIRECT = 0x0004D014, | |
IOCTL_SCSI_RESCAN_BUS = 0x0004101C, | |
IOCTL_SD_SUBMIT_REQUEST = 0x00043073, | |
IOCTL_SEND_USB_REQUEST = 0x80002024, | |
IOCTL_SERENUM_EXPOSE_HARDWARE = 0x00370200, | |
IOCTL_SERENUM_GET_PORT_NAME = 0x0037020C, | |
IOCTL_SERENUM_PORT_DESC = 0x00370208, | |
IOCTL_SERENUM_REMOVE_HARDWARE = 0x00370204, | |
IOCTL_SERIAL_CLEAR_STATS = 0x001B0090, | |
IOCTL_SERIAL_CLR_DTR = 0x001B0028, | |
IOCTL_SERIAL_CLR_RTS = 0x001B0034, | |
IOCTL_SERIAL_CONFIG_SIZE = 0x001B0080, | |
IOCTL_SERIAL_GET_BAUD_RATE = 0x001B0050, | |
IOCTL_SERIAL_GET_CHARS = 0x001B0058, | |
IOCTL_SERIAL_GET_COMMCONFIG = 0x001B0084, | |
IOCTL_SERIAL_GET_COMMSTATUS = 0x001B006C, | |
IOCTL_SERIAL_GET_DTRRTS = 0x001B0078, | |
IOCTL_SERIAL_GET_HANDFLOW = 0x001B0060, | |
IOCTL_SERIAL_GET_LINE_CONTROL = 0x001B0054, | |
IOCTL_SERIAL_GET_MODEMSTATUS = 0x001B0068, | |
IOCTL_SERIAL_GET_MODEM_CONTROL = 0x001B0094, | |
IOCTL_SERIAL_GET_PROPERTIES = 0x001B0074, | |
IOCTL_SERIAL_GET_STATS = 0x001B008C, | |
IOCTL_SERIAL_GET_TIMEOUTS = 0x001B0020, | |
IOCTL_SERIAL_GET_WAIT_MASK = 0x001B0040, | |
IOCTL_SERIAL_IMMEDIATE_CHAR = 0x001B0018, | |
IOCTL_SERIAL_INTERNAL_BASIC_SETTINGS = 0x001B000C, | |
IOCTL_SERIAL_INTERNAL_CANCEL_WAIT_WAKE = 0x001B0008, | |
IOCTL_SERIAL_INTERNAL_DO_WAIT_WAKE = 0x001B0004, | |
IOCTL_SERIAL_INTERNAL_RESTORE_SETTINGS = 0x001B0010, | |
IOCTL_SERIAL_LSRMST_INSERT = 0x001B007C, | |
IOCTL_SERIAL_PURGE = 0x001B004C, | |
IOCTL_SERIAL_RESET_DEVICE = 0x001B002C, | |
IOCTL_SERIAL_SET_BAUD_RATE = 0x001B0004, | |
IOCTL_SERIAL_SET_BREAK_OFF = 0x001B0014, | |
IOCTL_SERIAL_SET_BREAK_ON = 0x001B0010, | |
IOCTL_SERIAL_SET_CHARS = 0x001B005C, | |
IOCTL_SERIAL_SET_COMMCONFIG = 0x001B0088, | |
IOCTL_SERIAL_SET_DTR = 0x001B0024, | |
IOCTL_SERIAL_SET_FIFO_CONTROL = 0x001B009C, | |
IOCTL_SERIAL_SET_HANDFLOW = 0x001B0064, | |
IOCTL_SERIAL_SET_LINE_CONTROL = 0x001B000C, | |
IOCTL_SERIAL_SET_MODEM_CONTROL = 0x001B0098, | |
IOCTL_SERIAL_SET_QUEUE_SIZE = 0x001B0008, | |
IOCTL_SERIAL_SET_RTS = 0x001B0030, | |
IOCTL_SERIAL_SET_TIMEOUTS = 0x001B001C, | |
IOCTL_SERIAL_SET_WAIT_MASK = 0x001B0044, | |
IOCTL_SERIAL_SET_XOFF = 0x001B0038, | |
IOCTL_SERIAL_SET_XON = 0x001B003C, | |
IOCTL_SERIAL_WAIT_ON_MASK = 0x001B0048, | |
IOCTL_SERIAL_XOFF_COUNTER = 0x001B0070, | |
IOCTL_SET_DEVICE_WAKE = 0x00298004, | |
IOCTL_SET_NUM_DEVICE_INPUT_BUFFERS = 0x000B01A4, | |
IOCTL_SET_SERVER_STATE = 0x002B003C, | |
IOCTL_SET_SYS_MESSAGE_INDICATOR = 0x002981C0, | |
IOCTL_SET_TIMEOUT = 0x8000202C, | |
IOCTL_SFFDISK_DEVICE_COMMAND = 0x00079E84, | |
IOCTL_SFFDISK_DEVICE_PASSWORD = 0x00079E88, | |
IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL = 0x00071E80, | |
IOCTL_SMARTCARD_CONFISCATE = 0x00310010, | |
IOCTL_SMARTCARD_EJECT = 0x00310018, | |
IOCTL_SMARTCARD_GET_ATTRIBUTE = 0x00310008, | |
IOCTL_SMARTCARD_GET_LAST_ERROR = 0x0031003C, | |
IOCTL_SMARTCARD_GET_PERF_CNTR = 0x00310040, | |
IOCTL_SMARTCARD_GET_STATE = 0x00310038, | |
IOCTL_SMARTCARD_IS_ABSENT = 0x0031002C, | |
IOCTL_SMARTCARD_IS_PRESENT = 0x00310028, | |
IOCTL_SMARTCARD_POWER = 0x00310004, | |
IOCTL_SMARTCARD_SET_ATTRIBUTE = 0x0031000C, | |
IOCTL_SMARTCARD_SET_PROTOCOL = 0x00310030, | |
IOCTL_SMARTCARD_SWALLOW = 0x0031001C, | |
IOCTL_SMARTCARD_TRANSMIT = 0x00310014, | |
IOCTL_SOCKET_INFORMATION = 0x00042EF0, | |
IOCTL_STORAGE_ALLOCATE_BC_STREAM = 0x002DD804, | |
IOCTL_STORAGE_BC_VERSION = 0x00000001, | |
IOCTL_STORAGE_BREAK_RESERVATION = 0x002D5014, | |
IOCTL_STORAGE_CHECK_PRIORITY_HINT_SUPPORT = 0x002D1880, | |
IOCTL_STORAGE_CHECK_VERIFY = 0x002D4800, | |
IOCTL_STORAGE_CHECK_VERIFY2 = 0x002D0800, | |
IOCTL_STORAGE_EJECTION_CONTROL = 0x002D0940, | |
IOCTL_STORAGE_EJECT_MEDIA = 0x002D4808, | |
IOCTL_STORAGE_FIND_NEW_DEVICES = 0x002D4818, | |
IOCTL_STORAGE_FREE_BC_STREAM = 0x002DD808, | |
IOCTL_STORAGE_GET_BC_PROPERTIES = 0x002D5800, | |
IOCTL_STORAGE_GET_DEVICE_NUMBER = 0x002D1080, | |
IOCTL_STORAGE_GET_HOTPLUG_INFO = 0x002D0C14, | |
IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER = 0x002D0C10, | |
IOCTL_STORAGE_GET_MEDIA_TYPES = 0x002D0C00, | |
IOCTL_STORAGE_GET_MEDIA_TYPES_EX = 0x002D0C04, | |
IOCTL_STORAGE_LOAD_MEDIA = 0x002D480C, | |
IOCTL_STORAGE_LOAD_MEDIA2 = 0x002D080C, | |
IOCTL_STORAGE_MANAGE_DATA_SET_ATTRIBUTES = 0x002D9404, | |
IOCTL_STORAGE_MCN_CONTROL = 0x002D0944, | |
IOCTL_STORAGE_MEDIA_REMOVAL = 0x002D4804, | |
IOCTL_STORAGE_PERSISTENT_RESERVE_IN = 0x002D5018, | |
IOCTL_STORAGE_PERSISTENT_RESERVE_OUT = 0x002DD01C, | |
IOCTL_STORAGE_PREDICT_FAILURE = 0x002D1100, | |
IOCTL_STORAGE_QUERY_PROPERTY = 0x002D1400, | |
IOCTL_STORAGE_READ_CAPACITY = 0x002D5140, | |
IOCTL_STORAGE_RELEASE = 0x002D4814, | |
IOCTL_STORAGE_RESERVE = 0x002D4810, | |
IOCTL_STORAGE_RESET_BUS = 0x002D5000, | |
IOCTL_STORAGE_RESET_DEVICE = 0x002D5004, | |
IOCTL_STORAGE_SET_HOTPLUG_INFO = 0x002DCC18, | |
IOCTL_STORAGE_SET_READ_AHEAD = 0x002D4400, | |
IOCTL_SWENUM_GET_BUS_ID = 0x002A400B, | |
IOCTL_SWENUM_INSTALL_INTERFACE = 0x002A0000, | |
IOCTL_SWENUM_REMOVE_INTERFACE = 0x002A0004, | |
IOCTL_TAPE_CHECK_VERIFY = 0x001F4800, | |
IOCTL_TAPE_CREATE_PARTITION = 0x001FC028, | |
IOCTL_TAPE_EJECT_MEDIA = 0x001F4808, | |
IOCTL_TAPE_ERASE = 0x001FC000, | |
IOCTL_TAPE_FIND_NEW_DEVICES = 0x00074818, | |
IOCTL_TAPE_GET_DRIVE_PARAMS = 0x001F4014, | |
IOCTL_TAPE_GET_MEDIA_PARAMS = 0x001F401C, | |
IOCTL_TAPE_GET_POSITION = 0x001F400C, | |
IOCTL_TAPE_GET_STATUS = 0x001F4024, | |
IOCTL_TAPE_LOAD_MEDIA = 0x001F480C, | |
IOCTL_TAPE_MEDIA_REMOVAL = 0x001F4804, | |
IOCTL_TAPE_PREPARE = 0x001F4004, | |
IOCTL_TAPE_RELEASE = 0x001F4814, | |
IOCTL_TAPE_RESERVE = 0x001F4810, | |
IOCTL_TAPE_SET_DRIVE_PARAMS = 0x001FC018, | |
IOCTL_TAPE_SET_MEDIA_PARAMS = 0x001F4020, | |
IOCTL_TAPE_SET_POSITION = 0x001F4010, | |
IOCTL_TAPE_WRITE_MARKS = 0x001FC008, | |
IOCTL_TCP_QUERY_INFORMATION_EX = 0x00120003, | |
IOCTL_TDI_ACCEPT = 0x00210000, | |
IOCTL_TDI_ACTION = 0x00210036, | |
IOCTL_TDI_ASSOCIATE_ADDRESS = 0x0021002C, | |
IOCTL_TDI_CONNECT = 0x00210004, | |
IOCTL_TDI_DISASSOCIATE_ADDRESS = 0x00210030, | |
IOCTL_TDI_DISCONNECT = 0x00210008, | |
IOCTL_TDI_LISTEN = 0x0021000C, | |
IOCTL_TDI_MAGIC_BULLET = 0x002101FF, | |
IOCTL_TDI_QUERY_DIRECT_SENDDG_HANDLER = 0x00210207, | |
IOCTL_TDI_QUERY_DIRECT_SEND_HANDLER = 0x00210203, | |
IOCTL_TDI_QUERY_INFORMATION = 0x00210012, | |
IOCTL_TDI_RECEIVE = 0x00210016, | |
IOCTL_TDI_RECEIVE_DATAGRAM = 0x0021001A, | |
IOCTL_TDI_SEND = 0x0021001D, | |
IOCTL_TDI_SEND_DATAGRAM = 0x00210021, | |
IOCTL_TDI_SET_EVENT_HANDLER = 0x00210024, | |
IOCTL_TDI_SET_INFORMATION = 0x00210029, | |
IOCTL_TDI_TL_IO_CONTROL_ENDPOINT = 0x00210038, | |
IOCTL_THERMAL_QUERY_INFORMATION = 0x00294080, | |
IOCTL_THERMAL_SET_COOLING_POLICY = 0x00298084, | |
IOCTL_USBPRINT_GET_1284_ID = 0x00220034, | |
IOCTL_USBPRINT_GET_LPT_STATUS = 0x00220030, | |
IOCTL_USBPRINT_SOFT_RESET = 0x00220040, | |
IOCTL_USBPRINT_VENDOR_GET_COMMAND = 0x0022003C, | |
IOCTL_USBPRINT_VENDOR_SET_COMMAND = 0x00220038, | |
IOCTL_USB_DIAGNOSTIC_MODE_OFF = 0x00220404, | |
IOCTL_USB_DIAGNOSTIC_MODE_ON = 0x00220400, | |
IOCTL_USB_DIAG_IGNORE_HUBS_OFF = 0x0022041C, | |
IOCTL_USB_DIAG_IGNORE_HUBS_ON = 0x00220418, | |
IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION = 0x00220410, | |
IOCTL_USB_GET_HUB_CAPABILITIES = 0x0022043C, | |
IOCTL_USB_GET_HUB_CAPABILITIES_EX = 0x00220450, | |
IOCTL_USB_GET_NODE_CONNECTION_ATTRIBUTES = 0x00220440, | |
IOCTL_USB_GET_NODE_CONNECTION_DRIVERKEY_NAME = 0x00220420, | |
IOCTL_USB_GET_NODE_CONNECTION_INFORMATION = 0x0022040C, | |
IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX = 0x00220448, | |
IOCTL_USB_GET_NODE_CONNECTION_NAME = 0x00220414, | |
IOCTL_USB_GET_NODE_INFORMATION = 0x00220408, | |
IOCTL_USB_GET_ROOT_HUB_NAME = 0x00220408, | |
IOCTL_USB_HCD_DISABLE_PORT = 0x00220430, | |
IOCTL_USB_HCD_ENABLE_PORT = 0x00220434, | |
IOCTL_USB_HCD_GET_STATS_1 = 0x002203FC, | |
IOCTL_USB_HCD_GET_STATS_2 = 0x00220428, | |
IOCTL_USB_HUB_CYCLE_PORT = 0x00220444, | |
IOCTL_USB_RESET_HUB = 0x0022044C, | |
IOCTL_USB_USER_REQUEST = 0x00220438, | |
IOCTL_VIDEO_DISABLE_CURSOR = 0x00230424, | |
IOCTL_VIDEO_DISABLE_POINTER = 0x0023043C, | |
IOCTL_VIDEO_DISABLE_VDM = 0x00230004, | |
IOCTL_VIDEO_ENABLE_CURSOR = 0x00230420, | |
IOCTL_VIDEO_ENABLE_POINTER = 0x00230438, | |
IOCTL_VIDEO_ENABLE_VDM = 0x00230000, | |
IOCTL_VIDEO_ENUM_MONITOR_PDO = 0x00230018, | |
IOCTL_VIDEO_FREE_PUBLIC_ACCESS_RANGES = 0x00230464, | |
IOCTL_VIDEO_GET_BANK_SELECT_CODE = 0x00230454, | |
IOCTL_VIDEO_GET_CHILD_STATE = 0x00230480, | |
IOCTL_VIDEO_GET_OUTPUT_DEVICE_POWER_STATE = 0x00230010, | |
IOCTL_VIDEO_GET_POWER_MANAGEMENT = 0x00230470, | |
IOCTL_VIDEO_HANDLE_VIDEOPARAMETERS = 0x00230020, | |
IOCTL_VIDEO_INIT_WIN32K_CALLBACKS = 0x0023001C, | |
IOCTL_VIDEO_IS_VGA_DEVICE = 0x00230024, | |
IOCTL_VIDEO_LOAD_AND_SET_FONT = 0x00230414, | |
IOCTL_VIDEO_MAP_VIDEO_MEMORY = 0x00230458, | |
IOCTL_VIDEO_MONITOR_DEVICE = 0x00230014, | |
IOCTL_VIDEO_PREPARE_FOR_EARECOVERY = 0x0023002C, | |
IOCTL_VIDEO_QUERY_AVAIL_MODES = 0x00230400, | |
IOCTL_VIDEO_QUERY_COLOR_CAPABILITIES = 0x00230468, | |
IOCTL_VIDEO_QUERY_CURRENT_MODE = 0x00230408, | |
IOCTL_VIDEO_QUERY_CURSOR_ATTR = 0x0023042C, | |
IOCTL_VIDEO_QUERY_CURSOR_POSITION = 0x00230434, | |
IOCTL_VIDEO_QUERY_DISPLAY_BRIGHTNESS = 0x00230498, | |
IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES = 0x00230404, | |
IOCTL_VIDEO_QUERY_POINTER_ATTR = 0x00230444, | |
IOCTL_VIDEO_QUERY_POINTER_CAPABILITIES = 0x00230450, | |
IOCTL_VIDEO_QUERY_POINTER_POSITION = 0x0023044C, | |
IOCTL_VIDEO_QUERY_PUBLIC_ACCESS_RANGES = 0x00230460, | |
IOCTL_VIDEO_QUERY_SUPPORTED_BRIGHTNESS = 0x00230494, | |
IOCTL_VIDEO_REGISTER_VDM = 0x00230008, | |
IOCTL_VIDEO_RESET_DEVICE = 0x00230410, | |
IOCTL_VIDEO_RESTORE_HARDWARE_STATE = 0x00230204, | |
IOCTL_VIDEO_SAVE_HARDWARE_STATE = 0x00230200, | |
IOCTL_VIDEO_SET_BANK_POSITION = 0x00230490, | |
IOCTL_VIDEO_SET_CHILD_STATE_CONFIGURATION = 0x00230488, | |
IOCTL_VIDEO_SET_COLOR_LUT_DATA = 0x0023047C, | |
IOCTL_VIDEO_SET_COLOR_REGISTERS = 0x0023041C, | |
IOCTL_VIDEO_SET_CURRENT_MODE = 0x0023040C, | |
IOCTL_VIDEO_SET_CURSOR_ATTR = 0x00230428, | |
IOCTL_VIDEO_SET_CURSOR_POSITION = 0x00230430, | |
IOCTL_VIDEO_SET_DISPLAY_BRIGHTNESS = 0x0023049C, | |
IOCTL_VIDEO_SET_OUTPUT_DEVICE_POWER_STATE = 0x0023000C, | |
IOCTL_VIDEO_SET_PALETTE_REGISTERS = 0x00230418, | |
IOCTL_VIDEO_SET_POINTER_ATTR = 0x00230440, | |
IOCTL_VIDEO_SET_POINTER_POSITION = 0x00230448, | |
IOCTL_VIDEO_SET_POWER_MANAGEMENT = 0x0023046C, | |
IOCTL_VIDEO_SHARE_VIDEO_MEMORY = 0x00230474, | |
IOCTL_VIDEO_SWITCH_DUALVIEW = 0x0023048C, | |
IOCTL_VIDEO_UNMAP_VIDEO_MEMORY = 0x0023045C, | |
IOCTL_VIDEO_UNSHARE_VIDEO_MEMORY = 0x00230478, | |
IOCTL_VIDEO_USE_DEVICE_IN_SESSION = 0x00230028, | |
IOCTL_VIDEO_VALIDATE_CHILD_STATE_CONFIGURATION = 0x00230484, | |
IOCTL_VOLSNAP_FLUSH_AND_HOLD_WRITES = 0x0053C000, | |
IOCTL_VOLUME_ALLOCATE_BC_STREAM = 0x0056C040, | |
IOCTL_VOLUME_BC_VERSION = 0x00000001, | |
IOCTL_VOLUME_FREE_BC_STREAM = 0x0056C044, | |
IOCTL_VOLUME_GET_BC_PROPERTIES = 0x0056403C, | |
IOCTL_VOLUME_GET_GPT_ATTRIBUTES = 0x00560038, | |
IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS = 0x00560000, | |
IOCTL_VOLUME_IS_CLUSTERED = 0x00560030, | |
IOCTL_VOLUME_IS_DYNAMIC = 0x00560048, | |
IOCTL_VOLUME_IS_IO_CAPABLE = 0x00560014, | |
IOCTL_VOLUME_IS_OFFLINE = 0x00560010, | |
IOCTL_VOLUME_IS_PARTITION = 0x00560028, | |
IOCTL_VOLUME_LOGICAL_TO_PHYSICAL = 0x00560020, | |
IOCTL_VOLUME_OFFLINE = 0x0056C00C, | |
IOCTL_VOLUME_ONLINE = 0x0056C008, | |
IOCTL_VOLUME_PHYSICAL_TO_LOGICAL = 0x00560024, | |
IOCTL_VOLUME_PREPARE_FOR_CRITICAL_IO = 0x0056C04C, | |
IOCTL_VOLUME_PREPARE_FOR_SHRINK = 0x0056C05C, | |
IOCTL_VOLUME_QUERY_ALLOCATION_HINT = 0x00564052, | |
IOCTL_VOLUME_QUERY_FAILOVER_SET = 0x00560018, | |
IOCTL_VOLUME_QUERY_MINIMUM_SHRINK_SIZE = 0x00564058, | |
IOCTL_VOLUME_QUERY_VOLUME_NUMBER = 0x0056001C, | |
IOCTL_VOLUME_READ_PLEX = 0x0056402E, | |
IOCTL_VOLUME_SET_GPT_ATTRIBUTES = 0x00560034, | |
IOCTL_VOLUME_SUPPORTS_ONLINE_OFFLINE = 0x00560004, | |
IOCTL_VOLUME_UPDATE_PROPERTIES = 0x00560054, | |
IOCTL_WAIT_ON_DEVICE_EVENT = 0x80002008, | |
IOCTL_WMP_DEVICE_CAN_SYNC = 0x32504D57, | |
IOCTL_WMP_METADATA_ROUND_TRIP = 0x31504D57, | |
IOCTL_WPD_MESSAGE_READWRITE_ACCESS = 0x0040C108, | |
IOCTL_WPD_MESSAGE_READ_ACCESS = 0x00404108, | |
IOCTL_WRITE_REGISTERS = 0x80002010 | |
}; | |
} | |
'@ | |
Add-Type -TypeDefinition $TypeDef | |
# Mask off high order 16 bits ("Common" and Device Type) | |
# 11111111111111110000000000000000 == 0xFFFF0000 == 4294901760 | |
# Shift by 16 bits: | |
# Binary: XXXXXXXXXXXXXXXX0000000000000000 -> 0000000000000000XXXXXXXXXXXXXXXX | |
# Hex: 0xXXXX0000 -> 0x0000XXXX | |
# Treat as UInt16 since the value is unsigned and will never be larger than 16 bits | |
$DeviceType = [UInt16] (($IOControlCode -band 4294901760) -shr 16) | |
# Mask off high order bit ("Common") | |
# 10000000000000000000000000000000 == 0x80000000 == 2147483648 | |
# Shift by 31 bits: | |
# Binary: X0000000000000000000000000000000 -> 0000000000000000000000000000000X | |
# Treat as a Bool since the value will never be larger than 1 bit | |
$IsVendorDeviceType = [Bool] (($IOControlCode -band 2147483648) -shr 31) | |
# Mask off bits 2-13 ("Custom" and Function Code) | |
# 00000000000000000011111111111100 == 0x00003FFC == 16380 | |
# Shift by 2 bits: | |
# Binary: 000000000000000000XXXXXXXXXXXX00 -> 00000000000000000000XXXXXXXXXXXX | |
# Treat as UInt16 since the value is unsigned and will never be larger than 16 bits | |
$FunctionCode = [UInt16] (($IOControlCode -band 16380) -shr 2) | |
# Mask off bit 13 ("Custom") | |
# 00000000000000000010000000000000 == 0x00002000 == 8192 | |
# Shift by 13 bits: | |
# Binary: 000000000000000000X0000000000000 -> 0000000000000000000000000000000X | |
# Treat as a Bool since the value will never be larger than 1 bit | |
$IsVendorFunctionCode = [Bool] (($IOControlCode -band 8192) -shr 13) | |
# Mask off bits 0-1 (Transfer Type) | |
# 00000000000000000000000000000011 == 3 | |
# No shifting necessary since it is already the low-order two bits | |
# Treat as Byte since the value is unsigned and will never be larger than 8 bits | |
$TransferType = [Byte] ($IOControlCode -band 3) | |
# Mask off bits 14-15 (Required Access) | |
# 00000000000000001100000000000000 == 0x0000C000 == 49152 | |
# Shift by 14 bits: | |
# Binary: 0000000000000000XX00000000000000 -> 000000000000000000000000000000XX | |
# Treat as Byte since the value is unsigned and will never be larger than 8 bits | |
$RequiredAccess = [Byte] (($IOControlCode -band 49152) -shr 14) | |
# The Parse method will force a value even if it isn't | |
# defined to parse to the [IOControlCode.DeviceType] type | |
$ParsedDeviceType = [Enum]::Parse([IOControlCode.DeviceType], $DeviceType) | |
$FriendlyName = '' | |
if ([Enum]::IsDefined([IOControlCode.FriendlyName], [UInt32] $IOControlCode)) { | |
$FriendlyName = [IOControlCode.FriendlyName] $IOControlCode | |
} | |
[PSCustomObject] @{ | |
DeviceType = $ParsedDeviceType | |
IsVendorDeviceType = $IsVendorDeviceType | |
FunctionCode = $FunctionCode | |
IsVendorFunctionCode = $IsVendorFunctionCode | |
TransferType = [IOControlCode.TransferType] $TransferType | |
RequiredAccess = [Enum]::Parse([IOControlCode.RequiredAccess], $RequiredAccess) | |
FriendlyName = $FriendlyName | |
} | |
} | |
# Example IOCTL: | |
# IOCTL_DISK_SET_PARTITION_INFO_EX | |
$IOControlCode = 0x0007C04C | |
$IOControlCode | ConvertFrom-IOControlCode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment