Hi,
I plan to create a virtual drive in the disk class driver. Can I
create a virtual PDO during an FDO AddDevice? I was hoping that when
I create a virtual PDO and inform PnP manager, PnP will then call the
FDO AddDevice.
thanks,
Alex
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Hi,
I have a filter driver which acts as lower Filter
driver for Disk.I get PDO for the logical disk I
created in my AddDevice() routine.
I fail the SRB_CLAIM_DEVICE for this logical disk.
When I get IRP_MN_START_DEVICE for this logical disk,
I create another device Object called as virutal
deviceObject. I want that virtual Device Object to act
as PDO(Physical Device Object) for DISK.sys and the
DISK.sys should start sending IRP_MN_START_DEVICE and
SRB_FUNCTION_CLAIM_DEVICE for the virtual Device
Object(For that I am modifying the Device Relations of
the deviceObject to reflect that I have a child device
and the Pnp manager should send a IRP_MN_START_DEVICE
for the virtual Device Object).
But when I receive the IRP_MN_START_DEVICE for the
virtual device object, I try to call
IoRegisterDeviceInterface() to register it, it returns
with an error that the deviceObject is not a valid PDO
pointer.
Does anyone has a idea about why it is returning an
error.
I am creating the virtual Device Object as the
following:
NTSTATUS CreateChild(PDEVICE_EXTENSION pdx, ULONG
flags, PDEVICE_OBJECT* ppdo)
{
PDEVICE_OBJECT child;
IoCreateDevice(pdx->DriverObject,
sizeof (PDO_EXTENSION),
NULL,
FILE_DEVICE_DISK,
0,
FALSE, &child);
PPDO_EXTENSION px = (PPDO_EXTENSION)
child->DeviceExtension;
px->flags = ISPDO | flags;
px->DeviceObject = child;
px->Fdo = pdx->DeviceObject;
child->Flags &= ~DO_DEVICE_INITIALIZING;
*ppdo = child;
return STATUS_SUCCESS;
}
Any help would be appreciated.
Thanks and Regards,
Gurpreet
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
If you create a PDO, you must report it in the response to
MN_QUERY_RELATIONS.
Without this, the device object is not a PDO.
If you do not receive MN_QUERY_RELATIONS - call IoInvalidateDeviceRelations
in your START code.
Max
----- Original Message -----
From: “Gurpreet Anand”
To: “NT Developers Interest List”
Sent: Monday, September 10, 2001 9:34 PM
Subject: [ntdev] Virtual PDO
> Hi,
> I have a filter driver which acts as lower Filter
> driver for Disk.I get PDO for the logical disk I
> created in my AddDevice() routine.
> I fail the SRB_CLAIM_DEVICE for this logical disk.
> When I get IRP_MN_START_DEVICE for this logical disk,
> I create another device Object called as virutal
> deviceObject. I want that virtual Device Object to act
> as PDO(Physical Device Object) for DISK.sys and the
> DISK.sys should start sending IRP_MN_START_DEVICE and
> SRB_FUNCTION_CLAIM_DEVICE for the virtual Device
> Object(For that I am modifying the Device Relations of
> the deviceObject to reflect that I have a child device
> and the Pnp manager should send a IRP_MN_START_DEVICE
> for the virtual Device Object).
> But when I receive the IRP_MN_START_DEVICE for the
> virtual device object, I try to call
> IoRegisterDeviceInterface() to register it, it returns
> with an error that the deviceObject is not a valid PDO
> pointer.
>
> Does anyone has a idea about why it is returning an
> error.
> I am creating the virtual Device Object as the
> following:
> NTSTATUS CreateChild(PDEVICE_EXTENSION pdx, ULONG
> flags, PDEVICE_OBJECT* ppdo)
> {
> PDEVICE_OBJECT child;
> IoCreateDevice(pdx->DriverObject,
> sizeof (PDO_EXTENSION),
> NULL,
> FILE_DEVICE_DISK,
> 0,
> FALSE, &child);
> PPDO_EXTENSION px = (PPDO_EXTENSION)
> child->DeviceExtension;
> px->flags = ISPDO | flags;
> px->DeviceObject = child;
> px->Fdo = pdx->DeviceObject;
> child->Flags &= ~DO_DEVICE_INITIALIZING;
> *ppdo = child;
> return STATUS_SUCCESS;
> }
>
> Any help would be appreciated.
>
> Thanks and Regards,
> Gurpreet
>
>
> __________________________________________________
> Do You Yahoo!?
> Get email alerts & NEW webcam video instant messaging with Yahoo!
Messenger
> http://im.yahoo.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Hello Max,
Thanks for responding,
I am doing the following in the
IRP_MN_QUERY_DEVICE_RELATIONS
DEVICE_RELATION_TYPE type
=irpStack->Parameters.QueryDeviceRelations.Type;
if(type == busRelations)
Irp->IoStatus.Information =
(ULONG_PTR)deviceRelations;
deviceRelations->Count = 1;
deviceRelations->Objects[0] = DeviceObject;
ObReferenceObject(deviceRelations->Objects[0]);
status = STATUS_SUCCESS;
return status;
and I receive the IRP_MN_START_DEVICE for the virtual
DeviceObject.In IRP_MN_START_DEVICE, I try to
IoRegisterDeviceInterface().This call is failing and
giving error that it is not a valid PDO.
Regards,
Gurpreet
— “Maxim S. Shatskih”
wrote:
> If you create a PDO, you must report it in the
> response to
> MN_QUERY_RELATIONS.
> Without this, the device object is not a PDO.
> If you do not receive MN_QUERY_RELATIONS - call
> IoInvalidateDeviceRelations
> in your START code.
>
> Max
>
> ----- Original Message -----
> From: “Gurpreet Anand”
> To: “NT Developers Interest List”
>
> Sent: Monday, September 10, 2001 9:34 PM
> Subject: [ntdev] Virtual PDO
>
>
> > Hi,
> > I have a filter driver which acts as lower Filter
> > driver for Disk.I get PDO for the logical disk I
> > created in my AddDevice() routine.
> > I fail the SRB_CLAIM_DEVICE for this logical disk.
> > When I get IRP_MN_START_DEVICE for this logical
> disk,
> > I create another device Object called as virutal
> > deviceObject. I want that virtual Device Object to
> act
> > as PDO(Physical Device Object) for DISK.sys and
> the
> > DISK.sys should start sending IRP_MN_START_DEVICE
> and
> > SRB_FUNCTION_CLAIM_DEVICE for the virtual Device
> > Object(For that I am modifying the Device
> Relations of
> > the deviceObject to reflect that I have a child
> device
> > and the Pnp manager should send a
> IRP_MN_START_DEVICE
> > for the virtual Device Object).
> > But when I receive the IRP_MN_START_DEVICE for the
> > virtual device object, I try to call
> > IoRegisterDeviceInterface() to register it, it
> returns
> > with an error that the deviceObject is not a valid
> PDO
> > pointer.
> >
> > Does anyone has a idea about why it is returning
> an
> > error.
> > I am creating the virtual Device Object as the
> > following:
> > NTSTATUS CreateChild(PDEVICE_EXTENSION pdx, ULONG
> > flags, PDEVICE_OBJECT* ppdo)
> > {
> > PDEVICE_OBJECT child;
> > IoCreateDevice(pdx->DriverObject,
> > sizeof (PDO_EXTENSION),
> > NULL,
> > FILE_DEVICE_DISK,
> > 0,
> > FALSE, &child);
> > PPDO_EXTENSION px = (PPDO_EXTENSION)
> > child->DeviceExtension;
> > px->flags = ISPDO | flags;
> > px->DeviceObject = child;
> > px->Fdo = pdx->DeviceObject;
> > child->Flags &= ~DO_DEVICE_INITIALIZING;
> > *ppdo = child;
> > return STATUS_SUCCESS;
> > }
> >
> > Any help would be appreciated.
> >
> > Thanks and Regards,
> > Gurpreet
> >
> >
> >
> > Do You Yahoo!?
> > Get email alerts & NEW webcam video instant
> messaging with Yahoo!
> Messenger
> > http://im.yahoo.com
> >
> > —
> > You are currently subscribed to ntdev as:
> xxxxx@storagecraft.com
> > To unsubscribe send a blank email to
> leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
>
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com