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

VOID LoadAndBootWindows ( PCSTR  OperatingSystemName,
PSTR  SettingsValue,
USHORT  OperatingSystemVersion 
)

Definition at line 451 of file winldr.c.

Referenced by RunLoader().

{
    BOOLEAN HasSection;
    char  BootPath[MAX_PATH];
    CHAR  FileName[MAX_PATH];
    CHAR  BootOptions[256];
    PCHAR File;
    BOOLEAN Status;
    ULONG_PTR SectionId;
    PLOADER_PARAMETER_BLOCK LoaderBlock;

    // Open the operating system section
    // specified in the .ini file
    HasSection = IniOpenSection(OperatingSystemName, &SectionId);

    UiDrawBackdrop();
    UiDrawProgressBarCenter(1, 100, "Loading NT...");

    /* Read the system path is set in the .ini file */
    if (!HasSection ||
        !IniReadSettingByName(SectionId, "SystemPath", BootPath, sizeof(BootPath)))
    {
        strcpy(BootPath, OperatingSystemName);
    }

    /* Special case for LiveCD */
    if (!_strnicmp(BootPath, "LiveCD", strlen("LiveCD")))
    {
        strcpy(FileName, BootPath + strlen("LiveCD"));
        MachDiskGetBootPath(BootPath, sizeof(BootPath));
        strcat(BootPath, FileName);
    }

    /* append a backslash */
    if ((strlen(BootPath)==0) || BootPath[strlen(BootPath)] != '\\')
        strcat(BootPath, "\\");

    /* Read booting options */
    if (!HasSection || !IniReadSettingByName(SectionId, "Options", BootOptions, sizeof(BootOptions)))
    {
        /* Get options after the title */
        const CHAR*p = SettingsValue;
        while (*p == ' ' || *p == '"')
            p++;
        while (*p != '\0' && *p != '"')
            p++;
        strcpy(BootOptions, p);
        TRACE("BootOptions: '%s'\n", BootOptions);
    }

    /* Append boot-time options */
    AppendBootTimeOptions(BootOptions);

    /* Check if a ramdisk file was given */
    File = strstr(BootOptions, "/RDPATH=");
    if (File)
    {
        /* Copy the file name and everything else after it */
        strcpy(FileName, File + 8);

        /* Null-terminate */
        *strstr(FileName, " ") = ANSI_NULL;

        /* Load the ramdisk */
        RamDiskLoadVirtualFile(FileName);
    }

    /* Let user know we started loading */
    //UiDrawStatusText("Loading...");

    TRACE("BootPath: '%s'\n", BootPath);

    /* Allocate and minimalistic-initialize LPB */
    AllocateAndInitLPB(&LoaderBlock);

#ifdef _M_IX86
    /* Setup redirection support */
    WinLdrSetupEms(BootOptions);
#endif

    /* Load Hive */
    UiDrawBackdrop();
    UiDrawProgressBarCenter(15, 100, "Loading system hive...");
    Status = WinLdrInitSystemHive(LoaderBlock, BootPath);
    TRACE("SYSTEM hive loaded with status %d\n", Status);

    /* Load NLS data, OEM font, and prepare boot drivers list */
    Status = WinLdrScanSystemHive(LoaderBlock, BootPath);
    TRACE("SYSTEM hive scanned with status %d\n", Status);


    LoadAndBootWindowsCommon(OperatingSystemVersion,
                             LoaderBlock,
                             BootOptions,
                             BootPath,
                             0);
}

Generated on Sat May 26 2012 04:47:13 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.