2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/fsrtl/mcb.c
5 * PURPOSE: Mapped Control Block (MCB) support for File System Drivers
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
9 /* INCLUDES ******************************************************************/
15 /* PUBLIC FUNCTIONS **********************************************************/
22 FsRtlAddMcbEntry(IN PMCB Mcb
,
27 /* Call the newer function */
28 return FsRtlAddLargeMcbEntry(&Mcb
->
29 DummyFieldThatSizesThisStructureCorrectly
,
32 (LONGLONG
)SectorCount
);
40 FsRtlGetNextMcbEntry(IN PMCB Mcb
,
44 OUT PULONG SectorCount
)
46 BOOLEAN Return
= FALSE
;
49 LONGLONG llSectorCount
;
51 /* Call the Large version */
52 Return
= FsRtlGetNextLargeMcbEntry(
53 &Mcb
->DummyFieldThatSizesThisStructureCorrectly
,
59 /* Return the lower 32 bits */
62 *SectorCount
= (ULONG
)llSectorCount
;
64 /* And return the original value */
73 FsRtlInitializeMcb(IN PMCB Mcb
,
74 IN POOL_TYPE PoolType
)
76 /* Call the newer function */
77 FsRtlInitializeLargeMcb(&Mcb
->DummyFieldThatSizesThisStructureCorrectly
,
86 FsRtlLookupLastMcbEntry(IN PMCB Mcb
,
90 BOOLEAN Return
= FALSE
;
94 /* Call the Large version */
95 Return
= FsRtlLookupLastLargeMcbEntry(
96 &Mcb
->DummyFieldThatSizesThisStructureCorrectly
,
100 /* Return the lower 32-bits */
104 /* And return the original value */
113 FsRtlLookupMcbEntry(IN PMCB Mcb
,
116 OUT PULONG SectorCount OPTIONAL
,
119 BOOLEAN Return
= FALSE
;
121 LONGLONG llSectorCount
;
123 /* Call the Large version */
124 Return
= FsRtlLookupLargeMcbEntry(&Mcb
->
125 DummyFieldThatSizesThisStructureCorrectly
,
133 /* Return the lower 32-bits */
135 if (SectorCount
) *SectorCount
= (ULONG
)llSectorCount
;
137 /* And return the original value */
146 FsRtlNumberOfRunsInMcb(IN PMCB Mcb
)
148 /* Call the newer function */
149 return FsRtlNumberOfRunsInLargeMcb(
150 &Mcb
->DummyFieldThatSizesThisStructureCorrectly
);
158 FsRtlRemoveMcbEntry(IN PMCB Mcb
,
160 IN ULONG SectorCount
)
162 /* Call the large function */
163 FsRtlRemoveLargeMcbEntry(&Mcb
->DummyFieldThatSizesThisStructureCorrectly
,
165 (LONGLONG
)SectorCount
);
173 FsRtlTruncateMcb(IN PMCB Mcb
,
176 /* Call the newer function */
177 FsRtlTruncateLargeMcb(&Mcb
->DummyFieldThatSizesThisStructureCorrectly
,
186 FsRtlUninitializeMcb(IN PMCB Mcb
)
188 /* Call the newer function */
189 FsRtlUninitializeLargeMcb(&Mcb
->DummyFieldThatSizesThisStructureCorrectly
);