StorPortInitialize 函数 (storport.h)

StorPortInitialize 例程初始化端口驱动程序参数和扩展数据。 StorPortInitialize 还保存从 微型端口驱动程序DriverEntry 例程提供的适配器信息。

语法

STORPORT_API ULONG StorPortInitialize(
  [in]           PVOID                   Argument1,
  [in]           PVOID                   Argument2,
  [in]           _HW_INITIALIZATION_DATA *HwInitializationData,
  [in, optional] PVOID                   HwContext
);

参数

[in] Argument1

操作系统用来调用微型端口 DriverEntry 例程的第一个指针。

[in] Argument2

操作系统用来调用微型端口 DriverEntry 例程的第二个指针。

[in] HwInitializationData

指向微型端口驱动程序在其 DriverEntry 例程中设置的初始化和配置信息的指针。

[in, optional] HwContext

要传递给微型端口驱动程序的 HwStorFindAdapter 例程的上下文值的地址。 只有扫描总线中的 HBA 而不是从端口驱动程序接收配置信息的旧式微型端口驱动程序可以使用此参数来存储对 HwStorFindAdapter 的调用之间的状态。

返回值

StorPortInitialize 执行的初始化操作的结果。 微型端口驱动程序将返回此值作为其 DriverEntry 例程的返回值。

StorPortInitialize 返回以下状态代码之一:

返回代码 说明
STATUS_INVALID_PARAMETER Argument1 为 NULL,或 Argument2 为 NULL,或 HwInitializationData 为 NULL。
STATUS_SUCCESS 已成功初始化驱动程序扩展数据和适配器信息。
STATUS_NO_MEMORY 没有可用于存储初始化参数的内存。
STATUS_REVISION_MISMATCH HwInitializationData 指向的结构版本对于当前操作系统无效。
STATUS_INSUFFICENT_RESOURCES 驱动程序对象扩展数据的分配失败。

注解

必须从微型端口驱动程序的 DriverEntry 例程调用此例程。

由于 Storport 微型端口驱动程序必须支持 PnP,因此 Storport 驱动程序不使用传递给 StorPortInitializeHwContext 参数。

每个微型端口驱动程序的 DriverEntry 例程必须在微型端口驱动程序先归零,然后设置HW_INITIALIZATION_DATA的成员后调用 StorPortInitialize

要求

要求
目标平台 通用
标头 storport.h (包括 Storport.h)
Library Storport.lib

另请参阅

HW_INITIALIZATION_DATA

HwStorFindAdapter