Here is how I am handling it:
//
// Inline function for backward comapatbility with Windows NT 4.0.
//
#ifndef MmGetSystemAddressForMdlSafe
#define MmGetSystemAddressForMdlSafe(MDL, PRIORITY)
ZosGetSystemAddressForMdlSafe(MDL)
INLINE
PVOID
ZosGetSystemAddressForMdlSafe(PMDL Mdl)
{
PVOID Address;
CSHORT MdlCanFailFlag;
MdlCanFailFlag = (Mdl->MdlFlags & MDL_MAPPING_CAN_FAIL);
Mdl->MdlFlags |= MDL_MAPPING_CAN_FAIL;
Address = MmGetSystemAddressForMdl(Mdl);
if (!MdlCanFailFlag)
Mdl->MdlFlags &= ~MDL_MAPPING_CAN_FAIL;
return Address;
}
#endif
Best regards,
Bruce Engle
-----Original Message-----
From: Brad Sahr [mailto:xxxxx@macromedia.com]
Sent: Saturday, August 11, 2001 9:26 PM
To: File Systems Developers
Subject: [ntfsd] Re: Verifier bug check 81 on XP RC1
If you want to have a single binary for NT/2k/XP, then you could add code to
detect the operating system that you are running on and call the appropriate
function(s) for that OS. The HKLM\SOFTWARE\Microsoft\Windows
NT\CurrentVersion key contains a CurrentVersion REG_SZ. An NT4 box says
“4.0” and a Win2k box says “5.0”. I’d guess that XP says “6.0”.
I haven’t used this mechanism, others can probably comment on its
reliability. I did find some information indicating that the SOFTWARE hive
of the registry is loaded late, after kernel initialization, so it may not
be available when your driver needs this information.
Otherwise you could use the same code base with a few #defines or some
conditional compilation, but the end result will be a different binary for
different OSes, which I think you are trying to avoid.
Brad
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of
xxxxx@iOra.com
Sent: Friday, August 10, 2001 12:00 AM
To: File Systems Developers
Subject: [ntfsd] Re: Verifier bug check 81 on XP RC1
On 08/09/01, ““Maxim S. Shatskih” ” wrote:
> > > I have had no problems with this before. Now, when I run XP
> RC1 with the
> > > driver verifier, I (very occasionally) get a bug-check C4,81
> - “Call to
> > > MmMapLockedPages without MDL_MAPPING_CAN_FAIL” from the
> > > MmGetSystemAddressForMdl.
> >
> > Use MmGetSystemAddressForMdlSafe.
> > MmGetSystemAddressForMdl is obsolete.
> >
> > Max
> >
> >
>
> I’m fairly sure I know what the answer to this question will be,
> but I want
> to ask it explicitly.
>
> Does this mean that my existing use of a single driver for NT4/W2K/XP is
> not a good idea and a luxury I can’t afford to keep?? I.e. If
> MmGetSystemAddressForMdl is deemed to be obsolete on W2K and
> later (and can
> fail the verifier), but MmGetSystemAddressForMdlSafe is not available on
> NT4, do I have to build two drivers and install the appropriate one? Is
> there any “legacy” mechanism that would allow me to reliably use a single
> driver across the platforms?
>
> Hopefully, Brian
—
You are currently subscribed to ntfsd as: xxxxx@SERENA.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact
the sender by reply e-mail and destroy all copies of the original
message.
—
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