Gushe Posted February 21, 2010 Posted February 21, 2010 (edited) Delphi didn't seem to have these predefined, so I had to calculate it myself. Since it can be pretty tough finding the right values (even with Google) I thought I'd just calculate them all and share the list with you. They are for use with the DeviceIoControl() API. I have found the code used to calculate the values on internet and only had to find the right parameter values, thus not too much credit should go to me.This function being:function CTL_CODE(DeviceType, FunctionNo, Method, Access: Integer): Integer;begin Result := (DeviceType shl 16) or (Access shl 14) or (FunctionNo shl 2) or (Method);end;As for Method and Access, these are the values used for them: METHOD_BUFFERED = 0; METHOD_NEITHER = 3; FILE_ANY_ACCESS = 0; FILE_READ_ACCESS = 1; FILE_WRITE_ACCESS = 2;The list:(I used $ instead of 0x because this list will probably be predefined in most C/C++ and ASM compilers and I used it for Delphi)IOCTL_DISK_GET_DRIVE_GEOMETRY = $0070000IOCTL_DISK_GET_PARTITION_INFO = $0074004IOCTL_DISK_SET_PARTITION_INFO = $007C008IOCTL_DISK_GET_DRIVE_LAYOUT = $007400CIOCTL_DISK_SET_DRIVE_LAYOUT = $007C010IOCTL_DISK_VERIFY = $0070014IOCTL_DISK_FORMAT_TRACKS = $007C018IOCTL_DISK_REASSIGN_BLOCKS = $007C01CIOCTL_DISK_PERFORMANCE = $0070020IOCTL_DISK_IS_WRITABLE = $0070024IOCTL_DISK_LOGGING = $0070028IOCTL_DISK_FORMAT_TRACKS_EX = $007C02CIOCTL_DISK_HISTOGRAM_STRUCTURE = $0070030IOCTL_DISK_HISTOGRAM_DATA = $0070034IOCTL_DISK_HISTOGRAM_RESET = $0070038IOCTL_DISK_REQUEST_STRUCTURE = $007003CIOCTL_DISK_REQUEST_DATA = $0070040IOCTL_DISK_CONTROLLER_NUMBER = $0070044IOCTL_DISK_GET_PARTITION_INFO_EX = $0070048IOCTL_DISK_SET_PARTITION_INFO_EX = $007C04CIOCTL_DISK_GET_DRIVE_LAYOUT_EX = $0070050IOCTL_DISK_SET_DRIVE_LAYOUT_EX = $007C054IOCTL_DISK_CREATE_DISK = $007C058IOCTL_DISK_GET_LENGTH_INFO = $007405CSMART_GET_VERSION = $0074080SMART_SEND_DRIVE_COMMAND = $007C084SMART_RCV_DRIVE_DATA = $007C088IOCTL_DISK_GET_DRIVE_GEOMETRY_EX = $00700A0IOCTL_DISK_UPDATE_DRIVE_SIZE = $007C0C8IOCTL_DISK_GROW_PARTITION = $007C0D0IOCTL_DISK_GET_CACHE_INFORMATION = $00740D4IOCTL_DISK_SET_CACHE_INFORMATION = $007C0D8IOCTL_DISK_GET_WRITE_CACHE_STATE = $00740DCIOCTL_DISK_DELETE_DRIVE_LAYOUT = $007C100IOCTL_DISK_UPDATE_PROPERTIES = $0070140IOCTL_DISK_FORMAT_DRIVE = $007C3CCIOCTL_DISK_SENSE_DEVICE = $00703E0IOCTL_DISK_INTERNAL_SET_VERIFY = $0070403IOCTL_DISK_INTERNAL_CLEAR_VERIFY = $0070407IOCTL_DISK_INTERNAL_SET_NOTIFY = $0070408IOCTL_DISK_CHECK_VERIFY = $0074800IOCTL_DISK_MEDIA_REMOVAL = $0074804IOCTL_DISK_EJECT_MEDIA = $0074808IOCTL_DISK_LOAD_MEDIA = $007480CIOCTL_DISK_RESERVE = $0074810IOCTL_DISK_RELEASE = $0074814IOCTL_DISK_FIND_NEW_DEVICES = $0074818IOCTL_DISK_GET_MEDIA_TYPES = $0070C00I hope this will helpful for somebody!PS: If I forgot one or you are in need of another one, PM me or leave a message here! Edited February 21, 2010 by Gushe
ragdog Posted March 1, 2010 Posted March 1, 2010 HiIn last time coding i with Ioctl and i have a nice tool foundIoctlDecoder:/>http://www.freewebs.com/four-f/Tools/IoctlDecoder.zipAnd this is nice to decode the hexcode from disassembly a appGreets,
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now