Disk lower filter, SCSIPORT vs STORPORT

Hi all,

I have a storage class lower filter driver for write protection. Most of the storage devices used in our units are connected to a LSI SAS/SATA host adapter. The filter works fine with the older lsi_sas2.sys driver. But they have changed something in the new generation lsi_sas3.sys that my filter does not catch any IRPs anymore. I have not tried to debug the driver yet, but I noticed in their release notes they are stating that the new miniport is using the STORPORT rather than SCSIPORT interface. So I am wondering if that has anything to do with my filter not working now, and if there is an easy fix.

Thanks for any input,
Igor

Additional info.
I compiled a debug version with some debug messages, and with DebugView I see that on a new disk arrival my driver’s AddDevice routine does not get called at all, when the disk is connected to the SAS controller. But for USB it works fine.

If your add device routine is not getting called then you are not filtering
the correct enumeration type. Certainly the disk class driver’s add device
routine is getting called, right?

Mark Roddy

On Tue, Jan 2, 2018 at 9:43 AM, xxxxx@gmail.com
wrote:

> Additional info.
> I compiled a debug version with some debug messages, and with DebugView I
> see that on a new disk arrival my driver’s AddDevice routine does not get
> called at all, when the disk is connected to the SAS controller. But for
> USB it works fine.
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: http:> showlists.cfm?list=ntdev>
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
></http:></http:>

Hi Mark,
Thank you for your reply.
Please give me an idea what I should check, because as I said it works if I use the older SAS controller. My filter is installed as a lower filter on the disk drive class like below, so I don’ understand why a disk on one controller should work and another not.
Thanks

[ClassFilter_AddReg]
HKLM, System\CurrentControlSet\Control\Class{4D36E967-E325-11CE-BFC1-08002BE10318}, “LowerFilters”, 0x00000004
HKLM, System\CurrentControlSet\Control\Class{4D36E967-E325-11CE-BFC1-08002BE10318}, “LowerFilters”, 0x00010008, “filter”

xxxxx@gmail.com wrote:

Hi Mark,
Thank you for your reply.
Please give me an idea what I should check, because as I said it works if I use the older SAS controller. My filter is installed as a lower filter on the disk drive class like below, so I don’ understand why a disk on one controller should work and another not.

Do you have any evidence that those other drives actually come up in
class 4D36E967-E325-11CE-BFC1-08002BE10318?  Do they show up under “Disk
drives” in Device Manager?

 

[ClassFilter_AddReg]
HKLM, System\CurrentControlSet\Control\Class{4D36E967-E325-11CE-BFC1-08002BE10318}, “LowerFilters”, 0x00000004
HKLM, System\CurrentControlSet\Control\Class{4D36E967-E325-11CE-BFC1-08002BE10318}, “LowerFilters”, 0x00010008, “filter”

I don’t believe there are any guarantees about the order of operations
in an AddReg section, so you don’t know that it will do the delete
first.  You should only need the second 0x00010008 line.  It’s not up to
you to delete any filters that might already be there.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Yes, they all show up under disk drives. If a disk is connected to any interface other than that new SAS controller, my AddDevice gets called.
Thanks

So how are you installing your filter?

Mark Roddy

On Wed, Jan 3, 2018 at 8:05 PM, xxxxx@gmail.com
wrote:

> Yes, they all show up under disk drives. If a disk is connected to any
> interface other than that new SAS controller, my AddDevice gets called.
> Thanks
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: http:> showlists.cfm?list=ntdev>
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
></http:></http:>

From my installer app, like this:
RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 128 …

And I have an inf file that copies the driver file to the system drivers folder and adds the registry entries to register it as a lower filter to the hard drive class, like this:

[Filter_AddReg]
HKLM, System\CurrentControlSet\Control\Class{4D36E967-E325-11CE-BFC1-08002BE10318}, “LowerFilters”, 0x00000004
HKLM, System\CurrentControlSet\Control\Class{4D36E967-E325-11CE-BFC1-08002BE10318}, “LowerFilters”, 0x00010008, “filter”

So if you examine the class guid for the disks that you don’t attach to
what is their guid? (device manager device properties details Class Guid)

Or alternatively look in the Enum key for these devices and see what Driver
they are connecting to.

You need to poke around at the configuration to see what is going on.
!devnode and !devstack in the debugger might be helpful.

Mark Roddy

On Thu, Jan 4, 2018 at 10:09 AM, xxxxx@gmail.com
wrote:

> From my installer app, like this:
> RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 128 …
>
> And I have an inf file that copies the driver file to the system drivers
> folder and adds the registry entries to register it as a lower filter to
> the hard drive class, like this:
>
> [Filter_AddReg]
> HKLM, System\CurrentControlSet\Control\Class{4D36E967-E325-11CE-BFC1-08002BE10318},
> “LowerFilters”, 0x00000004
> HKLM, System\CurrentControlSet\Control\Class{4D36E967-E325-11CE-BFC1-08002BE10318},
> “LowerFilters”, 0x00010008, “filter”
>
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: http:> showlists.cfm?list=ntdev>
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
></http:></http:>

You really shouldn’t be deleting the LowerFilters value as you could be removing other filters from the list

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Tuesday, January 2, 2018 4:43 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Disk lower filter, SCSIPORT vs STORPORT

Hi Mark,
Thank you for your reply.
Please give me an idea what I should check, because as I said it works if I use the older SAS controller. My filter is installed as a lower filter on the disk drive class like below, so I don’ understand why a disk on one controller should work and another not.
Thanks

[ClassFilter_AddReg]
HKLM, System\CurrentControlSet\Control\Class{4D36E967-E325-11CE-BFC1-08002BE10318}, “LowerFilters”, 0x00000004 HKLM, System\CurrentControlSet\Control\Class{4D36E967-E325-11CE-BFC1-08002BE10318}, “LowerFilters”, 0x00010008, “filter”


NTDEV is sponsored by OSR

Visit the list online at: https:

MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
Details at https:

To unsubscribe, visit the List Server section of OSR Online at https:</https:></https:></https:>

IIRC STOREPORT was introduced with server 2003, so I don?t know how old your old driver is.

I would expect that all SAS and SATA controllers would have mini port drivers based on the storeport model as the older driver models had much inferior performance ? especially in the case of multi core machines and deep queues of pending IO.

Sent from Mailhttps: for Windows 10

________________________________
From: xxxxx@lists.osr.com on behalf of xxxxx@gmail.com
Sent: Wednesday, January 3, 2018 8:05:06 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Disk lower filter, SCSIPORT vs STORPORT

Yes, they all show up under disk drives. If a disk is connected to any interface other than that new SAS controller, my AddDevice gets called.
Thanks


NTDEV is sponsored by OSR

Visit the list online at: http:

MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
Details at http:

To unsubscribe, visit the List Server section of OSR Online at http:</http:></http:></http:></https:>

Yes, correct. They said that the new driver is based on the storport model. So how does it affect the disk lower filter drivers?