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

RESULT CMAPI HvpGetHiveHeader ( IN PHHIVE  Hive,
IN PHBASE_BLOCK *  HiveBaseBlock,
IN PLARGE_INTEGER  TimeStamp 
)

Definition at line 286 of file hiveinit.c.

Referenced by HvLoadHive().

{
    PHBASE_BLOCK BaseBlock;
    ULONG Alignment;
    ULONG Result;
    ULONG Offset = 0;
    ASSERT(sizeof(HBASE_BLOCK) >= (HV_BLOCK_SIZE * Hive->Cluster));

    /* Assume failure and allocate the buffer */
    *HiveBaseBlock = 0;
    BaseBlock = Hive->Allocate(sizeof(HBASE_BLOCK), TRUE, TAG_CM);
    if (!BaseBlock) return NoMemory;

    /* Check for, and enforce, alignment */
    Alignment = Hive->Cluster * HV_BLOCK_SIZE -1;
    if ((ULONG_PTR)BaseBlock & Alignment)
    {
        /* Free the old header */
        Hive->Free(BaseBlock, 0);
        BaseBlock = Hive->Allocate(PAGE_SIZE, TRUE, TAG_CM);
        if (!BaseBlock) return NoMemory;

        //BaseBlock->Length = PAGE_SIZE; ??
    }

    /* Clear it */
    RtlZeroMemory(BaseBlock, sizeof(HBASE_BLOCK));

    /* Now read it from disk */
    Result = Hive->FileRead(Hive,
                            HFILE_TYPE_PRIMARY,
                            &Offset,
                            BaseBlock,
                            Hive->Cluster * HV_BLOCK_SIZE);

    /* Couldn't read: assume it's not a hive */
    if (!Result) return NotHive;

    /* Do validation */
    if (!HvpVerifyHiveHeader(BaseBlock)) return NotHive;

    /* Return information */
    *HiveBaseBlock = BaseBlock;
    *TimeStamp = BaseBlock->TimeStamp;
    return HiveSuccess;
}

Generated on Fri May 25 2012 06:01:26 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.