示例#1
0
文件: freeldr.c 项目: Moteesh/reactos
VOID __cdecl BootMain(IN PCCH CmdLine)
{
    CmdLineParse(CmdLine);

    /* Debugger pre-initialization */
    DebugInit(FALSE);

    TRACE("BootMain() called.\n");

    MachInit(CmdLine);

    /* Check if the CPU is new enough */
    FrLdrCheckCpuCompatibility(); // FIXME: Should be done inside MachInit!

    /* UI pre-initialization */
    if (!UiInitialize(FALSE))
    {
        UiMessageBoxCritical("Unable to initialize UI.");
        goto Quit;
    }

    /* Initialize memory manager */
    if (!MmInitializeMemoryManager())
    {
        UiMessageBoxCritical("Unable to initialize memory manager.");
        goto Quit;
    }

    /* Initialize I/O subsystem */
    FsInit();

    RunLoader();

Quit:
    /* If we reach this point, something went wrong before, therefore reboot */
#if defined(__i386__) || defined(_M_AMD64)
    DiskStopFloppyMotor();
#endif
    Reboot();
}
示例#2
0
VOID BootMain(LPSTR CmdLine)
{
    CmdLineParse(CmdLine);

    MachInit(CmdLine);

    FsInit();

    DebugInit();

    TRACE("BootMain() called.\n");

    /* Check if the CPU is new enough */
    FrLdrCheckCpuCompatiblity();

    if (!UiInitialize(FALSE))
    {
        UiMessageBoxCritical("Unable to initialize UI.\n");
        goto quit;
    }

    if (!MmInitializeMemoryManager())
    {
        UiMessageBoxCritical("Unable to initialize memory manager");
        goto quit;
    }

#ifdef _M_IX86
	HalpInitializePciStubs();
	HalpInitBusHandler();
#endif
	RunLoader();

quit:
    /* If we reach this point, something went wrong before, therefore reboot */
    DiskStopFloppyMotor();
    Reboot();
}
示例#3
0
void main( int argc, char *argv[] ) {
#pragma on (unreferenced);

    uint        i;
    uint        num_files;
    cmdline_t   *cmd;
    int         multi_module;
    pobj_lib_info pli;

    atexit( cleanupHandler );
    MemInit();
    MsgInit( argv[0] );
    cmd = CmdLineParse();
    init();
    while( cmd->action != NULL ) {
        ActionInit( cmd );
        num_files = cmd->action->num_files;
        i = 0;
        do {
            ActionInfile( cmd, inputFile, i );
            fileIn = ObjReadOpen( inputFile );
            if( fileIn == NULL ) {
                Fatal( MSG_UNABLE_TO_OPEN_FILE, inputFile );
            }
            if( cmd->need_output ) {
                ActionOutfile( cmd, outputFile, i );
                fileOut = ObjWriteOpen( outputFile );
                if( fileOut == NULL ) {
                    Fatal( MSG_UNABLE_TO_OPEN_FILE, outputFile );
                }
            } else {
                fileOut = NULL;
            }
            if( cmd->quiet == 0 ) {
                char    msgbuff[MAX_RESOURCE_SIZE];

                MsgGet( MSG_CONVERTING, msgbuff );
                PrtFmt( msgbuff, inputFile );
                PrtFmt( "\n" );
            }
            pli.is_lib = 0;
            do {
                multi_module = PObj( fileIn, fileOut, &pli );
                prune();
            } while( multi_module );
            ObjReadClose( fileIn );
            if( fileOut != NULL ) {
                ObjWriteClose( fileOut );
                ActionRename( cmd, inputFile, outputFile, i, pli.is_lib,
                    pli.page_len );
            }
            ++i;
        } while( i < num_files );
        ActionFini( cmd );
    }
    fini();
    MsgFini();
    MemFini();
    outputFile[0] = '\0';
    exit( EXIT_SUCCESS );
}
    wprintf(L"url del <URL> \t\tDelete URL allow exemption\n\n");
    wprintf(L"filter get \t\tDisplay current filter ID and name path overrides\n\n");
    wprintf(L"filter set /g:<FilterID> /n:<FilterNamePath>\n \
             \t\tSet overriding filter by ID and name resource path\n\n");
    wprintf(L"filter reset \t\tReset filter override\n\n");
}


// Application entry point
int __cdecl wmain(int argc, __in_ecount(argc) WCHAR* argv[])
{
    OPERATION eOperation;
    SUBOPERATION eSubOperation;
    PCWSTR pcszExemption, pcszFilterID, pcszFilterNamePath;

    HRESULT hr = CmdLineParse(argc, argv, &eOperation, &eSubOperation, &pcszExemption, 
                              &pcszFilterID, &pcszFilterNamePath);
    if (hr == E_INVALIDARG)
    {
        // Printf usage and bypass further initialization
        Usage(argv[0]);
    }
    else if (SUCCEEDED(hr))
    {
        hr = WpcuCOMInit();
        if (FAILED(hr))
        {
            wprintf(L"Error:  Failed to initialize COM, hr is %8x.\n", hr);
        }
        else
        {
            // Declare and initialize WPC API interface pointers