ReactOS 0.4.16-dev-336-gb667d82
FxDeviceInterface Class Reference

#include <fxdeviceinterface.hpp>

Inheritance diagram for FxDeviceInterface:
Collaboration diagram for FxDeviceInterface:

Public Member Functions

 FxDeviceInterface (VOID)
 
 ~FxDeviceInterface (VOID)
 
_Must_inspect_result_ NTSTATUS Initialize (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in CONST GUID *InterfaceGUID, __in_opt PCUNICODE_STRING ReferenceString)
 
VOID SetState (__in BOOLEAN State)
 
_Must_inspect_result_ NTSTATUS Register (__in MdDeviceObject Pdo)
 
_Must_inspect_result_ NTSTATUS Register (_In_ FxDevice *Device)
 
NTSTATUS GetSymbolicLinkName (_In_ FxString *LinkString)
 
- Public Member Functions inherited from FxStump
PVOID operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
PVOID operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in POOL_TYPE PoolType)
 
VOID operator delete (__in PVOID pointer)
 
PVOID operator new[] (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
VOID operator delete[] (__in PVOID pointer)
 

Static Public Member Functions

static FxDeviceInterface_FromEntry (__in PSINGLE_LIST_ENTRY Entry)
 

Public Attributes

GUID m_InterfaceClassGUID
 
UNICODE_STRING m_ReferenceString
 
UNICODE_STRING m_SymbolicLinkName
 
SINGLE_LIST_ENTRY m_Entry
 
BOOLEAN m_State
 
MdDeviceObject m_Device
 

Additional Inherited Members

- Protected Member Functions inherited from FxStump
 FxStump (VOID)
 

Detailed Description

Definition at line 28 of file fxdeviceinterface.hpp.

Constructor & Destructor Documentation

◆ FxDeviceInterface()

FxDeviceInterface::FxDeviceInterface ( VOID  )

Definition at line 31 of file fxdeviceinterface.cpp.

45{
47
50
52
53 m_State = FALSE;
54
55#if (FX_CORE_MODE == FX_CORE_USER_MODE)
56 m_Device = NULL;
57#endif
58
59}
UNICODE_STRING m_SymbolicLinkName
MdDeviceObject m_Device
UNICODE_STRING m_ReferenceString
SINGLE_LIST_ENTRY m_Entry
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
struct _SINGLE_LIST_ENTRY * Next
Definition: ntbasedef.h:637
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262

◆ ~FxDeviceInterface()

FxDeviceInterface::~FxDeviceInterface ( VOID  )

Definition at line 61 of file fxdeviceinterface.cpp.

75{
76 // the device interface should be off now
78
79 // should no longer be in any list
81
85 }
86
89 }
90}
void FxPoolFree(__in_xcount(ptr is at an offset from AllocationStart) PVOID ptr)
Definition: wdfpool.cpp:361
#define ASSERT(a)
Definition: mode.c:44
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)

Member Function Documentation

◆ _FromEntry()

static FxDeviceInterface * FxDeviceInterface::_FromEntry ( __in PSINGLE_LIST_ENTRY  Entry)
inlinestatic

◆ GetSymbolicLinkName()

NTSTATUS FxDeviceInterface::GetSymbolicLinkName ( _In_ FxString LinkString)

Definition at line 212 of file fxdeviceinterfacekm.cpp.

215{
217
219 //
220 // The device interface has not yet been registered b/c it
221 // belongs to a PDO and the PDO has not been recognized by
222 // pnp yet.
223 //
225 UNREFERENCED_PARAMETER(LinkString);
226 }
227 else {
228 //
229 // Attempt a copy
230 //
231 status = LinkString->Assign(&m_SymbolicLinkName);
232 }
233
234 return status;
235}
LONG NTSTATUS
Definition: precomp.h:26
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
Definition: ps.c:97
#define STATUS_INVALID_DEVICE_STATE
Definition: udferr_usr.h:178

◆ Initialize()

_Must_inspect_result_ NTSTATUS FxDeviceInterface::Initialize ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals,
__in CONST GUID InterfaceGUID,
__in_opt PCUNICODE_STRING  ReferenceString 
)

Definition at line 94 of file fxdeviceinterface.cpp.

114{
115 RtlCopyMemory(&m_InterfaceClassGUID, InterfaceGUID, sizeof(GUID));
116
117 if (ReferenceString != NULL) {
118 return FxDuplicateUnicodeString(FxDriverGlobals,
121 }
122 else {
123 return STATUS_SUCCESS;
124 }
125}
#define STATUS_SUCCESS
Definition: shellext.h:65
_Must_inspect_result_ NTSTATUS FxDuplicateUnicodeString(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in const UNICODE_STRING *Source, __out PUNICODE_STRING Destination)
Definition: stringutil.cpp:180
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
_Must_inspect_result_ _In_ WDFDEVICE _In_ CONST GUID _In_opt_ PCUNICODE_STRING ReferenceString
Definition: wdfdevice.h:3630

◆ Register() [1/2]

_Must_inspect_result_ NTSTATUS FxDeviceInterface::Register ( __in MdDeviceObject  Pdo)

Definition at line 153 of file fxdeviceinterfacekm.cpp.

169{
171
172 if (m_ReferenceString.Length > 0) {
174 }
175 else {
176 pString = NULL;
177 }
178
181}
static __inline NTSTATUS MxRegisterDeviceInterface(_In_ PDEVICE_OBJECT PhysicalDeviceObject, _In_ const GUID *InterfaceClassGuid, _In_opt_ PUNICODE_STRING ReferenceString, _Out_ PUNICODE_STRING SymbolicLinkName)
Definition: mxgeneralkm.h:619
FxString * pString
WDF_EXTERN_C_START typedef _Must_inspect_result_ _In_ WDFDRIVER _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT Pdo
Definition: wdfminiport.h:72

Referenced by FxPkgPdo::PnpQueryResourceRequirements().

◆ Register() [2/2]

_Must_inspect_result_ NTSTATUS FxDeviceInterface::Register ( _In_ FxDevice Device)

Definition at line 185 of file fxdeviceinterfacekm.cpp.

188{
190 MdDeviceObject pdo;
191
192 pdo = Device->GetSafePhysicalDevice();
193
194 if (pdo != NULL) {
195 status = Register(pdo);
196 }
197 else {
198 //
199 // Leave the device interface unregistered. When we are in hardware
200 // available, we will register there once we know for sure we have a
201 // real live PDO that the system has acknowledged.
202 //
203 DO_NOTHING();
204
206 }
207
208 return status;
209}
#define DO_NOTHING()
Definition: mxgeneral.h:32
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474

◆ SetState()

VOID FxDeviceInterface::SetState ( __in BOOLEAN  State)

Definition at line 129 of file fxdeviceinterface.cpp.

145{
146 m_State = State;
147
148 //
149 // Only set the state if the interface has been registered
150 //
153 }
154}
static __inline NTSTATUS MxSetDeviceInterfaceState(_In_ PUNICODE_STRING SymbolicLinkName, _In_ BOOLEAN Enable)
Definition: mxgeneralkm.h:608

Referenced by for(), FxPkgPnp::PnpDisableInterfaces(), and FxPkgPnp::PnpEnableInterfacesAndRegisterWmi().

Member Data Documentation

◆ m_Device

MdDeviceObject FxDeviceInterface::m_Device

Definition at line 45 of file fxdeviceinterface.hpp.

Referenced by FxDeviceInterface().

◆ m_Entry

SINGLE_LIST_ENTRY FxDeviceInterface::m_Entry

◆ m_InterfaceClassGUID

GUID FxDeviceInterface::m_InterfaceClassGUID

◆ m_ReferenceString

UNICODE_STRING FxDeviceInterface::m_ReferenceString

◆ m_State

BOOLEAN FxDeviceInterface::m_State

Definition at line 39 of file fxdeviceinterface.hpp.

Referenced by FxDeviceInterface(), SetState(), and ~FxDeviceInterface().

◆ m_SymbolicLinkName


The documentation for this class was generated from the following files: