AtaPortRegistryControllerKeyWrite 函数 (irb.h)

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

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

语法

BOOLEAN AtaPortRegistryControllerKeyWrite(
  [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 指向的位置将更新已成功复制到注册表的数据长度。

返回值

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

言论

应使用 AtaPortRegistryAllocateBuffer分配缓冲区。

微型端口驱动程序必须在 AtaChannelInitRoutine 例程或 IdeHwControl 例程期间调用 AtaPortRegistryControllerKeyWrite。微型端口驱动程序无法从任何其他例程调用 AtaPortRegistryControllerKeyWrite,或者它将返回 FALSE。 此外,微型端口驱动程序只能从其 IdeHwControl 例程调用 AtaPortRegistryControllerKeyWrite,前提是调用其 IdeHwControl 例程,并在其 ControlAction 参数中具有 StartChannelStopChannel 的值。

要求

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

另请参阅

AtaChannelInitRoutine

AtaPortRegistryAllocateBuffer

IdeHwControl