Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 105 of file zone.c.
{ ULONG i; ULONG_PTR Entry; /* * BlockSize and Segment must be 8-byte aligned. * Blocksize cannot exceed Segment Size. */ if (((ULONG_PTR)InitialSegment & 7) || (InitialSegmentSize & 7) || (BlockSize > InitialSegmentSize)) { DPRINT1("Invalid ExInitializeZone Alignment and/or Size\n"); return STATUS_INVALID_PARAMETER; } /* Set the Zone Header */ Zone->BlockSize = BlockSize; /* Link empty list */ Zone->FreeList.Next = NULL; Zone->SegmentList.Next = NULL; PushEntryList(&Zone->SegmentList, &((PZONE_SEGMENT_HEADER)InitialSegment)->SegmentList); ((PZONE_SEGMENT_HEADER)InitialSegment)->Reserved = NULL; /* Get first entry */ Entry = (ULONG_PTR)InitialSegment + sizeof(ZONE_SEGMENT_HEADER); /* Loop through the segments */ for (i = sizeof(ZONE_SEGMENT_HEADER); i <= InitialSegmentSize - BlockSize; i+= BlockSize) { /* Link the Free and Segment Lists */ PushEntryList(&Zone->FreeList, (PSINGLE_LIST_ENTRY)Entry); /* Go to the next entry */ Entry += Zone->BlockSize; } /* Update Segment Size */ Zone->TotalSegmentSize += i; /* Return success */ return STATUS_SUCCESS; }