Attaching CDROM filter to Port driver

Dear All,

I’m using CDAUDIO sample for developing CDROM filter. I need to
attach this filter to the port driver for write purpose. I’ll
explain what i’m doing.

For some reason CdAudioAddDevice is called hence I’m creating
(IoCreateDevice)the device in DriverEntry to stay in the memory.
As i need to attach to Port driver, i’m trying to get the device
poiter of port.

PFILE_OBJECT FileObject;
PDEVICE_OBJECT DeviceObject;
UNICODE_STRING basePortName;
UNICODE_STRING fullPortName;
WCHAR basePortBuffer[100];

basePortName.Length = 0;
basePortName.MaximumLength = 100 * sizeof(WCHAR);

basePortName.Buffer = ExAllocatePool(PagedPool,

basePortName.MaximumLength);

RtlCopyUnicodeString(&basePortName, L"Scsi");

After creating the device

status = IoGetDeviceObjectPointer(
&basePortName,
FILE_ALL_ACCESS,
&FileObject,
&DeviceObject
);

But this call is giving Page fault.

Can you please guide as where i’m going wrong and whether i’m
right in concept. I’ve not installed CDAUDIO but just replaced the
cdaudio.sys with debug version in driver folder.

Thanks in advance

Sincerely
Nagaraja