MmIsNonPagedSystemAddressValid

MmIsNonPagedSystemAddressValid() isn’t really documented (yeah, I know it’s
obsolete). I’d just like to know how it behaves. In the following code
snippet, what would be the value of bMemGood after executing the statements
at Point1 and Point2? Assume that the memory allocation/free succeed.

{
.
.
// Allocate some memory (assume this call works)
pMem = ExAllocatePool(NonPagedPool, sizeof(MY_STRUCT));
.
.
// Point 1
bMemGood = MmIsNonPagedSystemAddressValid(pMem);
.
.
// Free the memory (assume this call works)
ExFreePool(pMem);
.
.
// Point 2
bMemGood = MmIsNonPagedSystemAddressValid(pMem);
.
.
}


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

I vote for TRUE. This function is not answering the question: “do I own this
nonpaged address?” but rather: “is this nonpaged address valid?”.

Mark Roddy
xxxxx@hollistech.com
www.hollistech.com
603 321 1032
WindowsNT Windows 2000 Consulting Services

-----Original Message-----
From: Nate Bushman [mailto:xxxxx@Legato.com]
Sent: Wednesday, March 14, 2001 2:46 PM
To: NT Developers Interest List
Subject: [ntdev] MmIsNonPagedSystemAddressValid

MmIsNonPagedSystemAddressValid() isn’t really documented (yeah, I know it’s
obsolete). I’d just like to know how it behaves. In the following code
snippet, what would be the value of bMemGood after executing the statements
at Point1 and Point2? Assume that the memory allocation/free succeed.

{
.
.
// Allocate some memory (assume this call works)
pMem = ExAllocatePool(NonPagedPool, sizeof(MY_STRUCT));
.
.
// Point 1
bMemGood = MmIsNonPagedSystemAddressValid(pMem);
.
.
// Free the memory (assume this call works)
ExFreePool(pMem);
.
.
// Point 2
bMemGood = MmIsNonPagedSystemAddressValid(pMem);
.
.
}


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


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

Mark, you’re right. I just tested this code, and
MmIsNonPagedSystemAddressValid() returns TRUE at
both Point1 and Point2.

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Wednesday, March 14, 2001 1:13 PM
To: NT Developers Interest List
Subject: [ntdev] RE: MmIsNonPagedSystemAddressValid

I vote for TRUE. This function is not answering the question: “do I own this
nonpaged address?” but rather: “is this nonpaged address valid?”.

Mark Roddy
xxxxx@hollistech.com
www.hollistech.com
603 321 1032
WindowsNT Windows 2000 Consulting Services

-----Original Message-----
From: Nate Bushman [mailto:xxxxx@Legato.com]
Sent: Wednesday, March 14, 2001 2:46 PM
To: NT Developers Interest List
Subject: [ntdev] MmIsNonPagedSystemAddressValid

MmIsNonPagedSystemAddressValid() isn’t really documented (yeah, I know it’s
obsolete). I’d just like to know how it behaves. In the following code
snippet, what would be the value of bMemGood after executing the statements
at Point1 and Point2? Assume that the memory allocation/free succeed.

{
.
.
// Allocate some memory (assume this call works)
pMem = ExAllocatePool(NonPagedPool, sizeof(MY_STRUCT));
.
.
// Point 1
bMemGood = MmIsNonPagedSystemAddressValid(pMem);
.
.
// Free the memory (assume this call works)
ExFreePool(pMem);
.
.
// Point 2
bMemGood = MmIsNonPagedSystemAddressValid(pMem);
.
.
}


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


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


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

Is there a way in kernel mode to determine if your pointer
to nonpaged pool actually points to something that you own?

-----Original Message-----
From: Nate Bushman [mailto:xxxxx@legato.com]
Sent: Wednesday, March 14, 2001 1:53 PM
To: NT Developers Interest List
Subject: [ntdev] RE: MmIsNonPagedSystemAddressValid

Mark, you’re right. I just tested this code, and
MmIsNonPagedSystemAddressValid() returns TRUE at
both Point1 and Point2.

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Wednesday, March 14, 2001 1:13 PM
To: NT Developers Interest List
Subject: [ntdev] RE: MmIsNonPagedSystemAddressValid

I vote for TRUE. This function is not answering the question: “do I own this
nonpaged address?” but rather: “is this nonpaged address valid?”.

Mark Roddy
xxxxx@hollistech.com
www.hollistech.com
603 321 1032
WindowsNT Windows 2000 Consulting Services

-----Original Message-----
From: Nate Bushman [mailto:xxxxx@Legato.com]
Sent: Wednesday, March 14, 2001 2:46 PM
To: NT Developers Interest List
Subject: [ntdev] MmIsNonPagedSystemAddressValid

MmIsNonPagedSystemAddressValid() isn’t really documented (yeah, I know it’s
obsolete). I’d just like to know how it behaves. In the following code
snippet, what would be the value of bMemGood after executing the statements
at Point1 and Point2? Assume that the memory allocation/free succeed.

{
.
.
// Allocate some memory (assume this call works)
pMem = ExAllocatePool(NonPagedPool, sizeof(MY_STRUCT));
.
.
// Point 1
bMemGood = MmIsNonPagedSystemAddressValid(pMem);
.
.
// Free the memory (assume this call works)
ExFreePool(pMem);
.
.
// Point 2
bMemGood = MmIsNonPagedSystemAddressValid(pMem);
.
.
}


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


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


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


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

> Is there a way in kernel mode to determine if your pointer

to nonpaged pool actually points to something that you own?

Assuming that you’re using it for debugging reasons and not some production
sort of code, you could use “pool tagging”. This is a way of putting a
4-byte tag on each allocation, typically, you use the name of your driver or
module. For example, the first module in some TCP/IP driver might use
“TCP1”. There’s all sorts of information about this in the DDK, and various
tools such as PoolMon to help you track how much memory you allocated,
freed, and so on. Furthermore, you could “cheat” and look at the tag, which
should start 8 bytes prior to your normal pointer. Start by looking at the
function ExAllocatePoolWithTag().


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

> Assuming that you’re using it for debugging reasons and not some
production

sort of code, you could use “pool tagging”. This is a way of putting a

Pool tagging has practically no overhead and thus can be used in production
code too.
At least the release build of the NT kernel uses it.

Max


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

Max,

Maybe in NT4, but it was turned off in 2000 … at least that’s what my
WinDbg says when I do !irpfind.

Gary

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Saturday, March 17, 2001 12:07 PM
To: NT Developers Interest List
Subject: [ntdev] RE: MmIsNonPagedSystemAddressValid

Assuming that you’re using it for debugging reasons and not some
production
sort of code, you could use “pool tagging”. This is a way of putting a

Pool tagging has practically no overhead and thus can be used in production
code too.
At least the release build of the NT kernel uses it.

Max


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


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

> > Assuming that you’re using it for debugging reasons and not some
production

> sort of code, you could use “pool tagging”.

Pool tagging has practically no overhead and thus can be used in
production
code too.

Yes, I know that. Additionally, NTDDK.H #defines ExAllocatePool to be
ExAllocatePoolWithTag (tag = "Ddk "), so that if you don’t specify a tag,
you get one by default.

The point I was making (but neglected to) was that the person asking the
question should not depend on the internals of system structures, such as
the header structure of the pool allocation blocks, in production code.
People like me like to write wrappers around such things when we’re doing
debugging, and their code would have failed on my system. Plus, it could be
different between different releases of NT, or even service packs!


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

Is there any !poolfind and !poolused in w2k?

----- Original Message -----
From: “Gary G. Little”
To: “NT Developers Interest List”
Sent: Sunday, March 18, 2001 4:33 AM
Subject: [ntdev] RE: MmIsNonPagedSystemAddressValid

> Max,
>
> Maybe in NT4, but it was turned off in 2000 … at least that’s what my
> WinDbg says when I do !irpfind.
>
> Gary
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
> Sent: Saturday, March 17, 2001 12:07 PM
> To: NT Developers Interest List
> Subject: [ntdev] RE: MmIsNonPagedSystemAddressValid
>
> > Assuming that you’re using it for debugging reasons and not some
> production
> > sort of code, you could use “pool tagging”. This is a way of putting a
>
> Pool tagging has practically no overhead and thus can be used in
production
> code too.
> At least the release build of the NT kernel uses it.
>
> Max
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@delphieng.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


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