谁知道IOCTL_STORAGE_CHECK_VERIFY的值;急急! (50分)

  • 主题发起人 主题发起人 kasee
  • 开始时间 开始时间
K

kasee

Unregistered / Unconfirmed
GUEST, unregistred user!
有谁知道:IOCTL_STORAGE_CHECK_VERIFY <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IOCTL_STORAGE_EJECT_MEDIA <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IOCTL_STORAGE_GET_MEDIA_TYPES <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IOCTL_STORAGE_LOAD_MEDIA <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IOCTL_STORAGE_MEDIA_REMOVAL <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 这几个参数的值?<br>&nbsp; &nbsp; &nbsp;重要的是IOCTL_STORAGE_CHECK_VERIFY,其它能说就说吧!<br>只有50分,急呀!
 
说清楚亚
 
也就是DeviceIoControl API中的那几个参数呀!!
 
#define FILE_DEVICE_MASS_STORAGE &nbsp; &nbsp; &nbsp; &nbsp;0x0000002d<br>#define IOCTL_STORAGE_BASE FILE_DEVICE_MASS_STORAGE<br>#define METHOD_BUFFERED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0<br>#define METHOD_IN_DIRECT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1<br>#define METHOD_OUT_DIRECT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 2<br>#define METHOD_NEITHER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3<br>#define FILE_ANY_ACCESS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0<br>#define FILE_SPECIAL_ACCESS &nbsp; &nbsp;(FILE_ANY_ACCESS)<br>#define FILE_READ_ACCESS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;( 0x0001 ) &nbsp; &nbsp;// file &amp; pipe<br>#define FILE_WRITE_ACCESS &nbsp; &nbsp; &nbsp; &nbsp; ( 0x0002 ) &nbsp; &nbsp;// file &amp; pipe<br><br>#define CTL_CODE( DeviceType, Function, Method, Access ) ( &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /<br>&nbsp; &nbsp; ((DeviceType) &lt;&lt; 16) | ((Access) &lt;&lt; 14) | ((Function) &lt;&lt; 2) | (Method) /<br>)<br><br>//<br>// The following device control codes are common for all class drivers. &nbsp;They<br>// should be used in place of the older IOCTL_DISK, IOCTL_CDROM and IOCTL_TAPE<br>// common codes<br>//<br><br>#define IOCTL_STORAGE_CHECK_VERIFY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)<br>#define IOCTL_STORAGE_CHECK_VERIFY2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_ANY_ACCESS)<br>#define IOCTL_STORAGE_MEDIA_REMOVAL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CTL_CODE(IOCTL_STORAGE_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)<br>#define IOCTL_STORAGE_EJECT_MEDIA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CTL_CODE(IOCTL_STORAGE_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)<br>#define IOCTL_STORAGE_LOAD_MEDIA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)<br>#define IOCTL_STORAGE_LOAD_MEDIA2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_ANY_ACCESS)<br>#define IOCTL_STORAGE_RESERVE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CTL_CODE(IOCTL_STORAGE_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)<br>#define IOCTL_STORAGE_RELEASE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CTL_CODE(IOCTL_STORAGE_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)<br>#define IOCTL_STORAGE_FIND_NEW_DEVICES &nbsp; &nbsp; &nbsp; &nbsp;CTL_CODE(IOCTL_STORAGE_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)<br><br>#define IOCTL_STORAGE_EJECTION_CONTROL &nbsp; &nbsp; &nbsp; &nbsp;CTL_CODE(IOCTL_STORAGE_BASE, 0x0250, METHOD_BUFFERED, FILE_ANY_ACCESS)<br>#define IOCTL_STORAGE_MCN_CONTROL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CTL_CODE(IOCTL_STORAGE_BASE, 0x0251, METHOD_BUFFERED, FILE_ANY_ACCESS)<br><br>#define IOCTL_STORAGE_GET_MEDIA_TYPES &nbsp; &nbsp; &nbsp; &nbsp; CTL_CODE(IOCTL_STORAGE_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)<br>#define IOCTL_STORAGE_GET_MEDIA_TYPES_EX &nbsp; &nbsp; &nbsp;CTL_CODE(IOCTL_STORAGE_BASE, 0x0301, METHOD_BUFFERED, FILE_ANY_ACCESS)<br>#define IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER CTL_CODE(IOCTL_STORAGE_BASE, 0x0304, METHOD_BUFFERED, FILE_ANY_ACCESS)<br>#define IOCTL_STORAGE_GET_HOTPLUG_INFO &nbsp; &nbsp; &nbsp; &nbsp;CTL_CODE(IOCTL_STORAGE_BASE, 0x0305, METHOD_BUFFERED, FILE_ANY_ACCESS)<br>#define IOCTL_STORAGE_SET_HOTPLUG_INFO &nbsp; &nbsp; &nbsp; &nbsp;CTL_CODE(IOCTL_STORAGE_BASE, 0x0306, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)<br><br>#define IOCTL_STORAGE_RESET_BUS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CTL_CODE(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)<br>#define IOCTL_STORAGE_RESET_DEVICE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)<br>#define IOCTL_STORAGE_BREAK_RESERVATION &nbsp; &nbsp; &nbsp; CTL_CODE(IOCTL_STORAGE_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS)<br><br>#define IOCTL_STORAGE_GET_DEVICE_NUMBER &nbsp; &nbsp; &nbsp; CTL_CODE(IOCTL_STORAGE_BASE, 0x0420, METHOD_BUFFERED, FILE_ANY_ACCESS)<br>#define IOCTL_STORAGE_PREDICT_FAILURE &nbsp; &nbsp; &nbsp; &nbsp; CTL_CODE(IOCTL_STORAGE_BASE, 0x0440, METHOD_BUFFERED, FILE_ANY_ACCESS)<br><br>摘录出来的。
 
NowCan:<br>&nbsp; &nbsp; 真是谢谢了!<br>&nbsp; &nbsp; 不知那位大哥懂C,解释一下嘛!完全看不懂!:》
 
简单的说一下嘛!例如:<br>#define CTL_CODE( DeviceType, Function, Method, Access ) ( &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; /<br>&nbsp; &nbsp; ((DeviceType) &lt;&lt; 16) | ((Access) &lt;&lt; 14) | ((Function) &lt;&lt; 2) | (Method) /<br>)<br>这是什么!是函数吗?下面的那些‘《’是什么意思!<br>
 
这个是宏,&lt;&lt;是左移(不带进位位),|是二进制或,但我不知道Delphi里怎么写。<br>你可以看成函数<br>它的参数就是那4个<br>返回值就是((DeviceType) &lt;&lt; 16) | ((Access) &lt;&lt; 14) | ((Function) &lt;&lt; 2) | (Method) <br><br>例如<br><br>#define IOCTL_STORAGE_CHECK_VERIFY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)<br>就是<br>IOCTL_STORAGE_BASE是0x0000002d,左移16位=0x2d0000<br>0x0200左移14位=0x800000<br>METHOD_BUFFERED是0,左移2位=0<br>FILE_READ_ACCESS是0x0001<br>最后或一下就得到最后结果00xad0001
 
不知道有没有算对。
 
实在多谢了!
 
后退
顶部