10#define TAG_ARBITER 'ibrA'
13#define ARBITER_MAXIMUM_ADDRESS ((ULONGLONG)~0ULL)
25#define ARBITER_PRIORITY_NULL 0x00000000
26#define ARBITER_PRIORITY_PREFERRED_RESERVED 0x7FFFFFFD
27#define ARBITER_PRIORITY_RESERVED 0x7FFFFFFE
28#define ARBITER_PRIORITY_EXHAUSTED 0x7FFFFFFF
31#define ARBITER_ALTERNATIVE_FLAG_SHARED 0x00000001
32#define ARBITER_ALTERNATIVE_FLAG_FIXED 0x00000002
33#define ARBITER_ALTERNATIVE_FLAG_BADRANGE 0x00000004
34#define ARBITER_ALTERNATIVE_FLAG_INACCESSIBLE_OK 0x00000008
53#define ARBITER_RANGE_BOOT_ALLOCATED 0x01
54#define ARBITER_RANGE_SHARED_DRIVER 0x02
55#define ARBITER_RANGE_PORT_ALIAS 0x10
56#define ARBITER_RANGE_INACCESSIBLE 0x40
59#define ARBITER_STATE_FLAG_BOOT 0x0004
60#define ARBITER_STATE_FLAG_NULL_CONFLICT_OK 0x0008
61#define ARBITER_STATE_FLAG_WORKSPACE 0x0010
62#define ARBITER_STATE_FLAG_MCFG_CONFLICT 0x0020
68#if (NTDDI_VERSION >= NTDDI_VISTA) || defined(__REACTOS__)
140#if (NTDDI_VERSION >= NTDDI_VISTA)
283#if (NTDDI_VERSION >= NTDDI_VISTA)
298#if (NTDDI_VERSION >= NTDDI_VISTA)
330#if (NTDDI_VERSION >= NTDDI_VISTA)
334#if (NTDDI_VERSION >= NTDDI_VISTA)
341#if (NTDDI_VERSION >= NTDDI_VISTA) && (NTDDI_VERSION < NTDDI_WINBLUE)
342 WCHAR PdoDescriptionString[336];
343 CHAR PdoSymbolicNameString[672];
344 WCHAR PdoAddressString[1];
354 _In_ CM_RESOURCE_TYPE ResourceType,
403#if (NTDDI_VERSION >= NTDDI_VISTA)
601#if (NTDDI_VERSION >= NTDDI_VISTA)
static _Out_opt_ PULONGLONG Start
COMPILER_DEPENDENT_UINT64 UINT64
NTSTATUS NTAPI ArbiterLibBootAllocation(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_BOOT_ALLOCATION_PARAMETERS Parameters)
The BootAllocation action: records every entry's firmware boot configuration in the committed allocat...
BOOLEAN(NTAPI * PARB_FIND_SUITABLE_RANGE)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
NTSTATUS(NTAPI * PARB_ALLOCATE_ENTRY)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
BOOLEAN NTAPI ArbiterLibGetNextAllocationRange(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
Moves the working window to the next candidate range, walking the entry's alternatives in priority or...
NTSTATUS NTAPI ArbiterLibInitializeRangeList(_In_ PARBITER_INSTANCE Arbiter, _In_ ULONG ResourceCount, _In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR Resources, _Inout_ PRTL_RANGE_LIST RangeList)
The InitializeRangeList callback default.
struct _ARBITER_ORDERING_LIST * PARBITER_ORDERING_LIST
NTSTATUS(NTAPI * PARB_ADD_RESERVED)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ADD_RESERVED_PARAMETERS Parameters)
NTSTATUS(NTAPI * PARB_ROLLBACK_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter)
NTSTATUS NTAPI ArbiterLibAllocateEntry(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
Places the whole stack of entries with backtracking: when an entry cannot be placed,...
VOID(NTAPI * PARB_ADD_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
struct _ARBITER_ALTERNATIVE * PARBITER_ALTERNATIVE
struct _ARBITER_ALLOCATION_STATE ARBITER_ALLOCATION_STATE
NTSTATUS NTAPI ArbiterLibAddInaccessibleAllocationRange(_In_ PARBITER_INSTANCE Arbiter, _In_ PCWSTR OrderingName, _Inout_ PRTL_RANGE_LIST RangeList)
Carves the firmware-reported inaccessible ranges (Arbiters\InaccessibleRange<OrderingName>) out of a ...
NTSTATUS NTAPI ArbiterLibRetestAllocation(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_RETEST_ALLOCATION_PARAMETERS Parameters)
The RetestAllocation action: deterministically re-establishes the placements a previous test chose,...
NTSTATUS(NTAPI * PARB_TRANSLATE_ORDERING)(_Out_ PIO_RESOURCE_DESCRIPTOR OutIoDescriptor, _In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor)
struct _ARBITER_ALLOCATION_STATE * PARBITER_ALLOCATION_STATE
NTSTATUS(NTAPI * PARB_INITIALIZE_RANGE_LIST)(_In_ PARBITER_INSTANCE Arbiter, _In_ ULONG DescriptorCount, _In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptors, _Inout_ PRTL_RANGE_LIST RangeList)
NTSTATUS NTAPI ArbiterLibTestAllocation(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_TEST_ALLOCATION_PARAMETERS Parameters)
The TestAllocation action: tentatively places every entry of the arbitration list,...
NTSTATUS NTAPI ArbiterLibAddReserved(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ADD_RESERVED_PARAMETERS Parameters)
The AddReserved action default: nothing to reserve.
BOOLEAN(NTAPI * PARB_OVERRIDE_CONFLICT)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
NTSTATUS(NTAPI * PARB_PREPROCESS_ENTRY)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
VOID NTAPI ArbiterLibBacktrackAllocation(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
Undoes the last AddAllocation performed for this entry.
BOOLEAN NTAPI ArbiterLibFindSuitableRange(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
Finds a free range of the current candidate window in the arbiter's tentative allocation list.
NTSTATUS NTAPI ArbiterLibQueryArbitrate(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_QUERY_ARBITRATE_PARAMETERS Parameters)
The QueryArbitrate action default: reports that this arbiter is willing to arbitrate the given list.
struct _ARBITER_ORDERING * PARBITER_ORDERING
NTSTATUS(NTAPI * PARB_RETEST_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_RETEST_ALLOCATION_PARAMETERS Parameters)
NTSTATUS(NTAPI * PARB_QUERY_ARBITRATE)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_QUERY_ARBITRATE_PARAMETERS Parameters)
BOOLEAN(NTAPI * PARB_GET_NEXT_ALLOCATION_RANGE)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
NTSTATUS NTAPI ArbiterLibCommitAllocation(_In_ PARBITER_INSTANCE Arbiter)
The CommitAllocation action: the tentative PossibleAllocation becomes the committed Allocation,...
VOID NTAPI ArbiterLibDeleteInstance(_In_ PARBITER_INSTANCE Arbiter)
NTSTATUS NTAPI ArbiterLibRollbackAllocation(_In_ PARBITER_INSTANCE Arbiter)
The RollbackAllocation action: discards the tentative allocation; the committed one is untouched.
NTSTATUS NTAPI ArbiterLibSortArbitrationList(_Inout_ PLIST_ENTRY ArbitrationList)
Orders an arbitration list most-constrained first, so fixed requirements are placed before flexible o...
NTSTATUS(NTAPI * PARB_PACK_RESOURCE)(_In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, _In_ UINT64 Start, _Out_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor)
NTSTATUS NTAPI ArbiterLibPreprocessEntry(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
Per-entry hook invoked before each placement attempt. The library default does nothing and succeeds.
NTSTATUS NTAPI ArbiterLibStartArbiter(_In_ PARBITER_INSTANCE Arbiter, _In_ PCM_RESOURCE_LIST StartResources)
The StartArbiter action default: seeds the committed allocation with the windows the bus decodes,...
NTSTATUS NTAPI ArbiterLibAddMmConfigRangeAsBootReserved(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PRTL_RANGE_LIST RangeList)
Reserves the PCI-Express enhanced-config (MMCONFIG / ECAM) MMIO window (Arbiters\ReservedResources\Mm...
NTSTATUS NTAPI ArbiterLibDefaultAssignmentOrdering(_Inout_ PARBITER_INSTANCE Arbiter, _In_ PCWSTR AllocationOrderName, _In_ PCWSTR ReservedResourcesName, _In_opt_ PARB_TRANSLATE_ORDERING TranslateOrderingFunction)
Builds the arbiter's allocation ordering from the registry policy, most-preferred window first.
BOOLEAN NTAPI ArbiterLibOverrideConflict(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
The OverrideConflict default, the last of the conflict escapes: grants a FIXED requirement whose wind...
NTSTATUS NTAPI ArbiterLibHandler(_In_ PVOID Context, _In_ ARBITER_ACTION Action, _Inout_ PARBITER_PARAMETERS Parameters)
The single ARBITER_ACTION dispatcher every exported ARBITER_INTERFACE points its ArbiterHandler at; C...
struct _ARBITER_ORDERING ARBITER_ORDERING
struct _ARBITER_INSTANCE ARBITER_INSTANCE
VOID NTAPI ArbiterLibReleaseResources(_In_ PARBITER_INSTANCE Arbiter, _In_ PVOID Owner)
Releases every committed range owned by Owner.
BOOLEAN NTAPI ArbiterLibIsConflictWithMmConfigRange(_In_ ULONGLONG Start, _In_ ULONGLONG End)
Determines whether a range overlaps the recorded MMCONFIG window.
struct _ARBITER_INSTANCE * PARBITER_INSTANCE
NTSTATUS(NTAPI * PARB_UNPACK_RESOURCE)(_In_ PCM_PARTIAL_RESOURCE_DESCRIPTOR CmDescriptor, _Out_ PUINT64 Start, _Out_ PUINT64 OutLength)
NTSTATUS(NTAPI * PARB_BOOT_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_BOOT_ALLOCATION_PARAMETERS Parameters)
VOID NTAPI ArbiterLibAddAllocation(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
Records the chosen placement in the arbiter's tentative allocation list, owned by the requesting devi...
struct _ARBITER_ALTERNATIVE ARBITER_ALTERNATIVE
VOID(NTAPI * PARB_BACKTRACK_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_ALLOCATION_STATE ArbState)
VOID NTAPI ArbiterLibFreeOrderingList(_Inout_ PARBITER_ORDERING_LIST OrderingList)
NTSTATUS(NTAPI * PARB_UNPACK_REQUIREMENT)(_In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor, _Out_ PUINT64 OutMinimumAddress, _Out_ PUINT64 OutMaximumAddress, _Out_ PUINT64 OutLength, _Out_ PUINT64 OutAlignment)
VOID NTAPI ArbiterLibReserveRange(_In_ PARBITER_INSTANCE Arbiter, _In_ ULONGLONG Start, _In_ ULONGLONG End, _In_opt_ PVOID Owner, _In_ BOOLEAN Shared)
Commits a single [Start, End] range into the arbiter as an ordinary allocation owned by Owner.
NTSTATUS NTAPI ArbiterLibInitializeInstance(_Inout_ PARBITER_INSTANCE Arbiter, _In_ PDEVICE_OBJECT BusDeviceObject, _In_ CM_RESOURCE_TYPE ResourceType, _In_ PCWSTR ArbiterName, _In_ PCWSTR OrderName, _In_ PARB_TRANSLATE_ORDERING TranslateOrderingFunction)
NTSTATUS(NTAPI * PARB_QUERY_CONFLICT)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_QUERY_CONFLICT_PARAMETERS Parameters)
NTSTATUS(NTAPI * PARB_START_ARBITER)(_In_ PARBITER_INSTANCE Arbiter, _In_ PCM_RESOURCE_LIST StartResources)
NTSTATUS NTAPI ArbiterLibAddOrdering(_Inout_ PARBITER_ORDERING_LIST OrderingList, _In_ UINT64 Start, _In_ UINT64 End)
INT32(NTAPI * PARB_SCORE_REQUIREMENT)(_In_ PIO_RESOURCE_DESCRIPTOR IoDescriptor)
NTSTATUS NTAPI ArbiterLibQueryConflict(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_QUERY_CONFLICT_PARAMETERS Parameters)
The QueryConflict action: reports which devices' committed ranges collide with a candidate resource.
NTSTATUS(NTAPI * PARB_COMMIT_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter)
NTSTATUS(NTAPI * PARB_TEST_ALLOCATION)(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_TEST_ALLOCATION_PARAMETERS Parameters)
struct _ARBITER_ORDERING_LIST ARBITER_ORDERING_LIST
unsigned __int64 * PUINT64
PDEVICE_OBJECT PhysicalDeviceObject
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
_In_ HANDLE _In_ CONST PDXGKMDT_OPM_GET_INFO_PARAMETERS Parameters
static ULONG ResourceCount
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ SaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ OwnerSize PSID Owner
BOOLEAN(NTAPI * PRTL_CONFLICT_RANGE_CALLBACK)(PVOID Context, struct _RTL_RANGE *Range)
PARBITER_ALTERNATIVE CurrentAlternative
UCHAR RangeAvailableAttributes
PARBITER_ALTERNATIVE Alternatives
PARBITER_LIST_ENTRY Entry
PIO_RESOURCE_DESCRIPTOR Descriptor
PARB_RETEST_ALLOCATION RetestAllocation
BOOLEAN TransactionInProgress
PARB_UNPACK_RESOURCE UnpackResource
PARB_OVERRIDE_CONFLICT OverrideConflict
PARB_SCORE_REQUIREMENT ScoreRequirement
PRTL_RANGE_LIST Allocation
PARB_START_ARBITER StartArbiter
PARBITER_INTERFACE Interface
PARB_ALLOCATE_ENTRY AllocateEntry
PRTL_CONFLICT_RANGE_CALLBACK ConflictCallback
PDEVICE_OBJECT BusDeviceObject
CM_RESOURCE_TYPE ResourceType
PARB_UNPACK_REQUIREMENT UnpackRequirement
ARBITER_ORDERING_LIST ReservedList
PARB_QUERY_ARBITRATE QueryArbitrate
PARB_INITIALIZE_RANGE_LIST InitializeRangeList
PARB_PREPROCESS_ENTRY PreprocessEntry
PARB_FIND_SUITABLE_RANGE FindSuitableRange
PARBITER_ALLOCATION_STATE AllocationStack
PARB_GET_NEXT_ALLOCATION_RANGE GetNextAllocationRange
PARB_BOOT_ALLOCATION BootAllocation
PVOID ConflictCallbackContext
ULONG AllocationStackMaxSize
PARB_ADD_RESERVED AddReserved
PARB_TEST_ALLOCATION TestAllocation
PARB_ADD_ALLOCATION AddAllocation
PARB_QUERY_CONFLICT QueryConflict
PRTL_RANGE_LIST PossibleAllocation
PARB_COMMIT_ALLOCATION CommitAllocation
ARBITER_ORDERING_LIST OrderingList
PARB_PACK_RESOURCE PackResource
PARB_BACKTRACK_ALLOCATION BacktrackAllocation
PARB_ROLLBACK_ALLOCATION RollbackAllocation
PARBITER_ORDERING Orderings
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
_Reserved_ PVOID Reserved
enum _ARBITER_ACTION ARBITER_ACTION