ReactOS  0.4.15-dev-3453-gff89651
fxfileobjectkm.cpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxFileObjectKm.hpp
8 
9 Abstract:
10 
11  This module implements a frameworks managed FileObject
12 
13 Author:
14 
15 
16 
17 Environment:
18 
19  Kernel mode only
20 
21 Revision History:
22 
23 
24 --*/
25 
26 #include "coreprivshared.hpp"
27 
28 // Tracing support
29 extern "C" {
30 // #include "FxFileObjectKm.tmh"
31 }
32 
33 VOID
35  _In_ MdFileObject WdmFileObject,
36  _In_ WDF_FILEOBJECT_CLASS NormalizedFileClass,
37  _In_ MdIrp Irp,
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 
68 VOID
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 }
VOID SetFsContext2(_In_ PVOID Value)
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
VOID SetFileObjectContext(_In_ MdFileObject WdmFileObject, _In_ WDF_FILEOBJECT_CLASS NormalizedFileClass, _In_ MdIrp Irp, _In_ FxDevice *Device)
VOID SetFsContext(_In_ PVOID Value)
LONG NTSTATUS
Definition: precomp.h:26
PFILE_OBJECT MdFileObject
Definition: mxgeneralkm.h:32
return STATUS_NOT_IMPLEMENTED
_In_ PIRP Irp
Definition: csq.h:116
enum _WDF_FILEOBJECT_CLASS WDF_FILEOBJECT_CLASS
unsigned char BOOLEAN
#define _In_
Definition: ms_sal.h:308
IWudfIrp * MdIrp
Definition: mxum.h:103
VOID Initialize(_In_ MdIrp CreateIrp)
#define _Must_inspect_result_
Definition: ms_sal.h:558
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_Must_inspect_result_ NTSTATUS UpdateProcessKeepAliveCount(_In_ BOOLEAN Increment)
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG Increment
Definition: CrNtStubs.h:42
#define DO_NOTHING()
Definition: mxgeneral.h:32