VirtualBox

Ignore:
Timestamp:
Oct 28, 2015 8:17:18 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
103761
Message:

EFI/Firmware: 'svn merge /vendor/edk2/UDK2010.SR1 /vendor/edk2/current .', reverting and removing files+dirs listed in ReadMe.vbox, resolving conflicts with help from ../UDK2014.SP1/. This is a raw untested merge.

Location:
trunk/src/VBox/Devices/EFI/Firmware
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware

  • trunk/src/VBox/Devices/EFI/Firmware/StdLib/LibC/Main/Main.c

    r48674 r58459  
    55  SIG_DFL; as appropriate.
    66
    7   Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
     7  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
    88  This program and the accompanying materials are licensed and made available under
    99  the terms and conditions of the BSD License that accompanies this distribution.
     
    7575ArgvConvert(UINTN Argc, CHAR16 **Argv)
    7676{
    77   size_t  AVsz;       /* Size of a single nArgv string */
     77  ssize_t  AVsz;       /* Size of a single nArgv string, or -1 */
    7878  UINTN   count;
    7979  char  **nArgv;
     
    8282
    8383DEBUG_CODE_BEGIN();
    84   Print(L"ArgvConvert called with %d arguments.\n", Argc);
     84  DEBUG((DEBUG_INIT, "ArgvConvert called with %d arguments.\n", Argc));
    8585  for(count = 0; count < ((Argc > 5)? 5: Argc); ++count) {
    86     Print(L"Argument[%d] = \"%s\".\n", count, Argv[count]);
     86    DEBUG((DEBUG_INIT, "Argument[%d] = \"%s\".\n", count, Argv[count]));
    8787  }
    8888DEBUG_CODE_END();
     
    9191  /* Determine space needed for narrow Argv strings. */
    9292  for(count = 0; count < Argc; ++count) {
    93     AVsz = wcstombs(NULL, Argv[count], ARG_MAX);
     93    AVsz = (ssize_t)wcstombs(NULL, Argv[count], ARG_MAX);
    9494    if(AVsz < 0) {
    95       Print(L"ABORTING: Argv[%d] contains an unconvertable character.\n", count);
     95      DEBUG((DEBUG_ERROR, "ABORTING: Argv[%d] contains an unconvertable character.\n", count));
    9696      exit(EXIT_FAILURE);
    9797      /* Not Reached */
     
    103103  gMD->NCmdLine = (char *)AllocateZeroPool(nArgvSize+1);
    104104  if(gMD->NCmdLine == NULL) {
    105     Print(L"ABORTING: Insufficient memory.\n");
     105    DEBUG((DEBUG_ERROR, "ABORTING: Insufficient memory.\n"));
    106106    exit(EXIT_FAILURE);
    107107    /* Not Reached */
     
    113113  for(count = 0; count < Argc; ++count) {
    114114    nArgv[count] = string;
    115     AVsz = wcstombs(string, Argv[count], nArgvSize);
    116     string[AVsz] = 0;   /* NULL terminate the argument */
     115    AVsz = wcstombs(string, Argv[count], nArgvSize) + 1;
    117116    DEBUG((DEBUG_INFO, "Cvt[%d] %d \"%s\" --> \"%a\"\n", (INT32)count, (INT32)AVsz, Argv[count], nArgv[count]));
    118     string += AVsz + 1;
    119     nArgvSize -= AVsz + 1;
     117    string += AVsz;
     118    nArgvSize -= AVsz;
    120119    if(nArgvSize < 0) {
    121       Print(L"ABORTING: Internal Argv[%d] conversion error.\n", count);
     120      DEBUG((DEBUG_ERROR, "ABORTING: Internal Argv[%d] conversion error.\n", count));
    122121      exit(EXIT_FAILURE);
    123122      /* Not Reached */
     
    160159    }
    161160
    162     i = open("stdin:", O_RDONLY, 0444);
     161    DEBUG((DEBUG_INIT, "StdLib: Open Standard IO.\n"));
     162    i = open("stdin:", (O_RDONLY | O_TTY_INIT), 0444);
    163163    if(i == 0) {
    164       i = open("stdout:", O_WRONLY, 0222);
     164      i = open("stdout:", (O_WRONLY | O_TTY_INIT), 0222);
    165165      if(i == 1) {
    166166        i = open("stderr:", O_WRONLY, 0222);
     
    179179    else {
    180180      if( setjmp(gMD->MainExit) == 0) {
     181        errno   = 0;    // Clean up any "scratch" values from startup.
    181182        ExitVal = (INTN)main( (int)Argc, gMD->NArgV);
    182183        exitCleanup(ExitVal);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette