ReactOS  0.4.15-dev-3316-g067ca88
FxIoResReqList Class Reference

#include <fxresource.hpp>

Inheritance diagram for FxIoResReqList:
Collaboration diagram for FxIoResReqList:

Public Member Functions

WDFIORESREQLIST GetHandle (VOID)
 
_Must_inspect_result_ PIO_RESOURCE_REQUIREMENTS_LIST CreateWdmList (VOID)
 
- Public Member Functions inherited from FxResourceCollection
BOOLEAN RemoveAndDelete (__in ULONG Index)
 
_Must_inspect_result_ NTSTATUS AddAt (__in ULONG Index, __in FxObject *Object)
 
BOOLEAN IsRemoveAllowed (VOID)
 
BOOLEAN IsAddAllowed (VOID)
 
VOID MarkChanged (VOID)
 
BOOLEAN IsChanged (VOID)
 
- Public Member Functions inherited from FxCollection
 FxCollection (__in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
 ~FxCollection (VOID)
 
BOOLEAN Add (__in FxObject *Item)
 
VOID StealCollection (__in FxCollection *Collection)
 
- Public Member Functions inherited from FxNonPagedObject
 FxNonPagedObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
 FxNonPagedObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObjectType ObjectType)
 
virtual ~FxNonPagedObject (VOID)
 
 _Acquires_lock_ (this->m_NPLock.m_Lock) __drv_maxIRQL(DISPATCH_LEVEL) __drv_setsIRQL(DISPATCH_LEVEL) VOID Lock(__out __drv_deref(__drv_savesIRQL) PKIRQL PreviousIrql)
 
 _Releases_lock_ (this->m_NPLock.m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) __inline VOID Unlock(__in __drv_restoresIRQL KIRQL PreviousIrql)
 
 _Acquires_lock_ (this->m_NPLock.m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) VOID LockAtDispatch(VOID)
 
 _Requires_lock_held_ (this->m_NPLock.m_Lock) _Releases_lock_(this -> m_NPLock.m_Lock) __drv_requiresIRQL(DISPATCH_LEVEL) __inline VOID UnlockFromDispatch(VOID)
 
- Public Member Functions inherited from FxObject
PVOID GetCOMWrapper ()
 
void SetCOMWrapper (__drv_aliasesMem PVOID Wrapper)
 
 FxObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
virtual ~FxObject (VOID)
 
PVOID __inline operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObjectType Type)
 
PVOID __inline operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __in USHORT ExtraSize=0)
 
VOID operator delete (__in PVOID Memory)
 
VOID SetNoContextHeader (VOID)
 
PVOID __inline GetObjectHandle (VOID)
 
__inline FxContextHeaderGetContextHeader (VOID)
 
__inline PFX_DRIVER_GLOBALS GetDriverGlobals (VOID)
 
WDFTYPE GetType (VOID)
 
USHORT GetObjectSize (VOID)
 
LONG GetRefCnt (VOID)
 
FxTagTrackerGetTagTracker (VOID)
 
CfxDeviceGetDevice (VOID)
 
CfxDeviceBaseGetDeviceBase (VOID)
 
VOID SetDeviceBase (__in CfxDeviceBase *DeviceBase)
 
__inline VOID CallCleanup (VOID)
 
ULONG __inline AddRef (__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual ULONG Release (__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual ULONG AddRefOverride (__in WDFOBJECT_OFFSET Offset, __in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual ULONG ReleaseOverride (__in WDFOBJECT_OFFSET Offset, __in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
 
virtual _Must_inspect_result_ NTSTATUS QueryInterface (__in FxQueryInterfaceParams *Params)
 
VOID MarkTraceState (VOID)
 
BOOLEAN __inline IsTraceState (VOID)
 
VOID __inline TraceDroppedEvent (__in FxObjectDroppedEvent Event)
 
VOID MarkPassiveDispose (__in FxObjectLockState State=ObjectLock)
 
VOID MarkPassiveCallbacks (__in FxObjectLockState State=ObjectLock)
 
VOID MarkForceDisposeThread (__in FxObjectLockState State=ObjectLock)
 
BOOLEAN IsPassiveCallbacks (__in BOOLEAN AcquireLock=TRUE)
 
BOOLEAN IsPassiveDispose (__in BOOLEAN AcquireLock=TRUE)
 
BOOLEAN IsForceDisposeThread (__in BOOLEAN AcquireLock=TRUE)
 
VOID MarkCommitted (VOID)
 
BOOLEAN IsCommitted (VOID)
 
VOID MarkDisposeOverride (__in FxObjectLockState State=ObjectLock)
 
VOID MarkNoDeleteDDI (__in FxObjectLockState State=ObjectLock)
 
BOOLEAN IsNoDeleteDDI (VOID)
 
_Must_inspect_result_ NTSTATUS Commit (__in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __out_opt WDFOBJECT *ObjectHandle, __in_opt FxObject *Parent=NULL, __in BOOLEAN AssignDriverAsDefaultParent=TRUE)
 
VOID DeleteFromFailedCreate (VOID)
 
VOID ClearEvtCallbacks (VOID)
 
BOOLEAN EarlyDispose (VOID)
 
virtual VOID DeleteObject (VOID)
 
virtual BOOLEAN Dispose (VOID)
 
_Must_inspect_result_ NTSTATUS AssignParentObject (__in FxObject *ParentObject)
 
_Must_inspect_result_ NTSTATUS AddContext (__in FxContextHeader *Header, __in PVOID *Context, __in PWDF_OBJECT_ATTRIBUTES Attributes)
 
_Must_inspect_result_ NTSTATUS RemoveParentAssignment (VOID)
 
_Must_inspect_result_ FxObjectGetParentObjectReferenced (__in PVOID Tag)
 
BOOLEAN IsDisposed (VOID)
 
- Public Member Functions inherited from FxCollectionInternal
 FxCollectionInternal (VOID)
 
 ~FxCollectionInternal (VOID)
 
_Must_inspect_result_ FxCollectionEntryFindEntry (__in ULONG Index)
 
_Must_inspect_result_ FxCollectionEntryFindEntryByObject (__in FxObject *Object)
 
ULONG Count (VOID)
 
BOOLEAN Add (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObject *Item)
 
_Must_inspect_result_ FxObjectGetItem (__in ULONG Index)
 
_Must_inspect_result_ FxObjectGetFirstItem (VOID)
 
_Must_inspect_result_ FxObjectGetLastItem (VOID)
 
NTSTATUS Remove (__in ULONG Index)
 
VOID CleanupEntry (__in FxCollectionEntry *Entry)
 
VOID CleanupEntryObject (__in FxObject *Object)
 
NTSTATUS RemoveEntry (__in FxCollectionEntry *Entry)
 
_Must_inspect_result_ NTSTATUS RemoveItem (__in FxObject *Item)
 
_Must_inspect_result_ FxCollectionEntryStart (VOID)
 
_Must_inspect_result_ FxCollectionEntryEnd (VOID)
 
VOID Clear (VOID)
 

Static Public Member Functions

static _Must_inspect_result_ NTSTATUS _CreateAndInit (__in FxIoResReqList **ResourceReqList, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in_opt PWDF_OBJECT_ATTRIBUTES ListAttributes, __in UCHAR AccessFlags)
 
static _Must_inspect_result_ FxIoResReqList_CreateFromWdmList (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PIO_RESOURCE_REQUIREMENTS_LIST WdmRequirementsList, __in UCHAR AccessFlags)
 
- Static Public Member Functions inherited from FxObject
static FxObject_FromDisposeEntry (__in PSINGLE_LIST_ENTRY Entry)
 
static FxObject_GetObjectFromHandle (__in WDFOBJECT Handle, __inout PWDFOBJECT_OFFSET ObjectOffset)
 
static PVOID __inline _ToHandle (__in FxObject *Object)
 
static VOID __inline _ReferenceActual (__in WDFOBJECT Object, __in_opt PVOID Tag, __in LONG Line, __in PSTR File)
 
static VOID __inline _DereferenceActual (__in WDFOBJECT Object, __in_opt PVOID Tag, __in LONG Line, __in PSTR File)
 
static PVOID _GetDebugBase (__in FxObject *Object)
 
static PFX_POOL_HEADER _CleanupPointer (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObject *Object)
 
static _Must_inspect_result_ NTSTATUS _GetEffectiveLock (__in FxObject *Object, __in_opt IFxHasCallbacks *Callbacks, __in BOOLEAN AutomaticLocking, __in BOOLEAN PassiveCallbacks, __out FxCallbackLock **CallbackLock, __out_opt FxObject **CallbackLockObject)
 
static _Must_inspect_result_ NTSTATUS _ObjectQuery (_In_ FxObject *Object, _In_ CONST GUID *Guid, _In_ ULONG QueryBufferLength, _Out_writes_bytes_(QueryBufferLength) PVOID QueryBuffer)
 

Public Attributes

ULONG m_SlotNumber
 
INTERFACE_TYPE m_InterfaceType
 
- Public Attributes inherited from FxResourceCollection
UCHAR m_AccessFlags
 
BOOLEAN m_Changed
 

Protected Member Functions

 FxIoResReqList (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in UCHAR AccessFlags=FxResourceNoAccess)
 
- Protected Member Functions inherited from FxResourceCollection
 FxResourceCollection (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in WDFTYPE Type, __in USHORT Size, __in UCHAR AccessFlags=FxResourceNoAccess)
 
- Protected Member Functions inherited from FxCollection
 FxCollection (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in WDFTYPE Type, __in USHORT Size)
 
- Protected Member Functions inherited from FxObject
 FxObject (__in WDFTYPE Type, __in USHORT Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObjectType ObjectType)
 
FxObjectDebugExtensionGetDebugExtension (VOID)
 
BOOLEAN IsDebug (VOID)
 
VOID AllocateTagTracker (__in WDFTYPE Type)
 
virtual VOID SelfDestruct (VOID)
 
PVOID __inline GetObjectHandleUnchecked (VOID)
 
VOID __inline DestroyChildren (VOID)
 
VOID DeleteEarlyDisposedObject (VOID)
 
- Protected Member Functions inherited from FxCollectionInternal
_Must_inspect_result_ FxCollectionEntryAllocateEntry (__in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
VOID AddEntry (__in FxCollectionEntry *Node, __in FxObject *Item)
 

Additional Inherited Members

- Static Protected Member Functions inherited from FxObject
static PVOID _GetBase (__in FxObject *Object)
 
- Protected Attributes inherited from FxObject
union {
   CfxDeviceBase *   m_DeviceBase
 
   CfxDevice *   m_Device
 
}; 
 
- Protected Attributes inherited from FxCollectionInternal
ULONG m_Count
 
LIST_ENTRY m_ListHead
 

Detailed Description

Definition at line 626 of file fxresource.hpp.

Constructor & Destructor Documentation

◆ FxIoResReqList()

FxIoResReqList::FxIoResReqList ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals,
__in UCHAR  AccessFlags = FxResourceNoAccess 
)
inlineprotected

Definition at line 628 of file fxresource.hpp.

631  :
632  FxResourceCollection(FxDriverGlobals,
634  sizeof(FxIoResReqList),
635  AccessFlags),
637  {
638  m_AccessFlags = AccessFlags;
639  }
INTERFACE_TYPE m_InterfaceType
Definition: fxresource.hpp:716
FxResourceCollection(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in WDFTYPE Type, __in USHORT Size, __in UCHAR AccessFlags=FxResourceNoAccess)
Definition: fxresource.hpp:282

Referenced by _CreateAndInit(), and _CreateFromWdmList().

Member Function Documentation

◆ _CreateAndInit()

static _Must_inspect_result_ NTSTATUS FxIoResReqList::_CreateAndInit ( __in FxIoResReqList **  ResourceReqList,
__in PFX_DRIVER_GLOBALS  FxDriverGlobals,
__in_opt PWDF_OBJECT_ATTRIBUTES  ListAttributes,
__in UCHAR  AccessFlags 
)
inlinestatic

Definition at line 646 of file fxresource.hpp.

652  {
653  NTSTATUS ntStatus;
654  FxIoResReqList *resReqList = NULL;
655 
656  //
657  // Initialize
658  //
659  *ResourceReqList = NULL;
660 
661  //
662  // Allocate a new resource list object
663  //
664  resReqList = new(FxDriverGlobals, ListAttributes)
665  FxIoResReqList(FxDriverGlobals, AccessFlags);
666  if (resReqList == NULL) {
668 
669  DoTraceLevelMessage(FxDriverGlobals, TRACE_LEVEL_ERROR,
671  "Failed to allocate FxIoResReqList, "
672  "returning %!STATUS!",
673  ntStatus);
674 
675  goto exit;
676  }
677 
678  *ResourceReqList = resReqList;
679  ntStatus = STATUS_SUCCESS;
680 
681  exit:
682  if (!NT_SUCCESS(ntStatus)) {
683  if (NULL != resReqList) {
684  resReqList->DeleteFromFailedCreate();
685  }
686  }
687  return ntStatus;
688  }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
LONG NTSTATUS
Definition: precomp.h:26
#define TRACINGDEVICE
Definition: dbgtrace.h:58
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define NULL
Definition: types.h:112
VOID DeleteFromFailedCreate(VOID)
Definition: fxobject.cpp:391
FxIoResReqList(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in UCHAR AccessFlags=FxResourceNoAccess)
Definition: fxresource.hpp:628
#define STATUS_SUCCESS
Definition: shellext.h:65
void exit(int exitcode)
Definition: _exit.c:33

Referenced by FxPkgPdo::PnpQueryResourceRequirements().

◆ _CreateFromWdmList()

_Must_inspect_result_ FxIoResReqList * FxIoResReqList::_CreateFromWdmList ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals,
__in PIO_RESOURCE_REQUIREMENTS_LIST  WdmRequirementsList,
__in UCHAR  AccessFlags 
)
static

Definition at line 477 of file fxresourcecollection.cpp.

499 {
501  ULONG i;
502 
503  pIoResReqList = new(FxDriverGlobals, WDF_NO_OBJECT_ATTRIBUTES)
504  FxIoResReqList(FxDriverGlobals, AccessFlags);
505 
506  if (pIoResReqList != NULL) {
507  PIO_RESOURCE_LIST pWdmResourceList;
509 
510  if (WdmRequirementsList == NULL) {
511  return pIoResReqList;
512  }
513 
515  pWdmResourceList = &WdmRequirementsList->List[0];
516 
517  pIoResReqList->m_InterfaceType = WdmRequirementsList->InterfaceType;
518  pIoResReqList->m_SlotNumber = WdmRequirementsList->SlotNumber;
519 
520  for (i = 0; i < WdmRequirementsList->AlternativeLists; i++) {
522 
523  pResList = new(FxDriverGlobals, WDF_NO_OBJECT_ATTRIBUTES)
524  FxIoResList(FxDriverGlobals, pIoResReqList);
525 
526  if (pResList != NULL) {
528 
529  //
530  // Since we control our own lifetime, assigning the parent should
531  // never fail.
532  //
534 
535  status = pResList->BuildFromWdmList(&pWdmResourceList);
536  }
537  else {
538  //
539  // We failed to allocate a child collection. Clean up
540  // and break out of the loop.
541  //
543  }
544 
545  if (!NT_SUCCESS(status)) {
546  break;
547  }
548  }
549 
550  if (!NT_SUCCESS(status)) {
551  //
552  // Cleanup and return a NULL object
553  //
556  }
557  }
558 
559  return pIoResReqList;
560 }
virtual VOID DeleteObject(VOID)
INTERFACE_TYPE m_InterfaceType
Definition: fxresource.hpp:716
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
LONG NTSTATUS
Definition: precomp.h:26
FxIoResReqList * pIoResReqList
_Must_inspect_result_ NTSTATUS BuildFromWdmList(__deref_in PIO_RESOURCE_LIST *WdmResourceList)
#define ASSERT(a)
Definition: mode.c:44
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
FxIoResList * pResList
_Must_inspect_result_ NTSTATUS AssignParentObject(__in FxObject *ParentObject)
Definition: fxobject.cpp:529
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define NULL
Definition: types.h:112
#define WDF_NO_OBJECT_ATTRIBUTES
Definition: wdftypes.h:105
unsigned int ULONG
Definition: retypes.h:1
FxIoResReqList(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in UCHAR AccessFlags=FxResourceNoAccess)
Definition: fxresource.hpp:628
#define STATUS_SUCCESS
Definition: shellext.h:65
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

Referenced by FxPkgFdo::PnpFilterResourceRequirements().

◆ CreateWdmList()

_Must_inspect_result_ PIO_RESOURCE_REQUIREMENTS_LIST FxIoResReqList::CreateWdmList ( VOID  )

Definition at line 564 of file fxresourcecollection.cpp.

581 {
582  PIO_RESOURCE_REQUIREMENTS_LIST pRequirementsList;
585  ULONG totalDescriptors;
586  ULONG size;
587  ULONG count;
588  ULONG tmp;
590 
591  totalDescriptors = 0;
592  pRequirementsList = NULL;
593 
594  count = Count();
596 
597  if (count > 0) {
598  //
599  // The collection object should contain a set of child collections
600  // with each of the various requirement lists. Use the number of
601  // these collections to determine the size of our requirements
602  // list.
603  //
604  end = End();
605  for (cur = Start(); cur != end; cur = cur->Next()) {
606  status = RtlULongAdd(totalDescriptors,
607  ((FxIoResList *) cur->m_Object)->Count(),
608  &totalDescriptors);
609 
610  if (!NT_SUCCESS(status)) {
611  goto Overflow;
612  }
613  }
614 
615  //
616  // We now have enough information to determine how much memory we
617  // need to allocate for our requirements list.
618  //
619  // size = sizeof(IO_RESOURCE_REQUIREMENTS_LIST) +
620  // (sizeof(IO_RESOURCE_LIST) * (count - 1)) +
621  // (sizeof(IO_RESOURCE_DESCRIPTOR) * totalDescriptors) -
622  // (sizeof(IO_RESOURCE_DESCRIPTOR) * count);
623  //
624  // sizeof(IO_RESOURCE_DESCRIPTOR) * count is subtracted off because
625  // each IO_RESOURCE_LIST has an embedded IO_RESOURCE_DESCRIPTOR in it
626  // and we don't want to overallocated.
627  //
628 
629  //
630  // To handle overflow each mathematical operation is split out into an
631  // overflow safe call.
632  //
634 
635  // sizeof(IO_RESOURCE_LIST) * (count - 1)
636  status = RtlULongMult(sizeof(IO_RESOURCE_LIST), count - 1, &tmp);
637  if (!NT_SUCCESS(status)) {
638  goto Overflow;
639  }
640 
641  status = RtlULongAdd(size, tmp, &size);
642  if (!NT_SUCCESS(status)) {
643  goto Overflow;
644  }
645 
646  // (sizeof(IO_RESOURCE_DESCRIPTOR) * totalDescriptors)
647  status = RtlULongMult(sizeof(IO_RESOURCE_DESCRIPTOR),
648  totalDescriptors,
649  &tmp);
650  if (!NT_SUCCESS(status)) {
651  goto Overflow;
652  }
653 
654  status = RtlULongAdd(size, tmp, &size);
655  if (!NT_SUCCESS(status)) {
656  goto Overflow;
657  }
658 
659  // - sizeof(IO_RESOURCE_DESCRIPTOR) * Count() (note the subtraction!)
660  status = RtlULongMult(sizeof(IO_RESOURCE_DESCRIPTOR), count, &tmp);
661  if (!NT_SUCCESS(status)) {
662  goto Overflow;
663  }
664 
665  // Sub, not Add!
666  status = RtlULongSub(size, tmp, &size);
667  if (!NT_SUCCESS(status)) {
668  goto Overflow;
669  }
670 
671  pRequirementsList = (PIO_RESOURCE_REQUIREMENTS_LIST)
673 
674  if (pRequirementsList != NULL) {
676  FxResourceIo *pResource;
677 
678  pList = pRequirementsList->List;
679 
680  //
681  // Start by zero initializing our structure
682  //
683  RtlZeroMemory(pRequirementsList, size);
684 
685  //
686  // InterfaceType and BusNumber are unused for WDM, but InterfaceType
687  // is used by the arbiters.
688  //
689  pRequirementsList->InterfaceType = m_InterfaceType;
690 
691  pRequirementsList->SlotNumber = m_SlotNumber;
692 
693  //
694  // Now populate the requirements list with the resources from
695  // our collections.
696  //
697  pRequirementsList->ListSize = size;
698  pRequirementsList->AlternativeLists = Count();
699 
700  end = End();
701  for (cur = Start(); cur != end; cur = cur->Next()) {
703  PIO_RESOURCE_DESCRIPTOR pDescriptor;
704  FxCollectionEntry *pIoResCur, *pIoResEnd;
705 
707 
708  pList->Version = 1;
709  pList->Revision = 1;
710  pList->Count = pIoResList->Count();
711 
712  pDescriptor = pList->Descriptors;
713 
714  pIoResEnd = pIoResList->End();
715  for (pIoResCur = pIoResList->Start();
716  pIoResCur != pIoResEnd;
717  pIoResCur = pIoResCur->Next()) {
718 
719  pResource = (FxResourceIo *) pIoResCur->m_Object;
720  RtlCopyMemory(pDescriptor,
721  &pResource->m_Descriptor,
722  sizeof(pResource->m_Descriptor));
723  pDescriptor++;
724  }
725 
726  pList = (PIO_RESOURCE_LIST) pDescriptor;
727  }
728  }
729  }
730 
731  return pRequirementsList;
732 
733 Overflow:
735  "Integer overflow occured when computing size of "
736  "IO_RESOURCE_REQUIREMENTS_LIST");
737 
738  return NULL;
739 }
struct _IO_RESOURCE_REQUIREMENTS_LIST IO_RESOURCE_REQUIREMENTS_LIST
INTERFACE_TYPE m_InterfaceType
Definition: fxresource.hpp:716
struct _IO_RESOURCE_LIST * PIO_RESOURCE_LIST
_Must_inspect_result_ FxCollectionEntry * Start(VOID)
IO_RESOURCE_DESCRIPTOR m_Descriptor
Definition: fxresource.hpp:224
GLuint GLuint GLsizei count
Definition: gl.h:1545
FxIoResList * pIoResList
LONG NTSTATUS
Definition: precomp.h:26
struct _IO_RESOURCE_REQUIREMENTS_LIST * PIO_RESOURCE_REQUIREMENTS_LIST
static __inline PVOID MxAllocatePoolWithTag(__in POOL_TYPE PoolType, __in SIZE_T NumberOfBytes, __in ULONG Tag)
Definition: mxmemorykm.h:30
FxChildList * pList
_Must_inspect_result_ FxCollectionEntry * End(VOID)
GLsizeiptr size
Definition: glext.h:5919
PFX_DRIVER_GLOBALS pFxDriverGlobals
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
FxObject * m_Object
GLuint GLuint end
Definition: gl.h:1545
FxCollectionEntry * cur
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define TRACINGPNP
Definition: dbgtrace.h:67
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
static SERVICE_STATUS status
Definition: service.c:31
FxCollectionEntry * Next(VOID)
Definition: ps.c:97

Referenced by FxPkgFdo::PnpFilterResourceRequirements(), and FxPkgPdo::PnpQueryResourceRequirements().

◆ GetHandle()

WDFIORESREQLIST FxIoResReqList::GetHandle ( VOID  )
inline

Definition at line 691 of file fxresource.hpp.

694  {
695  return (WDFIORESREQLIST) GetObjectHandle();
696  }
PVOID __inline GetObjectHandle(VOID)
Definition: fxobject.hpp:603

Referenced by FxPkgFdo::PnpFilterResourceRequirements().

Member Data Documentation

◆ m_InterfaceType

INTERFACE_TYPE FxIoResReqList::m_InterfaceType

Definition at line 716 of file fxresource.hpp.

Referenced by __drv_strictTypeMatch(), _CreateFromWdmList(), and CreateWdmList().

◆ m_SlotNumber

ULONG FxIoResReqList::m_SlotNumber

Definition at line 714 of file fxresource.hpp.

Referenced by _CreateFromWdmList(), and CreateWdmList().


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