ReactOS 0.4.16-dev-297-gc569aee
mcb.c
Go to the documentation of this file.
1/*
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)
7 */
8
9/* INCLUDES ******************************************************************/
10
11#include <ntoskrnl.h>
12#define NDEBUG
13#include <debug.h>
14
15/* PUBLIC FUNCTIONS **********************************************************/
16
17/*
18 * @implemented
19 */
23 IN VBN Vbn,
24 IN LBN Lbn,
26{
27 /* Call the newer function */
29 DummyFieldThatSizesThisStructureCorrectly,
33}
34
35/*
36 * @implemented
37 */
42 OUT PVBN Vbn,
43 OUT PLBN Lbn,
45{
46 BOOLEAN Return = FALSE;
47 LONGLONG llVbn;
48 LONGLONG llLbn;
49 LONGLONG llSectorCount;
50
51 /* Call the Large version */
53 &Mcb->DummyFieldThatSizesThisStructureCorrectly,
55 &llVbn,
56 &llLbn,
57 &llSectorCount);
58
59 /* Return the lower 32 bits */
60 *Vbn = (ULONG)llVbn;
61 *Lbn = (ULONG)llLbn;
62 *SectorCount = (ULONG)llSectorCount;
63
64 /* And return the original value */
65 return Return;
66}
67
68/*
69 * @implemented
70 */
71VOID
75{
76 /* Call the newer function */
77 FsRtlInitializeLargeMcb(&Mcb->DummyFieldThatSizesThisStructureCorrectly,
78 PoolType);
79}
80
81/*
82 * @implemented
83 */
87 OUT PVBN Vbn,
88 OUT PLBN Lbn)
89{
90 BOOLEAN Return = FALSE;
91 LONGLONG llVbn = 0;
92 LONGLONG llLbn = 0;
93
94 /* Call the Large version */
96 &Mcb->DummyFieldThatSizesThisStructureCorrectly,
97 &llVbn,
98 &llLbn);
99
100 /* Return the lower 32-bits */
101 *Vbn = (ULONG)llVbn;
102 *Lbn = (ULONG)llLbn;
103
104 /* And return the original value */
105 return Return;
106}
107
108/*
109 * @implemented
110 */
112NTAPI
114 IN VBN Vbn,
115 OUT PLBN Lbn,
118{
119 BOOLEAN Return = FALSE;
120 LONGLONG llLbn;
121 LONGLONG llSectorCount;
122
123 /* Call the Large version */
124 Return = FsRtlLookupLargeMcbEntry(&Mcb->
125 DummyFieldThatSizesThisStructureCorrectly,
126 (LONGLONG)Vbn,
127 &llLbn,
128 &llSectorCount,
129 NULL,
130 NULL,
131 Index);
132
133 /* Return the lower 32-bits */
134 *Lbn = (ULONG)llLbn;
135 if (SectorCount) *SectorCount = (ULONG)llSectorCount;
136
137 /* And return the original value */
138 return Return;
139}
140
141/*
142 * @implemented
143 */
144ULONG
145NTAPI
147{
148 /* Call the newer function */
150 &Mcb->DummyFieldThatSizesThisStructureCorrectly);
151}
152
153/*
154 * @implemented
155 */
156VOID
157NTAPI
159 IN VBN Vbn,
161{
162 /* Call the large function */
163 FsRtlRemoveLargeMcbEntry(&Mcb->DummyFieldThatSizesThisStructureCorrectly,
164 (LONGLONG)Vbn,
166}
167
168/*
169 * @implemented
170 */
171VOID
172NTAPI
174 IN VBN Vbn)
175{
176 /* Call the newer function */
177 FsRtlTruncateLargeMcb(&Mcb->DummyFieldThatSizesThisStructureCorrectly,
178 (LONGLONG)Vbn);
179}
180
181/*
182 * @implemented
183 */
184VOID
185NTAPI
187{
188 /* Call the newer function */
189 FsRtlUninitializeLargeMcb(&Mcb->DummyFieldThatSizesThisStructureCorrectly);
190}
unsigned char BOOLEAN
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
IN PVCB IN ULONG IN OUT PULONG IN BOOLEAN OUT PLARGE_MCB Mcb
Definition: fatprocs.h:349
_Must_inspect_result_ _In_ ULONG RunIndex
Definition: fsrtlfuncs.h:538
_In_ LONGLONG Vbn
Definition: fsrtlfuncs.h:470
_Must_inspect_result_ _In_ LONGLONG _In_ LONGLONG Lbn
Definition: fsrtlfuncs.h:480
LBN * PLBN
Definition: fsrtltypes.h:5
ULONG VBN
Definition: fsrtltypes.h:7
VBN * PVBN
Definition: fsrtltypes.h:8
VOID NTAPI FsRtlRemoveLargeMcbEntry(IN PLARGE_MCB Mcb, IN LONGLONG Vbn, IN LONGLONG SectorCount)
Definition: largemcb.c:905
VOID NTAPI FsRtlTruncateLargeMcb(IN PLARGE_MCB Mcb, IN LONGLONG Vbn)
Definition: largemcb.c:1059
BOOLEAN NTAPI FsRtlAddLargeMcbEntry(IN PLARGE_MCB Mcb, IN LONGLONG Vbn, IN LONGLONG Lbn, IN LONGLONG SectorCount)
Definition: largemcb.c:288
VOID NTAPI FsRtlUninitializeLargeMcb(IN PLARGE_MCB Mcb)
Definition: largemcb.c:1096
VOID NTAPI FsRtlInitializeLargeMcb(IN PLARGE_MCB Mcb, IN POOL_TYPE PoolType)
Definition: largemcb.c:451
BOOLEAN NTAPI FsRtlLookupLastLargeMcbEntry(IN PLARGE_MCB Mcb, OUT PLONGLONG Vbn, OUT PLONGLONG Lbn)
Definition: largemcb.c:718
BOOLEAN NTAPI FsRtlLookupLargeMcbEntry(IN PLARGE_MCB Mcb, IN LONGLONG Vbn, OUT PLONGLONG Lbn OPTIONAL, OUT PLONGLONG SectorCountFromLbn OPTIONAL, OUT PLONGLONG StartingLbn OPTIONAL, OUT PLONGLONG SectorCountFromStartingLbn OPTIONAL, OUT PULONG Index OPTIONAL)
Definition: largemcb.c:560
ULONG NTAPI FsRtlNumberOfRunsInLargeMcb(IN PLARGE_MCB Mcb)
Definition: largemcb.c:765
BOOLEAN NTAPI FsRtlGetNextLargeMcbEntry(IN PLARGE_MCB Mcb, IN ULONG RunIndex, OUT PLONGLONG Vbn, OUT PLONGLONG Lbn, OUT PLONGLONG SectorCount)
Definition: largemcb.c:392
BOOLEAN NTAPI FsRtlLookupMcbEntry(IN PMCB Mcb, IN VBN Vbn, OUT PLBN Lbn, OUT PULONG SectorCount OPTIONAL, OUT PULONG Index)
Definition: mcb.c:113
VOID NTAPI FsRtlInitializeMcb(IN PMCB Mcb, IN POOL_TYPE PoolType)
Definition: mcb.c:73
BOOLEAN NTAPI FsRtlAddMcbEntry(IN PMCB Mcb, IN VBN Vbn, IN LBN Lbn, IN ULONG SectorCount)
Definition: mcb.c:22
BOOLEAN NTAPI FsRtlLookupLastMcbEntry(IN PMCB Mcb, OUT PVBN Vbn, OUT PLBN Lbn)
Definition: mcb.c:86
BOOLEAN NTAPI FsRtlGetNextMcbEntry(IN PMCB Mcb, IN ULONG RunIndex, OUT PVBN Vbn, OUT PLBN Lbn, OUT PULONG SectorCount)
Definition: mcb.c:40
VOID NTAPI FsRtlRemoveMcbEntry(IN PMCB Mcb, IN VBN Vbn, IN ULONG SectorCount)
Definition: mcb.c:158
VOID NTAPI FsRtlTruncateMcb(IN PMCB Mcb, IN VBN Vbn)
Definition: mcb.c:173
ULONG NTAPI FsRtlNumberOfRunsInMcb(IN PMCB Mcb)
Definition: mcb.c:146
VOID NTAPI FsRtlUninitializeMcb(IN PMCB Mcb)
Definition: mcb.c:186
ULONG SectorCount
Definition: part_xbox.c:31
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
uint32_t * PULONG
Definition: typedefs.h:59
INT POOL_TYPE
Definition: typedefs.h:78
int64_t LONGLONG
Definition: typedefs.h:68
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3815