ReactOS  0.4.15-dev-3446-g30010a5
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 
51  m_Entry.Next = NULL;
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_ReferenceString
UNICODE_STRING m_SymbolicLinkName
#define FALSE
Definition: types.h:117
struct _SINGLE_LIST_ENTRY * Next
Definition: ntbasedef.h:629
#define NULL
Definition: types.h:112
SINGLE_LIST_ENTRY m_Entry
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
MdDeviceObject m_Device

◆ ~FxDeviceInterface()

FxDeviceInterface::~FxDeviceInterface ( VOID  )

Definition at line 61 of file fxdeviceinterface.cpp.

75 {
76  // the device interface should be off now
77  ASSERT(m_State == FALSE);
78 
79  // should no longer be in any list
80  ASSERT(m_Entry.Next == NULL);
81 
82  if (m_ReferenceString.Buffer != NULL) {
85  }
86 
89  }
90 }
UNICODE_STRING m_ReferenceString
UNICODE_STRING m_SymbolicLinkName
#define FALSE
Definition: types.h:117
#define ASSERT(a)
Definition: mode.c:44
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
struct _SINGLE_LIST_ENTRY * Next
Definition: ntbasedef.h:629
#define NULL
Definition: types.h:112
SINGLE_LIST_ENTRY m_Entry
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
void FxPoolFree(__in_xcount(ptr is at an offset from AllocationStart) PVOID ptr)
Definition: wdfpool.cpp:361

Member Function Documentation

◆ _FromEntry()

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

Definition at line 60 of file fxdeviceinterface.hpp.

63  {
65  }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
SINGLE_LIST_ENTRY m_Entry
base of all file and directory entries
Definition: entries.h:82

Referenced by for(), FxDevice::IsInterfaceRegistered(), FxPkgPnp::PnpDisableInterfaces(), FxPkgPnp::PnpEnableInterfacesAndRegisterWmi(), FxPkgPdo::PnpQueryResourceRequirements(), and FxPkgPnp::~FxPkgPnp().

◆ GetSymbolicLinkName()

NTSTATUS FxDeviceInterface::GetSymbolicLinkName ( _In_ FxString LinkString)

Definition at line 212 of file fxdeviceinterfacekm.cpp.

215 {
217 
218  if (m_SymbolicLinkName.Buffer == NULL) {
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 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
LONG NTSTATUS
Definition: precomp.h:26
UNICODE_STRING m_SymbolicLinkName
#define STATUS_INVALID_DEVICE_STATE
Definition: udferr_usr.h:178
#define NULL
Definition: types.h:112
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ 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 }
UNICODE_STRING m_ReferenceString
_Must_inspect_result_ NTSTATUS FxDuplicateUnicodeString(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in const UNICODE_STRING *Source, __out PUNICODE_STRING Destination)
Definition: stringutil.cpp:180
_Must_inspect_result_ _In_ WDFDEVICE _In_ CONST GUID _In_opt_ PCUNICODE_STRING ReferenceString
Definition: wdfdevice.h:3625
#define NULL
Definition: types.h:112
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_SUCCESS
Definition: shellext.h:65

◆ 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
UNICODE_STRING m_ReferenceString
UNICODE_STRING m_SymbolicLinkName
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:64
FxString * pString
#define NULL
Definition: types.h:112

Referenced by FxPkgPdo::PnpQueryResourceRequirements(), and Register().

◆ 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 }
_Must_inspect_result_ NTSTATUS Register(__in MdDeviceObject Pdo)
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
#define NULL
Definition: types.h:112
#define STATUS_SUCCESS
Definition: shellext.h:65
static SERVICE_STATUS status
Definition: service.c:31
#define DO_NOTHING()
Definition: mxgeneral.h:32
Definition: ps.c:97

◆ 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  //
151  if (m_SymbolicLinkName.Buffer != NULL) {
153  }
154 }
_In_ ULONG _In_ ULONG State
Definition: potypes.h:516
UNICODE_STRING m_SymbolicLinkName
static __inline NTSTATUS MxSetDeviceInterfaceState(_In_ PUNICODE_STRING SymbolicLinkName, _In_ BOOLEAN Enable)
Definition: mxgeneralkm.h:608
#define NULL
Definition: types.h:112

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: