How to find where the irp come from?

I’m wondering if I use DefineDosDevice to assign driver letter z: to \Device\HardDiskVolume1 which is assigned to c: by default, I will get c: and z: the exactly same volume, but is there any way that I can find where the irp I got in HardDiskVolume1’s filter driver come from?c: or z:?
btw,I’m trying to write a volume snapshot driver,is there any suggestion?
Thank You!

There is no way to know which symbolic link that is a handle is opened by. The io manager will resolve the sym link to the device object name before the driver sees the IRP_MJ_CREATE irp.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Tuesday, October 14, 2008 11:02 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to find where the irp come from?

I’m wondering if I use DefineDosDevice to assign driver letter z: to \Device\HardDiskVolume1 which is assigned to c: by default, I will get c: and z: the exactly same volume, but is there any way that I can find where the irp I got in HardDiskVolume1’s filter driver come from?c: or z:?
btw,I’m trying to write a volume snapshot driver,is there any suggestion?
Thank You!


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thanks.
what I want to do is to write a volume snapshot driver.I try to create a snapshot of a volume,and mount it using DefineDosDevice. Now I know I can’t seperate the irp from the origin volume or the snapshot volume, is there any other way to implement the volume snapshot?
any suggestion?

Let’s start simple. Let’s say there are three people who come up to you,
one at a time. The first calls you ‘Joe’, the second ‘Bob’, and the third
‘Charles’. Does that change who or what you are? I hope not. Therefore, a
single volume, known by it volume name cannot be something different. This
includes being a snapshot of that volume at a different time. So, the
snapshot must be a volume with its own name that can use the real volume
plus its data that details the sectors that have changed since the snapshot
was taken.

Look into Microsoft’s VSS capability that began with XP. If you look at the
snapshots it exposes with the OSR disk and devicetree tools, it should show
you how it is done.

wrote in message news:xxxxx@ntdev…
> Thanks.
> what I want to do is to write a volume snapshot driver.I try to create a
> snapshot of a volume,and mount it using DefineDosDevice. Now I know I
> can’t seperate the irp from the origin volume or the snapshot volume, is
> there any other way to implement the volume snapshot?
> any suggestion?
>

Thanks.
I use the vshadow.exe in VSS SDK to create a snapshot of HardDiskVolume1 and expose it to z:. I find a new \Device\HardDiskVolumeShadowCopy1, it seems it creates the new device and assigns letter z to it. The device \Device\HardDiskVolumeShadowCopy1’s driver is \Drvier\VolSnap which is a volume filter driver. So the read request from z: will be caught in VolSnap driver, but I’m wondering does VolSnap also get the read request from c:(HardDiskVolume1)?If so how it tell between them?If not who will get the read/write request from c:?

Did you run the tools I mentioned? Do so. If you still don’t understand,
then you may need to take a driver class or two from OSR.

wrote in message news:xxxxx@ntdev…
> Thanks.
> I use the vshadow.exe in VSS SDK to create a snapshot of HardDiskVolume1
> and expose it to z:. I find a new \Device\HardDiskVolumeShadowCopy1, it
> seems it creates the new device and assigns letter z to it. The device
> \Device\HardDiskVolumeShadowCopy1’s driver is \Drvier\VolSnap which is a
> volume filter driver. So the read request from z: will be caught in
> VolSnap driver, but I’m wondering does VolSnap also get the read request
> from c:(HardDiskVolume1)?If so how it tell between them?If not who will
> get the read/write request from c:?
>

I used devicetree and I found that the VolSnap create a new device for a new shadow copy, so I do it in my driver. I create a new device in my driver’s deviceIoControl. In the driver I seperate the filter device and the new created device by a flag in the device extension,and I send all the irp to the lower device for both device. But when I create the new device and use definedosdevice to assign z: to the new device, I found the new device is not useable and it seems I got no irps in the new device’s driver.Is there thing I need to do to make the new device a useable volume?
I found another virtual disk driver called file-disk, which use file to create new volume. It seems that it create new device and redirect the read and write irps to the file. Can I just do it the same way except redirect the irps to the origin volume?
Thanks.