VirtualBox

Changeset 35542 in vbox


Ignore:
Timestamp:
Jan 13, 2011 3:42:16 PM (14 years ago)
Author:
vboxsync
Message:

VBoxExtPackHelperApp.cpp: Fixed issue with non-ascii characters in the argument list on windows that prevent installing extension packs residing in directory with non-ascii names.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-helper-apps/VBoxExtPackHelperApp.cpp

    r35527 r35542  
    18551855    g_hInstance = hInstance;
    18561856    NOREF(hPrevInstance); NOREF(nShowCmd); NOREF(lpCmdLine);
    1857     return main(__argc, __argv);
     1857
     1858    int rc = RTR3Init();
     1859    if (RT_FAILURE(rc))
     1860        return RTMsgInitFailure(rc);
     1861
     1862    LPWSTR pwszCmdLine = GetCommandLineW();
     1863    if (!pwszCmdLine)
     1864        return RTMsgErrorExit(RTEXITCODE_FAILURE, "GetCommandLineW failed");
     1865
     1866    char *pszCmdLine;
     1867    rc = RTUtf16ToUtf8(pwszCmdLine, &pszCmdLine); /* leaked */
     1868    if (RT_FAILURE(rc))
     1869        return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to convert the command line: %Rrc", rc);
     1870
     1871    int    cArgs;
     1872    char **papszArgs;
     1873    rc = RTGetOptArgvFromString(&papszArgs, &cArgs, pszCmdLine, NULL);
     1874    if (RT_SUCCESS(rc))
     1875    {
     1876
     1877        rc = main(cArgs, papszArgs);
     1878
     1879        RTGetOptArgvFree(papszArgs);
     1880    }
     1881    else
     1882        rc = RTMsgErrorExit(RTEXITCODE_FAILURE, "RTGetOptArgvFromString failed: %Rrc", rc);
     1883    RTStrFree(pszCmdLine);
     1884
     1885    return rc;
    18581886}
    18591887#endif
Note: See TracChangeset for help on using the changeset viewer.

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