Hi, maybe I am wrong but you are defining a IOCTL_KS_READ_STREAM code which is already define, that is why you intercept the "wrong" code. Check where are they define and check their values.
Then, if you manage to get the data buffer through irp, you can have a look to the audio virtual dirver sample in the SDK. It does the same thing.
Hope this helps,
Regards,
Giuseppe Maione
hi , i am developing a device upper filter driver for audio device that will also save the streams passing through it. to process the data , i am trying to intercept IRP_MJ_DEVICE_CONTROL IRPs with following IoControl codes.
IOCTL_KS_WRITE_STREAM IOCTL_KS_READ_STREAM
I defined them as below.
#define IOCTL_KS_READ_STREAM CTL_CODE(FILE_DEVICE_KS, 0x005, METHOD_NEITHER, FILE_ANY_ACCESS) #define IOCTL_KS_WRITE_STREAM CTL_CODE(FILE_DEVICE_KS, 0x004, METHOD_NEITHER, FILE_WRITE_ACCESS)
while a sound was being played and i tried to interecept IOCTL_KS_READ_STREAM in deviceIocontrol routine i could not recieve irps with this iocontrol code.
when i printed above devclared IOCTL_KS_READ_STREAM and recieved code while debugging their values are printed as below
declared IOCTL_KS_READ_STREAM code : 3080215 recieved io control code: 3080195
the recieved code is equal to as defined below with function code 0x000
CTL_CODE(FILE_DEVICE_KS, 0x000, METHOD_NEITHER, FILE_ANY_ACCESS)
where does the problem lies. am i declaring IOCTL_KS_READ_STREAM with wrong function code ? and recieved irp with above io control code corresponds to what??? i want to intercept IOCTL_KS_READ_STREAM and save the stream to ta file in wave format. am i following the correct approach?
2ndly if i get the data buffer through irp. what is the procedure to save that data to file?
looking forward for your response... Regards ___________
Saad Bashir
-- Giuseppe Maione