30#if defined(EVENT_TRACING)
31#include "FxResource.hpp.tmh"
36#if (FX_CORE_MODE==FX_CORE_USER_MODE)
81 *RegisterTable =
NULL;
88 "Failed to allocate Resource table %!STATUS!",
status);
92 *RegisterTable =
table;
183 "Failed to allocate Resource table %!STATUS!",
status);
350#if (FX_CORE_MODE==FX_CORE_USER_MODE)
385#if (FX_CORE_MODE==FX_CORE_USER_MODE)
421 resList =
new(FxDriverGlobals, ListAttributes)
424 if (resList ==
NULL) {
430 "Failed to allocate FxCmResList, "
431 "returning %!STATUS!",
441 if (
NULL != resList) {
479#if (FX_CORE_MODE == FX_CORE_USER_MODE)
486#pragma prefast(suppress:__WARNING_UNEXPECTED_IRQL_CHANGE, "UM has no IRQL")
499#pragma prefast(suppress:__WARNING_UNEXPECTED_IRQL_CHANGE, "UM has no IRQL")
659 *ResourceReqList =
NULL;
664 resReqList =
new(FxDriverGlobals, ListAttributes)
666 if (resReqList ==
NULL) {
671 "Failed to allocate FxIoResReqList, "
672 "returning %!STATUS!",
678 *ResourceReqList = resReqList;
683 if (
NULL != resReqList) {
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
HRESULT ValidatePortAddressRange(__in PVOID Address, __in SIZE_T Length)
VOID DeletePortResourceTable(VOID)
static _Must_inspect_result_ NTSTATUS _CreateAndInit(__in FxCmResList **ResourceList, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in CfxDevice *Device, __in_opt PWDF_OBJECT_ATTRIBUTES ListAttributes, __in UCHAR AccessFlags)
BOOLEAN m_HasConnectionResources
PCM_PARTIAL_RESOURCE_DESCRIPTOR GetDescriptor(__in ULONG Index)
VOID ValidateResourceUnmap(VOID)
FxRegisterResourceInfo * m_RegisterResourceTable
_Must_inspect_result_ PCM_RESOURCE_LIST CreateWdmList(__in __drv_strictTypeMatch(__drv_typeExpr) POOL_TYPE PoolType=PagedPool)
HRESULT ValidateAndClearMapping(__in PVOID Address, __in SIZE_T Length)
NTSTATUS BuildPortResourceTable(VOID)
HRESULT ValidateRegisterSystemBaseAddress(__in PVOID Address, __out PVOID *UsermodeBaseAddress)
SIZE_T GetResourceLength(__in PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor, __out_opt PHYSICAL_ADDRESS *Start)
VOID DeleteRegisterResourceTable(VOID)
WDFCMRESLIST GetHandle(VOID)
HRESULT ValidateRegisterPhysicalAddressRange(__in PHYSICAL_ADDRESS PhysicalAddress, __in SIZE_T Size, __out FxRegisterResourceInfo **TableEntry)
ULONG m_RegisterResourceTableSizeCe
FxPortResourceInfo * m_PortResourceTable
HRESULT ValidateRegisterSystemAddressRange(__in PVOID SystemAddress, __in SIZE_T Length, __out_opt PVOID *UsermodeAddress)
__inline void LockResourceTable()
FxCmResList(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in UCHAR AccessFlags)
_Must_inspect_result_ NTSTATUS CheckForConnectionResources(VOID)
ULONG m_PortResourceTableSizeCe
HRESULT MapIoSpaceWorker(__in PHYSICAL_ADDRESS PhysicalAddress, __in SIZE_T NumberOfBytes, __in MEMORY_CACHING_TYPE CacheType, __deref_out VOID **PseudoBaseAddress)
NTSTATUS BuildRegisterResourceTable(VOID)
BOOLEAN HasConnectionResources(VOID)
MxLock m_ResourceTableLock
VOID UpdateRegisterResourceEntryLocked(__in FxRegisterResourceInfo *Entry, __in PVOID SystemMappedAddress, __in SIZE_T NumberOfBytes, __in PVOID UsermodeMappedAddress)
_Must_inspect_result_ NTSTATUS BuildFromWdmList(__in PCM_RESOURCE_LIST ResourceList, __in UCHAR AccessFlags)
VOID ClearRegisterResourceEntryLocked(__in FxRegisterResourceInfo *Entry)
__inline void UnlockResourceTable()
WDFIORESLIST GetHandle(VOID)
_Must_inspect_result_ NTSTATUS BuildFromWdmList(__deref_in PIO_RESOURCE_LIST *WdmResourceList)
FxIoResReqList * m_OwningList
FxIoResList(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxIoResReqList *RequirementsList)
_Must_inspect_result_ PIO_RESOURCE_REQUIREMENTS_LIST CreateWdmList(VOID)
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)
INTERFACE_TYPE m_InterfaceType
WDFIORESREQLIST GetHandle(VOID)
FxIoResReqList(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in UCHAR AccessFlags=FxResourceNoAccess)
VOID MarkNoDeleteDDI(__in FxObjectLockState State=ObjectLock)
VOID DeleteFromFailedCreate(VOID)
CM_PARTIAL_RESOURCE_DESCRIPTOR m_DescriptorClone
DECLARE_INTERNAL_NEW_OPERATOR()
FxResourceCm(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PCM_PARTIAL_RESOURCE_DESCRIPTOR Resource)
CM_PARTIAL_RESOURCE_DESCRIPTOR m_Descriptor
FxResourceCollection(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in WDFTYPE Type, __in USHORT Size, __in UCHAR AccessFlags=FxResourceNoAccess)
BOOLEAN IsRemoveAllowed(VOID)
BOOLEAN RemoveAndDelete(__in ULONG Index)
BOOLEAN IsAddAllowed(VOID)
_Must_inspect_result_ NTSTATUS AddAt(__in ULONG Index, __in FxObject *Object)
IO_RESOURCE_DESCRIPTOR m_Descriptor
DECLARE_INTERNAL_NEW_OPERATOR()
FxResourceIo(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PIO_RESOURCE_DESCRIPTOR Resource)
IO_RESOURCE_DESCRIPTOR m_DescriptorClone
#define NT_SUCCESS(StatCode)
#define __drv_strictTypeMatch(mode)
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
return pObject GetObjectHandle()
_Must_inspect_result_ _In_ WDFDEVICE _In_ PHYSICAL_ADDRESS _In_ SIZE_T _In_ MEMORY_CACHING_TYPE _Out_ PVOID * PseudoBaseAddress
#define FLAG_TO_BOOL(_Flags, _FlagMask)
@ FxResourceRemoveAllowed
@ FxResourceAllAccessAllowed
@ FX_TYPE_IO_RES_REQ_LIST
enum _INTERFACE_TYPE INTERFACE_TYPE
#define _Must_inspect_result_
#define UNREFERENCED_PARAMETER(P)
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define TRACE_LEVEL_ERROR
base of all file and directory entries
VOID SetPhysicalAddress(__in PHYSICAL_ADDRESS StartPa, __in SIZE_T Length)
static NTSTATUS _CreateAndInit(_In_ PFX_DRIVER_GLOBALS DriverGlobals, _In_ ULONG Count, _Out_ FxPortResourceInfo **PortTable)
PHYSICAL_ADDRESS m_StartPa
static NTSTATUS _CreateAndInit(_In_ PFX_DRIVER_GLOBALS DriverGlobals, _In_ ULONG Count, _Out_ FxRegisterResourceInfo **RegisterTable)
VOID SetPhysicalAddress(__in PHYSICAL_ADDRESS StartPa, __in SIZE_T Length)
VOID ClearMappedAddress(VOID)
~FxRegisterResourceInfo()
PHYSICAL_ADDRESS m_StartPa
FxRegisterResourceInfo(VOID)
VOID SetMappedAddress(__in PVOID SystemBaseAddress, __in SIZE_T MappedLength, __in PVOID UsermodeBaseAddress)
#define RtlCopyMemory(Destination, Source, Length)
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_ WDFDEVICE Device
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
_In_ WDFIORESREQLIST RequirementsList
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS PhysicalAddress
_Must_inspect_result_ typedef _In_ ULONG TableEntry
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
_Must_inspect_result_ _In_ PHYSICAL_ADDRESS _In_ PHYSICAL_ADDRESS _In_opt_ PHYSICAL_ADDRESS _In_ MEMORY_CACHING_TYPE CacheType
enum _MEMORY_CACHING_TYPE MEMORY_CACHING_TYPE