ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

NTSTATUS NTAPI ExInitializeZone ( PZONE_HEADER  Zone,
ULONG  BlockSize,
PVOID  InitialSegment,
ULONG  InitialSegmentSize 
)

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;
}

Generated on Sun May 27 2012 06:06:43 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.