Sorry,Its DeviceObject Not DriverObject....

I am really sorry its actually the DeviceObject
Also the point where it gets destroyed is at
IoGetCurrentIrpStackLocation .
Sorry again…
–Mayur.
“Mayur Kankanwadi” wrote in message
news:xxxxx@windbg…
> Hi,
> I have coded a very basic driver for a device which stores the most recent
> string written to the device and on a read returns that string.
> I am doing my debugging on VmWare using SoftIce.
> The loading part i.e. DriverEntry goes smooth , but when I do a write on
the
> device,
> the DeviceObject gets destroyed automatically in the Dispatch Routine for
> Write.
> The code is as follows( not the complete routine,but till the point where
> deviceobject
> automatically becomes 0 ):
> ***********************************************************
> NTSTATUS MyWrite( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp )
> {
> PVOID argBuffer = NULL;
> UINT32 argBufLength = 0;
> PIO_STACK_LOCATION pIoStack;
> PLOCAL_DEVICE_INFO deviceInfo = NULL;
>
> DbgPrint(“\nMyWrite()::Write called on LoopBack device…”);
>
> deviceInfo = (PLOCAL_DEVICE_INFO) DeviceObject->DeviceExtension;
>
> //get the argument string buffer which contains the string to be
> written
> argBuffer = Irp->AssociatedIrp.SystemBuffer;
>
> DbgPrint(“\nMyWrite()::Getting the arguments…”);
> pIoStack = IoGetCurrentIrpStackLocation(Irp);
> //here the DeviceObject gets destroyed.
>**********************************************************
> Can somebody point any bugs in code or some tips to make it work.
> Bye.
> --Mayur.
>
>
>

Solved it, had done a very-very silly mistake in setting flags.
Bye.
–Mayur.

“Mayur Kankanwadi” wrote in message
news:xxxxx@windbg…
> I am really sorry its actually the DeviceObject
> Also the point where it gets destroyed is at
> IoGetCurrentIrpStackLocation .
> Sorry again…
> --Mayur.
> “Mayur Kankanwadi” wrote in message
> news:xxxxx@windbg…
> > Hi,
> > I have coded a very basic driver for a device which stores the most
recent
> > string written to the device and on a read returns that string.
> > I am doing my debugging on VmWare using SoftIce.
> > The loading part i.e. DriverEntry goes smooth , but when I do a write on
> the
> > device,
> > the DeviceObject gets destroyed automatically in the Dispatch Routine
for
> > Write.
> > The code is as follows( not the complete routine,but till the point
where
> > deviceobject
> > automatically becomes 0 ):
> > ***********************************************************
> > NTSTATUS MyWrite( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp )
> > {
> > PVOID argBuffer = NULL;
> > UINT32 argBufLength = 0;
> > PIO_STACK_LOCATION pIoStack;
> > PLOCAL_DEVICE_INFO deviceInfo = NULL;
> >
> > DbgPrint(“\nMyWrite()::Write called on LoopBack device…”);
> >
> > deviceInfo = (PLOCAL_DEVICE_INFO) DeviceObject->DeviceExtension;
> >
> > //get the argument string buffer which contains the string to be
> > written
> > argBuffer = Irp->AssociatedIrp.SystemBuffer;
> >
> > DbgPrint(“\nMyWrite()::Getting the arguments…”);
> > pIoStack = IoGetCurrentIrpStackLocation(Irp);
> > //here the DeviceObject gets destroyed.
> >**********************************************************
> > Can somebody point any bugs in code or some tips to make it work.
> > Bye.
> > --Mayur.
> >
> >
> >
>
>
>