ReactOS  0.4.15-dev-1619-g69dffed
mdl.c File Reference
#include <ntoskrnl.h>
#include <debug.h>
Include dependency graph for mdl.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID NTAPI CcMdlRead (IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, OUT PMDL *MdlChain, OUT PIO_STATUS_BLOCK IoStatus)
 
VOID NTAPI CcMdlReadComplete2 (IN PFILE_OBJECT FileObject, IN PMDL MemoryDescriptorList)
 
VOID NTAPI CcMdlReadComplete (IN PFILE_OBJECT FileObject, IN PMDL MdlChain)
 
VOID NTAPI CcMdlWriteComplete (IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN PMDL MdlChain)
 
VOID NTAPI CcMdlWriteComplete2 (IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN PMDL MdlChain)
 
VOID NTAPI CcMdlWriteAbort (IN PFILE_OBJECT FileObject, IN PMDL MdlChain)
 
VOID NTAPI CcPrepareMdlWrite (IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN ULONG Length, OUT PMDL *MdlChain, OUT PIO_STATUS_BLOCK IoStatus)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file mdl.c.

Function Documentation

◆ CcMdlRead()

VOID NTAPI CcMdlRead ( IN PFILE_OBJECT  FileObject,
IN PLARGE_INTEGER  FileOffset,
IN ULONG  Length,
OUT PMDL MdlChain,
OUT PIO_STATUS_BLOCK  IoStatus 
)

Definition at line 23 of file mdl.c.

30 {
31  CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%I64d Length=%lu\n",
32  FileObject, FileOffset->QuadPart, Length);
33 
35 }
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:547
#define CC_API_DEBUG
Definition: cc.h:11
#define CCTRACE(x, fmt,...)
Definition: cc.h:36
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:159
#define UNIMPLEMENTED
Definition: debug.h:115

◆ CcMdlReadComplete()

VOID NTAPI CcMdlReadComplete ( IN PFILE_OBJECT  FileObject,
IN PMDL  MdlChain 
)

Definition at line 90 of file mdl.c.

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,
107  DeviceObject))
108  {
109  /* Request was handled */
110  return;
111  }
112  }
113 
114  /* Use slow path */
116 }
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Outptr_ PMDL * MdlChain
Definition: fsrtlfuncs.h:46
PDEVICE_OBJECT NTAPI IoGetRelatedDeviceObject(IN PFILE_OBJECT FileObject)
Definition: device.c:1539
PFAST_IO_MDL_READ_COMPLETE MdlReadComplete
Definition: iotypes.h:1747
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
VOID NTAPI CcMdlReadComplete2(IN PFILE_OBJECT FileObject, IN PMDL MemoryDescriptorList)
Definition: mdl.c:56
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:547
#define NULL
Definition: types.h:112

◆ CcMdlReadComplete2()

VOID NTAPI CcMdlReadComplete2 ( IN PFILE_OBJECT  FileObject,
IN PMDL  MemoryDescriptorList 
)

Definition at line 56 of file mdl.c.

60 {
61  PMDL Mdl;
62 
63  /* Free MDLs */
64  while ((Mdl = MemoryDescriptorList))
65  {
66  MemoryDescriptorList = Mdl->Next;
68  IoFreeMdl(Mdl);
69  }
70 }
VOID NTAPI MmUnlockPages(IN PMDL Mdl)
Definition: mdlsup.c:1439
_Inout_ PMDL MemoryDescriptorList
Definition: mmfuncs.h:405
VOID NTAPI IoFreeMdl(PMDL Mdl)
Definition: iomdl.c:146
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl

Referenced by CcMdlReadComplete().

◆ CcMdlWriteAbort()

VOID NTAPI CcMdlWriteAbort ( IN PFILE_OBJECT  FileObject,
IN PMDL  MdlChain 
)

Definition at line 168 of file mdl.c.

171 {
173 }
#define UNIMPLEMENTED
Definition: debug.h:115

◆ CcMdlWriteComplete()

VOID NTAPI CcMdlWriteComplete ( IN PFILE_OBJECT  FileObject,
IN PLARGE_INTEGER  FileOffset,
IN PMDL  MdlChain 
)

Definition at line 123 of file mdl.c.

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,
140  FileOffset,
141  MdlChain,
142  DeviceObject))
143  {
144  /* Request was handled */
145  return;
146  }
147  }
148 
149  /* Use slow path */
151 }
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _Outptr_ PMDL * MdlChain
Definition: fsrtlfuncs.h:46
PDEVICE_OBJECT NTAPI IoGetRelatedDeviceObject(IN PFILE_OBJECT FileObject)
Definition: device.c:1539
VOID NTAPI CcMdlWriteComplete2(IN PFILE_OBJECT FileObject, IN PLARGE_INTEGER FileOffset, IN PMDL MdlChain)
Definition: mdl.c:155
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:547
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:159
#define NULL
Definition: types.h:112
PFAST_IO_MDL_WRITE_COMPLETE MdlWriteComplete
Definition: iotypes.h:1749

◆ CcMdlWriteComplete2()

VOID NTAPI CcMdlWriteComplete2 ( IN PFILE_OBJECT  FileObject,
IN PLARGE_INTEGER  FileOffset,
IN PMDL  MdlChain 
)

Definition at line 155 of file mdl.c.

159 {
161 }
#define UNIMPLEMENTED
Definition: debug.h:115

Referenced by CcMdlWriteComplete().

◆ CcPrepareMdlWrite()

VOID NTAPI CcPrepareMdlWrite ( IN PFILE_OBJECT  FileObject,
IN PLARGE_INTEGER  FileOffset,
IN ULONG  Length,
OUT PMDL MdlChain,
OUT PIO_STATUS_BLOCK  IoStatus 
)

Definition at line 180 of file mdl.c.

186 {
187  CCTRACE(CC_API_DEBUG, "FileObject=%p FileOffset=%I64d Length=%lu\n",
188  FileObject, FileOffset->QuadPart, Length);
189 
191 }
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:547
#define CC_API_DEBUG
Definition: cc.h:11
#define CCTRACE(x, fmt,...)
Definition: cc.h:36
_In_ PFCB _In_ LONGLONG FileOffset
Definition: cdprocs.h:159
#define UNIMPLEMENTED
Definition: debug.h:115