AtaPortRegistryAllocateBuffer 函数 (irb.h)

AtaPortRegistryAllocateBuffer 例程为注册表操作分配缓冲区。

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

语法

PVOID AtaPortRegistryAllocateBuffer(
  [in] PVOID ChannelExtension,
       ULONG BufferSize
);

参数

[in] ChannelExtension

指向通道扩展的指针。

BufferSize

指定缓冲区的长度(以字节为单位)。

返回值

AtaPortRegistryAllocateBuffer 在成功时返回指向分配缓冲区的指针。 否则,它将返回 NULL

注解

端口驱动程序允许微型端口驱动程序为其所有注册表操作分配一个缓冲区。 在微型端口驱动程序使用 AtaPortRegistryAllocateBuffer 分配缓冲区后,以后对 AtaPortRegistryAllocateBuffer 的 调用将失败并返回 NULL。 微型端口驱动程序通过调用 AtaPortRegistryFreeBuffer 例程释放分配的缓冲区后,它可以通过调用 AtaPortRegistryAllocateBuffer 再次分配缓冲区。

微型端口驱动程序必须在其 AtaChannelInitRoutine 例程或其 IdeHwControl 例程中调用 AtaPortRegistryAllocateBuffer。 它不能从任何其他例程调用 AtaPortRegistryAllocateBuffer 。 此外,微型端口驱动程序只能从其 IdeHwControl 例程调用 AtaPortRegistryAllocateBuffer,前提是其 IdeHwControl 例程已调用其 ControlAction 参数中的 StartChannelStopChannel 值。

要求

要求
目标平台 桌面
标头 irb.h (包括 Ata.h、Irb.h)
Library Ataport.lib;Pciidex.lib

另请参阅

AtaChannelInitRoutine

AtaPortRegistryFreeBuffer

IdeHwControl