ReactOS 0.4.15-dev-7834-g00c4b3d
fxdevicekm.hpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 FxDeviceKM.hpp
8
9Abstract:
10
11 This is the definition of the FxDevice object KM specific
12
13Author:
14
15
16
17Environment:
18
19 Kernel mode only
20
21Revision History:
22
23--*/
24
25#ifndef _FXDEVICEKM_H_
26#define _FXDEVICEKM_H_
27
28__inline
32 )
33{
34 //
35 // DeviceObject->DeviceExtension points to our FxDevice allocation. We
36 // get the underlying DeviceExtension allocated as part of the
37 // PDEVICE_OBJECT by adding the sizeof(DEVICE_OBJECT) to get the start
38 // of the DeviceExtension. This is documented behavior on how the
39 // DeviceExtension can be found.
40 //
42 sizeof(*DeviceObject));
43}
44
45__inline
48 VOID
49 )
50{
53}
54
55__inline
58 VOID
59 )
60{
61 if (m_DeviceObject.GetObject() != NULL) {
64 }
65 else {
66 return FALSE;
67 }
68}
69
70__inline
74 )
75{
77
78 //
79 // DeviceExtension points to the start of the first context assigned to
80 // WDFDEVICE. We walk backwards from the context to the FxDevice*.
81 //
84 Context)->Object;
85}
86
87__inline
88VOID
90 VOID
91 )
92{
96 }
97}
98
99__inline
100VOID
102 VOID
103 )
104{
105 PDEVICE_OBJECT pdo;
106
107 //
108 // If the PDO is not yet reported to pnp, do not call the API. In this
109 // case, the PDO will soon be reported and started and the state that
110 // was just set will be queried for automatically by pnp as a part of
111 // start.
112 //
113 pdo = GetSafePhysicalDevice();
114
115 if (pdo != NULL) {
117 }
118}
119
120VOID
121__inline
123 VOID
124 )
125{
127 //
128 // Must be at PASSIVE_LEVEL for this call
129 //
132 }
133
136 }
137}
138
139__inline
146 )
147{
152}
153
154__inline
162 )
163{
169}
170
171#endif //_FXDEVICEKM_H_
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
MxDeviceObject m_AttachedDevice
Definition: fxdevice.hpp:472
MxDeviceObject m_DeviceObject
Definition: fxdevice.hpp:471
VOID DeleteSymbolicLink(VOID)
BOOLEAN IsRemoveLockEnabledForIo(VOID)
Definition: fxdevicekm.hpp:57
static FxDevice * GetFxDevice(__in MdDeviceObject DeviceObject)
Definition: fxdeviceum.cpp:60
VOID InvalidateDeviceState(VOID)
MdDeviceObject __inline GetSafePhysicalDevice(VOID)
Definition: fxdevice.hpp:1005
static FxWdmDeviceExtension * _GetFxWdmExtension(__in MdDeviceObject DeviceObject)
Definition: fxdevicekm.hpp:30
MdRemoveLock GetRemoveLock(VOID)
Definition: fxdevicekm.hpp:47
UNICODE_STRING m_SymbolicLinkName
Definition: fxdevice.hpp:580
VOID DetachDevice(VOID)
static __inline NTSTATUS _GetDeviceProperty(_In_ MdDeviceObject DeviceObject, _In_ DEVICE_REGISTRY_PROPERTY DeviceProperty, _In_ ULONG BufferLength, _Out_opt_ PVOID PropertyBuffer, _Out_ PULONG ResultLength)
static __inline NTSTATUS _OpenDeviceRegistryKey(_In_ MdDeviceObject DeviceObject, _In_ ULONG DevInstKeyType, _In_ ACCESS_MASK DesiredAccess, _Out_ PHANDLE DevInstRegKey)
__inline VOID SetObject(__in_opt MdDeviceObject DeviceObject)
PVOID GetDeviceExtension(VOID)
__inline MdDeviceObject GetObject(VOID)
static VOID MxDetachDevice(_Inout_ MdDeviceObject Device)
Definition: mxgeneralkm.h:502
static __inline VOID MxDeleteSymbolicLink(__in PUNICODE_STRING Link)
Definition: mxgeneralkm.h:424
#define __in
Definition: dbghelp.h:35
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
MxDeviceObject deviceObject
return pDevice GetDeviceObject()
void FxPoolFree(__in_xcount(ptr is at an offset from AllocationStart) PVOID ptr)
Definition: wdfpool.cpp:361
#define _Out_opt_
Definition: ms_sal.h:346
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
ULONG ACCESS_MASK
Definition: nt_native.h:40
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
NTSTATUS NTAPI IoOpenDeviceRegistryKey(IN PDEVICE_OBJECT DeviceObject, IN ULONG DevInstKeyType, IN ACCESS_MASK DesiredAccess, OUT PHANDLE DevInstRegKey)
Definition: pnpmgr.c:1621
NTSTATUS NTAPI IoGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_REGISTRY_PROPERTY DeviceProperty, IN ULONG BufferLength, OUT PVOID PropertyBuffer, OUT PULONG ResultLength)
Definition: pnpmgr.c:1382
VOID NTAPI IoInvalidateDeviceState(IN PDEVICE_OBJECT DeviceObject)
Definition: pnpmgr.c:1848
ULONG RemoveLockOptionFlags
Definition: fxdevice.hpp:38
WUDF_IO_REMOVE_LOCK IoRemoveLock
Definition: fxdevice.hpp:34
uint32_t * PULONG
Definition: typedefs.h:59
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define WDF_PTR_ADD_OFFSET(_ptr, _offset)
Definition: wdfcore.h:144
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658
@ WDF_REMOVE_LOCK_OPTION_ACQUIRE_FOR_IO
Definition: wdfdevice.h:1639
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID PropertyBuffer
Definition: wdfdevice.h:4437
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY DeviceProperty
Definition: wdfdevice.h:3769
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3771
_In_ ULONG _In_ ACCESS_MASK _Out_ PHANDLE DevInstRegKey
Definition: iofuncs.h:1127
_In_ ULONG DevInstKeyType
Definition: iofuncs.h:1125
DEVICE_REGISTRY_PROPERTY
Definition: iotypes.h:1194