Merge trunk (r43561)
[reactos.git] / reactos / include / ndk / mmtypes.h
1 /*++ NDK Version: 0098
2
3 Copyright (c) Alex Ionescu. All rights reserved.
4
5 Header Name:
6
7 mmtypes.h
8
9 Abstract:
10
11 Type definitions for the Memory Manager
12
13 Author:
14
15 Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
16
17 --*/
18
19 #ifndef _MMTYPES_H
20 #define _MMTYPES_H
21
22 //
23 // Dependencies
24 //
25 #include <umtypes.h>
26 #include <arch/mmtypes.h>
27 #include <extypes.h>
28
29 //
30 // Page-Rounding Macros
31 //
32 #define PAGE_ROUND_DOWN(x) \
33 (((ULONG_PTR)(x))&(~(PAGE_SIZE-1)))
34 #define PAGE_ROUND_UP(x) \
35 ( (((ULONG_PTR)(x)) + PAGE_SIZE-1) & (~(PAGE_SIZE-1)) )
36 #ifdef NTOS_MODE_USER
37 #define ROUND_TO_PAGES(Size) \
38 (((ULONG_PTR)(Size) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))
39 #endif
40 #define ROUND_TO_ALLOCATION_GRANULARITY(Size) \
41 (((ULONG_PTR)(Size) + MM_ALLOCATION_GRANULARITY - 1) \
42 & ~(MM_ALLOCATION_GRANULARITY - 1))
43
44 //
45 // PFN Identity Uses
46 //
47 #define MMPFNUSE_PROCESSPRIVATE 0
48 #define MMPFNUSE_FILE 1
49 #define MMPFNUSE_PAGEFILEMAPPED 2
50 #define MMPFNUSE_PAGETABLE 3
51 #define MMPFNUSE_PAGEDPOOL 4
52 #define MMPFNUSE_NONPAGEDPOOL 5
53 #define MMPFNUSE_SYSTEMPTE 6
54 #define MMPFNUSE_SESSIONPRIVATE 7
55 #define MMPFNUSE_METAFILE 8
56 #define MMPFNUSE_AWEPAGE 9
57 #define MMPFNUSE_DRIVERLOCKPAGE 10
58 #define MMPFNUSE_KERNELSTACK 11
59
60 //
61 // Lock/Unlock Virtuam Memory Flags
62 //
63 #define MAP_PROCESS 1
64 #define MAP_SYSTEM 2
65
66 #ifndef NTOS_MODE_USER
67
68 //
69 // Virtual Memory Flags
70 //
71 #define MEM_WRITE_WATCH 0x200000
72 #define MEM_PHYSICAL 0x400000
73 #define MEM_ROTATE 0x800000
74 #define MEM_IMAGE SEC_IMAGE
75 #define MEM_DOS_LIM 0x40000000
76
77 //
78 // Section Flags for NtCreateSection
79 //
80 #define SEC_NO_CHANGE 0x400000
81 #define SEC_FILE 0x800000
82 #define SEC_IMAGE 0x1000000
83 #define SEC_PROTECTED_IMAGE 0x2000000
84 #define SEC_RESERVE 0x4000000
85 #define SEC_COMMIT 0x8000000
86 #define SEC_NOCACHE 0x10000000
87 #define SEC_WRITECOMBINE 0x40000000
88 #define SEC_LARGE_PAGES 0x80000000
89 #else
90 #define SEC_BASED 0x200000
91
92 //
93 // Section Inherit Flags for NtCreateSection
94 //
95 typedef enum _SECTION_INHERIT
96 {
97 ViewShare = 1,
98 ViewUnmap = 2
99 } SECTION_INHERIT;
100
101 //
102 // Pool Types
103 //
104 typedef enum _POOL_TYPE
105 {
106 NonPagedPool,
107 PagedPool,
108 NonPagedPoolMustSucceed,
109 DontUseThisType,
110 NonPagedPoolCacheAligned,
111 PagedPoolCacheAligned,
112 NonPagedPoolCacheAlignedMustS,
113 MaxPoolType,
114 NonPagedPoolSession = 32,
115 PagedPoolSession,
116 NonPagedPoolMustSucceedSession,
117 DontUseThisTypeSession,
118 NonPagedPoolCacheAlignedSession,
119 PagedPoolCacheAlignedSession,
120 NonPagedPoolCacheAlignedMustSSession
121 } POOL_TYPE;
122 #endif
123
124 //
125 // Memory Manager Page Lists
126 //
127 typedef enum _MMLISTS
128 {
129 ZeroedPageList = 0,
130 FreePageList = 1,
131 StandbyPageList = 2,
132 ModifiedPageList = 3,
133 ModifiedNoWritePageList = 4,
134 BadPageList = 5,
135 ActiveAndValid = 6,
136 TransitionPage = 7
137 } MMLISTS;
138
139 //
140 // Per Processor Non Paged Lookaside List IDs
141 //
142 typedef enum _PP_NPAGED_LOOKASIDE_NUMBER
143 {
144 LookasideSmallIrpList = 0,
145 LookasideLargeIrpList = 1,
146 LookasideMdlList = 2,
147 LookasideCreateInfoList = 3,
148 LookasideNameBufferList = 4,
149 LookasideTwilightList = 5,
150 LookasideCompletionList = 6,
151 LookasideMaximumList = 7
152 } PP_NPAGED_LOOKASIDE_NUMBER;
153
154 //
155 // Memory Information Classes for NtQueryVirtualMemory
156 //
157 typedef enum _MEMORY_INFORMATION_CLASS
158 {
159 MemoryBasicInformation,
160 MemoryWorkingSetList,
161 MemorySectionName,
162 MemoryBasicVlmInformation
163 } MEMORY_INFORMATION_CLASS;
164
165 //
166 // Section Information Clasess for NtQuerySection
167 //
168 typedef enum _SECTION_INFORMATION_CLASS
169 {
170 SectionBasicInformation,
171 SectionImageInformation,
172 } SECTION_INFORMATION_CLASS;
173
174 #ifdef NTOS_MODE_USER
175
176 //
177 // Virtual Memory Counters
178 //
179 typedef struct _VM_COUNTERS
180 {
181 SIZE_T PeakVirtualSize;
182 SIZE_T VirtualSize;
183 ULONG PageFaultCount;
184 SIZE_T PeakWorkingSetSize;
185 SIZE_T WorkingSetSize;
186 SIZE_T QuotaPeakPagedPoolUsage;
187 SIZE_T QuotaPagedPoolUsage;
188 SIZE_T QuotaPeakNonPagedPoolUsage;
189 SIZE_T QuotaNonPagedPoolUsage;
190 SIZE_T PagefileUsage;
191 SIZE_T PeakPagefileUsage;
192 } VM_COUNTERS, *PVM_COUNTERS;
193
194 typedef struct _VM_COUNTERS_EX
195 {
196 SIZE_T PeakVirtualSize;
197 SIZE_T VirtualSize;
198 ULONG PageFaultCount;
199 SIZE_T PeakWorkingSetSize;
200 SIZE_T WorkingSetSize;
201 SIZE_T QuotaPeakPagedPoolUsage;
202 SIZE_T QuotaPagedPoolUsage;
203 SIZE_T QuotaPeakNonPagedPoolUsage;
204 SIZE_T QuotaNonPagedPoolUsage;
205 SIZE_T PagefileUsage;
206 SIZE_T PeakPagefileUsage;
207 SIZE_T PrivateUsage;
208 } VM_COUNTERS_EX, *PVM_COUNTERS_EX;
209 #endif
210
211 //
212 // Sub-Information Types for PFN Identity
213 //
214 typedef struct _MEMORY_FRAME_INFORMATION
215 {
216 ULONGLONG UseDescription:4;
217 ULONGLONG ListDescription:3;
218 ULONGLONG Reserved0:1;
219 ULONGLONG Pinned:1;
220 ULONGLONG DontUse:48;
221 ULONGLONG Priority:3;
222 ULONGLONG Reserved:4;
223 } MEMORY_FRAME_INFORMATION, *PMEMORY_FRAME_INFORMATION;
224
225 typedef struct _FILEOFFSET_INFORMATION
226 {
227 ULONGLONG DontUse:9;
228 ULONGLONG Offset:48;
229 ULONGLONG Reserved:7;
230 } FILEOFFSET_INFORMATION, *PFILEOFFSET_INFORMATION;
231
232 typedef struct _PAGEDIR_INFORMATION
233 {
234 ULONGLONG DontUse:9;
235 ULONGLONG PageDirectoryBase:48;
236 ULONGLONG Reserved:7;
237 } PAGEDIR_INFORMATION, *PPAGEDIR_INFORMATION;
238
239 typedef struct _UNIQUE_PROCESS_INFORMATION
240 {
241 ULONGLONG DontUse:9;
242 ULONGLONG UniqueProcessKey:48;
243 ULONGLONG Reserved:7;
244 } UNIQUE_PROCESS_INFORMATION, *PUNIQUE_PROCESS_INFORMATION;
245
246 //
247 // PFN Identity Data Structure
248 //
249 typedef struct _MMPFN_IDENTITY
250 {
251 union
252 {
253 MEMORY_FRAME_INFORMATION e1;
254 FILEOFFSET_INFORMATION e2;
255 PAGEDIR_INFORMATION e3;
256 UNIQUE_PROCESS_INFORMATION e4;
257 } u1;
258 SIZE_T PageFrameIndex;
259 union
260 {
261 struct
262 {
263 ULONG Image:1;
264 ULONG Mismatch:1;
265 } e1;
266 PVOID FileObject;
267 PVOID UniqueFileObjectKey;
268 PVOID ProtoPteAddress;
269 PVOID VirtualAddress;
270 } u2;
271 } MMPFN_IDENTITY, *PMMPFN_IDENTITY;
272
273 //
274 // List of Working Sets
275 //
276 typedef struct _MEMORY_WORKING_SET_LIST
277 {
278 ULONG NumberOfPages;
279 ULONG WorkingSetList[1];
280 } MEMORY_WORKING_SET_LIST, *PMEMORY_WORKING_SET_LIST;
281
282 //
283 // Memory Information Structures for NtQueryVirtualMemory
284 //
285 typedef struct
286 {
287 UNICODE_STRING SectionFileName;
288 WCHAR NameBuffer[ANYSIZE_ARRAY];
289 } MEMORY_SECTION_NAME, *PMEMORY_SECTION_NAME;
290
291 //
292 // Section Information Structures for NtQuerySection
293 //
294 typedef struct _SECTION_BASIC_INFORMATION
295 {
296 PVOID BaseAddress;
297 ULONG Attributes;
298 LARGE_INTEGER Size;
299 } SECTION_BASIC_INFORMATION, *PSECTION_BASIC_INFORMATION;
300
301 typedef struct _SECTION_IMAGE_INFORMATION
302 {
303 PVOID TransferAddress;
304 ULONG ZeroBits;
305 ULONG MaximumStackSize;
306 ULONG CommittedStackSize;
307 ULONG SubSystemType;
308 USHORT SubSystemMinorVersion;
309 USHORT SubSystemMajorVersion;
310 ULONG GpValue;
311 USHORT ImageCharacteristics;
312 USHORT DllCharacteristics;
313 USHORT Machine;
314 UCHAR ImageContainsCode;
315 UCHAR Spare1;
316 ULONG LoaderFlags;
317 ULONG ImageFileSize;
318 ULONG Reserved[1];
319 } SECTION_IMAGE_INFORMATION, *PSECTION_IMAGE_INFORMATION;
320
321 #ifndef NTOS_MODE_USER
322
323 //
324 // PTE Structures
325 //
326 typedef struct _MMPTE
327 {
328 union
329 {
330 ULONG_PTR Long;
331 HARDWARE_PTE Flush;
332 MMPTE_HARDWARE Hard;
333 #ifdef _M_AMD64
334 MMPTE_HARDWARE_LARGEPAGE HardLarge;
335 #endif
336 MMPTE_PROTOTYPE Proto;
337 MMPTE_SOFTWARE Soft;
338 MMPTE_TRANSITION Trans;
339 MMPTE_SUBSECTION Subsect;
340 MMPTE_LIST List;
341 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
342 volatile ULONG_PTR VolatileLong;
343 MMPTE_TIMESTAMP TimeStamp;
344 #endif
345 } u;
346 } MMPTE, *PMMPTE;
347
348 //
349 // Section Extension Information
350 //
351 typedef struct _MMEXTEND_INFO
352 {
353 ULONGLONG CommittedSize;
354 ULONG ReferenceCount;
355 } MMEXTEND_INFO, *PMMEXTEND_INFO;
356
357 //
358 // Segment and Segment Flags
359 //
360 typedef struct _SEGMENT_FLAGS
361 {
362 ULONG TotalNumberOfPtes4132:10;
363 ULONG ExtraSharedWowSubsections:1;
364 ULONG LargePages:1;
365 ULONG Spare:20;
366 } SEGMENT_FLAGS, *PSEGMENT_FLAGS;
367
368 typedef struct _SEGMENT
369 {
370 struct _CONTROL_AREA *ControlArea;
371 ULONG TotalNumberOfPtes;
372 ULONG NonExtendedPtes;
373 ULONG Spare0;
374 ULONGLONG SizeOfSegment;
375 MMPTE SegmentPteTemplate;
376 ULONG NumberOfCommittedPages;
377 PMMEXTEND_INFO ExtendInfo;
378 SEGMENT_FLAGS SegmentFlags;
379 PVOID BasedAddress;
380 union
381 {
382 SIZE_T ImageCommitment;
383 PEPROCESS CreatingProcess;
384 } u1;
385 union
386 {
387 PSECTION_IMAGE_INFORMATION ImageInformation;
388 PVOID FirstMappedVa;
389 } u2;
390 PMMPTE PrototypePte;
391 MMPTE ThePtes[1];
392 } SEGMENT, *PSEGMENT;
393
394 //
395 // Event Counter Structure
396 //
397 typedef struct _EVENT_COUNTER
398 {
399 SLIST_ENTRY ListEntry;
400 ULONG RefCount;
401 KEVENT Event;
402 } EVENT_COUNTER, *PEVENT_COUNTER;
403
404 //
405 // Flags
406 //
407 typedef struct _MMSECTION_FLAGS
408 {
409 ULONG BeingDeleted:1;
410 ULONG BeingCreated:1;
411 ULONG BeingPurged:1;
412 ULONG NoModifiedWriting:1;
413 ULONG FailAllIo:1;
414 ULONG Image:1;
415 ULONG Based:1;
416 ULONG File:1;
417 ULONG Networked:1;
418 ULONG NoCache:1;
419 ULONG PhysicalMemory:1;
420 ULONG CopyOnWrite:1;
421 ULONG Reserve:1;
422 ULONG Commit:1;
423 ULONG FloppyMedia:1;
424 ULONG WasPurged:1;
425 ULONG UserReference:1;
426 ULONG GlobalMemory:1;
427 ULONG DeleteOnClose:1;
428 ULONG FilePointerNull:1;
429 ULONG DebugSymbolsLoaded:1;
430 ULONG SetMappedFileIoComplete:1;
431 ULONG CollidedFlush:1;
432 ULONG NoChange:1;
433 ULONG filler0:1;
434 ULONG ImageMappedInSystemSpace:1;
435 ULONG UserWritable:1;
436 ULONG Accessed:1;
437 ULONG GlobalOnlyPerSession:1;
438 ULONG Rom:1;
439 ULONG WriteCombined:1;
440 ULONG filler:1;
441 } MMSECTION_FLAGS, *PMMSECTION_FLAGS;
442
443 typedef struct _MMSUBSECTION_FLAGS
444 {
445 ULONG ReadOnly:1;
446 ULONG ReadWrite:1;
447 ULONG SubsectionStatic:1;
448 ULONG GlobalMemory:1;
449 ULONG Protection:5;
450 ULONG Spare:1;
451 ULONG StartingSector4132:10;
452 ULONG SectorEndOffset:12;
453 } MMSUBSECTION_FLAGS, *PMMSUBSECTION_FLAGS;
454
455 typedef struct _MMSUBSECTION_FLAGS2
456 {
457 ULONG SubsectionAccessed:1;
458 ULONG SubsectionConverted:1;
459 ULONG Reserved:30;
460 } MMSUBSECTION_FLAGS2;
461
462 //
463 // Control Area Structures
464 //
465 typedef struct _CONTROL_AREA
466 {
467 PSEGMENT Segment;
468 LIST_ENTRY DereferenceList;
469 ULONG NumberOfSectionReferences;
470 ULONG NumberOfPfnReferences;
471 ULONG NumberOfMappedViews;
472 ULONG NumberOfSystemCacheViews;
473 ULONG NumberOfUserReferences;
474 union
475 {
476 ULONG LongFlags;
477 MMSECTION_FLAGS Flags;
478 } u;
479 PFILE_OBJECT FilePointer;
480 PEVENT_COUNTER WaitingForDeletion;
481 USHORT ModifiedWriteCount;
482 USHORT FlushInProgressCount;
483 ULONG WritableUserReferences;
484 ULONG QuadwordPad;
485 } CONTROL_AREA, *PCONTROL_AREA;
486
487 typedef struct _LARGE_CONTROL_AREA
488 {
489 PSEGMENT Segment;
490 LIST_ENTRY DereferenceList;
491 ULONG NumberOfSectionReferences;
492 ULONG NumberOfPfnReferences;
493 ULONG NumberOfMappedViews;
494 ULONG NumberOfSystemCacheViews;
495 ULONG NumberOfUserReferences;
496 union
497 {
498 ULONG LongFlags;
499 MMSECTION_FLAGS Flags;
500 } u;
501 PFILE_OBJECT FilePointer;
502 PEVENT_COUNTER WaitingForDeletion;
503 USHORT ModifiedWriteCount;
504 USHORT FlushInProgressCount;
505 ULONG WritableUserReferences;
506 ULONG QuadwordPad;
507 ULONG StartingFrame;
508 LIST_ENTRY UserGlobalList;
509 ULONG SessionId;
510 } LARGE_CONTROL_AREA, *PLARGE_CONTROL_AREA;
511
512 //
513 // Subsection and Mapped Subsection
514 //
515 typedef struct _SUBSECTION
516 {
517 PCONTROL_AREA ControlArea;
518 union
519 {
520 ULONG LongFlags;
521 MMSUBSECTION_FLAGS SubsectionFlags;
522 } u;
523 ULONG StartingSector;
524 ULONG NumberOfFullSectors;
525 PMMPTE SubsectionBase;
526 ULONG UnusedPtes;
527 ULONG PtesInSubsection;
528 struct _SUBSECTION *NextSubsection;
529 } SUBSECTION, *PSUBSECTION;
530
531 typedef struct _MSUBSECTION
532 {
533 PCONTROL_AREA ControlArea;
534 union
535 {
536 ULONG LongFlags;
537 MMSUBSECTION_FLAGS SubsectionFlags;
538 } u;
539 ULONG StartingSector;
540 ULONG NumberOfFullSectors;
541 PMMPTE SubsectionBase;
542 ULONG UnusedPtes;
543 ULONG PtesInSubsection;
544 struct _SUBSECTION *NextSubsection;
545 LIST_ENTRY DereferenceList;
546 ULONG_PTR NumberOfMappedViews;
547 union
548 {
549 ULONG LongFlags2;
550 MMSUBSECTION_FLAGS2 SubsectionFlags2;
551 } u2;
552 } MSUBSECTION, *PMSUBSECTION;
553
554 //
555 // Segment Object
556 //
557 typedef struct _SEGMENT_OBJECT
558 {
559 PVOID BaseAddress;
560 ULONG TotalNumberOfPtes;
561 LARGE_INTEGER SizeOfSegment;
562 ULONG NonExtendedPtes;
563 ULONG ImageCommitment;
564 PCONTROL_AREA ControlArea;
565 PSUBSECTION Subsection;
566 PLARGE_CONTROL_AREA LargeControlArea;
567 PMMSECTION_FLAGS MmSectionFlags;
568 PMMSUBSECTION_FLAGS MmSubSectionFlags;
569 } SEGMENT_OBJECT, *PSEGMENT_OBJECT;
570
571 //
572 // Section Object
573 //
574 typedef struct _SECTION_OBJECT
575 {
576 PVOID StartingVa;
577 PVOID EndingVa;
578 PVOID LeftChild;
579 PVOID RightChild;
580 PSEGMENT_OBJECT Segment;
581 } SECTION_OBJECT, *PSECTION_OBJECT;
582
583 //
584 // Generic Address Range Structure
585 //
586 typedef struct _ADDRESS_RANGE
587 {
588 ULONG BaseAddrLow;
589 ULONG BaseAddrHigh;
590 ULONG LengthLow;
591 ULONG LengthHigh;
592 ULONG Type;
593 } ADDRESS_RANGE, *PADDRESS_RANGE;
594
595 //
596 // Node in Memory Manager's AVL Table
597 //
598 typedef struct _MMADDRESS_NODE
599 {
600 union
601 {
602 LONG Balance:2;
603 struct _MMADDRESS_NODE *Parent;
604 } u1;
605 struct _MMADDRESS_NODE *LeftChild;
606 struct _MMADDRESS_NODE *RightChild;
607 ULONG StartingVpn;
608 ULONG EndingVpn;
609 } MMADDRESS_NODE, *PMMADDRESS_NODE;
610
611 //
612 // Memory Manager AVL Table for VADs and other descriptors
613 //
614 typedef struct _MM_AVL_TABLE
615 {
616 MMADDRESS_NODE BalancedRoot;
617 ULONG DepthOfTree:5;
618 ULONG Unused:3;
619 ULONG NumberGenericTableElements:24;
620 PVOID NodeHint;
621 PVOID NodeFreeHint;
622 } MM_AVL_TABLE, *PMM_AVL_TABLE;
623
624 //
625 // Actual Section Object
626 //
627 typedef struct _SECTION
628 {
629 MMADDRESS_NODE Address;
630 PSEGMENT Segment;
631 LARGE_INTEGER SizeOfSection;
632 union
633 {
634 ULONG LongFlags;
635 MMSECTION_FLAGS Flags;
636 } u;
637 ULONG InitialPageProtection;
638 } SECTION, *PSECTION;
639
640 //
641 // Memory Manager Working Set Structures
642 //
643 typedef struct _MMWSLENTRY
644 {
645 ULONG Valid:1;
646 ULONG LockedInWs:1;
647 ULONG LockedInMemory:1;
648 ULONG Protection:5;
649 ULONG Hashed:1;
650 ULONG Direct:1;
651 ULONG Age:2;
652 ULONG VirtualPageNumber:20;
653 } MMWSLENTRY, *PMMWSLENTRY;
654
655 typedef struct _MMWSLE
656 {
657 union
658 {
659 PVOID VirtualAddress;
660 ULONG Long;
661 MMWSLENTRY e1;
662 } u1;
663 } MMWSLE, *PMMWSLE;
664
665 typedef struct _MMWSLE_HASH
666 {
667 PVOID Key;
668 ULONG Index;
669 } MMWSLE_HASH, *PMMWSLE_HASH;
670
671 typedef struct _MMWSL
672 {
673 ULONG FirstFree;
674 ULONG FirstDynamic;
675 ULONG LastEntry;
676 ULONG NextSlot;
677 PMMWSLE Wsle;
678 ULONG LastInitializedWsle;
679 ULONG NonDirectCount;
680 PMMWSLE_HASH HashTable;
681 ULONG HashTableSize;
682 ULONG NumberOfCommittedPageTables;
683 PVOID HashTableStart;
684 PVOID HighestPermittedHashAddress;
685 ULONG NumberOfImageWaiters;
686 ULONG VadBitMapHint;
687 USHORT UsedPageTableEntries[768];
688 ULONG CommittedPageTables[24];
689 } MMWSL, *PMMWSL;
690
691 //
692 // Flags for Memory Support Structure
693 //
694 typedef struct _MMSUPPORT_FLAGS
695 {
696 ULONG SessionSpace:1;
697 ULONG BeingTrimmed:1;
698 ULONG SessionLeader:1;
699 ULONG TrimHard:1;
700 ULONG MaximumWorkingSetHard:1;
701 ULONG ForceTrim:1;
702 ULONG MinimumWorkingSetHard:1;
703 ULONG Available0:1;
704 ULONG MemoryPriority:8;
705 ULONG GrowWsleHash:1;
706 ULONG AcquiredUnsafe:1;
707 ULONG Available:14;
708 } MMSUPPORT_FLAGS, *PMMSUPPORT_FLAGS;
709
710 //
711 // Per-Process Memory Manager Data
712 //
713 typedef struct _MMSUPPORT
714 {
715 #if (NTDDI_VERSION >= NTDDI_WS03)
716 LIST_ENTRY WorkingSetExpansionLinks;
717 #endif
718 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
719 USHORT LastTrimpStamp;
720 USHORT NextPageColor;
721 #else
722 LARGE_INTEGER LastTrimTime;
723 #endif
724 MMSUPPORT_FLAGS Flags;
725 ULONG PageFaultCount;
726 ULONG PeakWorkingSetSize;
727 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
728 ULONG Spare0;
729 #else
730 ULONG GrowthSinceLastEstimate;
731 #endif
732 ULONG MinimumWorkingSetSize;
733 ULONG MaximumWorkingSetSize;
734 PMMWSL VmWorkingSetList;
735 #if (NTDDI_VERSION < NTDDI_WS03)
736 LIST_ENTRY WorkingSetExpansionLinks;
737 #endif
738 ULONG Claim;
739 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
740 ULONG Spare;
741 ULONG WorkingSetPrivateSize;
742 ULONG WorkingSetSizeOverhead;
743 #else
744 ULONG NextEstimationSlot;
745 ULONG NextAgingSlot;
746 ULONG EstimatedAvailable;
747 #endif
748 ULONG WorkingSetSize;
749 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
750 PKEVENT ExitEvent;
751 #endif
752 EX_PUSH_LOCK WorkingSetMutex;
753 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
754 PVOID AccessLog;
755 #endif
756 } MMSUPPORT, *PMMSUPPORT;
757
758 //
759 // Memory Information Types
760 //
761 typedef struct _MEMORY_BASIC_INFORMATION
762 {
763 PVOID BaseAddress;
764 PVOID AllocationBase;
765 ULONG AllocationProtect;
766 SIZE_T RegionSize;
767 ULONG State;
768 ULONG Protect;
769 ULONG Type;
770 } MEMORY_BASIC_INFORMATION,*PMEMORY_BASIC_INFORMATION;
771
772 //
773 // Driver Verifier Data
774 //
775 typedef struct _MM_DRIVER_VERIFIER_DATA
776 {
777 ULONG Level;
778 ULONG RaiseIrqls;
779 ULONG AcquireSpinLocks;
780 ULONG SynchronizeExecutions;
781 ULONG AllocationsAttempted;
782 ULONG AllocationsSucceeded;
783 ULONG AllocationsSucceededSpecialPool;
784 ULONG AllocationsWithNoTag;
785 ULONG TrimRequests;
786 ULONG Trims;
787 ULONG AllocationsFailed;
788 ULONG AllocationsFailedDeliberately;
789 ULONG Loads;
790 ULONG Unloads;
791 ULONG UnTrackedPool;
792 ULONG UserTrims;
793 ULONG CurrentPagedPoolAllocations;
794 ULONG CurrentNonPagedPoolAllocations;
795 ULONG PeakPagedPoolAllocations;
796 ULONG PeakNonPagedPoolAllocations;
797 ULONG PagedBytes;
798 ULONG NonPagedBytes;
799 ULONG PeakPagedBytes;
800 ULONG PeakNonPagedBytes;
801 ULONG BurstAllocationsFailedDeliberately;
802 ULONG SessionTrims;
803 ULONG Reserved[2];
804 } MM_DRIVER_VERIFIER_DATA, *PMM_DRIVER_VERIFIER_DATA;
805
806 //
807 // Internal Driver Verifier Table Data
808 //
809 typedef struct _DRIVER_SPECIFIED_VERIFIER_THUNKS
810 {
811 LIST_ENTRY ListEntry;
812 struct _LDR_DATA_TABLE_ENTRY *DataTableEntry;
813 ULONG NumberOfThunks;
814 } DRIVER_SPECIFIED_VERIFIER_THUNKS, *PDRIVER_SPECIFIED_VERIFIER_THUNKS;
815
816 //
817 // Default heap size values. For user mode, these values are copied to a new
818 // process's PEB by the kernel in MmCreatePeb. In kernel mode, RtlCreateHeap
819 // reads these variables directly.
820 //
821 // These variables should be considered "const"; they are written only once,
822 // during MmInitSystem.
823 //
824 extern SIZE_T MmHeapSegmentReserve;
825 extern SIZE_T MmHeapSegmentCommit;
826 extern SIZE_T MmHeapDeCommitTotalFreeThreshold;
827 extern SIZE_T MmHeapDeCommitFreeBlockThreshold;
828
829 //
830 // Section Object Type
831 //
832 extern POBJECT_TYPE MmSectionObjectType;
833
834 #endif // !NTOS_MODE_USER
835
836 #endif // _MMTYPES_H