61 &Alternative->Minimum,
62 &Alternative->Maximum,
68#if (NTDDI_VERSION >= NTDDI_VISTA)
69 Alternative->Length =
Length;
79 Alternative->Flags = 0;
85 if (Alternative->Maximum < Alternative->Minimum)
87 else if ((Alternative->Maximum - Alternative->Minimum + 1) == Alternative->Length)
127 ULONG StateCount = EntryCount + 1;
128 ULONG AlternativeCount = 0;
133 for (ListEntry = ArbitrationList->
Flink;
134 ListEntry != ArbitrationList;
135 ListEntry = ListEntry->
Flink)
139 if (
Entry->AlternativeCount == 0)
142 AlternativeCount +=
Entry->AlternativeCount;
148 if (Arbiter->AllocationStackMaxSize <
Size)
153 if (NewStack ==
NULL)
156 if (Arbiter->AllocationStack !=
NULL)
159 Arbiter->AllocationStack = NewStack;
160 Arbiter->AllocationStackMaxSize =
Size;
164 State = Arbiter->AllocationStack;
167 for (ListEntry = ArbitrationList->
Flink;
168 ListEntry != ArbitrationList;
169 ListEntry = ListEntry->
Flink)
174 if (
Entry->AlternativeCount == 0)
178 State->AlternativeCount =
Entry->AlternativeCount;
179 State->Alternatives = Alternative;
226 ULONG EntryCount = 0;
238 for (ListEntry = ArbitrationList->
Flink;
239 ListEntry != ArbitrationList;
240 ListEntry = ListEntry->
Flink)
252 if (
Entry->PhysicalDeviceObject != PreviousOwner)
254 PreviousOwner =
Entry->PhysicalDeviceObject;
259 Entry->WorkSpace = 0;
260 if (Arbiter->ScoreRequirement !=
NULL)
270 Entry->WorkSpace += Score;
281 Status = Arbiter->AllocateEntry(Arbiter, Arbiter->AllocationStack);
336 State.Alternatives = &Alternative;
337 State.CurrentAlternative = &Alternative;
338 State.AlternativeCount = 1;
350 for (ListEntry = ArbitrationList->
Flink;
351 ListEntry != ArbitrationList;
352 ListEntry = ListEntry->
Flink)
357 Entry->PhysicalDeviceObject);
362 for (ListEntry = ArbitrationList->
Flink;
363 ListEntry != ArbitrationList;
364 ListEntry = ListEntry->
Flink)
391 Status = Arbiter->PreprocessEntry(Arbiter, &
State);
396 Arbiter->AddAllocation(Arbiter, &
State);
401 State.Flags &= ~ARBITER_STATE_FLAG_WORKSPACE;
432#if (NTDDI_VERSION >= NTDDI_VISTA)
468#if (NTDDI_VERSION >= NTDDI_VISTA)
510 Arbiter->Allocation = Arbiter->PossibleAllocation;
511 Arbiter->PossibleAllocation = Old;
COMPILER_DEPENDENT_UINT64 UINT64
NTSTATUS NTAPI ArbiterLibSortArbitrationList(_Inout_ PLIST_ENTRY ArbitrationList)
#define ARBITER_ALTERNATIVE_FLAG_BADRANGE
#define ARBITER_ALTERNATIVE_FLAG_SHARED
struct _ARBITER_ALTERNATIVE * PARBITER_ALTERNATIVE
struct _ARBITER_ALLOCATION_STATE ARBITER_ALLOCATION_STATE
#define ARBITER_PRIORITY_NULL
#define ARBITER_STATE_FLAG_WORKSPACE
#define ARBITER_ALTERNATIVE_FLAG_FIXED
_In_ HANDLE _In_ CONST PDXGKMDT_OPM_GET_INFO_PARAMETERS Parameters
#define NT_SUCCESS(StatCode)
#define ExAllocatePoolWithTag(hernya, size, tag)
union Alignment_ Alignment
#define ExFreePoolWithTag(_P, _T)
NTSYSAPI NTSTATUS NTAPI RtlDeleteOwnersRanges(_Inout_ PRTL_RANGE_LIST RangeList, _In_ _Maybenull_ PVOID Owner)
NTSYSAPI VOID NTAPI RtlInitializeRangeList(_Out_ PRTL_RANGE_LIST RangeList)
NTSYSAPI NTSTATUS NTAPI RtlCopyRangeList(_Out_ PRTL_RANGE_LIST CopyRangeList, _In_ PRTL_RANGE_LIST RangeList)
NTSYSAPI VOID NTAPI RtlFreeRangeList(_In_ PRTL_RANGE_LIST RangeList)
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define STATUS_DEVICE_CONFIGURATION_ERROR
for(i=0;i< sizeof(testsuite)/sizeof(testsuite[0]);++i) ok(call_test(testsuite[i].func)
struct _LIST_ENTRY * Flink
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 ArbiterLibTestAllocation(_In_ PARBITER_INSTANCE Arbiter, _Inout_ PARBITER_TEST_ALLOCATION_PARAMETERS Parameters)
The TestAllocation action: tentatively places every entry of the arbitration list,...
static NTSTATUS ArbpBuildAllocationStack(_In_ PARBITER_INSTANCE Arbiter, _In_ PLIST_ENTRY ArbitrationList, _In_ ULONG EntryCount)
Builds the allocation stack for an arbitration list into Arbiter->AllocationStack: one ARBITER_ALLOCA...
NTSTATUS NTAPI ArbiterLibCommitAllocation(_In_ PARBITER_INSTANCE Arbiter)
The CommitAllocation action: the tentative PossibleAllocation becomes the committed Allocation,...
NTSTATUS NTAPI ArbiterLibRollbackAllocation(_In_ PARBITER_INSTANCE Arbiter)
The RollbackAllocation action: discards the tentative allocation; the committed one is untouched.
static NTSTATUS ArbpTestAllocation(_In_ PARBITER_INSTANCE Arbiter, _In_ PLIST_ENTRY ArbitrationList)
Test-allocates every entry on an arbitration list into the arbiter's tentative allocation....
static NTSTATUS ArbpBuildAlternative(_In_ PARBITER_INSTANCE Arbiter, _In_ PIO_RESOURCE_DESCRIPTOR Descriptor, _Out_ PARBITER_ALTERNATIVE Alternative)
Expands one IO_RESOURCE_DESCRIPTOR into an ARBITER_ALTERNATIVE through the arbiter's UnpackRequiremen...
static NTSTATUS ArbpRetestAllocation(_In_ PARBITER_INSTANCE Arbiter, _In_ PLIST_ENTRY ArbitrationList)
Re-establishes a previously tested solution in the arbiter's tentative allocation without searching a...
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
@ ArbiterResultNullRequest