Bewerken

Delen via


IoAllocateController function (ntddk.h)

The IoAllocateController routine sets up the call to a driver-supplied ControllerControl routine as soon as the device controller, represented by the given controller object, is available to carry out an I/O operation for the target device, represented by the given device object.

Syntax

void IoAllocateController(
  [in]           PCONTROLLER_OBJECT ControllerObject,
  [in]           PDEVICE_OBJECT     DeviceObject,
  [in]           PDRIVER_CONTROL    ExecutionRoutine,
  [in, optional] PVOID              Context
);

Parameters

[in] ControllerObject

Pointer to a driver-created controller object, usually representing a physical controller to be allocated for an I/O operation on an attached device.

[in] DeviceObject

Pointer to the device object, representing the target device of the current IRP.

[in] ExecutionRoutine

Pointer to the driver-supplied ControllerControl routine.

[in, optional] Context

Pointer to a driver-determined context, passed to the driver's ControllerControl routine when it is called.

Return value

None

Remarks

This routine reserves exclusive access to the hardware controller for the specified device.

The ControllerControl routine returns a value indicating whether the controller remains allocated to the device, either DeallocateObject or KeepObject. If it returns KeepObject, the driver must subsequently call IoFreeController to release the controller object.

Requirements

Requirement Value
Minimum supported client Available starting with Windows 2000.
Target Platform Universal
Header ntddk.h (include Ntddk.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL DISPATCH_LEVEL
DDI compliance rules HwStorPortProhibitedDDIs(storport), IrqlDispatch(storport), IrqlDispatch(storport), IrqlDispatch(wdm), SpNoWait(storport), StorPortStartIo(storport)

See also

ControllerControl

IoCreateController

IoDeleteController

IoFreeController