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