ReactOS 0.4.15-dev-7711-g5627da4
mdl.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: ntoskrnl/cc/mdl.c
5 * PURPOSE: Implements MDL Cache Manager Functions
6 *
7 * PROGRAMMERS: Alex Ionescu
8 */
9
10/* INCLUDES ******************************************************************/
11
12#include <ntoskrnl.h>
13#define NDEBUG
14#include <debug.h>
15
16/* FUNCTIONS *****************************************************************/
17
18/*
19 * @implemented
20 */
21VOID
29 )
30{
31 CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%I64d Length=%lu\n",
32 FileObject, FileOffset->QuadPart, Length);
33
35}
36
37/*
38 * NAME INTERNAL
39 * CcMdlReadComplete2@8
40 *
41 * DESCRIPTION
42 *
43 * ARGUMENTS
44 * MdlChain
45 * DeviceObject
46 *
47 * RETURN VALUE
48 * None.
49 *
50 * NOTE
51 * Used by CcMdlReadComplete@8 and FsRtl
52 *
53 */
54VOID
59)
60{
61 PMDL Mdl;
62
63 /* Free MDLs */
64 while ((Mdl = MemoryDescriptorList))
65 {
69 }
70}
71
72/*
73 * NAME EXPORTED
74 * CcMdlReadComplete@8
75 *
76 * DESCRIPTION
77 *
78 * ARGUMENTS
79 *
80 * RETURN VALUE
81 * None.
82 *
83 * NOTE
84 * From Bo Branten's ntifs.h v13.
85 *
86 * @implemented
87 */
88VOID
93{
95 PFAST_IO_DISPATCH FastDispatch;
96
97 /* Get Fast Dispatch Data */
99 FastDispatch = DeviceObject->DriverObject->FastIoDispatch;
100
101 /* Check if we support Fast Calls, and check this one */
102 if (FastDispatch && FastDispatch->MdlReadComplete)
103 {
104 /* Use the fast path */
105 if (FastDispatch->MdlReadComplete(FileObject,
106 MdlChain,
108 {
109 /* Request was handled */
110 return;
111 }
112 }
113
114 /* Use slow path */
116}
117
118/*
119 * @implemented
120 */
121VOID
122NTAPI
127{
129 PFAST_IO_DISPATCH FastDispatch;
130
131 /* Get Fast Dispatch Data */
133 FastDispatch = DeviceObject->DriverObject->FastIoDispatch;
134
135 /* Check if we support Fast Calls, and check this one */
136 if (FastDispatch && FastDispatch->MdlWriteComplete)
137 {
138 /* Use the fast path */
139 if (FastDispatch->MdlWriteComplete(FileObject,
141 MdlChain,
143 {
144 /* Request was handled */
145 return;
146 }
147 }
148
149 /* Use slow path */
151}
152
153VOID
154NTAPI
159{
161}
162
163/*
164 * @unimplemented
165 */
166VOID
167NTAPI
171{
173}
174
175/*
176 * @unimplemented
177 */
178VOID
179NTAPI
184 OUT PMDL * MdlChain,
186{
187 CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%I64d Length=%lu\n",
188 FileObject, FileOffset->QuadPart, Length);
189
191}
#define UNIMPLEMENTED
Definition: debug.h:115
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:160
#define NULL
Definition: types.h:112
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Outptr_ PMDL * MdlChain
Definition: fsrtlfuncs.h:49
#define IoFreeMdl
Definition: fxmdl.h:89
VOID NTAPI CcMdlReadComplete2(IN PFILE_OBJECT FileObject, IN PMDL MemoryDescriptorList)
Definition: mdl.c:56
VOID NTAPI CcPrepareMdlWrite(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, OUT PMDL *MdlChain, OUT PIO_STATUS_BLOCK IoStatus)
Definition: mdl.c:180
VOID NTAPI CcMdlWriteAbort(IN PFILE_OBJECT FileObject, IN PMDL MdlChain)
Definition: mdl.c:168
VOID NTAPI CcMdlWriteComplete2(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN PMDL MdlChain)
Definition: mdl.c:155
VOID NTAPI CcMdlReadComplete(IN PFILE_OBJECT FileObject, IN PMDL MdlChain)
Definition: mdl.c:90
VOID NTAPI CcMdlRead(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, OUT PMDL *MdlChain, OUT PIO_STATUS_BLOCK IoStatus)
Definition: mdl.c:23
VOID NTAPI CcMdlWriteComplete(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN PMDL MdlChain)
Definition: mdl.c:123
VOID NTAPI MmUnlockPages(IN PMDL Mdl)
Definition: mdlsup.c:1435
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
Definition: mxum.h:159
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define CC_API_DEBUG
Definition: cc.h:11
#define CCTRACE(x, fmt,...)
Definition: cc.h:36
PDEVICE_OBJECT NTAPI IoGetRelatedDeviceObject(IN PFILE_OBJECT FileObject)
Definition: device.c:1539
PFAST_IO_MDL_READ_COMPLETE MdlReadComplete
Definition: iotypes.h:1750
PFAST_IO_MDL_WRITE_COMPLETE MdlWriteComplete
Definition: iotypes.h:1752
#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_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
* PFILE_OBJECT
Definition: iotypes.h:1998
_Inout_ PMDL MemoryDescriptorList
Definition: mmfuncs.h:405