Hello all,
- What is the purpose of the flag
“IO_READONLY_DEVICE” during IoCreateDevice? I assumed
it will prevent any application from opening the
device in Write mode, but it doesnt seem to.
I use the following call to create the device.
ret = IoCreateDevice(
pDriverObject, /* related driver object input */
sizeof(DEV_EXTENSION), /* device extension size */
&ntString, /* native name for device */
FILE_DEVICE_CD_ROM, /* device storage type */
FILE_READ_ONLY_DEVICE, /* device characteristics */
FALSE, /* indicate exclusive */
&pDeviceObject /* returned device object */
);
Later on, I use the following call to open the device
in my user mode application.
device = CreateFile(
USER_MODE_DEV_NAME,
GENERIC_READ | GENERIC_WRITE, //GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE, //FILE_SHARE_READ
NULL,
OPEN_EXISTING,
FILE_FLAG_NO_BUFFERING,
NULL
);
But this doesnt seem to fail, infact I am also able to
send data to the device via IOCTL calls. Is writing
via “DeviceIoControl” handled separately from regular
“writefile” calls?
- After the above process, I send data to device via
IOCTLs. I am using buffered write transfers. After
some IOCTL writes to the device, the IOCTL call
doesnot seem to get through. The system (XP Pro)
deadlocks. Is there any reason why this could happen?
Thanks in advance,
DK
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com