From: Daniel Zhang on
Hi everybody,
I want to write a filter driver which can change the usb disk into
a read-only disk. I edit the reg at HKEY_LOCAL_MACHINE\SYSTEM
\CurrentControlSet\Control\Class\{4D36E967-E325-11CE-
BFC1-08002BE10318}, and I add a key (lowerFilters) ,the value is my
filter driver's name.
First , when I plug into the usb disk,the filter driver runs OK.
When I reboot my computer,however, the windows is blue sceen and can't
login the system. I think maybe I filter all the disk's IRP, so I
change the code at AddDevice.

NTSTATUS AddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT
pdo)
{ // AddDevice
PAGED_CODE();
NTSTATUS status;

PDEVICE_OBJECT fido;

if (!USB_Disk(pdo))
{
return STATUS_UNSUCCESSFUL;
}
// .......

}

But there is also blus screen. Can anybody help me?

Daniel Zhang
From: Doron Holan [MSFT] on
attach a debugger and see what happens. send the output of !analyze -v on
the dump file

d

--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.



"Daniel Zhang" <fanzier(a)gmail.com> wrote in message
news:86b1d258-d1de-4d4a-8a19-cc61cf64fc36(a)v5g2000pre.googlegroups.com...
> Hi everybody,
> I want to write a filter driver which can change the usb disk into
> a read-only disk. I edit the reg at HKEY_LOCAL_MACHINE\SYSTEM
> \CurrentControlSet\Control\Class\{4D36E967-E325-11CE-
> BFC1-08002BE10318}, and I add a key (lowerFilters) ,the value is my
> filter driver's name.
> First , when I plug into the usb disk,the filter driver runs OK.
> When I reboot my computer,however, the windows is blue sceen and can't
> login the system. I think maybe I filter all the disk's IRP, so I
> change the code at AddDevice.
>
> NTSTATUS AddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT
> pdo)
> { // AddDevice
> PAGED_CODE();
> NTSTATUS status;
>
> PDEVICE_OBJECT fido;
>
> if (!USB_Disk(pdo))
> {
> return STATUS_UNSUCCESSFUL;
> }
> // .......
>
> }
>
> But there is also blus screen. Can anybody help me?
>
> Daniel Zhang

From: Wayne on
> First , when I plug into the usb disk,the filter driver runs OK.
> When I reboot my computer,however, the windows is blue sceen and can't
> login the system. I think maybe I filter all the disk's IRP, so I
> change the code at AddDevice.

If the BSOD code is 0x7B, I think your guess is right.


> NTSTATUS AddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT
> pdo)
> { // AddDevice
> PAGED_CODE();
> NTSTATUS status;
>
> PDEVICE_OBJECT fido;
>
> if (!USB_Disk(pdo))

Please check this routine works fine.

From: Daniel Zhang on
How would I do for this?

On Jan 15, 3:24 pm, Wayne <wayne.g...(a)oracle.com> wrote:
> >    First , when I plug into the usb disk,the filter driver runs OK.
> > When I reboot my computer,however, the windows is blue sceen and can't
> > login the system. I think maybe I filter all the disk's IRP, so I
> > change the code at AddDevice.
>
> If the BSOD code is 0x7B, I think your guess is right.
>
> > NTSTATUS AddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT
> > pdo)
> > {                            // AddDevice
> >     PAGED_CODE();
> >     NTSTATUS status;
>
> >     PDEVICE_OBJECT fido;
>
> >     if (!USB_Disk(pdo))
>
> Please check this routine works fine.

From: Wayne.Gong on
"Daniel Zhang" <fanzier(a)gmail.com> 写入消息 news:7008581a-f5d7-4a59-a7d6-561ab8fa3b49(a)r10g2000prf.googlegroups.com...
How would I do for this?

On Jan 15, 3:24pm, Wayne <wayne.g...(a)oracle.com> wrote:
> > First , when I plug into the usb disk,the filter driver runs OK.
> > When I reboot my computer,however, the windows is blue sceen and can't
> > login the system. I think maybe I filter all the disk's IRP, so I
> > change the code at AddDevice.
>
> If the BSOD code is 0x7B, I think your guess is right.
>
> > NTSTATUS AddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT
> > pdo)
> > { // AddDevice
> > PAGED_CODE();
> > NTSTATUS status;
>
> > PDEVICE_OBJECT fido;
>
> > if (!USB_Disk(pdo))
>
> Please check this routine works fine.



I think you can get device property to determine whether it's a USB device. IIRC, you can use IoGetDeviceProperty.

Thanks
Wayne