PPHYSICAL_COUNTER_OVERFLOW_HANDLER funzione di callback (ntddk.h)
Il PPHYSICAL_COUNTER_OVERFLOW_HANDLER viene implementato dal driver client per gestire gli overflow dei contatori dalle risorse dei contatori acquisite tramite la routine HalAllocateHardwareCounters.
Sintassi
PPHYSICAL_COUNTER_OVERFLOW_HANDLER PphysicalCounterOverflowHandler;
void PphysicalCounterOverflowHandler(
ULONGLONG OverflowBits,
HANDLE OwningHandle
)
{...}
Parametri
OverflowBits
Fornisce una bitmap che descrive quali contatori hanno superato l'overflow.
OwningHandle
Fornisce il HANDLE corrispondente al set di risorse a cui appartengono i contatori di overflow.
Valore restituito
Nessuno
Osservazioni
Registrare l'implementazione di questa funzione di callback chiamando HalAllocateHardwareCounters con una struttura di tipo PHYSICAL_COUNTER_RESOURCE_LIST. Nella PHYSICAL_COUNTER_RESOURCE_LISTspecificare una struttura di tipo PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR che specifica un PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR_TYPE di ResourceTypeOverflow.
Ecco un prototipo di esempio per un gestore di overflow:
VOID
PmuAwareOverflowHandler (
_In_ ULONGLONG OverflowStatus,
_In_ HANDLE OwningHandle
)
/*++
Routine Description:
This routine is the PMU Overflow Handler for a sharing driver.
Arguments:
OverflowStatus - The counters which have overflowed.
OwningHandle - The handle owning the counters.
Return Value:
None.
--*/
{
}
Per registrare il gestore di overflow, usare il codice simile al seguente:
VOID
CreateOverflowDescriptor (
_Inout_ PPHYSICAL_COUNTER_RESOURCE_LIST CounterResourceList,
_In_ ULONG DescriptorIndex
)
{
CounterResourceList->Descriptors[DescriptorIndex].Type = ResourceTypeOverflow;
CounterResourceList->Descriptors[DescriptorIndex].u.OverflowHandler = PmuAwareOverflowHandler;
}
Questo callback viene chiamato in IRQL = PROFILE_LEVEL. Ciò significa che deve essere sempre residente in memoria. Il callback deve essere restituito il più rapidamente possibile e non deve tentare di eseguire alcuna delle operazioni seguenti.
Acquisire o rilasciare blocchi spin.
Pool con paging di accesso non bloccato in memoria
Chiamare una routine di paging.
Il callback non deve gestire la cancellazione dei registri di overflow perché verrà gestito dall'HAL.
Fabbisogno
Requisito | Valore |
---|---|
piattaforma di destinazione | Finestre |
intestazione | ntddk.h |
IRQL | PROFILE_LEVEL |