MmGetSystemAddressForMdl obsolete in Win2K?

In my filter driver I am using IoAllocateMdl followed by MmProbeAndLockPages
and MmGetSystemAddressForMdl. However, Win2K Driver Verifier is telling me I
should be using MmGetSystemAddressForMdlSafe instead of
MmGetSystemAddressForMdl. Does anyone know what this is about? Is
MmGetSystemAddressForMdl obsolete in Win2K.

On a related note, since MmGetSystemAddressForMdl might call MmMapLockedPages,
do I also need to call MmUnmapLockedPages at some point?

Thanks (and best wishes to all for a happy new year).

Neil


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

MmGetSystemAddressForMdlSafe returns a NULL if the pages could not be
locked, where MmGetSystemAddressForMdl could blue screen due to low
resources.

As far as MmMapLockedPages I do the following:

MmProbeAndLockPages(pMdl, KernelMode, IoReadAccess);
pMdlBuf = MmGetSystemAddressForMdlSafe( pMdl, NormalPagePriority );
MmUnlockPages(pMdl);

Ken
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Neil Weicher
Sent: Tuesday, January 02, 2001 9:07 PM
To: File Systems Developers
Subject: [ntfsd] MmGetSystemAddressForMdl obsolete in Win2K?

In my filter driver I am using IoAllocateMdl followed by
MmProbeAndLockPages
and MmGetSystemAddressForMdl. However, Win2K Driver Verifier is telling me
I
should be using MmGetSystemAddressForMdlSafe instead of
MmGetSystemAddressForMdl. Does anyone know what this is about? Is
MmGetSystemAddressForMdl obsolete in Win2K.

On a related note, since MmGetSystemAddressForMdl might call
MmMapLockedPages,
do I also need to call MmUnmapLockedPages at some point?

Thanks (and best wishes to all for a happy new year).

Neil


You are currently subscribed to ntfsd as: xxxxx@legato.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> On a related note, since MmGetSystemAddressForMdl might call
MmMapLockedPages,

do I also need to call MmUnmapLockedPages at some point?

MmUnlockPages will do this for you.
If the MDL is associated with the IRP - then MmUnlockPages will be called by
IoCompleteRequest - again without your aid.

Max


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

MmGetSystemAddressForMdl will bugcheck the system if there aren’t enough
contiguous system VA pages to map the MDL.

…Safe will return NULL.

In Windows 2000, carrying over into Whistler, we’re trying to eliminate
the reasons why the OS will bugcheck. Forget bugs, things like this are
just far too obvious, and we did succeed in completely cleaning use of
it out of everything internally. Expect next to see
NonPagedPoolMustSucceed get depracated …

MmPrepareMdlForReuse will do the unmap trick, but IoFreeMdl does the
right thing for you anyway. You only need to do this explicitly in very
special circumstances that would have to arise from your driver design;
you won’t encounter them in normal practice. Ex: when you have an MDL
you don’t ever want to free, but want use to map and unmap at will.

Whistler FAT will demonstrate such an example.

-----Original Message-----
From: Neil Weicher [mailto:xxxxx@netlib.com]
Sent: Tuesday, January 02, 2001 6:07 PM
To: File Systems Developers
Subject: [ntfsd] MmGetSystemAddressForMdl obsolete in Win2K?

In my filter driver I am using IoAllocateMdl followed by
MmProbeAndLockPages
and MmGetSystemAddressForMdl. However, Win2K Driver Verifier is telling
me I
should be using MmGetSystemAddressForMdlSafe instead of
MmGetSystemAddressForMdl. Does anyone know what this is about? Is
MmGetSystemAddressForMdl obsolete in Win2K.

On a related note, since MmGetSystemAddressForMdl might call
MmMapLockedPages,
do I also need to call MmUnmapLockedPages at some point?

Thanks (and best wishes to all for a happy new year).

Neil


You are currently subscribed to ntfsd as: xxxxx@exchange.microsoft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Thanks for the helpful replies.

Is there any equivalent to MmGetSystemAddressForMdlSafe in NT4? Or should I
simply put it inside a “try” construct?

Neil


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Putting kernel code inside a try construct can only prevent against one type
of blue screen, that is KMODE_EXCEPTION_NOT_HANDLED. Literally, this error
means a structured exception was raised and no one handled it. The try
construct is not a generic mechanism for overriding a call to KeBugCheck
made by a routine such as MmGetSystemAddressForMdlSafe.

-----Original Message-----
From: Neil Weicher [mailto:xxxxx@netlib.com]
Sent: Thursday, January 04, 2001 7:19 AM
To: File Systems Developers
Subject: [ntfsd] RE: MmGetSystemAddressForMdl obsolete in Win2K?

Thanks for the helpful replies.

Is there any equivalent to MmGetSystemAddressForMdlSafe in
NT4? Or should I
simply put it inside a “try” construct?

Neil


You are currently subscribed to ntfsd as: xxxxx@nsisw.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Yes, exception handlers catch exceptions. They do not catch calls to
KeBugCheck, either by *lower* exception handlers in the stack or
otherwise.

MmGetSystemAddressForMdlSafe will not bugcheck the system if no VA are
available (this is the point of it). MmGetSystemAddressForMdl *will*.

-----Original Message-----
From: Rob Fuller [mailto:xxxxx@NSISW.COM]
Sent: Thursday, January 04, 2001 6:49 AM
To: File Systems Developers
Subject: [ntfsd] RE: MmGetSystemAddressForMdl obsolete in Win2K?

Putting kernel code inside a try construct can only prevent against one
type
of blue screen, that is KMODE_EXCEPTION_NOT_HANDLED. Literally, this
error
means a structured exception was raised and no one handled it. The try
construct is not a generic mechanism for overriding a call to KeBugCheck
made by a routine such as MmGetSystemAddressForMdlSafe.

-----Original Message-----
From: Neil Weicher [mailto:xxxxx@netlib.com]
Sent: Thursday, January 04, 2001 7:19 AM
To: File Systems Developers
Subject: [ntfsd] RE: MmGetSystemAddressForMdl obsolete in Win2K?

Thanks for the helpful replies.

Is there any equivalent to MmGetSystemAddressForMdlSafe in
NT4? Or should I
simply put it inside a “try” construct?

Neil


You are currently subscribed to ntfsd as: xxxxx@nsisw.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: xxxxx@exchange.microsoft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

For heavens sake.

Why not fix MmGetSystemAddressForMdl!!!

All these “improvements” are creating nightmares for developers that must
support multiple Windows platforms.

Regards

Thomas F. Divine

PCAUSA - Toolkits & Resources For Network Software Developers
NDIS Protocol - NDIS Intermediate - TDI Client
http: - http:

----- Original Message -----
From: Daniel Lovinger
To: File Systems Developers
Sent: Thursday, January 04, 2001 1:50 PM
Subject: [ntfsd] RE: MmGetSystemAddressForMdl obsolete in Win2K?

> Yes, exception handlers catch exceptions. They do not catch calls to
> KeBugCheck, either by lower exception handlers in the stack or
> otherwise.
>
> MmGetSystemAddressForMdlSafe will not bugcheck the system if no VA are
> available (this is the point of it). MmGetSystemAddressForMdl will.
>
> -----Original Message-----
> From: Rob Fuller [mailto:xxxxx@NSISW.COM]
> Sent: Thursday, January 04, 2001 6:49 AM
> To: File Systems Developers
> Subject: [ntfsd] RE: MmGetSystemAddressForMdl obsolete in Win2K?
>
>
> Putting kernel code inside a try construct can only prevent against one
> type
> of blue screen, that is KMODE_EXCEPTION_NOT_HANDLED. Literally, this
> error
> means a structured exception was raised and no one handled it. The try
> construct is not a generic mechanism for overriding a call to KeBugCheck
> made by a routine such as MmGetSystemAddressForMdlSafe.
>
> > -----Original Message-----
> > From: Neil Weicher [mailto:xxxxx@netlib.com]
> > Sent: Thursday, January 04, 2001 7:19 AM
> > To: File Systems Developers
> > Subject: [ntfsd] RE: MmGetSystemAddressForMdl obsolete in Win2K?
> >
> >
> > Thanks for the helpful replies.
> >
> > Is there any equivalent to MmGetSystemAddressForMdlSafe in
> > NT4? Or should I
> > simply put it inside a “try” construct?
> >
> > Neil
> >
> >
> >
> > —
> > You are currently subscribed to ntfsd as: xxxxx@nsisw.com
> > To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
>
> —
> You are currently subscribed to ntfsd as: xxxxx@exchange.microsoft.com
> To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@mindspring.com
> To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com</http:></http:>

You can set the MDL_MAPPING_CAN_FAIL flag in the MDL itself; however,
take care to save/restore the current value after the call (this is why
the new API was created; its an annoying mess).

-----Original Message-----
From: Neil Weicher [mailto:xxxxx@netlib.com]
Sent: Thursday, January 04, 2001 4:19 AM
To: File Systems Developers
Subject: [ntfsd] RE: MmGetSystemAddressForMdl obsolete in Win2K?

Thanks for the helpful replies.

Is there any equivalent to MmGetSystemAddressForMdlSafe in NT4? Or
should I
simply put it inside a “try” construct?

Neil


You are currently subscribed to ntfsd as: xxxxx@exchange.microsoft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Thanks. That’s what I wanted to hear. I’ll try it out.

Neil


Subject: RE: MmGetSystemAddressForMdl obsolete in Win2K?
From: “Daniel Lovinger”
Date: Thu, 4 Jan 2001 13:16:41 -0800
X-Message-Number: 18

You can set the MDL_MAPPING_CAN_FAIL flag in the MDL itself; however,
take care to save/restore the current value after the call (this is why
the new API was created; its an annoying mess).


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com