Hello everyone,
I am trying to figure out why a crash occurs when I am trying to send a
Irp to a audio driver from a upper filter driver sitting above it.
Since I havn’t done this before I was wondering if there is anything
obvious that will cause the crash.
PIRP Irp;
KEVENT event;
IO_STATUS_BLOCK iosb;
KeInitializeEvent(&event, NotificationEvent, FALSE);
KSPROPERTY ksP;
ksP.Set = KSPROPSETID_Audio;
ksP.Id = KSPROPERTY_AUDIO_POSITION;
ksP.Flags = KSPROPERTY_TYPE_GET;
KSAUDIO_POSITION ksAudio;
Irp = IoBuildDeviceIoControlRequest(IOCTL_KS_PROPERTY, pAudioDeviceParent->LowerDeviceObject,
&ksP, sizeof ksP,&ksAudio, sizeof ksAudio, FALSE,&event,&iosb);
PIO_STACK_LOCATION stack = IoGetCurrentIrpStackLocation(Irp);
stack->FileObject = FileObject; // FILE OBJECT FROM MJ_CREATE for the audio pin.
status = IoCallDriver(pAudioDeviceParent->DeviceObject, Irp); // CRASHES HERE
if (status == STATUS_PENDING)
{
KeWaitForSingleObject(&event, Executive, KernelMode, FALSE, NULL);
status = iosb.Status;
}
So is there anything in that above that stick out like dog balls or does
anyone have any tips?
p.s. This code is ranned in created thread.
Cheers
Obble.