Function code is a value to help uniquely identify the specific IOCTL. So
for instance if you are defining 5 IOCTL’s you would do something like:
#define IOCTL_1 CTL_CODE( MyDeviceType, 0, METHOD_BUFFERED,
#define IOCTL_2 CTL_CODE( MyDeviceType, 1, METHOD_BUFFERED,
#define IOCTL_3 CTL_CODE( MyDeviceType, 2, METHOD_BUFFERED,
#define IOCTL_4 CTL_CODE( MyDeviceType, 3, METHOD_BUFFERED,
#define IOCTL_5 CTL_CODE( MyDeviceType, 4, METHOD_BUFFERED,
The function code has nothing to do with the dispatch of the function.
Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Remove StopSpam to reply
"Javier CÃ ceres" <> wrote in message
> This link (http://msdn.microsoft.com/en-us/library/ms795909.aspx) says
> is necessary to define I/O contro codes in this way:
> #define IOCTL_Device_Function CTL_CODE(DeviceType, Function, Method,
> The Function is a reference to a driver function, but how do you specify
> I have seen other IOCTL definition and they use to be hex addresses.
> I have two doubts:
> 1-Where does FunctionCode come from?
> 2-I’m confused, if FunctionCode points to driver’s handler function then
> what does DispatchDeviceControl do? ->I mean, DispatchDeviceControl is
> suposse to handle all calls to DeviceIoControl.
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 4431 (20090916) __________
> The message was checked by ESET NOD32 Antivirus.
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4431 (20090916) __________
The message was checked by ESET NOD32 Antivirus.