ExExtendZone

NTSTATUS
    ExExtendZone(

        IN PZONE_HEADER  Zone,
        IN PVOID  Segment,
        IN ULONG  SegmentSize
        );

ExExtendZone extends a zone by adding another segment’s worth of blocks to the zone.

Parameters

Zone
Points to the address of a zone header to be extended.
Segment
Points to a segment of storage. The base address of the segment must be aligned on an 8-byte boundary.
SegmentSize
Is the size in bytes of Segment.

Return Value

ExExtendZone returns one of the following:

Status

Meaning

STATUS_UNSUCCESSFUL

Segment was not aligned on an 8-byte boundary or a block size was larger than SegmentSize.

STATUS_SUCCESS

The zone was successfully extended.

Comments

When a zone has no free blocks, additional temporary memory should be allocated with ExAllocatePool, rather than ExExtendZone or ExInterlockedExtendZone. Such a temporary allocation can be released with ExFreePool when the original zone has free entries again.

ExExtendZone allocates memory that remains allocated to its caller until the machine is rebooted. Consequently, ExExtendZone should not be called every time a call to ExIsFullZone returns TRUE. Call ExExtendZone only for a very heavy I/O demand situation when neither the original zone’s entries are being released nor the temporary memory allocated with ExAllocatePool.

The first ZONE_SEGMENT_HEADER-sized portion of the segment is used by the zone allocator. The remainder of the segment is divided into fixed-size blocks, as specified by BlockSize in the original call to ExInitializeZone, and added to the zone.

Callers of ExExtendZone must be running at IRQL <= DISPATCH_LEVEL.

See Also

ExAllocateFromZone, ExAllocatePool, ExFreePool, ExFreeToZone, ExInitializeZone, ExInterlockedAllocateFromZone, ExInterlockedExtendZone, ExInterlockedFreeToZone, ExIsFullZone, ExIsObjectInFirstZoneSegment