IoFreeIrp

I have found that IoFreeIrp does not free an MDL that has been set in the
Irp. I issue an MJ_READ and some driver below sets the MDL.

Calling IoFreeMdl frees the mdl. Is there anything else I need to to to
clean up the MDL aside from calling IoFreeMdl (like unlock pages, etc.)?

Thanks,

Ken

The one who initialized the MDL by MmProbeAndLockPages must be the one who unlocks it.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: Ken Galipeau
To: Windows File Systems Devs Interest List
Sent: Thursday, March 31, 2005 9:15 PM
Subject: [ntfsd] IoFreeIrp

I have found that IoFreeIrp does not free an MDL that has been set in the Irp. I issue an MJ_READ and some driver below sets the MDL.

Calling IoFreeMdl frees the mdl. Is there anything else I need to to to clean up the MDL aside from calling IoFreeMdl (like unlock pages, etc.)?

Thanks,

Ken


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

Can I assume that has been done?

Why wouldn’t the one who initialized it also free it?

Ken


From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Thursday, March 31, 2005 1:27 PM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] IoFreeIrp

The one who initialized the MDL by MmProbeAndLockPages must be the one
who unlocks it.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com mailto:xxxxx
http://www.storagecraft.com http:

----- Original Message -----

From: Ken Galipeau mailto:xxxxx

To: Windows File mailto:xxxxx Systems Devs Interest List

Sent: Thursday, March 31, 2005 9:15 PM

Subject: [ntfsd] IoFreeIrp

I have found that IoFreeIrp does not free an MDL that has been set in the
Irp. I issue an MJ_READ and some driver below sets the MDL.

Calling IoFreeMdl frees the mdl. Is there anything else I need to to to
clean up the MDL aside from calling IoFreeMdl (like unlock pages, etc.)?

Thanks,

Ken


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.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</mailto:xxxxx></mailto:xxxxx></http:></mailto:xxxxx>

This is not always the case. In most scenarios where the Irp is allocated
from high up above the stack;i.e. the IO Mgr, then when the Irp is completed
all will be torn down correctly. But if you roll your own and send it down,
it is possible that a driver below you will allocate an Mdl and lock down
the pages. In this case, it is up to you to unlock and free the Mdl before
deallocating the Mdl.

Pete

Kernel Drivers
Windows Filesystem and Device Driver Consulting
www.KernelDrivers.com
(303)546-0300


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Thursday, March 31, 2005 11:27 AM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] IoFreeIrp

The one who initialized the MDL by MmProbeAndLockPages must be the one
who unlocks it.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----

From: Ken Galipeau mailto:xxxxx

To: Windows File mailto:xxxxx Systems Devs Interest List

Sent: Thursday, March 31, 2005 9:15 PM

Subject: [ntfsd] IoFreeIrp

I have found that IoFreeIrp does not free an MDL that has been set in the
Irp. I issue an MJ_READ and some driver below sets the MDL.

Calling IoFreeMdl frees the mdl. Is there anything else I need to to to
clean up the MDL aside from calling IoFreeMdl (like unlock pages, etc.)?

Thanks,

Ken


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.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</mailto:xxxxx></mailto:xxxxx>

Hi Pete,

How do I know if it needs to be unlocked?

Thanks,

Ken


From: Peter Scott [mailto:xxxxx@KernelDrivers.com]
Sent: Thursday, March 31, 2005 1:34 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] IoFreeIrp

This is not always the case. In most scenarios where the Irp is allocated
from high up above the stack;i.e. the IO Mgr, then when the Irp is completed
all will be torn down correctly. But if you roll your own and send it down,
it is possible that a driver below you will allocate an Mdl and lock down
the pages. In this case, it is up to you to unlock and free the Mdl before
deallocating the Mdl.

Pete

Kernel Drivers
Windows Filesystem and Device Driver Consulting
www.KernelDrivers.com
(303)546-0300


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Thursday, March 31, 2005 11:27 AM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] IoFreeIrp

The one who initialized the MDL by MmProbeAndLockPages must be the one
who unlocks it.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com mailto:xxxxx
http://www.storagecraft.com http:

----- Original Message -----

From: Ken Galipeau mailto:xxxxx

To: Windows File mailto:xxxxx Systems Devs Interest List

Sent: Thursday, March 31, 2005 9:15 PM

Subject: [ntfsd] IoFreeIrp

I have found that IoFreeIrp does not free an MDL that has been set in the
Irp. I issue an MJ_READ and some driver below sets the MDL.

Calling IoFreeMdl frees the mdl. Is there anything else I need to to to
clean up the MDL aside from calling IoFreeMdl (like unlock pages, etc.)?

Thanks,

Ken


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.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.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</mailto:xxxxx></mailto:xxxxx></http:></mailto:xxxxx>

You should have a loop that looks like this:

VOID
MyFreeMdl(
PMDL Mdl
)
{
PMDL currentMdl, nextMdl;

for (currentMdl = Mdl; currentMdl != NULL; currentMdl = nextMdl) {
nextMdl = currentMdl->Next;

if (FlagOn( currentMdl->MdlFlags, MDL_PAGES_LOCKED )) {
MmUnlockPages( currentMdl );
}
IoFreeMdl( currentMdl );
}
}


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ken Galipeau
Sent: Thursday, March 31, 2005 9:15 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] IoFreeIrp

I have found that IoFreeIrp does not free an MDL that has been set in
the Irp. I issue an MJ_READ and some driver below sets the MDL.

Calling IoFreeMdl frees the mdl. Is there anything else I need to to to
clean up the MDL aside from calling IoFreeMdl (like unlock pages, etc.)?

Thanks,
Ken

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

Neal,

Per my reply to Ken, shouldn’t you also check to see if they are mapped? And
un-map accordingly?

Pete

Kernel Drivers
Windows Filesystem and Device Driver Consulting
www.KernelDrivers.com
(303)546-0300

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Neal Christiansen
Sent: Thursday, March 31, 2005 1:58 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] IoFreeIrp

You should have a loop that looks like this:

VOID
MyFreeMdl(
PMDL Mdl
)
{
PMDL currentMdl, nextMdl;

for (currentMdl = Mdl; currentMdl != NULL; currentMdl = nextMdl) {
nextMdl = currentMdl->Next;

if (FlagOn( currentMdl->MdlFlags, MDL_PAGES_LOCKED )) {
MmUnlockPages( currentMdl );
}
IoFreeMdl( currentMdl );
}
}


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ken Galipeau
Sent: Thursday, March 31, 2005 9:15 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] IoFreeIrp

I have found that IoFreeIrp does not free an MDL that has been set in
the Irp. I issue an MJ_READ and some driver below sets the MDL.

Calling IoFreeMdl frees the mdl. Is there anything else I need to to to
clean up the MDL aside from calling IoFreeMdl (like unlock pages, etc.)?

Thanks,
Ken

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.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

Mdl->Flags & MDL_PAGES_LOCKED

I also check to see if they are mapped, usually to a system address space
for devices below you in the stack. In this case check for

Mdl->Flags & MDL_MAPPED_TO_SYSTEM_VA

Get the system address then un-map it accordingly. This is done prior to
unlocking the pages.

Pete

Kernel Drivers
Windows Filesystem and Device Driver Consulting
www.KernelDrivers.com
(303)546-0300


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ken Galipeau
Sent: Thursday, March 31, 2005 12:42 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] IoFreeIrp

Hi Pete,

How do I know if it needs to be unlocked?

Thanks,

Ken


From: Peter Scott [mailto:xxxxx@KernelDrivers.com]
Sent: Thursday, March 31, 2005 1:34 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] IoFreeIrp

This is not always the case. In most scenarios where the Irp is allocated
from high up above the stack;i.e. the IO Mgr, then when the Irp is completed
all will be torn down correctly. But if you roll your own and send it down,
it is possible that a driver below you will allocate an Mdl and lock down
the pages. In this case, it is up to you to unlock and free the Mdl before
deallocating the Mdl.

Pete

Kernel Drivers
Windows Filesystem and Device Driver Consulting
www.KernelDrivers.com
(303)546-0300


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Thursday, March 31, 2005 11:27 AM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] IoFreeIrp

The one who initialized the MDL by MmProbeAndLockPages must be the one
who unlocks it.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----

From: Ken Galipeau mailto:xxxxx

To: Windows File mailto:xxxxx Systems Devs Interest List

Sent: Thursday, March 31, 2005 9:15 PM

Subject: [ntfsd] IoFreeIrp

I have found that IoFreeIrp does not free an MDL that has been set in the
Irp. I issue an MJ_READ and some driver below sets the MDL.

Calling IoFreeMdl frees the mdl. Is there anything else I need to to to
clean up the MDL aside from calling IoFreeMdl (like unlock pages, etc.)?

Thanks,

Ken


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.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.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.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</mailto:xxxxx></mailto:xxxxx>

It is not necessary, the unmapping will happen automatically when the
MDL is torn down.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no
Rights

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Peter Scott
Sent: Thursday, March 31, 2005 1:06 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] IoFreeIrp

Neal,

Per my reply to Ken, shouldn’t you also check to see if they are mapped?
And
un-map accordingly?

Pete

Kernel Drivers
Windows Filesystem and Device Driver Consulting
www.KernelDrivers.com
(303)546-0300

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Neal Christiansen
Sent: Thursday, March 31, 2005 1:58 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] IoFreeIrp

You should have a loop that looks like this:

VOID
MyFreeMdl(
PMDL Mdl
)
{
PMDL currentMdl, nextMdl;

for (currentMdl = Mdl; currentMdl != NULL; currentMdl = nextMdl) {
nextMdl = currentMdl->Next;

if (FlagOn( currentMdl->MdlFlags, MDL_PAGES_LOCKED )) {
MmUnlockPages( currentMdl );
}
IoFreeMdl( currentMdl );
}
}


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ken Galipeau
Sent: Thursday, March 31, 2005 9:15 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] IoFreeIrp

I have found that IoFreeIrp does not free an MDL that has been set in
the Irp. I issue an MJ_READ and some driver below sets the MDL.

Calling IoFreeMdl frees the mdl. Is there anything else I need to to to
clean up the MDL aside from calling IoFreeMdl (like unlock pages, etc.)?

Thanks,
Ken

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.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.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

It is not necessary to unlock the pages if you lock them UNLESS you are the originator of the IO. In that case you should always check for unlocking them (and freeing the MDL). If an IO comes down from the IOManager and a lower driver locks it, the IOManager will clean it up.

The reason you don’t want the guy who locks it to unlock it (unless they originated it) is because someone higher in the stack, while processing the completion, may need it locked. If you lock and unlock it then they are going to have to lock it again which incurs unnecessary overhead.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no Rights


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Ken Galipeau
Sent: Thursday, March 31, 2005 10:32 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] IoFreeIrp

Can I assume that has been done?

Why wouldn’t the one who initialized it also free it?

Ken


From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Thursday, March 31, 2005 1:27 PM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] IoFreeIrp

??? The one who initialized the MDL by MmProbeAndLockPages must be the one who unlocks it.
?
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: Ken Galipeau
To: Windows File Systems Devs Interest List
Sent: Thursday, March 31, 2005 9:15 PM
Subject: [ntfsd] IoFreeIrp

I have found that IoFreeIrp does not free an MDL that has been set in the Irp. I issue an MJ_READ and some driver below sets the MDL.

Calling IoFreeMdl frees the mdl. Is there anything else I need to to to clean up the MDL aside from calling IoFreeMdl (like unlock pages, etc.)?

Thanks,
Ken

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.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.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

So, can we say that if my driver rolls an IRP then i must always check for
MDL_PAGES_LOCKED flag before freeing the MDL. Sometimes the pages may not be
locked by the lower driver and sometimes they may be in which case we must
call MmUnlockPages. And there is no need to check for any other flag.
Somebody confirm my inference.

…Mani

“Neal Christiansen” wrote in message
news:xxxxx@ntfsd…
It is not necessary to unlock the pages if you lock them UNLESS you are the
originator of the IO. In that case you should always check for unlocking
them (and freeing the MDL). If an IO comes down from the IOManager and a
lower driver locks it, the IOManager will clean it up.

The reason you don’t want the guy who locks it to unlock it (unless they
originated it) is because someone higher in the stack, while processing the
completion, may need it locked. If you lock and unlock it then they are
going to have to lock it again which incurs unnecessary overhead.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no Rights


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ken Galipeau
Sent: Thursday, March 31, 2005 10:32 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] IoFreeIrp

Can I assume that has been done?

Why wouldn’t the one who initialized it also free it?

Ken


From: Maxim S. Shatskih [mailto:xxxxx@storagecraft.com]
Sent: Thursday, March 31, 2005 1:27 PM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] IoFreeIrp

The one who initialized the MDL by MmProbeAndLockPages must be the one who
unlocks it.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: Ken Galipeau
To: Windows File Systems Devs Interest List
Sent: Thursday, March 31, 2005 9:15 PM
Subject: [ntfsd] IoFreeIrp

I have found that IoFreeIrp does not free an MDL that has been set in the
Irp. I issue an MJ_READ and some driver below sets the MDL.

Calling IoFreeMdl frees the mdl. Is there anything else I need to to to
clean up the MDL aside from calling IoFreeMdl (like unlock pages, etc.)?

Thanks,
Ken

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.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.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

> So, can we say that if my driver rolls an IRP then i must always check for

MDL_PAGES_LOCKED flag before freeing the MDL.

No. If your driver have called MmProbeAndLockPages itself - then it must call
MmUnlockPages in the completion. Otherwise, no need to ever call MmUnlockPages.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Max,

You need to read the thread of emails here.

Again - if you rolled up the Irp yourself and passed it down the stack,
hence you will be freeing the irp, then you DO need to check if pages have
been locked. A driver below you may have created and Mdl and locked the
pages, assuming that the IO Manager will clean them up at Irp completion
time, per normal behavior But since this Irp isn’t going to reach the IO
Mgr, then you need to perform this unlocking of the pages. And you do this
by checking the appropriate flag in the Mdl.

Pete

Kernel Drivers
Windows Filesystem and Device Driver Consulting
www.KernelDrivers.com
(303)546-0300

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Friday, April 01, 2005 1:10 AM
To: Windows File Systems Devs Interest List
Subject: Re: Re:[ntfsd] IoFreeIrp

So, can we say that if my driver rolls an IRP then i must always check for
MDL_PAGES_LOCKED flag before freeing the MDL.

No. If your driver have called MmProbeAndLockPages itself - then it must
call
MmUnlockPages in the completion. Otherwise, no need to ever call
MmUnlockPages.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@kerneldrivers.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

> been locked. A driver below you may have created and Mdl and locked the

pages, assuming that the IO Manager will clean them up at Irp completion
time

Do you mean that the driver below can create a MDL, set Irp->MdlAddres of my
IRP to it, and then complete this IRP still with the same Irp->MdlAddress?

For me, looks like a bug in driver below.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Why would this be a bug? Filesystems do it all the time when they lock down
a user buffer, create an Mdl and set the Irp->MdlAddress without cleaning up
on the backside.

Drivers below you have no idea that this is ‘your’ Irp vs. an IO Mgr Irp.

For me, I would think this is good practice in keeping overhead down of
creating and tearing down a bunch of Mdls and as long as you know about it
at cleanup time then what’s the problem?

Pete

Kernel Drivers
Windows Filesystem and Device Driver Consulting
www.KernelDrivers.com
(303)546-0300

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Friday, April 01, 2005 11:53 PM
To: Windows File Systems Devs Interest List
Subject: Re: Re:[ntfsd] IoFreeIrp

been locked. A driver below you may have created and Mdl and locked the
pages, assuming that the IO Manager will clean them up at Irp completion
time

Do you mean that the driver below can create a MDL, set Irp->MdlAddres of
my
IRP to it, and then complete this IRP still with the same Irp->MdlAddress?

For me, looks like a bug in driver below.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@kerneldrivers.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

It’s not a bug. Normal, full i/o completion unmaps/unlocks/frees the MDL chain. Drivers that originate the request and arrest normal completion doing their own completion processing should do the same. We should fix IFSKIT docs if they are not clear on this.
Ravi


From: xxxxx@lists.osr.com on behalf of Peter Scott
Sent: Sat 4/2/2005 6:00 AM
To: Windows File Systems Devs Interest List
Subject: RE: Re:[ntfsd] IoFreeIrp

Why would this be a bug? Filesystems do it all the time when they lock down
a user buffer, create an Mdl and set the Irp->MdlAddress without cleaning up
on the backside.

Drivers below you have no idea that this is ‘your’ Irp vs. an IO Mgr Irp.

For me, I would think this is good practice in keeping overhead down of
creating and tearing down a bunch of Mdls and as long as you know about it
at cleanup time then what’s the problem?

Pete

Kernel Drivers
Windows Filesystem and Device Driver Consulting
www.KernelDrivers.com
(303)546-0300

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Friday, April 01, 2005 11:53 PM
To: Windows File Systems Devs Interest List
Subject: Re: Re:[ntfsd] IoFreeIrp

been locked. A driver below you may have created and Mdl and locked the
pages, assuming that the IO Manager will clean them up at Irp completion
time

Do you mean that the driver below can create a MDL, set Irp->MdlAddres of
my
IRP to it, and then complete this IRP still with the same Irp->MdlAddress?

For me, looks like a bug in driver below.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@kerneldrivers.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: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

That would be a good idea to add that to the docs, in additional.

How about providing a IoCleanupAndFreeIrp routine? Or routines to cleanup
the things that need to be cleaned up.

Ken


From: Ravisankar Pudipeddi [mailto:xxxxx@windows.microsoft.com]
Sent: Sunday, April 03, 2005 3:42 PM
To: Windows File Systems Devs Interest List
Cc: Diane Olsen
Subject: RE: Re:[ntfsd] IoFreeIrp

It’s not a bug. Normal, full i/o completion unmaps/unlocks/frees the MDL
chain. Drivers that originate the request and arrest normal completion doing
their own completion processing should do the same. We should fix IFSKIT
docs if they are not clear on this.

Ravi


From: xxxxx@lists.osr.com on behalf of Peter Scott
Sent: Sat 4/2/2005 6:00 AM
To: Windows File Systems Devs Interest List
Subject: RE: Re:[ntfsd] IoFreeIrp

Why would this be a bug? Filesystems do it all the time when they lock down
a user buffer, create an Mdl and set the Irp->MdlAddress without cleaning up
on the backside.

Drivers below you have no idea that this is ‘your’ Irp vs. an IO Mgr Irp.

For me, I would think this is good practice in keeping overhead down of
creating and tearing down a bunch of Mdls and as long as you know about it
at cleanup time then what’s the problem?

Pete

Kernel Drivers
Windows Filesystem and Device Driver Consulting
www.KernelDrivers.com
(303)546-0300

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com
mailto:xxxxx ] On Behalf Of Maxim S. Shatskih
Sent: Friday, April 01, 2005 11:53 PM
To: Windows File Systems Devs Interest List
Subject: Re: Re:[ntfsd] IoFreeIrp

> been locked. A driver below you may have created and Mdl and locked the
> pages, assuming that the IO Manager will clean them up at Irp completion
> time

Do you mean that the driver below can create a MDL, set Irp->MdlAddres of
my
IRP to it, and then complete this IRP still with the same Irp->MdlAddress?

For me, looks like a bug in driver below.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com http:


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
https:

You are currently subscribed to ntfsd as: xxxxx@kerneldrivers.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
https:

You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.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</https:></https:></http:></mailto:xxxxx>