Hi
I’m currently working on a filter driver for \FileSystem\Ntfs , but when it’s get attached (the function return STATUS_SUCCESS) , at IopfCallDriver I got BSOD.
here is the source of attaching.
ntStatus = IoCreateDevice(DriverObject,sizeof(DEVICE_EXTENSION),NULL,FILE_DEVICE_DISK_FILE_SYSTEM,0,0,&newDeviceObject);
if(NT_SUCCESS(ntStatus))
pDevExt = (DEVICE_EXTENSION)newDeviceObject->DeviceExtension;
RtlInitUnicodeString(&devname, L"\FileSystem\Ntfs");
RtlInitUnicodeString(&ObName,L"ObReferenceObjectByName");
FunctionAddress = (OBReferenceObjectByName)MmGetSystemRoutineAddress(&ObName);
ntStatus = ((OBReferenceObjectByName)FunctionAddress)(&devname,0x40,0,0,*IoDriverObjectType,0,0,(PVOID*)&filesystem);
if(!NT_SUCCESS(ntStatus))
DbgPrint(“OBReferenceObjectByName failed with 0x%x\n”,ntStatus);
target = filesystem->DeviceObject;
newDeviceObject->Flags |= (target->Flags & (DO_SUPPORTS_TRANSACTIONS| DO_DIRECT_IO| DO_BUFFERED_IO));
newDeviceObject->Characteristics |= (target->Characteristics & FILE_DEVICE_SECURE_OPEN);
ntStatus = IoAttachDeviceToDeviceStackSafe(newDeviceObject,target,&pDevExt->AttachedToDeviceObject);
I can’t find out what the problem is
thanks