ReactOS  0.4.15-dev-5112-g22d8c0f
fxfileobjectapikm.cpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxFileObjectApiUm.cpp
8 
9 Abstract:
10 
11  This modules implements the C API's for the FxFileObject.
12 
13 Author:
14 
15 Environment:
16 
17  Kernel Mode mode only
18 
19 Revision History:
20 
21 
22 --*/
23 
24 #include "coreprivshared.hpp"
25 #include "fxfileobject.hpp"
26 
27 extern "C" {
28 // #include "FxFileObjectApiKm.tmh"
29 }
30 
31 //
32 // Extern "C" the entire file
33 //
34 extern "C" {
35 
38 STDCALL
39 WDFEXPORT(WdfFileObjectWdmGetFileObject)(
40  __in
42  __in
43  WDFFILEOBJECT FileObject
44  )
45 /*++
46 
47 Routine Description:
48 
49  This functions returns the corresponding WDM fileobject. If the device is opened
50  by a kernel-mode componenet by sending a IRP_MJ_CREATE irp
51  directly without a fileobject, this call can return a NULL pointer.
52 
53  Creating a WDFFILEOBJECT without an underlying WDM fileobject
54  is done only for 'exclusive' devices.
55 
56  Serenum sends such a create-irp to the serial driver.
57 
58 Arguments:
59 
60  FileObject - WDFFILEOBJECT
61 
62 Return Value:
63 
64 
65 --*/
66 {
67  DDI_ENTRY();
68 
70 
71  //
72  // Validate the FileObject object handle, and get its FxFileObject*
73  //
75  FileObject,
77  (PVOID*)&pFO);
78 
79  return pFO->GetWdmFileObject();
80 }
81 
82 } // extern "C"
#define DDI_ENTRY()
Definition: fxglobalskm.h:56
DriverGlobals
#define WDFEXPORT(a)
Definition: fxmacros.hpp:157
__inline MdFileObject GetWdmFileObject(VOID)
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:547
#define STDCALL
Definition: wdf.h:45
* PFILE_OBJECT
Definition: iotypes.h:1998
__drv_maxIRQL(DISPATCH_LEVEL) PFILE_OBJECT STDCALL WDFEXPORT(WdfFileObjectWdmGetFileObject)(__in PWDF_DRIVER_GLOBALS DriverGlobals
FxObjectHandleGetPtr(GetFxDriverGlobals(DriverGlobals), FileObject, FX_TYPE_FILEOBJECT,(PVOID *)&pFO)
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
__in WDFFILEOBJECT FileObject
__inline PFX_DRIVER_GLOBALS GetFxDriverGlobals(__in PWDF_DRIVER_GLOBALS DriverGlobals)
Definition: fxglobals.h:597
FxFileObject * pFO
#define __in
Definition: dbghelp.h:35