IoEnumerateDeviceObjectList....

Hi Guys,

we know that IoEnumerateDeviceObjectList is available from win2k sp4 but if i want to enumerate volume object on window 2000 without sp4 then how can i do that?

or is it fine to filter entire filesystem on win2k without sp4?

i have one more doubt that is it required to filter each and every volume or is it just fine to filter entire file system?

A file system usually has two types of device objects, a control device
object (the CDO) and then volume device objects for each volume (VDO). If
you just attach to the CDO then you will not see IO on any of the volumes.
You will see mount requests and other requests that are send to the CDO.

In order to filter volumes, you need to attach to each VDO you intend to
filter.

I don’t know how you can enumerate VDOs before win2k SP4.

Thanks,
Alex.

You can get all device objects created by a driver object by checking the
DeviceObject member of the driver object and traverse the linked list of
DeviceObject->NextDevice. The next thing to do would be to check if these
DeviceObjects are actually VDOs, possibly you can do this by checking
DeviceObject->DeviceType.

//Daniel

wrote in message news:xxxxx@ntfsd…
> Hi Guys,
>
> we know that IoEnumerateDeviceObjectList is available from win2k sp4 but
> if i want to enumerate volume object on window 2000 without sp4 then how
> can i do that?
>
> or is it fine to filter entire filesystem on win2k without sp4?
>
> i have one more doubt that is it required to filter each and every volume
> or is it just fine to filter entire file system?
>
>

> You can get all device objects created by a driver object by checking the

DeviceObject member of the driver object and traverse the linked list of
DeviceObject->NextDevice.

…and you cannot hold the IopDatabaseLock which protects this list.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

“Maxim S. Shatskih” wrote in message
news:xxxxx@ntfsd…
>> You can get all device objects created by a driver object by checking the
>> DeviceObject member of the driver object and traverse the linked list of
>> DeviceObject->NextDevice.
>
> …and you cannot hold the IopDatabaseLock which protects this list.
>

I know this is is a problem, for this reason IoEnumerateDeviceObjectList
creates a reference on each device object returned which prevents them from
becoming deleted. Sometimes to support older OS you will need to resort to
methods which are not completely safe and I would say the risk of a race is
low here, whether that’s acceptable depends. Raising to DISPATCH_LEVEL and
getting busy all other processors together with ObReferenceObject may be
among the possible solutions to become completely waterproof.

//Daniel

> i have one more doubt that is it required to filter each and every volume or is it just fine to filter entire

You do not need any enumeration to attach the FS filter.

Look at SFILTER sample in the older WDK how to do this. They attach at mount.


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com