StorPortAllocateRegistryBuffer routine

The StorPortAllocateRegistryBuffer routine is called by the miniport driver to allocate a buffer that can be used to read and write registry data.


STORPORT_API PUCHAR StorPortAllocateRegistryBuffer(
  _In_ PVOID  HwDeviceExtension,
  _In_ PULONG Length


HwDeviceExtension [in]

A pointer to the hardware device extension. This is a per HBA storage area that the port driver allocates and initializes on behalf of the miniport driver. Miniport drivers usually store HBA-specific information in this extension, such as the state of the HBA and the mapped access ranges for the HBA. This area is available to the miniport driver immediately after the miniport driver calls StorPortInitialize. The port driver frees this memory when it removes the device. The miniport driver must be running at IRQL PASSIVE_LEVEL when it calls this routine.

Length [in]

Pointer to a long that indicates, on input, the length in bytes of the registry buffer that the caller requires. On output, Length is updated to reflect the actual size in bytes of the buffer that was allocated.

Return value

StorPortAllocateRegistryBuffer returns a pointer to the registry buffer that the caller requested, or NULL if some error prevents the memory from being allocated.


Each instantiation of a miniport driver can only have one registry buffer allocated at a time. If a miniport driver attempts to allocate more than one registry buffer, the allocation will fail and StorPortAllocateRegistryBuffer will return NULL.


Target platform



Storport.h (include Storport.h)



See also




Send comments about this topic to Microsoft

© 2016 Microsoft