ReactOS 0.4.15-dev-8145-ga541a46
fxfileobjectkm.cpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 FxFileObjectKm.hpp
8
9Abstract:
10
11 This module implements a frameworks managed FileObject
12
13Author:
14
15
16
17Environment:
18
19 Kernel mode only
20
21Revision History:
22
23
24--*/
25
26#include "coreprivshared.hpp"
27
28// Tracing support
29extern "C" {
30// #include "FxFileObjectKm.tmh"
31}
32
33VOID
35 _In_ MdFileObject WdmFileObject,
36 _In_ WDF_FILEOBJECT_CLASS NormalizedFileClass,
39 )
40{
41 MxFileObject wdmFileObject(WdmFileObject);
42
45
46 //
47 // We now must be able to quickly retrieve the FxFileObject*
48 // from the WDM PFILE_OBJECT when we get I/O requests.
49 //
50 // But different driver stacks have different rules, so
51 // we must be flexible here, including not touching the
52 // WDM PFILE_OBJECT at all.
53 //
54 if( NormalizedFileClass == WdfFileObjectWdfCanUseFsContext ) {
55 wdmFileObject.SetFsContext(this);
56 }
57 else if( NormalizedFileClass == WdfFileObjectWdfCanUseFsContext2 ) {
58 wdmFileObject.SetFsContext2(this);
59 }
60 else {
61 //
62 // WdfDeviceFileObjectNoContext will look up the FxFileObject
63 // from the FxDevice->m_FileObjectListHead at runtime.
64 //
65 }
66}
67
68VOID
70 _In_ MdIrp CreateIrp
71 )
72{
73 UNREFERENCED_PARAMETER(CreateIrp);
74
75 //
76 // Not needed for KMDF.
77 //
78 DO_NOTHING();
79
80 return;
81}
82
87 )
88{
90
91 //
92 // Not needed for KMDF.
93 //
94 DO_NOTHING();
95
97}
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
VOID Initialize(_In_ MdIrp CreateIrp)
VOID SetFileObjectContext(_In_ MdFileObject WdmFileObject, _In_ WDF_FILEOBJECT_CLASS NormalizedFileClass, _In_ MdIrp Irp, _In_ FxDevice *Device)
_Must_inspect_result_ NTSTATUS UpdateProcessKeepAliveCount(_In_ BOOLEAN Increment)
VOID SetFsContext2(_In_ PVOID Value)
VOID SetFsContext(_In_ PVOID Value)
_In_ PIRP Irp
Definition: csq.h:116
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG Increment
Definition: CrNtStubs.h:46
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define _In_
Definition: ms_sal.h:308
#define DO_NOTHING()
Definition: mxgeneral.h:32
PFILE_OBJECT MdFileObject
Definition: mxgeneralkm.h:32
IWudfIrp * MdIrp
Definition: mxum.h:103
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
enum _WDF_FILEOBJECT_CLASS WDF_FILEOBJECT_CLASS
@ WdfFileObjectWdfCanUseFsContext
Definition: wdfdevice.h:461
@ WdfFileObjectWdfCanUseFsContext2
Definition: wdfdevice.h:462