Re[2]: IRP_MJ_MDL_READ question

If you read about the MDL interface, in the MDL read you request an MDL
from CC which describes the region in the system cache. At this point
the pages are pinned down and when accessed the data is in-paged. Then
the MDL Complete unpins these pages but the content is still in the
system cache for some non-deterministic amount of time. In your
implementation, the backing content ‘goes away’. It is probably some
edge case that C&P works, where the data is moved to an intermediate
buffer before the MDL complete is issued. Where as in the cmd line copy,
it is relying on the content to be in the system cache.

How do you handle memory mapped files or file execution in your design?
From what you describe, you cannot correctly handle the MDL IO interface
or either of these.

Pete


Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com
866.263.9295

------ Original Message ------
From: xxxxx@hotmail.com
To: “Windows File Systems Devs Interest List”
Sent: 12/8/2016 11:57:10 AM
Subject: RE:[ntfsd] IRP_MJ_MDL_READ question

>Hi Anatoly,
>
>We disabled the Cache IO for our files, that’s why we allocated our own
>buffer for the MDL instead of requesting from Cache manager. We have
>our own cache buffer.
>
>Thanks
>Tsang
>
>—
>NTFSD is sponsored by OSR
>
>
>MONTHLY seminars on crash dump analysis, WDF, Windows internals and
>software drivers!
>Details at http:
>
>To unsubscribe, visit the List Server section of OSR Online at
>http:</http:></http:>

> Where as in the cmd line copy, it is relying on the content to be in the
system cache.

I think it’s not a problem at all because cmd line copy will go through
usual IRP_MJ_READ, where we will again copy from our intermediate buffer.
The only problem is such mdl implementation can return stale data, because
there can be a write to file before requester of mdl read them but after
mdl was created and data was copied. So i think it doesn’t explain NULL
data.

For mapped files and images such implementation is a problem. I think this
driver doesn’t support mapped files and images also because there is no
section at all.

2016-12-08 22:56 GMT+03:00 PScott :

>
> If you read about the MDL interface, in the MDL read you request an MDL
> from CC which describes the region in the system cache. At this point the
> pages are pinned down and when accessed the data is in-paged. Then the MDL
> Complete unpins these pages but the content is still in the system cache
> for some non-deterministic amount of time. In your implementation, the
> backing content ‘goes away’. It is probably some edge case that C&P works,
> where the data is moved to an intermediate buffer before the MDL complete
> is issued. Where as in the cmd line copy, it is relying on the content to
> be in the system cache.
>
> How do you handle memory mapped files or file execution in your design?
> From what you describe, you cannot correctly handle the MDL IO interface or
> either of these.
>
> Pete
>
> –
> Kernel Drivers
> Windows File System and Device Driver Consulting
> www.KernelDrivers.com
> 866.263.9295
>
>
>
> ------ Original Message ------
> From: xxxxx@hotmail.com
> To: “Windows File Systems Devs Interest List”
> Sent: 12/8/2016 11:57:10 AM
> Subject: RE:[ntfsd] IRP_MJ_MDL_READ question
>
> Hi Anatoly,
>>
>> We disabled the Cache IO for our files, that’s why we allocated our own
>> buffer for the MDL instead of requesting from Cache manager. We have our
>> own cache buffer.
>>
>> Thanks
>> Tsang
>>
>> —
>> NTFSD is sponsored by OSR
>>
>>
>> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
>> software drivers!
>> Details at http:
>>
>> To unsubscribe, visit the List Server section of OSR Online at <
>> http://www.osronline.com/page.cfm?name=ListServer&gt;
>>
>
>
> —
> NTFSD is sponsored by OSR
>
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
></http:></http:>

For mapped file open, we will restore data back to the sparse file when creating the session of the file. After that, we won’t intercept this file any more.