StorPortInvokeAcpiMethod 函数 (storport.h)

StorPortInvokeAcpiMethod 例程为存储设备执行 ACPI 方法。

语法

ULONG StorPortInvokeAcpiMethod(
  [in]            PVOID         HwDeviceExtension,
  [in, optional]  PSTOR_ADDRESS Address,
  [in]            ULONG         MethodName,
  [in, optional]  PVOID         InputBuffer,
  [in]            ULONG         InputBufferLength,
  [in, optional]  PVOID         OutputBuffer,
  [in]            ULONG         OutputBufferLength,
  [out, optional] PULONG        BytesReturned
);

参数

[in] HwDeviceExtension

指向主机总线适配器(HBA)的硬件设备扩展的指针。

[in, optional] Address

目标设备的地址。 此参数是可选的。 如果 地址 设置为 NULL,则适配器是目标。

[in] MethodName

ACPI 方法的四字节名称。 例如,(ULONG) “DDS_” 将命名为 AHCI 控制器的 _SDD 或 “设置设备数据”, ACPI 方法。

[in, optional] InputBuffer

指向方法的输入数据的指针。

[in] InputBufferLength

InputBuffer中缓冲区的长度(以字节为单位)。

[in, optional] OutputBuffer

指向方法输出数据的指针。

[in] OutputBufferLength

OutputBuffer中缓冲区的长度(以字节为单位)。

[out, optional] BytesReturned

指向 OutputBuffer中返回的数据长度(以字节为单位)的指针。

返回值

StorPortInvokeAcpiMethod 例程返回以下状态代码之一:

返回代码 描述
STOR_STATUS_INVALID_UNSUCCESSFUL
存在一般错误条件。
STOR_STATUS_INVALID_PARAMETER
HwDeviceExtensionInputBuffer,或 OutputBuffer 为 NULL。

-或-

地址 是指不存在的目标。

STOR_STATUS_NOT_IMPLEMENTED
ACPI 方法未实现。
STOR_STATUS_INSUFFICIENT_RESOURCES
资源不足,无法执行该方法,或者 OutputBufferLength 不足以容纳返回的数据。
STOR_STATUS_INVALID_IRQL
当前 IRQL > PASSIVE_LEVEL。
STOR_STATUS_SUCCESS
成功执行的方法。

言论

StorPortInvokeAcpiMethod 使微型端口驱动程序能够调用为存储控制器和存储 LUN 定义的 ACPI 方法。 方法名称是四字节字符串,在 MethodName中占据 ULONG 值。

要求

要求 价值
最低支持的客户端 在 Windows 8 及更高版本的 Windows 中可用。
目标平台 普遍
标头 storport.h (包括 Storport.h)
IRQL PASSIVE_LEVEL