IoCreateController

PCONTROLLER_OBJECT
IoCreateController(

IN ULONG Size
);

IoCreateController allocates memory for and initializes a controller object with a controller extension of a driver-determined size.

Parameters

Size

Specifies the number of bytes to be allocated for the controller extension.

Return Value

IoCreateController returns a pointer to the controller object or a NULL pointer if memory could not be allocated for the requested device extension.

Comments

A controller object usually represents a physical device controller with attached devices on which a single driver carries out I/O requests. The controller extension is allocated from nonpaged pool and is guaranteed to be accessible by any driver routine and in an arbitrary thread context.

The controller object is used to synchronize I/O operations to target devices for which I/O requests can come in concurrently to a single, monolithic driver. A driver also might use a controller object to synchronize operations through device channels.

If IoCreateController returns NULL, such a driver should not load.

Callers of IoCreateController must be running at IRQL PASSIVE_LEVEL.

See Also

CONTROLLER_OBJECT, IoAllocateController, IoFreeController, IoDeleteController