ReactOS 0.4.15-dev-8227-g32d615f
fxrequestsystembufferkm.cpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 FxRequestSystemBuffer.cpp
8
9Abstract:
10
11 This module implements class representing the system buffer in an FxRequest
12
13Author:
14
15
16
17
18Environment:
19
20 Kernel mode only
21
22Revision History:
23
24
25
26
27--*/
28
29#include "coreprivshared.hpp"
30
31// Tracing support
32extern "C" {
33// #include "FxRequestSystemBufferKm.tmh"
34}
35
39 VOID
40 )
41/*++
42
43Routine Description:
44 Returns the system buffer that has been cached away by the call to SetBuffer()
45
46Arguments:
47 None
48
49Return Value:
50 Valid memory or NULL on error
51
52 --*/
53{
56 WDF_DEVICE_IO_TYPE ioType;
57
58 switch (irp->GetMajorFunction()) {
61 return m_Buffer;
62
63 case IRP_MJ_READ:
64 case IRP_MJ_WRITE:
66 ioType = pDevice->GetIoType();
67
68 switch (ioType) {
70 return m_Buffer;
71
73 //
74 // FxRequest::GetMemoryObject has already called MmGetSystemAddressForMdlSafe
75 // and returned success, so we know that we can safely call
76 // MmGetSystemAddressForMdlSafe again to get a valid VA pointer.
77 //
79
81 return m_Buffer;
82
83 default:
85 return NULL;
86 }
87
88 default:
90 return NULL;
91 }
92}
93
__inline WDF_DEVICE_IO_TYPE GetIoType(VOID)
Definition: fxdevice.hpp:1084
static FxDevice * GetFxDevice(__in MdDeviceObject DeviceObject)
Definition: fxdeviceum.cpp:60
Definition: fxirp.hpp:28
UCHAR GetMajorFunction(VOID)
Definition: fxirpum.cpp:217
MdDeviceObject GetDeviceObject(VOID)
Definition: fxirpum.cpp:1352
FxIrp * GetFxIrp(VOID)
Definition: fxrequest.hpp:957
static __inline PVOID MxGetSystemAddressForMdlSafe(__inout PMDL Mdl, __in ULONG Priority)
Definition: mxgeneralkm.h:366
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
FxDevice * pDevice
FxIrp * irp
#define ASSERT(a)
Definition: mode.c:44
@ NormalPagePriority
Definition: imports.h:56
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define IRP_MJ_READ
Definition: rdpdr.c:46
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
virtual _Must_inspect_result_ PVOID GetBuffer(VOID)
enum _WDF_DEVICE_IO_TYPE WDF_DEVICE_IO_TYPE
@ WdfDeviceIoNeither
Definition: wdfdevice.h:451
@ WdfDeviceIoBuffered
Definition: wdfdevice.h:452
@ WdfDeviceIoDirect
Definition: wdfdevice.h:453
#define IRP_MJ_INTERNAL_DEVICE_CONTROL