Fix (USERMODE=0) build :
[reactos.git] / 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 Long;
331 HARDWARE_PTE Flush;
332 MMPTE_HARDWARE Hard;
333 MMPTE_PROTOTYPE Proto;
334 MMPTE_SOFTWARE Soft;
335 MMPTE_TRANSITION Trans;
336 MMPTE_SUBSECTION Subsect;
337 MMPTE_LIST List;
338 } u;
339 } MMPTE, *PMMPTE;
340
341 //
342 // Section Extension Information
343 //
344 typedef struct _MMEXTEND_INFO
345 {
346 ULONGLONG CommittedSize;
347 ULONG ReferenceCount;
348 } MMEXTEND_INFO, *PMMEXTEND_INFO;
349
350 //
351 // Segment and Segment Flags
352 //
353 typedef struct _SEGMENT_FLAGS
354 {
355 ULONG TotalNumberOfPtes4132:10;
356 ULONG ExtraSharedWowSubsections:1;
357 ULONG LargePages:1;
358 ULONG Spare:20;
359 } SEGMENT_FLAGS, *PSEGMENT_FLAGS;
360
361 typedef struct _SEGMENT
362 {
363 struct _CONTROL_AREA *ControlArea;
364 ULONG TotalNumberOfPtes;
365 ULONG NonExtendedPtes;
366 ULONG Spare0;
367 ULONGLONG SizeOfSegment;
368 MMPTE SegmentPteTemplate;
369 ULONG NumberOfCommittedPages;
370 PMMEXTEND_INFO ExtendInfo;
371 SEGMENT_FLAGS SegmentFlags;
372 PVOID BasedAddress;
373 union
374 {
375 SIZE_T ImageCommitment;
376 PEPROCESS CreatingProcess;
377 } u1;
378 union
379 {
380 PSECTION_IMAGE_INFORMATION ImageInformation;
381 PVOID FirstMappedVa;
382 } u2;
383 PMMPTE PrototypePte;
384 MMPTE ThePtes[1];
385 } SEGMENT, *PSEGMENT;
386
387 //
388 // Event Counter Structure
389 //
390 typedef struct _EVENT_COUNTER
391 {
392 SLIST_ENTRY ListEntry;
393 ULONG RefCount;
394 KEVENT Event;
395 } EVENT_COUNTER, *PEVENT_COUNTER;
396
397 //
398 // Flags
399 //
400 typedef struct _MMSECTION_FLAGS
401 {
402 ULONG BeingDeleted:1;
403 ULONG BeingCreated:1;
404 ULONG BeingPurged:1;
405 ULONG NoModifiedWriting:1;
406 ULONG FailAllIo:1;
407 ULONG Image:1;
408 ULONG Based:1;
409 ULONG File:1;
410 ULONG Networked:1;
411 ULONG NoCache:1;
412 ULONG PhysicalMemory:1;
413 ULONG CopyOnWrite:1;
414 ULONG Reserve:1;
415 ULONG Commit:1;
416 ULONG FloppyMedia:1;
417 ULONG WasPurged:1;
418 ULONG UserReference:1;
419 ULONG GlobalMemory:1;
420 ULONG DeleteOnClose:1;
421 ULONG FilePointerNull:1;
422 ULONG DebugSymbolsLoaded:1;
423 ULONG SetMappedFileIoComplete:1;
424 ULONG CollidedFlush:1;
425 ULONG NoChange:1;
426 ULONG filler0:1;
427 ULONG ImageMappedInSystemSpace:1;
428 ULONG UserWritable:1;
429 ULONG Accessed:1;
430 ULONG GlobalOnlyPerSession:1;
431 ULONG Rom:1;
432 ULONG WriteCombined:1;
433 ULONG filler:1;
434 } MMSECTION_FLAGS, *PMMSECTION_FLAGS;
435
436 typedef struct _MMSUBSECTION_FLAGS
437 {
438 ULONG ReadOnly:1;
439 ULONG ReadWrite:1;
440 ULONG SubsectionStatic:1;
441 ULONG GlobalMemory:1;
442 ULONG Protection:5;
443 ULONG Spare:1;
444 ULONG StartingSector4132:10;
445 ULONG SectorEndOffset:12;
446 } MMSUBSECTION_FLAGS, *PMMSUBSECTION_FLAGS;
447
448 typedef struct _MMSUBSECTION_FLAGS2
449 {
450 ULONG SubsectionAccessed:1;
451 ULONG SubsectionConverted:1;
452 ULONG Reserved:30;
453 } MMSUBSECTION_FLAGS2;
454
455 //
456 // Control Area Structures
457 //
458 typedef struct _CONTROL_AREA
459 {
460 PSEGMENT Segment;
461 LIST_ENTRY DereferenceList;
462 ULONG NumberOfSectionReferences;
463 ULONG NumberOfPfnReferences;
464 ULONG NumberOfMappedViews;
465 ULONG NumberOfSystemCacheViews;
466 ULONG NumberOfUserReferences;
467 union
468 {
469 ULONG LongFlags;
470 MMSECTION_FLAGS Flags;
471 } u;
472 PFILE_OBJECT FilePointer;
473 PEVENT_COUNTER WaitingForDeletion;
474 USHORT ModifiedWriteCount;
475 USHORT FlushInProgressCount;
476 ULONG WritableUserReferences;
477 ULONG QuadwordPad;
478 } CONTROL_AREA, *PCONTROL_AREA;
479
480 typedef struct _LARGE_CONTROL_AREA
481 {
482 PSEGMENT Segment;
483 LIST_ENTRY DereferenceList;
484 ULONG NumberOfSectionReferences;
485 ULONG NumberOfPfnReferences;
486 ULONG NumberOfMappedViews;
487 ULONG NumberOfSystemCacheViews;
488 ULONG NumberOfUserReferences;
489 union
490 {
491 ULONG LongFlags;
492 MMSECTION_FLAGS Flags;
493 } u;
494 PFILE_OBJECT FilePointer;
495 PEVENT_COUNTER WaitingForDeletion;
496 USHORT ModifiedWriteCount;
497 USHORT FlushInProgressCount;
498 ULONG WritableUserReferences;
499 ULONG QuadwordPad;
500 ULONG StartingFrame;
501 LIST_ENTRY UserGlobalList;
502 ULONG SessionId;
503 } LARGE_CONTROL_AREA, *PLARGE_CONTROL_AREA;
504
505 //
506 // Subsection and Mapped Subsection
507 //
508 typedef struct _SUBSECTION
509 {
510 PCONTROL_AREA ControlArea;
511 union
512 {
513 ULONG LongFlags;
514 MMSUBSECTION_FLAGS SubsectionFlags;
515 } u;
516 ULONG StartingSector;
517 ULONG NumberOfFullSectors;
518 PMMPTE SubsectionBase;
519 ULONG UnusedPtes;
520 ULONG PtesInSubsection;
521 struct _SUBSECTION *NextSubsection;
522 } SUBSECTION, *PSUBSECTION;
523
524 typedef struct _MSUBSECTION
525 {
526 PCONTROL_AREA ControlArea;
527 union
528 {
529 ULONG LongFlags;
530 MMSUBSECTION_FLAGS SubsectionFlags;
531 } u;
532 ULONG StartingSector;
533 ULONG NumberOfFullSectors;
534 PMMPTE SubsectionBase;
535 ULONG UnusedPtes;
536 ULONG PtesInSubsection;
537 struct _SUBSECTION *NextSubsection;
538 LIST_ENTRY DereferenceList;
539 ULONG_PTR NumberOfMappedViews;
540 union
541 {
542 ULONG LongFlags2;
543 MMSUBSECTION_FLAGS2 SubsectionFlags2;
544 } u2;
545 } MSUBSECTION, *PMSUBSECTION;
546
547 //
548 // Segment Object
549 //
550 typedef struct _SEGMENT_OBJECT
551 {
552 PVOID BaseAddress;
553 ULONG TotalNumberOfPtes;
554 LARGE_INTEGER SizeOfSegment;
555 ULONG NonExtendedPtes;
556 ULONG ImageCommitment;
557 PCONTROL_AREA ControlArea;
558 PSUBSECTION Subsection;
559 PLARGE_CONTROL_AREA LargeControlArea;
560 PMMSECTION_FLAGS MmSectionFlags;
561 PMMSUBSECTION_FLAGS MmSubSectionFlags;
562 } SEGMENT_OBJECT, *PSEGMENT_OBJECT;
563
564 //
565 // Section Object
566 //
567 typedef struct _SECTION_OBJECT
568 {
569 PVOID StartingVa;
570 PVOID EndingVa;
571 PVOID LeftChild;
572 PVOID RightChild;
573 PSEGMENT_OBJECT Segment;
574 } SECTION_OBJECT, *PSECTION_OBJECT;
575
576 //
577 // Generic Address Range Structure
578 //
579 typedef struct _ADDRESS_RANGE
580 {
581 ULONG BaseAddrLow;
582 ULONG BaseAddrHigh;
583 ULONG LengthLow;
584 ULONG LengthHigh;
585 ULONG Type;
586 } ADDRESS_RANGE, *PADDRESS_RANGE;
587
588 //
589 // Node in Memory Manager's AVL Table
590 //
591 typedef struct _MMADDRESS_NODE
592 {
593 union
594 {
595 LONG Balance:2;
596 struct _MMADDRESS_NODE *Parent;
597 } u1;
598 struct _MMADDRESS_NODE *LeftChild;
599 struct _MMADDRESS_NODE *RightChild;
600 ULONG StartingVpn;
601 ULONG EndingVpn;
602 } MMADDRESS_NODE, *PMMADDRESS_NODE;
603
604 //
605 // Memory Manager AVL Table for VADs and other descriptors
606 //
607 typedef struct _MM_AVL_TABLE
608 {
609 MMADDRESS_NODE BalancedRoot;
610 ULONG DepthOfTree:5;
611 ULONG Unused:3;
612 ULONG NumberGenericTableElements:24;
613 PVOID NodeHint;
614 PVOID NodeFreeHint;
615 } MM_AVL_TABLE, *PMM_AVL_TABLE;
616
617 //
618 // Actual Section Object
619 //
620 typedef struct _SECTION
621 {
622 MMADDRESS_NODE Address;
623 PSEGMENT Segment;
624 LARGE_INTEGER SizeOfSection;
625 union
626 {
627 ULONG LongFlags;
628 MMSECTION_FLAGS Flags;
629 } u;
630 ULONG InitialPageProtection;
631 } SECTION, *PSECTION;
632
633 //
634 // Memory Manager Working Set Structures
635 //
636 typedef struct _MMWSLENTRY
637 {
638 ULONG Valid:1;
639 ULONG LockedInWs:1;
640 ULONG LockedInMemory:1;
641 ULONG Protection:5;
642 ULONG Hashed:1;
643 ULONG Direct:1;
644 ULONG Age:2;
645 ULONG VirtualPageNumber:20;
646 } MMWSLENTRY, *PMMWSLENTRY;
647
648 typedef struct _MMWSLE
649 {
650 union
651 {
652 PVOID VirtualAddress;
653 ULONG Long;
654 MMWSLENTRY e1;
655 } u1;
656 } MMWSLE, *PMMWSLE;
657
658 typedef struct _MMWSLE_HASH
659 {
660 PVOID Key;
661 ULONG Index;
662 } MMWSLE_HASH, *PMMWSLE_HASH;
663
664 typedef struct _MMWSL
665 {
666 ULONG FirstFree;
667 ULONG FirstDynamic;
668 ULONG LastEntry;
669 ULONG NextSlot;
670 PMMWSLE Wsle;
671 ULONG LastInitializedWsle;
672 ULONG NonDirectCount;
673 PMMWSLE_HASH HashTable;
674 ULONG HashTableSize;
675 ULONG NumberOfCommittedPageTables;
676 PVOID HashTableStart;
677 PVOID HighestPermittedHashAddress;
678 ULONG NumberOfImageWaiters;
679 ULONG VadBitMapHint;
680 USHORT UsedPageTableEntries[768];
681 ULONG CommittedPageTables[24];
682 } MMWSL, *PMMWSL;
683
684 //
685 // Flags for Memory Support Structure
686 //
687 typedef struct _MMSUPPORT_FLAGS
688 {
689 ULONG SessionSpace:1;
690 ULONG BeingTrimmed:1;
691 ULONG SessionLeader:1;
692 ULONG TrimHard:1;
693 ULONG MaximumWorkingSetHard:1;
694 ULONG ForceTrim:1;
695 ULONG MinimumWorkingSetHard:1;
696 ULONG Available0:1;
697 ULONG MemoryPriority:8;
698 ULONG GrowWsleHash:1;
699 ULONG AcquiredUnsafe:1;
700 ULONG Available:14;
701 } MMSUPPORT_FLAGS, *PMMSUPPORT_FLAGS;
702
703 //
704 // Per-Process Memory Manager Data
705 //
706 typedef struct _MMSUPPORT
707 {
708 #if (NTDDI_VERSION >= NTDDI_WS03)
709 LIST_ENTRY WorkingSetExpansionLinks;
710 #endif
711 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
712 USHORT LastTrimpStamp;
713 USHORT NextPageColor;
714 #else
715 LARGE_INTEGER LastTrimTime;
716 #endif
717 MMSUPPORT_FLAGS Flags;
718 ULONG PageFaultCount;
719 ULONG PeakWorkingSetSize;
720 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
721 ULONG Spare0;
722 #else
723 ULONG GrowthSinceLastEstimate;
724 #endif
725 ULONG MinimumWorkingSetSize;
726 ULONG MaximumWorkingSetSize;
727 PMMWSL VmWorkingSetList;
728 #if (NTDDI_VERSION < NTDDI_WS03)
729 LIST_ENTRY WorkingSetExpansionLinks;
730 #endif
731 ULONG Claim;
732 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
733 ULONG Spare;
734 ULONG WorkingSetPrivateSize;
735 ULONG WorkingSetSizeOverhead;
736 #else
737 ULONG NextEstimationSlot;
738 ULONG NextAgingSlot;
739 ULONG EstimatedAvailable;
740 #endif
741 ULONG WorkingSetSize;
742 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
743 PKEVENT ExitEvent;
744 #endif
745 EX_PUSH_LOCK WorkingSetMutex;
746 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
747 PVOID AccessLog;
748 #endif
749 } MMSUPPORT, *PMMSUPPORT;
750
751 //
752 // Memory Information Types
753 //
754 typedef struct _MEMORY_BASIC_INFORMATION
755 {
756 PVOID BaseAddress;
757 PVOID AllocationBase;
758 ULONG AllocationProtect;
759 SIZE_T RegionSize;
760 ULONG State;
761 ULONG Protect;
762 ULONG Type;
763 } MEMORY_BASIC_INFORMATION,*PMEMORY_BASIC_INFORMATION;
764
765 //
766 // Driver Verifier Data
767 //
768 typedef struct _MM_DRIVER_VERIFIER_DATA
769 {
770 ULONG Level;
771 ULONG RaiseIrqls;
772 ULONG AcquireSpinLocks;
773 ULONG SynchronizeExecutions;
774 ULONG AllocationsAttempted;
775 ULONG AllocationsSucceeded;
776 ULONG AllocationsSucceededSpecialPool;
777 ULONG AllocationsWithNoTag;
778 ULONG TrimRequests;
779 ULONG Trims;
780 ULONG AllocationsFailed;
781 ULONG AllocationsFailedDeliberately;
782 ULONG Loads;
783 ULONG Unloads;
784 ULONG UnTrackedPool;
785 ULONG UserTrims;
786 ULONG CurrentPagedPoolAllocations;
787 ULONG CurrentNonPagedPoolAllocations;
788 ULONG PeakPagedPoolAllocations;
789 ULONG PeakNonPagedPoolAllocations;
790 ULONG PagedBytes;
791 ULONG NonPagedBytes;
792 ULONG PeakPagedBytes;
793 ULONG PeakNonPagedBytes;
794 ULONG BurstAllocationsFailedDeliberately;
795 ULONG SessionTrims;
796 ULONG Reserved[2];
797 } MM_DRIVER_VERIFIER_DATA, *PMM_DRIVER_VERIFIER_DATA;
798
799 //
800 // Internal Driver Verifier Table Data
801 //
802 typedef struct _DRIVER_SPECIFIED_VERIFIER_THUNKS
803 {
804 LIST_ENTRY ListEntry;
805 struct _LDR_DATA_TABLE_ENTRY *DataTableEntry;
806 ULONG NumberOfThunks;
807 } DRIVER_SPECIFIED_VERIFIER_THUNKS, *PDRIVER_SPECIFIED_VERIFIER_THUNKS;
808
809 //
810 // Default heap size values. For user mode, these values are copied to a new
811 // process's PEB by the kernel in MmCreatePeb. In kernel mode, RtlCreateHeap
812 // reads these variables directly.
813 //
814 // These variables should be considered "const"; they are written only once,
815 // during MmInitSystem.
816 //
817 extern SIZE_T MmHeapSegmentReserve;
818 extern SIZE_T MmHeapSegmentCommit;
819 extern SIZE_T MmHeapDeCommitTotalFreeThreshold;
820 extern SIZE_T MmHeapDeCommitFreeBlockThreshold;
821
822 //
823 // Section Object Type
824 //
825 extern POBJECT_TYPE MmSectionObjectType;
826
827 #endif // !NTOS_MODE_USER
828
829 #endif // _MMTYPES_H