Hi,
I have a strange problem.
I have written a file filter driver.
And using a win32 app, I tried to send a IOCTL to my driver and ask my
driver to return my win32 app some data.
Using administrator to launch the win32 app, when I tried to createfile with
GENERIC_READ | GENERIC_WRITE, I have no problem sending the IOCTL using
DeviceIoControl.
However when I use createfile with GENERIC_READ only, I have ACCESS DENIED
error when I send the IOCTL using DeviceIoControl.
Why is that so?
To send IOCTL I must createfile with both read/write access?
Hope someone can help.
Thank You!
cheers,
vincent
My driver is using:
status = IoCreateDeviceSecure(
myDriverObject,
sizeof(DEVICE_EXTENSION),
&NameString,
FILE_DEVICE_DISK_FILE_SYSTEM,
FILE_DEVICE_SECURE_OPEN,
TRUE,
&SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_R,
&GUID_DEVCLASS_MYDEV,
&myPrimaryDeviceObject);
#define IOCTL_TEST (ULONG) CTL_CODE (MY_DEVICE_TYPE,
0x080300,METHOD_BUFFERED, FILE_ALL_ACCESS)
hDevice = CreateFile (HANDLE,
GENERIC_READ,
0,
NULL,
OPEN_EXISTING,
0,
NULL
);
DeviceIoControl(hDevice,IOCTL_TEST, NULL, 0, &myData, sizeof (myData),
&BytesReturned, NULL);
Get MSN Hotmail alerts on your mobile. http://en-asiasms.mobile.msn.com/