ReactOS 0.4.16-dev-340-g0540c21
fxfileobjectapi.cpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 FxFileObjectApi.cpp
8
9Abstract:
10
11 This modules implements the C API's for the FxFileObject.
12
13Author:
14
15
16
17Environment:
18
19 Both kernel and user mode
20
21Revision History:
22
23
24--*/
25
26#include "coreprivshared.hpp"
27#include "fxfileobject.hpp"
28
29extern "C" {
30// #include "FxFileObjectApi.tmh"
31}
32
33//
34// Extern "C" the entire file
35//
36extern "C" {
37
41WDFEXPORT(WdfFileObjectGetFileName)(
42 __in
44 __in
45 WDFFILEOBJECT FileObject
46 )
47
48/*++
49
50Routine Description:
51
52 This returns the UNICODE_STRING for the FileName inside
53 the WDM fileobject.
54
55Arguments:
56
57 FileObject - WDFFILEOBJECT
58
59Return Value:
60
61 PUNICODE_STRING (file name)
62
63--*/
64
65{
66 DDI_ENTRY();
67
71
72 //
73 // Validate the FileObject object handle, and get its FxFileObject*
74 //
78 (PVOID*)&pFO,
80
83 return NULL;
84 }
85
87 return pFO->GetFileName();
88 }
89 else {
90 return NULL;
91 }
92}
93
94
98WDFEXPORT(WdfFileObjectGetFlags)(
99 __in
101 __in
102 WDFFILEOBJECT FileObject
103 )
104
105/*++
106
107Routine Description:
108
109 This returns the flags inside the WDM fileobject.
110
111Arguments:
112
113 FileObject - WDFFILEOBJECT
114
115Return Value:
116
117 ULONG (flags)
118
119--*/
120
121{
122 DDI_ENTRY();
123
125
126 //
127 // Validate the FileObject object handle, and get its FxFileObject*
128 //
132 (PVOID*)&pFO);
133
134 if (pFO->GetWdmFileObject() != NULL) {
135 return pFO->GetFlags();
136 }
137 else {
138 return 0x0;
139 }
140}
141
143WDFDEVICE
145WDFEXPORT(WdfFileObjectGetDevice)(
146 __in
148 __in
149 WDFFILEOBJECT FileObject
150 )
151
152/*++
153
154Routine Description:
155
156 This returns the Device that the fileobject is associated with.
157
158Arguments:
159
160 FileObject - WDFFILEOBJECT
161
162Return Value:
163
164 WDFDEVICE
165
166--*/
167
168{
169 DDI_ENTRY();
170
172
173 //
174 // Validate the FileObject object handle, and get its FxFileObject*
175 //
179 (PVOID*)&pFO);
180
181 return pFO->GetDevice()->GetHandle();
182}
183
184} // extern "C"
LONG NTSTATUS
Definition: precomp.h:26
WDFDEVICE __inline GetHandle(VOID)
Definition: fxdevice.hpp:237
__inline ULONG GetFlags(VOID)
__inline MdFileObject GetWdmFileObject(VOID)
__inline CfxDevice * GetDevice(VOID)
__inline PUNICODE_STRING GetFileName(VOID)
#define __in
Definition: dbghelp.h:35
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define __drv_maxIRQL(irql)
Definition: driverspecs.h:291
#define PASSIVE_LEVEL
Definition: env_spec_w32.h:693
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
DriverGlobals
NTSTATUS status
FxObjectHandleGetPtr(GetFxDriverGlobals(DriverGlobals), FileObject, FX_TYPE_FILEOBJECT,(PVOID *)&pFO)
FxObjectHandleGetPtrAndGlobals(GetFxDriverGlobals(DriverGlobals), FileObject, FX_TYPE_FILEOBJECT,(PVOID *)&pFO, &pFxDriverGlobals)
__in WDFFILEOBJECT FileObject
FxFileObject * pFO
PFX_DRIVER_GLOBALS pFxDriverGlobals
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
#define DDI_ENTRY()
Definition: fxglobalskm.h:56
#define WDFEXPORT(a)
Definition: fxmacros.hpp:157
@ FX_TYPE_FILEOBJECT
Definition: fxtypes.h:71
__inline NTSTATUS FxVerifierCheckIrqlLevel(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in KIRQL Irql)
Definition: fxverifier.h:158
Definition: ps.c:97
uint32_t ULONG
Definition: typedefs.h:59
#define STDCALL
Definition: wdf.h:45
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550