The format of the PFN entry is in the standard symbols on the symbol server:
lkd> dt nt!_MMPFN -b
+0x000 u1 : __unnamed
+0x000 Flink : Uint4B
+0x000 WsIndex : Uint4B
+0x000 Event : Ptr32
+0x000 ReadStatus : Int4B
+0x000 NextStackPfn : _SINGLE_LIST_ENTRY
+0x000 Next : Ptr32
+0x004 PteAddress : Ptr32
+0x008 u2 : __unnamed
+0x000 Blink : Uint4B
+0x000 ShareCount : Uint4B
+0x00c u3 : __unnamed
+0x000 e1 : _MMPFNENTRY
+0x000 Modified : Pos 0, 1 Bit
+0x000 ReadInProgress : Pos 1, 1 Bit
+0x000 WriteInProgress : Pos 2, 1 Bit
+0x000 PrototypePte : Pos 3, 1 Bit
+0x000 PageColor : Pos 4, 3 Bits
+0x000 ParityError : Pos 7, 1 Bit
+0x000 PageLocation : Pos 8, 3 Bits
+0x000 RemovalRequested : Pos 11, 1 Bit
+0x000 CacheAttribute : Pos 12, 2 Bits
+0x000 Rom : Pos 14, 1 Bit
+0x000 LockCharged : Pos 15, 1 Bit
+0x000 DontUse : Pos 16, 16 Bits
+0x000 e2 : __unnamed
+0x000 ShortFlags : Uint2B
+0x002 ReferenceCount : Uint2B
+0x010 OriginalPte : _MMPTE
+0x000 u : __unnamed
+0x000 Long : Uint4B
+0x000 Hard : _MMPTE_HARDWARE
+0x000 Valid : Pos 0, 1 Bit
+0x000 Writable : Pos 1, 1 Bit
+0x000 Owner : Pos 2, 1 Bit
+0x000 WriteThrough : Pos 3, 1 Bit
+0x000 CacheDisable : Pos 4, 1 Bit
+0x000 Accessed : Pos 5, 1 Bit
+0x000 Dirty : Pos 6, 1 Bit
+0x000 LargePage : Pos 7, 1 Bit
+0x000 Global : Pos 8, 1 Bit
+0x000 CopyOnWrite : Pos 9, 1 Bit
+0x000 Prototype : Pos 10, 1 Bit
+0x000 Write : Pos 11, 1 Bit
+0x000 PageFrameNumber : Pos 12, 20 Bits
+0x000 Flush : _HARDWARE_PTE
+0x000 Valid : Pos 0, 1 Bit
+0x000 Write : Pos 1, 1 Bit
+0x000 Owner : Pos 2, 1 Bit
+0x000 WriteThrough : Pos 3, 1 Bit
+0x000 CacheDisable : Pos 4, 1 Bit
+0x000 Accessed : Pos 5, 1 Bit
+0x000 Dirty : Pos 6, 1 Bit
+0x000 LargePage : Pos 7, 1 Bit
+0x000 Global : Pos 8, 1 Bit
+0x000 CopyOnWrite : Pos 9, 1 Bit
+0x000 Prototype : Pos 10, 1 Bit
+0x000 reserved : Pos 11, 1 Bit
+0x000 PageFrameNumber : Pos 12, 20 Bits
+0x000 Proto : _MMPTE_PROTOTYPE
+0x000 Valid : Pos 0, 1 Bit
+0x000 ProtoAddressLow : Pos 1, 7 Bits
+0x000 ReadOnly : Pos 8, 1 Bit
+0x000 WhichPool : Pos 9, 1 Bit
+0x000 Prototype : Pos 10, 1 Bit
+0x000 ProtoAddressHigh : Pos 11, 21 Bits
+0x000 Soft : _MMPTE_SOFTWARE
+0x000 Valid : Pos 0, 1 Bit
+0x000 PageFileLow : Pos 1, 4 Bits
+0x000 Protection : Pos 5, 5 Bits
+0x000 Prototype : Pos 10, 1 Bit
+0x000 Transition : Pos 11, 1 Bit
+0x000 PageFileHigh : Pos 12, 20 Bits
+0x000 Trans : _MMPTE_TRANSITION
+0x000 Valid : Pos 0, 1 Bit
+0x000 Write : Pos 1, 1 Bit
+0x000 Owner : Pos 2, 1 Bit
+0x000 WriteThrough : Pos 3, 1 Bit
+0x000 CacheDisable : Pos 4, 1 Bit
+0x000 Protection : Pos 5, 5 Bits
+0x000 Prototype : Pos 10, 1 Bit
+0x000 Transition : Pos 11, 1 Bit
+0x000 PageFrameNumber : Pos 12, 20 Bits
+0x000 Subsect : _MMPTE_SUBSECTION
+0x000 Valid : Pos 0, 1 Bit
+0x000 SubsectionAddressLow : Pos 1, 4 Bits
+0x000 Protection : Pos 5, 5 Bits
+0x000 Prototype : Pos 10, 1 Bit
+0x000 SubsectionAddressHigh : Pos 11, 20 Bits
+0x000 WhichPool : Pos 31, 1 Bit
+0x000 List : _MMPTE_LIST
+0x000 Valid : Pos 0, 1 Bit
+0x000 OneEntry : Pos 1, 1 Bit
+0x000 filler0 : Pos 2, 8 Bits
+0x000 Prototype : Pos 10, 1 Bit
+0x000 filler1 : Pos 11, 1 Bit
+0x000 NextEntry : Pos 12, 20 Bits
+0x014 u4 : __unnamed
+0x000 EntireFrame : Uint4B
+0x000 PteFrame : Pos 0, 26 Bits
+0x000 InPageError : Pos 26, 1 Bit
+0x000 VerifierAllocation : Pos 27, 1 Bit
+0x000 AweAllocation : Pos 28, 1 Bit
+0x000 LockCharged : Pos 29, 1 Bit
+0x000 KernelStack : Pos 30, 1 Bit
+0x000 Reserved : Pos 31, 1 Bit
Note that the OriginalPTE field has seven different formats. Interpreting the contents of that would thus depend upon knowing the correct context of the PFN entry itself. I *can* assure you that there are no unused fields in the PFN. On the contrary, the fields of the PFN are often overloaded and used to mean different things in different contexts, depending upon the state of the specific page.
Actually, after considering the text you quoted I would agree that what you observe is consistent with the text. If the page is removed from the page table, there wouldn’t be cases where the “original PTE” would ever be valid. Thus, the PTE that it would restore would need to tell the memory manager how to locate the data for that page (since the page itself is not referenced in the PTE).
Regards,
Tony
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
Looking forward to seeing you at the Next OSR File Systems Class October 18, 2004 in Silicon Valley!
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of I?aki Castillo
Sent: Friday, September 24, 2004 10:33 AM
To: ntdev redirect
Subject: RE: [ntdev] PFN Database, Original PTE field
Maybe, you are right, “for what you know”.
-----Mensaje original-----
De: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]En nombre de Maxim S. Shatskih
Enviado el: viernes, 24 de septiembre de 2004 8:21
Para: Windows System Software Devs Interest List
Asunto: Re: [ntdev] PFN Database, Original PTE field
From what I know, the PFN entry is NEVER documented.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: I?aki Castillo mailto:xxxxx
To: Windows System Software Devs Interest List mailto:xxxxx
Sent: Thursday, September 23, 2004 10:21 PM
Subject: [ntdev] PFN Database, Original PTE field
The field Original PTE in each PFN Database entry is documented as being loaded with the original PTE contents.
However, it seems to contain only ‘invalid’ page states. I mean this field never contains a valid page state.
It preserves an invalid state all the time even if the corresponding PTE is valid currently.
According to Inside Microsoft Windows, page 475, ‘saving the contents of the PTE allows it to be restored when the physical page is no longer resident’. However, I cannot see it saves anything other than ‘invalid states’.
Which is the exact purpose of this field in the PFN database entries ? When is it used ?
Thanks.
Inaki.
—
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
—
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
—
Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com</mailto:xxxxx></mailto:xxxxx>