// storport.h
ULONG StorPortInitializeWorker(
[in] PVOID HwDeviceExtension,
[out] PVOID *Worker
);
View the official Windows Driver Kit DDI referenceNo description available.
Creates a new Storport work item that runs in a system worker thread.
HwDeviceExtension [in]A pointer to the hardware device extension for the host bus adapter (HBA).
Worker [out]A pointer to an opaque buffer that holds context information for the work item.
The StorPortInitializeWorker routine returns one of these status codes:
| Return code | Description |
|---|---|
| STOR_STATUS_INVALID_IRQL | Current IRQL > DISPATCH_LEVEL. |
| STOR_STATUS_INVALID_PARAMETER | Either HwDeviceExtension or Worker is NULL. |
| STOR_STATUS_INSUFFICIENT_RESOURCES | Insufficient resources are available to initialize the work item context. |
| STOR_STATUS_SUCCESS | The work item was successfully initialized. |
The work item context returned in the Worker parameter by StorPortInitializeWorker is used in future calls to StorPortQueueWorkItem or StorPortFreeWorker.
If the miniport uses the work item during IO processing, we recommended that StorPortInitializeWorker be called during the miniport's HwStorFindAdapter function to ensure that resources are available when needed.