Having issue in Simple Mirror driver need help

Hi,

I am new to windows kernel development.

I am writing Simple Mirror driver in windows kernel.I am facing some problem
in write dispatch routine.

Following are the steps:-

  1. In DriverEntry virtual device is created using IoCreateDevice and
    pointers to actual storage devices are stored in device extension using
    IoGetDeviceObjectPointer.

  2. In WriteDispatch routine after receiving the original IRP, two new IRPs
    are created (with different IRP pointers) using
    IoBuildAsynchronousFsdRequest.

  3. For both calls to IoBuildAsynchronousFsdRequest, passing original IRPs
    Associated.Systembuffer to create new IRP (for buffered IO).

  4. Then initialize WriteCompletionRoutine followed by the call to
    IoCallDriver with newly crated IRP, passing Original IRP as an argument
    (Context) to completion routine.

  5. In completion routine calling IoFreeIrp for new IRPs.

  6. When Completion routine called last time for new IRP, completing original
    IRP by calling IoCompleteRequest.

Driver producing crash dump, after Crashdump analysis using WinDbg we found
that IoCallDriver for 2nd IRP is failing along with following message:

<----------------------------------------------------------------------------------------------------------->
PFN_LIST_CORRUPT (4e)
Typically caused by drivers passing bad memory descriptor lists (ie:
callingMmUnlockPages twice with the same list, etc). If a kernel debugger
is
available get the stack trace.
<----------------------------------------------------------------------------------------------------------->

I am speculating that using original IRP system buffer to create two IRPs it
is creating problem.

So I created new two buffers( using ExAllocatePoolWithTag) and used those to
create new IRPs, and ReadDispatch and WriteDispatch is executed without
problem.

We trying to find out appropriate way to solve this problem. (need to avoid
buffer creation inside kernel memory)

We tried to follow this link to understand working of
IoBuildAsynchronousFsdRequest :
http://www.koders.com/c/fid7F69307699E37B3C069034986A8F8E97F6A41D66.aspx

Can someone please help us on this issue ?


Thanks and Regards,
Chaitanya Kulkarni

This is a disk mirror driver?

In general you want to use MDL based operations and use IoBuildPartialMdl to
correctly share the original MDL with one or more related IRPs.

Mark Roddy

On Thu, Aug 18, 2011 at 2:26 AM, chaitanya kulkarni <
xxxxx@gmail.com> wrote:

Hi,

I am new to windows kernel development.

I am writing Simple Mirror driver in windows kernel.I am facing some
problem in write dispatch routine.

Following are the steps:-

  1. In DriverEntry virtual device is created using IoCreateDevice and
    pointers to actual storage devices are stored in device extension using
    IoGetDeviceObjectPointer.

  2. In WriteDispatch routine after receiving the original IRP, two new IRPs
    are created (with different IRP pointers) using
    IoBuildAsynchronousFsdRequest.

  3. For both calls to IoBuildAsynchronousFsdRequest, passing original IRPs
    Associated.Systembuffer to create new IRP (for buffered IO).

  4. Then initialize WriteCompletionRoutine followed by the call to
    IoCallDriver with newly crated IRP, passing Original IRP as an argument
    (Context) to completion routine.

  5. In completion routine calling IoFreeIrp for new IRPs.

  6. When Completion routine called last time for new IRP, completing
    original IRP by calling IoCompleteRequest.

Driver producing crash dump, after Crashdump analysis using WinDbg we found
that IoCallDriver for 2nd IRP is failing along with following message:

<----------------------------------------------------------------------------------------------------------->
PFN_LIST_CORRUPT (4e)
Typically caused by drivers passing bad memory descriptor lists (ie:
callingMmUnlockPages twice with the same list, etc). If a kernel debugger
is
available get the stack trace.

<----------------------------------------------------------------------------------------------------------->

I am speculating that using original IRP system buffer to create two IRPs
it is creating problem.

So I created new two buffers( using ExAllocatePoolWithTag) and used those
to create new IRPs, and ReadDispatch and WriteDispatch is executed without
problem.

We trying to find out appropriate way to solve this problem. (need to avoid
buffer creation inside kernel memory)

We tried to follow this link to understand working of
IoBuildAsynchronousFsdRequest :
http://www.koders.com/c/fid7F69307699E37B3C069034986A8F8E97F6A41D66.aspx

Can someone please help us on this issue ?


Thanks and Regards,
Chaitanya Kulkarni
— 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

Hi Mark,

Thanks for your replay Mark. It is of disk Mirror driver but very simple as
of now.

Our main aim to create two different IRPS using original IRP.

According to our understanding for buffered I/O IRP data can be accessed
using original_pIrp->AssociatedIrp.SystemBuffer, thats why we are using
system buffer to create new IRPS.

Following is the code snippet that we’ve:

*
<------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
/* 1st IRP creation */
newIrpDisk1 = IoBuildAsynchronousFsdRequest(IRP_MJ_WRITE,

pDevExt->pTargetDeviceObject1,

pOriginalIrp->AssociatedIrp.SystemBuffer,

pOriginalIrpStack->Parameters.Write.Length,

&lDiskOffset,

&ioStatus);
newIrp1stack =
IoGetNextIrpStackLocation(newIrpDisk1);
if (!newIrpDisk1) {

DbgPrint(“IoBuildSynchronousFsdRequest failed to crete new IRP %s 1 \n”,
FUNCTION);
status =
STATUS_INSUFFICIENT_RESOURCES;
goto end;
}
IoSetCompletionRoutine(newIrpDisk1,
WriteIoCompletion, Context, TRUE, TRUE, TRUE);
newIrp1stack->FileObject =
pDevExt->pFileObject1;
status =
IoCallDriver(pDevExt->pTargetDeviceObject1, newIrpDisk1);
/* 2nd IRP creation */
newIrpDisk2 = IoBuildAsynchronousFsdRequest(IRP_MJ_WRITE,

pDevExt->pTargetDeviceObject2,

pOriginalIrp->AssociatedIrp.SystemBuffer,

pOriginalIrpStack->Parameters.Write.Length,

&lDiskOffset,

&ioStatus);
newIrp2stack =
IoGetNextIrpStackLocation(newIrpDisk2);
if (!newIrpDisk2) {

DbgPrint(“IoBuildSynchronousFsdRequest failed to crete new IRP %s 2 \n”,
FUNCTION);
status =
STATUS_INSUFFICIENT_RESOURCES;
goto end;
}
IoSetCompletionRoutine(newIrpDisk2,
WriteIoCompletion, Context, TRUE, TRUE, TRUE);
newIrp2stack->FileObject =
pDevExt->pFileObject2;
status =
IoCallDriver(pDevExt->pTargetDeviceObject2, newIrpDisk2);
<------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

*
Above code is failing @2nd IoCallDriver with following crash dump message:
<----------------------------------------------------------------------------------------------------------->
PFN_LIST_CORRUPT (4e)
Typically caused by drivers passing bad memory descriptor lists (ie:
callingMmUnlockPages twice with the same list, etc). If a kernel debugger
is
available get the stack trace.
<----------------------------------------------------------------------------------------------------------->

According to our understanding we need to do MDL manipulation when direct
I/O in picture, but we are doing buffered I/O so we are
usingpOriginalIrp->AssociatedIrp.SystemBuffer.

Is this correct ?

Please correct me I am very new at windows kernel development.

On Thu, Aug 18, 2011 at 11:28 PM, Mark Roddy wrote:

> This is a disk mirror driver?
>
> In general you want to use MDL based operations and use IoBuildPartialMdl
> to correctly share the original MDL with one or more related IRPs.
>
> Mark Roddy
>
>
> On Thu, Aug 18, 2011 at 2:26 AM, chaitanya kulkarni <
> xxxxx@gmail.com> wrote:
>
>> Hi,
>>
>> I am new to windows kernel development.
>>
>> I am writing Simple Mirror driver in windows kernel.I am facing some
>> problem in write dispatch routine.
>>
>> Following are the steps:-
>>
>> 1. In DriverEntry virtual device is created using IoCreateDevice and
>> pointers to actual storage devices are stored in device extension using
>> IoGetDeviceObjectPointer.
>>
>> 2. In WriteDispatch routine after receiving the original IRP, two new IRPs
>> are created (with different IRP pointers) using
>> IoBuildAsynchronousFsdRequest.
>>
>> 3. For both calls to IoBuildAsynchronousFsdRequest, passing original IRPs
>> Associated.Systembuffer to create new IRP (for buffered IO).
>>
>> 4. Then initialize WriteCompletionRoutine followed by the call to
>> IoCallDriver with newly crated IRP, passing Original IRP as an argument
>> (Context) to completion routine.
>>
>> 5. In completion routine calling IoFreeIrp for new IRPs.
>>
>> 6. When Completion routine called last time for new IRP, completing
>> original IRP by calling IoCompleteRequest.
>>
>> Driver producing crash dump, after Crashdump analysis using WinDbg we
>> found that IoCallDriver for 2nd IRP is failing along with following message:
>>
>>
>> <----------------------------------------------------------------------------------------------------------->
>> PFN_LIST_CORRUPT (4e)
>> Typically caused by drivers passing bad memory descriptor lists (ie:
>> callingMmUnlockPages twice with the same list, etc). If a kernel debugger
>> is
>> available get the stack trace.
>>
>> <----------------------------------------------------------------------------------------------------------->
>>
>> I am speculating that using original IRP system buffer to create two IRPs
>> it is creating problem.
>>
>> So I created new two buffers( using ExAllocatePoolWithTag) and used those
>> to create new IRPs, and ReadDispatch and WriteDispatch is executed without
>> problem.
>>
>> We trying to find out appropriate way to solve this problem. (need to
>> avoid buffer creation inside kernel memory)
>>
>> We tried to follow this link to understand working of
>> IoBuildAsynchronousFsdRequest :
>> http://www.koders.com/c/fid7F69307699E37B3C069034986A8F8E97F6A41D66.aspx
>>
>> Can someone please help us on this issue ?
>>
>> –
>> Thanks and Regards,
>> Chaitanya Kulkarni
>> — 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
>
>
> — 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 and Regards,
Chaitanya Kulkarni

You cannot re-use the system buffer the way you are doing it, but your
earlier experiments confirmed that. These are async requests and the
“original” system buffer is going to be deallocated at some point in time -
and that point in time is likely to be while you are re-using it for the
mirror IRP.

Also I have no idea where you are doing your filtering in the stack, but in
general disk filters must use MDL based IRPs as that is how IRPs destined
for the disk subsystem are formatted.

A better mechanism is to create two related IRPs, using IoAllocatePartialMdl
to use MDL based IRPs to share the original IRPs data buffer, track the
completion progress of those two mirror IRPs, and complete the original IRP
when both mirror IRPs have completed.

Mark Roddy

On Fri, Aug 19, 2011 at 2:25 AM, chaitanya kulkarni <
xxxxx@gmail.com> wrote:

Hi Mark,

Thanks for your replay Mark. It is of disk Mirror driver but very simple as
of now.

Our main aim to create two different IRPS using original IRP.

According to our understanding for buffered I/O IRP data can be accessed
using original_pIrp->AssociatedIrp.SystemBuffer, thats why we are using
system buffer to create new IRPS.

Following is the code snippet that we’ve:

*
<------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
/* 1st IRP creation */
newIrpDisk1 = IoBuildAsynchronousFsdRequest(IRP_MJ_WRITE,

pDevExt->pTargetDeviceObject1,

pOriginalIrp->AssociatedIrp.SystemBuffer,

pOriginalIrpStack->Parameters.Write.Length,

&lDiskOffset,

&ioStatus);
newIrp1stack =
IoGetNextIrpStackLocation(newIrpDisk1);
if (!newIrpDisk1) {

DbgPrint(“IoBuildSynchronousFsdRequest failed to crete new IRP %s 1 \n”,
FUNCTION);
status =
STATUS_INSUFFICIENT_RESOURCES;
goto end;
}
IoSetCompletionRoutine(newIrpDisk1,
WriteIoCompletion, Context, TRUE, TRUE, TRUE);
newIrp1stack->FileObject =
pDevExt->pFileObject1;
status =
IoCallDriver(pDevExt->pTargetDeviceObject1, newIrpDisk1);
/* 2nd IRP creation */
newIrpDisk2 = IoBuildAsynchronousFsdRequest(IRP_MJ_WRITE,

pDevExt->pTargetDeviceObject2,

pOriginalIrp->AssociatedIrp.SystemBuffer,

pOriginalIrpStack->Parameters.Write.Length,

&lDiskOffset,

&ioStatus);
newIrp2stack =
IoGetNextIrpStackLocation(newIrpDisk2);
if (!newIrpDisk2) {

DbgPrint(“IoBuildSynchronousFsdRequest failed to crete new IRP %s 2 \n”,
FUNCTION);
status =
STATUS_INSUFFICIENT_RESOURCES;
goto end;
}
IoSetCompletionRoutine(newIrpDisk2,
WriteIoCompletion, Context, TRUE, TRUE, TRUE);
newIrp2stack->FileObject =
pDevExt->pFileObject2;
status =
IoCallDriver(pDevExt->pTargetDeviceObject2, newIrpDisk2);

<------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

*
Above code is failing @2nd IoCallDriver with following crash dump message:

<----------------------------------------------------------------------------------------------------------->
PFN_LIST_CORRUPT (4e)
Typically caused by drivers passing bad memory descriptor lists (ie:
callingMmUnlockPages twice with the same list, etc). If a kernel debugger
is
available get the stack trace.

<----------------------------------------------------------------------------------------------------------->

According to our understanding we need to do MDL manipulation when direct
I/O in picture, but we are doing buffered I/O so we are usingpOriginalIrp->AssociatedIrp.SystemBuffer.

Is this correct ?

Please correct me I am very new at windows kernel development.

On Thu, Aug 18, 2011 at 11:28 PM, Mark Roddy wrote:
>
>> This is a disk mirror driver?
>>
>> In general you want to use MDL based operations and use IoBuildPartialMdl
>> to correctly share the original MDL with one or more related IRPs.
>>
>> Mark Roddy
>>
>>
>> On Thu, Aug 18, 2011 at 2:26 AM, chaitanya kulkarni <
>> xxxxx@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I am new to windows kernel development.
>>>
>>> I am writing Simple Mirror driver in windows kernel.I am facing some
>>> problem in write dispatch routine.
>>>
>>> Following are the steps:-
>>>
>>> 1. In DriverEntry virtual device is created using IoCreateDevice and
>>> pointers to actual storage devices are stored in device extension using
>>> IoGetDeviceObjectPointer.
>>>
>>> 2. In WriteDispatch routine after receiving the original IRP, two new
>>> IRPs are created (with different IRP pointers) using
>>> IoBuildAsynchronousFsdRequest.
>>>
>>> 3. For both calls to IoBuildAsynchronousFsdRequest, passing original IRPs
>>> Associated.Systembuffer to create new IRP (for buffered IO).
>>>
>>> 4. Then initialize WriteCompletionRoutine followed by the call to
>>> IoCallDriver with newly crated IRP, passing Original IRP as an argument
>>> (Context) to completion routine.
>>>
>>> 5. In completion routine calling IoFreeIrp for new IRPs.
>>>
>>> 6. When Completion routine called last time for new IRP, completing
>>> original IRP by calling IoCompleteRequest.
>>>
>>> Driver producing crash dump, after Crashdump analysis using WinDbg we
>>> found that IoCallDriver for 2nd IRP is failing along with following message:
>>>
>>>
>>> <----------------------------------------------------------------------------------------------------------->
>>> PFN_LIST_CORRUPT (4e)
>>> Typically caused by drivers passing bad memory descriptor lists (ie:
>>> callingMmUnlockPages twice with the same list, etc). If a kernel debugger
>>> is
>>> available get the stack trace.
>>>
>>> <----------------------------------------------------------------------------------------------------------->
>>>
>>> I am speculating that using original IRP system buffer to create two IRPs
>>> it is creating problem.
>>>
>>> So I created new two buffers( using ExAllocatePoolWithTag) and used those
>>> to create new IRPs, and ReadDispatch and WriteDispatch is executed without
>>> problem.
>>>
>>> We trying to find out appropriate way to solve this problem. (need to
>>> avoid buffer creation inside kernel memory)
>>>
>>> We tried to follow this link to understand working of
>>> IoBuildAsynchronousFsdRequest :
>>> http://www.koders.com/c/fid7F69307699E37B3C069034986A8F8E97F6A41D66.aspx
>>>
>>> Can someone please help us on this issue ?
>>>
>>> –
>>> Thanks and Regards,
>>> Chaitanya Kulkarni
>>> — 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
>>
>>
>> — 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 and Regards,
> Chaitanya Kulkarni
> — 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
>

>A better mechanism is to create two related IRPs, using IoAllocatePartialMdl

IoAllocateMdl + IoBuildPartialMdl


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

Hi,

Thanks for the reply Mark/Maxim.

I was successful yesterday while in creating two IRPs using combination of
IoAllocateMdl + IoBuildPartialMdl…:slight_smile:

Now I was using DO_DIRECT_IO flag for this.

Now I am searching for how to create MDL using System buffers if I want
handle buffered IO scenario.

Thanks for your reply guys, it really helped to find the appropriate
solution to this problem.

On Tue, Aug 23, 2011 at 1:18 AM, Maxim S. Shatskih
wrote:

> >A better mechanism is to create two related IRPs, using
> IoAllocatePartialMdl
>
> IoAllocateMdl + IoBuildPartialMdl
>
> –
> Maxim S. Shatskih
> Windows DDK MVP
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> —
> 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 and Regards,
Chaitanya Kulkarni

>Now I am searching for how to create MDL using System buffers if I want handle buffered IO scenario.

IoAllocateMdl + MmBuildMdlForNonPagedPool


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

Plus note again that you cannot complete the original IRP until both related
mirror IRPs have been completed. Also I continue to wonder about your filter
driver’s stack location such that DISK IO Requests arrive as METHOD_BUFFERED
IRPs. That is a most unusual situation.

Mark Roddy

On Tue, Aug 23, 2011 at 4:06 AM, Maxim S. Shatskih
wrote:

> >Now I am searching for how to create MDL using System buffers if I want
> handle buffered IO scenario.
>
> IoAllocateMdl + MmBuildMdlForNonPagedPool
>
> –
> Maxim S. Shatskih
> Windows DDK MVP
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> —
> 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
>

Hi Mark,

I am not writing filter driver this we accessing lower device pointers by
using IoGetDeviceObjectPointer() and not using IoAttachDevice().

I am creating new IRPs by using lower device objects stacksize +1.

On Tue, Aug 23, 2011 at 11:02 PM, Mark Roddy wrote:

> Plus note again that you cannot complete the original IRP until both
> related mirror IRPs have been completed. Also I continue to wonder about
> your filter driver’s stack location such that DISK IO Requests arrive as
> METHOD_BUFFERED IRPs. That is a most unusual situation.
>
> Mark Roddy
>
>
> On Tue, Aug 23, 2011 at 4:06 AM, Maxim S. Shatskih > > wrote:
>
>> >Now I am searching for how to create MDL using System buffers if I want
>> handle buffered IO scenario.
>>
>> IoAllocateMdl + MmBuildMdlForNonPagedPool
>>
>> –
>> Maxim S. Shatskih
>> Windows DDK MVP
>> xxxxx@storagecraft.com
>> http://www.storagecraft.com
>>
>>
>> —
>> 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
>>
>
> — 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 and Regards,
Chaitanya Kulkarni

What? Wait - you are doing a disk copy operation? Oh. Hmmm… and if the
disk changes while you are copying it? How can you not be a filter driver
and hope that this will work?

Mark Roddy

On Wed, Aug 24, 2011 at 8:10 AM, chaitanya kulkarni <
xxxxx@gmail.com> wrote:

Hi Mark,

I am not writing filter driver this we accessing lower device pointers by
using IoGetDeviceObjectPointer() and not using IoAttachDevice().

I am creating new IRPs by using lower device objects stacksize +1.

On Tue, Aug 23, 2011 at 11:02 PM, Mark Roddy wrote:
>
>> Plus note again that you cannot complete the original IRP until both
>> related mirror IRPs have been completed. Also I continue to wonder about
>> your filter driver’s stack location such that DISK IO Requests arrive as
>> METHOD_BUFFERED IRPs. That is a most unusual situation.
>>
>> Mark Roddy
>>
>>
>> On Tue, Aug 23, 2011 at 4:06 AM, Maxim S. Shatskih <
>> xxxxx@storagecraft.com> wrote:
>>
>>> >Now I am searching for how to create MDL using System buffers if I want
>>> handle buffered IO scenario.
>>>
>>> IoAllocateMdl + MmBuildMdlForNonPagedPool
>>>
>>> –
>>> Maxim S. Shatskih
>>> Windows DDK MVP
>>> xxxxx@storagecraft.com
>>> http://www.storagecraft.com
>>>
>>>
>>> —
>>> 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
>>>
>>
>> — 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 and Regards,
> Chaitanya Kulkarni
> — 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

Hi Mark,

I am not doing disk copy operation. I have exported virtual device and I am
getting device object pointer from using IoGetDeviceObjectPointer().

And manupulating incoming IRP to create IRPs for other disks.

Now I am working on striping i.e. creating multiple IRP.

Any suggestion on this how I can proceed or what is the correct way to do
that ?

On Wed, Aug 24, 2011 at 6:36 PM, Mark Roddy wrote:

> What? Wait - you are doing a disk copy operation? Oh. Hmmm… and if the
> disk changes while you are copying it? How can you not be a filter driver
> and hope that this will work?
>
> Mark Roddy
>
>
> On Wed, Aug 24, 2011 at 8:10 AM, chaitanya kulkarni <
> xxxxx@gmail.com> wrote:
>
>> Hi Mark,
>>
>> I am not writing filter driver this we accessing lower device pointers by
>> using IoGetDeviceObjectPointer() and not using IoAttachDevice().
>>
>> I am creating new IRPs by using lower device objects stacksize +1.
>>
>>
>>
>>
>> On Tue, Aug 23, 2011 at 11:02 PM, Mark Roddy wrote:
>>
>>> Plus note again that you cannot complete the original IRP until both
>>> related mirror IRPs have been completed. Also I continue to wonder about
>>> your filter driver’s stack location such that DISK IO Requests arrive as
>>> METHOD_BUFFERED IRPs. That is a most unusual situation.
>>>
>>> Mark Roddy
>>>
>>>
>>> On Tue, Aug 23, 2011 at 4:06 AM, Maxim S. Shatskih <
>>> xxxxx@storagecraft.com> wrote:
>>>
>>>> >Now I am searching for how to create MDL using System buffers if I want
>>>> handle buffered IO scenario.
>>>>
>>>> IoAllocateMdl + MmBuildMdlForNonPagedPool
>>>>
>>>> –
>>>> Maxim S. Shatskih
>>>> Windows DDK MVP
>>>> xxxxx@storagecraft.com
>>>> http://www.storagecraft.com
>>>>
>>>>
>>>> —
>>>> 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
>>>>
>>>
>>> — 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 and Regards,
>> Chaitanya Kulkarni
>> — 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
>
>
> — 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 and Regards,
Chaitanya Kulkarni

Its done :slight_smile: now working on writing full-proof completion routines for chaild
IRPS
On Tue, Aug 30, 2011 at 11:10 AM, chaitanya kulkarni <
xxxxx@gmail.com> wrote:

Hi Mark,

I am not doing disk copy operation. I have exported virtual device and I am
getting device object pointer from using IoGetDeviceObjectPointer().

And manupulating incoming IRP to create IRPs for other disks.

Now I am working on striping i.e. creating multiple IRP.

Any suggestion on this how I can proceed or what is the correct way to do
that ?

On Wed, Aug 24, 2011 at 6:36 PM, Mark Roddy wrote:
>
>> What? Wait - you are doing a disk copy operation? Oh. Hmmm… and if the
>> disk changes while you are copying it? How can you not be a filter driver
>> and hope that this will work?
>>
>> Mark Roddy
>>
>>
>> On Wed, Aug 24, 2011 at 8:10 AM, chaitanya kulkarni <
>> xxxxx@gmail.com> wrote:
>>
>>> Hi Mark,
>>>
>>> I am not writing filter driver this we accessing lower device pointers by
>>> using IoGetDeviceObjectPointer() and not using IoAttachDevice().
>>>
>>> I am creating new IRPs by using lower device objects stacksize +1.
>>>
>>>
>>>
>>>
>>> On Tue, Aug 23, 2011 at 11:02 PM, Mark Roddy wrote:
>>>
>>>> Plus note again that you cannot complete the original IRP until both
>>>> related mirror IRPs have been completed. Also I continue to wonder about
>>>> your filter driver’s stack location such that DISK IO Requests arrive as
>>>> METHOD_BUFFERED IRPs. That is a most unusual situation.
>>>>
>>>> Mark Roddy
>>>>
>>>>
>>>> On Tue, Aug 23, 2011 at 4:06 AM, Maxim S. Shatskih <
>>>> xxxxx@storagecraft.com> wrote:
>>>>
>>>>> >Now I am searching for how to create MDL using System buffers if I
>>>>> want handle buffered IO scenario.
>>>>>
>>>>> IoAllocateMdl + MmBuildMdlForNonPagedPool
>>>>>
>>>>> –
>>>>> Maxim S. Shatskih
>>>>> Windows DDK MVP
>>>>> xxxxx@storagecraft.com
>>>>> http://www.storagecraft.com
>>>>>
>>>>>
>>>>> —
>>>>> 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
>>>>>
>>>>
>>>> — 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 and Regards,
>>> Chaitanya Kulkarni
>>> — 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
>>
>>
>> — 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 and Regards,
> Chaitanya Kulkarni
>


Thanks and Regards,
Chaitanya Kulkarni