AtaPortRegistryChannelSubkeyWrite 函数 (irb.h)

AtaPortRegistryChannelSubKeyWrite 例程将数据写入注册表项HKLM\CurrentControlSet\Services\<service name>\ControllerN\ChannelM下的指示值名称,其中 N 是控制器的编号,M 是通道的编号。

注意 ATA 端口驱动程序和 ATA 微型端口驱动程序模型将来可能会更改或不可用。 建议改用 Storport 驱动程序Storport 微型端口 驱动程序模型。
 

语法

BOOLEAN AtaPortRegistryChannelSubkeyWrite(
  [in] PVOID  ChannelExtension,
  [in] UCHAR  ControllerNumber,
  [in] PCHAR  ValueName,
  [in] UCHAR  ValueType,
  [in] PUCHAR Buffer,
       PULONG BufferLength
);

参数

[in] ChannelExtension

指向通道扩展的指针。

[in] ControllerNumber

包含控制器编号。

[in] ValueName

包含要写入的注册表值的名称。

[in] ValueType

指示注册表值中包含的数据类型。 应为此成员分配下表中指示的值之一。

含义
IDE_REG_DWORD 一个 4 字节的数值。
IDE_REG_BINARY 二进制数据。
IDE_REG_SZ 以 null 结尾的 Unicode 字符串。

[in] Buffer

指向源缓冲区的指针,其中包含要写入注册表的数据。

BufferLength

指向要复制的数据字节数的指针。 如果操作失败, Length 指向的位置将更新为成功写入注册表的数据长度。

返回值

如果操作成功,AtaPortRegistryChannelSubKeyWrite 将返回 TRUE。 否则,它将返回 FALSE。 如果微型端口驱动程序未从正确的例程调用该例程,该例程也会返回 FALSE

注解

如果值名称不存在, AtaPortRegistryChannelSubKeyWrite 会为值创建一个条目,并且数据存储在新创建的值中。

必须使用 AtaPortRegistryAllocateBuffer 分配由 Buffer 指向的缓冲区。

微型端口驱动程序必须在 AtaChannelInitRoutine 例程或 IdeHwControl 例程期间调用 AtaPortRegistryChannelSubKeyWrite。微型端口驱动程序无法在不返回 FALSE 的情况下从任何其他例程调用 AtaPortRegistryChannelSubKeyWrite 此外,如果微型端口驱动程序的 IdeHwControl 例程已调用并且其 ControlAction 参数中值为 StartChannel 或 StopChannel,则微型端口驱动程序只能从其 IdeHwControl 例程调用 AtaPortRegistryChannelSubKeyWrite

要求

要求
目标平台 桌面
标头 irb.h (包括 Ata.h、Irb.h)

另请参阅

AtaChannelInitRoutine

AtaPortRegistryChannelSubKeyRead

AtaPortRegistryChannelSubKeyWriteDeferred

IdeHwControl