ReactOS 0.4.16-dev-197-g92996da
fxdeviceinterfaceapi.cpp File Reference
#include "fxsupportpch.hpp"
Include dependency graph for fxdeviceinterfaceapi.cpp:

Go to the source code of this file.

Functions

_Must_inspect_result_ __drv_maxIRQL (PASSIVE_LEVEL) NTSTATUS STDCALL WDFEXPORT(WdfDeviceCreateDeviceInterface)(__in PWDF_DRIVER_GLOBALS DriverGlobals
 
 FxObjectHandleGetPtrAndGlobals (GetFxDriverGlobals(DriverGlobals), Device, FX_TYPE_DEVICE,(PVOID *) &pDevice, &pFxDriverGlobals)
 
 FxPointerNotNull (pFxDriverGlobals, InterfaceClassGUID)
 
 if (!NT_SUCCESS(status))
 
 if (ReferenceString !=NULL)
 
 if (pDevice->IsLegacy())
 
 if (pDeviceInterface==NULL)
 
pPkgPnp m_DeviceInterfaceLock AcquireLock (pFxDriverGlobals)
 
 if (NT_SUCCESS(status))
 
pPkgPnp m_DeviceInterfaceLock ReleaseLock (pFxDriverGlobals)
 
 if (RefString !=NULL)
 
 for (ple=pPkgPnp->m_DeviceInterfaceHead.Next;ple !=NULL;ple=ple->Next)
 
 FxObjectHandleGetPtr (pFxDriverGlobals, String, FX_TYPE_STRING,(PVOID *) &pString)
 

Variables

_Must_inspect_result_ __in WDFDEVICE Device
 
_Must_inspect_result_ __in WDFDEVICE __in CONST GUIDInterfaceClassGUID
 
_Must_inspect_result_ __in WDFDEVICE __in CONST GUID __in_opt PCUNICODE_STRING ReferenceString
 
SINGLE_LIST_ENTRY ** ppPrev
 
SINGLE_LIST_ENTRYpCur
 
PFX_DRIVER_GLOBALS pFxDriverGlobals
 
FxDeviceInterfacepDeviceInterface = new(pFxDriverGlobals, PagedPool) FxDeviceInterface()
 
FxDevicepDevice
 
FxPkgPnppPkgPnp = pDevice->m_PkgPnp
 
NTSTATUS status = FxVerifierCheckIrqlLevel(pFxDriverGlobals, PASSIVE_LEVEL)
 
Done __pad0__
 
__in WDFDEVICE __in CONST GUID __in_opt PCUNICODE_STRING RefString
 
__in WDFDEVICE __in CONST GUID __in_opt PCUNICODE_STRING __in BOOLEAN State
 
PSINGLE_LIST_ENTRY ple
 
_Must_inspect_result_ __in WDFDEVICE __in CONST GUID __in_opt PCUNICODE_STRING __in WDFSTRING String
 
FxStringpString
 

Function Documentation

◆ __drv_maxIRQL()

_Must_inspect_result_ __drv_maxIRQL ( PASSIVE_LEVEL  )

◆ AcquireLock()

◆ for()

for ( ple  = pPkgPnp->m_DeviceInterfaceHead.Next; ple != NULLple = ple->Next)

Definition at line 228 of file fxdeviceinterfaceapi.cpp.

228 {
230
232
234 if (RefString != NULL) {
235 if ((RefString->Length == pDI->m_ReferenceString.Length)
236 &&
239 RefString->Length) == RefString->Length)) {
240 //
241 // They match, carry on
242 //
243 DO_NOTHING();
244 }
245 else {
246 //
247 // The ref strings do not match, continue on in the search
248 // of the collection.
249 //
250 continue;
251 }
252 }
253 else if (pDI->m_ReferenceString.Length > 0) {
254 //
255 // Caller didn't specify a ref string but this interface has
256 // one, continue on in the search through the collection.
257 //
258 continue;
259 }
260
261 //
262 // Set the state and break out of the loop because we found our
263 // interface.
264 //
265 pDI->SetState(State);
266 break;
267 }
268 }
VOID SetState(__in BOOLEAN State)
static FxDeviceInterface * _FromEntry(__in PSINGLE_LIST_ENTRY Entry)
UNICODE_STRING m_ReferenceString
#define NULL
Definition: types.h:112
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
__in WDFDEVICE __in CONST GUID __in_opt PCUNICODE_STRING RefString
PSINGLE_LIST_ENTRY ple
_Must_inspect_result_ BOOLEAN __inline FxIsEqualGuid(__in CONST GUID *Lhs, __in CONST GUID *Rhs)
Definition: fxglobals.h:977
#define DO_NOTHING()
Definition: mxgeneral.h:32
_Must_inspect_result_ _In_ WDFDEVICE _In_ CONST GUID * InterfaceClassGUID
Definition: wdfdevice.h:3627

◆ FxObjectHandleGetPtr()

FxObjectHandleGetPtr ( pFxDriverGlobals  ,
String  ,
FX_TYPE_STRING  ,
(PVOID *) &  pString 
)

◆ FxObjectHandleGetPtrAndGlobals()

FxObjectHandleGetPtrAndGlobals ( GetFxDriverGlobals(DriverGlobals ,
Device  ,
FX_TYPE_DEVICE  ,
(PVOID *) &  pDevice,
pFxDriverGlobals 
)

◆ FxPointerNotNull()

FxPointerNotNull ( pFxDriverGlobals  ,
InterfaceClassGUID   
)

◆ if() [1/6]

if ( NT_SUCCESSstatus)

Definition at line 87 of file fxdeviceinterfaceapi.cpp.

87 {
88 return status;
89 }
NTSTATUS status

◆ if() [2/6]

if ( NT_SUCCESS(status )

Definition at line 141 of file fxdeviceinterfaceapi.cpp.

141 {
142 //
143 // Insert into the end of the list
144 //
147 while (pCur != NULL) {
148 ppPrev = &pCur->Next;
149 pCur = pCur->Next;
150 }
151
153 }
SINGLE_LIST_ENTRY m_Entry
SINGLE_LIST_ENTRY m_DeviceInterfaceHead
Definition: fxpkgpnp.hpp:4126
SINGLE_LIST_ENTRY * pCur
FxDeviceInterface * pDeviceInterface
FxPkgPnp * pPkgPnp
SINGLE_LIST_ENTRY ** ppPrev
struct _SINGLE_LIST_ENTRY * Next
Definition: ntbasedef.h:629

◆ if() [3/6]

if ( pDevice->  IsLegacy())

Definition at line 98 of file fxdeviceinterfaceapi.cpp.

98 {
100
103 "WDFDEVICE %p is not a PNP device, device interface creation not "
104 "allowed %!STATUS!", Device, status);
105
106 return status;
107 }
#define TRACINGERROR
Definition: dbgtrace.h:63
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
Definition: ps.c:97
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474

◆ if() [4/6]

if ( pDeviceInterface  = NULL)

Definition at line 111 of file fxdeviceinterfaceapi.cpp.

111 {
113
116 "WDFDEVICE %p DeviceInterface object creation failed, %!STATUS!",
117 Device, status);
118
119 return status;
120 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158

◆ if() [5/6]

if ( ReferenceString = NULL)

Definition at line 91 of file fxdeviceinterfaceapi.cpp.

91 {
93 if (!NT_SUCCESS(status)) {
94 return status;
95 }
96 }
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
_Must_inspect_result_ NTSTATUS __inline FxValidateUnicodeString(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PCUNICODE_STRING String)
_Must_inspect_result_ _In_ WDFDEVICE _In_ CONST GUID _In_opt_ PCUNICODE_STRING ReferenceString
Definition: wdfdevice.h:3630

◆ if() [6/6]

if ( RefString = NULL)

Definition at line 204 of file fxdeviceinterfaceapi.cpp.

204 {
206 if (!NT_SUCCESS(status)) {
208 return;
209 }
210 }
FxVerifierDbgBreakPoint(pFxDriverGlobals)

◆ ReleaseLock()

pPkgPnp m_DeviceInterfaceLock ReleaseLock ( pFxDriverGlobals  )

Referenced by LpcpFreeToPortZone().

Variable Documentation

◆ __pad0__

Done __pad0__

Definition at line 157 of file fxdeviceinterfaceapi.cpp.

◆ Device

Definition at line 45 of file fxdeviceinterfaceapi.cpp.

◆ InterfaceClassGUID

◆ pCur

◆ pDevice

FxDevice* pDevice

Definition at line 74 of file fxdeviceinterfaceapi.cpp.

◆ pDeviceInterface

◆ pFxDriverGlobals

PFX_DRIVER_GLOBALS pFxDriverGlobals

Definition at line 72 of file fxdeviceinterfaceapi.cpp.

Referenced by if().

◆ ple

Definition at line 184 of file fxdeviceinterfaceapi.cpp.

Referenced by FxIoTarget::_CancelSentRequests(), FxDeviceText::_CleanupList(), FxUsbDevice::_CleanupPipesRequests(), FxWmiIrpHandler::_RegInfo(), FxResourceCollection::AddAt(), FxChildList::BeginScan(), FxPkgPnp::ChildListNotifyRemove(), FxIoTarget::CompletePendedRequestList(), FxObject::DestroyChildren(), FxPkgPnp::Dispose(), Fbt_Dispatch(), FxCollectionInternal::FindEntry(), FxCollectionInternal::FindEntryByObject(), FindObjectForGivenLocale(), FxWmiIrpHandler::FindProviderLocked(), for(), FxIoQueue::ForwardRequestWorker(), FxPoolDump(), GdiPoolAllocate(), GdiPoolDestroy(), GdiPoolFree(), FxWmiProvider::GetInstanceIndex(), FxWmiProvider::GetInstanceReferencedLocked(), FxChildList::GetNextDevice(), FxTransactionedList::GetNextEntryLocked(), FxPkgIo::GetNextIoQueueLocked(), FxChildList::GetNextStaticDevice(), FxIoTarget::GetSentRequestsListLocked(), FxPkgPnp::HandleQueryBusRelations(), FxPkgPnp::HandleQueryInterface(), FxChildList::IndicateWakeStatus(), FxChildList::InvokeReportedMissingCallback(), FxDevice::IsInterfaceRegistered(), FxPkgPnp::NotifyResourceObjectsD0(), FxPkgPnp::NotifyResourceObjectsDx(), FxPkgPnp::PnpAssignInterruptsSyncIrql(), FxPkgPnp::PnpDisableInterfaces(), FxPkgPnp::PnpEnableInterfacesAndRegisterWmi(), FxPkgPnp::PnpEventSurpriseRemovePendingOverload(), FxPkgPnp::PnpMatchResources(), FxPkgPdo::PnpQueryResourceRequirements(), FxChildList::PostParentToD0(), FxPkgPnp::PowerCompletePendedWakeIrp(), FxPkgPnp::PowerDmaEnableAndScan(), FxPkgPnp::PowerPolicyDisarmWakeFromSx(), FxPkgPnp::PowerPolicyPostParentToD0ToChildren(), FxRelatedDeviceList::ProcessAdd(), FxChildList::ProcessBusRelations(), FxTransactionedList::ProcessObjectsToRelease(), FxTransactionedList::ProcessTransactionList(), FxPkgIo::ResetStateForRestart(), FxPkgIo::ResumeProcessingForPower(), FxChildList::SearchBackwardsForMatchingDescriptionLocked(), FxChildList::SearchBackwardsForMatchingModificationLocked(), FxTransactionedList::SearchForAndRemove(), FxPkgPnp::SendEventToAllWakeInterrupts(), FxUsbDevice::Start(), FxCollection::StealCollection(), FxPkgIo::StopProcessingForPower(), FxIoTarget::SubmitPendedRequests(), FxSystemThread::Thread(), FxChildList::UpdateDeviceAsMissing(), FxChildList::VerifyDescriptionEntry(), FxChildList::VerifyModificationEntry(), FxPkgPnp::~FxPkgPnp(), and FxTransactionedList::~FxTransactionedList().

◆ pPkgPnp

◆ ppPrev

Definition at line 71 of file fxdeviceinterfaceapi.cpp.

Referenced by FxPkgPnp::AddQueryInterface(), and if().

◆ pString

FxString* pString

Definition at line 309 of file fxdeviceinterfaceapi.cpp.

◆ ReferenceString

Initial value:
{
#define DDI_ENTRY()
Definition: fxglobalskm.h:56

Definition at line 49 of file fxdeviceinterfaceapi.cpp.

◆ RefString

◆ State

Initial value:

Definition at line 179 of file fxdeviceinterfaceapi.cpp.

◆ status

◆ String

Initial value:

Definition at line 287 of file fxdeviceinterfaceapi.cpp.