Utkarsh,
Search is your friend!
http://www.microsoft.com/whdc/devtools/ifskit/ServerIFSKitOrderinfo.mspx
Regards
Ben Curley
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Utkarsh DABHADE
Sent: 06 July 2005 08:58
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Swapping Mdl
Hi Tony,
Thanks for Valuable Help. IFS Kit is Really only US 109$.
If So please guide me where we can by this in same price. I might have
wrong information about price.
Regards,
Utkarsh S. Dabhade
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Tony Mason
Sent: Wednesday, July 06, 2005 11:56 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Swapping Mdl
Hi Utkarsh,
I would strongly recommend that you obtain the IFS Kit - it will likely
be the most useful US$109 that you ever spend in the file systems
development arena.
Your understanding is correct. When you restore the original MDL, I
would also suggest restoring the UserBuffer (although in many cases it
won’t be used, I generally recommend leaving the system in a consistent
state, in order to encourage interoperability with other filters, for
example).
Regards,
Tony
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Utkarsh DABHADE
Sent: Wednesday, July 06, 2005 2:17 AM
To: ntfsd redirect
Subject: RE: [ntfsd] Swapping Mdl
Hi Tony,
Thanks for the help. But we don’t have IFS Kit.
What I understand from your explanation is as follows please correct me.
Stage 1:-
// Required for mapping non-pagged pool memory to an MDL.
MmBuildMdlForNonPagedPool(pNewMdl);
Stage 2:-
// Swap the MDL in the IRP with the one we created.
I.m_Irp->MdlAddress = pNewMdl;
Then What you have Suggested ->
I.UserBuffer == MmGetMdlVirtualAddress(I.MdlAddress)
is this the right way you want to say?..
Regards,
Utkarsh S. Dabhade
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Tony Mason
Sent: Tuesday, July 05, 2005 7:37 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Swapping Mdl
I think you misunderstand - I wasn’t talking about the *data contents*
of the user buffer, merely the numeric value that the file system uses
when computing the correct offset when constructing partial MDLs for
fragmented files.
If you don’t update UserBuffer then the underlying file system cannot
properly handle any fragmented files. In general, this can manifest as
I/O operations that never complete or random crashes because the DMA is
done to non-existent pages or it corrupts pages that are already in
memory.
In the IFS Kit see deviosup.c in FastFat (look for IoBuildPartialMdl)
and you can see how it uses Irp->UserBuffer, although it does not use
the data contents of Irp->UserBuffer. If Irp->UserBuffer is not
updated so Irp->UserBuffer == MmGetMdlVirtualAddress(Irp->MdlAddress)
the computation it does to find the correct pages won’t work properly.
My experience is that most DMA controllers do not properly handle DMA to
invalid physical memory addresses, despite the PCI spec requirement that
they do so. That’s generally what leads to the hang situation. The
data corruption occurs when a read is done into a real physical page,
but NOT the one that should be used.
Regards,
Tony
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Raghwendra
Sent: Tuesday, July 05, 2005 9:25 AM
To: ntfsd redirect
Subject: Re: [ntfsd] Swapping Mdl
Hi Tony
For the moment i am not playing with UserBuffer as i need to
change only MDL data. When i say not working with .Doc files means, as i
assign new MDL to IRP at IRP_MJ_WRITE, winword.exe got hang for a while
and later a page fault error occurs. Whereas for other txt editor like
NotePad, Wordpad it working smoothly. One point more some times for
Winword even it work’s fine. So actually i am unable to understand this
inconsistant behavior of system.
Since WinWord before saving any file, many times interact with cache
using fastIO calls… so i hope i am not disturbing cache by creating
new MDL and assigning it to IRP and putting back the oriznal MDL at
completion routine .
Raghwendra
----- Original Message -----
From: “Tony Mason”
To: “Windows File Systems Devs Interest List”
Sent: Tuesday, July 05, 2005 5:21 PM
Subject: RE: [ntfsd] Swapping Mdl
> You don’t adjust Irp->UserBuffer; this will cause problems whenever
the
file is fragmented, regardless of the type of the file. See deviosup.c
in the FAT source code example (look for the use of Irp->UserBuffer.
>
> Since you don’t mention what “not working” means it is a guess as to
how
it does not work in your environment.
>
> Since you pass the IRP in the IoAllocateIrp call, it has already been
added to the MDL chain. The way the code is now written this will work,
but it is the kind of thing that will break in the future when someone
changes the code around.
>
> Regards,
>
> Tony
>
> Tony Mason
> Consulting Partner
> OSR Open Systems Resources, Inc.
> http://www.osr.com
>
>
> ________________________________________
> From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]
On Behalf Of Raghwendra
> Sent: Tuesday, July 05, 2005 3:03 AM
> To: ntfsd redirect
> Subject: [ntfsd] Swapping Mdl
>
> Hi All
> I want to swap the MDL buffer into my filter driver. Below is the way
i am
doing.
> My this code is working fine for .txt files. But for .Doc it’s
sometimes
working sometimes not. Am i missing something. Please suggest.
>
> originalMdl = Irp->MdlAddress;
> stagingBuffer = ExAllocatePool
> (
> NonPagedPoolCacheAligned,
> currentSp->Parameters.Write.Length
> );
> if (stagingBuffer != NULL)
> stagingMdl = IoAllocateMdl
> (
> stagingBuffer,
> currentSp->Parameters.Write.Length,
> FALSE,
> FALSE,
> Irp
> );
> // If there were problems getting memory, just pass the request along.
> if (stagingBuffer == NULL || stagingMdl == NULL) { if (stagingBuffer
> != NULL) ExFreePool(stagingBuffer);
> Irp->MdlAddress = originalMdl;
> nextSp = currentSp;
> ntStatus = IoCallDriver(filterExtension->TargetDevice, Irp); return
> (ntStatus); } // Required for mapping non-pagged pool memory to an
> MDL.
> MmBuildMdlForNonPagedPool(stagingMdl);
> // Swap the MDL in the IRP with the one we created.
> Irp->MdlAddress = stagingMdl;
> // Copy current stack to next stack.
> nextSp = currentSp;
> // Switch the MDL back in the completion routine
> IoSetCompletionRoutine ( Irp, WriteCompletion, originalMdl, TRUE,
> TRUE, TRUE ); // Call driver below us.
> ntStatus = IoCallDriver(TargetDevice, Irp); return (ntStatus);
> Completion code:
> // Initialize pointers to the MDLs.
> stagingMdl = Irp->MdlAddress;
> originalMdl = OriginalMdl;
> // Initialize pointers to the I/O buffers stagingBuffer =
> MmGetSystemAddressForMdl(stagingMdl);
> originalBuffer = MmGetSystemAddressForMdl(originalMdl);
> // Restore the original IRP.
> Irp->MdlAddress = originalMdl;
> IoFreeMdl(stagingMdl);
> ExFreePool(stagingBuffer);
> Raghwendra
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: unknown lmsubst tag
argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cf
m?id=17
>
> You are currently subscribed to ntfsd as: unknown lmsubst tag
argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
Disclaimer:
The contents of this E-mail (including the contents of the enclosure(s)
or attachment(s) if any) are privileged and confidential material of MBT
and should not be disclosed to, used by or copied in any manner by
anyone other than the intended addressee(s). In case you are not the
desired addressee, you should delete this message and/or re-direct it to
the sender. The views expressed in this E-mail message (including the
enclosure(s) or attachment(s) if any) are those of the individual
sender, except where the sender expressly, and with authority, states
them to be the views of MBT.
This e-mail message including attachment/(s), if any, is believed to be
free of any virus. However, it is the responsibility of the recipient
to ensure that it is virus free and MBT is not responsible for any loss
or damage arising in any way from its use
—
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@osr.com To unsubscribe
send a blank email to xxxxx@lists.osr.com
—
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
Disclaimer:
The contents of this E-mail (including the contents of the enclosure(s)
or attachment(s) if any) are privileged and confidential material of MBT
and should not be disclosed to, used by or copied in any manner by
anyone other than the intended addressee(s). In case you are not the
desired addressee, you should delete this message and/or re-direct it to
the sender. The views expressed in this E-mail message (including the
enclosure(s) or attachment(s) if any) are those of the individual
sender, except where the sender expressly, and with authority, states
them to be the views of MBT.
This e-mail message including attachment/(s), if any, is believed to be
free of any virus. However, it is the responsibility of the recipient
to ensure that it is virus free and MBT is not responsible for any loss
or damage arising in any way from its use
—
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@osr.com To unsubscribe
send a blank email to xxxxx@lists.osr.com
—
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
Disclaimer:
The contents of this E-mail (including the contents of the enclosure(s)
or attachment(s) if any) are privileged and confidential material of MBT
and should not be disclosed to, used by or copied in any manner by
anyone other than the intended addressee(s). In case you are not the
desired addressee, you should delete this message and/or re-direct it to
the sender. The views expressed in this E-mail message (including the
enclosure(s) or attachment(s) if any) are those of the individual
sender, except where the sender expressly, and with authority, states
them to be the views of MBT.
This e-mail message including attachment/(s), if any, is believed to be
free of any virus. However, it is the responsibility of the recipient
to ensure that it is virus free and MBT is not responsible for any loss
or damage arising in any way from its use
*
—
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@des.co.uk To unsubscribe
send a blank email to xxxxx@lists.osr.com