Hi,
I am a beginner to Windows Device Driver Development and trying to complete a read operation (from hardware registers) using IOCTL from a user application.
I am able to call EvtIODeviceControl of KMDF Driver from User application.
Following call is being used:-
if (!DeviceIoControl(DriverHandle,
(DWORD) IOCTL_READ_REG, // Read IOCTL
®list, // Ptr to Input Buffer
sizeof(struct hx170_reglist_t), // Length of InBuffer
®list1, // Ptr to Output Buffer
sizeof(struct hx170_reglist_t), // Length of OutBuffer
&index, // BytesReturned
0) ) // Ptr to Overlapped structure
Problem is :
-
How can we access the input buffer pointer (®list) passed in DeviceIOControl of user application in kernel side driver? (Input buffer pointer contains offset information to read from hardware registers). In linux, we have copy_to_user and copy_from_user to copy data from kernel to user and user to kernel side. How it is possible in Windows?
-
Can WdfRequestRetrieveOutputBuffer/WdfRequestRetrieveInputBuffer be used for same in EvtDeviceIOControl of Driver?
-
How can we return the read value back to the user application?
Thanks and Regards
Jayant Shekhar