VirtualBox

Ignore:
Timestamp:
Sep 5, 2011 1:49:45 PM (13 years ago)
Author:
vboxsync
Message:

*,IPRT: Redid the ring-3 init to always convert the arguments to UTF-8.

Location:
trunk/src/VBox/HostDrivers/Support
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h

    r37596 r38636  
    277277 *
    278278 * This is dynamically resolved and invoked by the static library before it
    279  * calls RTR3Init and thereby SUPR3Init.
     279 * calls RTR3InitEx and thereby SUPR3Init.
    280280 *
    281281 * @returns IPRT status code.
  • trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp

    r38076 r38636  
    7979#include <VBox/err.h>
    8080#include <iprt/string.h>
     81#include <iprt/initterm.h>
    8182#include <iprt/param.h>
    8283
     
    110111*******************************************************************************/
    111112/** @see RTR3InitEx */
    112 typedef DECLCALLBACK(int) FNRTR3INITEX(uint32_t iVersion, const char *pszProgramPath, bool fInitSUPLib);
     113typedef DECLCALLBACK(int) FNRTR3INITEX(uint32_t iVersion, uint32_t fFlags, int cArgs,
     114                                       char **papszArgs, const char *pszProgramPath);
    113115typedef FNRTR3INITEX *PFNRTR3INITEX;
    114116
     
    826828/**
    827829 * Loads the VBoxRT DLL/SO/DYLIB, hands it the open driver,
    828  * and calls RTR3Init.
     830 * and calls RTR3InitEx.
    829831 *
    830832 * @param   fFlags      The SUPR3HardenedMain fFlags argument, passed to supR3PreInit.
     
    896898        pszExePath = g_szSupLibHardenedExePath;
    897899#endif
    898     rc = pfnRTInitEx(0, pszExePath, !(fFlags & SUPSECMAIN_FLAGS_DONT_OPEN_DEV));
     900    rc = pfnRTInitEx(RTR3INIT_VER_1,
     901                     fFlags & SUPSECMAIN_FLAGS_DONT_OPEN_DEV ? 0 : RTR3INIT_FLAGS_SUPLIB,
     902                     0 /*cArgs*/, NULL /*papszArgs*/, pszExePath);
    899903    if (RT_FAILURE(rc))
    900904        supR3HardenedFatalMsg("supR3HardenedMainInitRuntime", kSupInitOp_IPRT, rc,
    901                               "RTR3Init failed with rc=%d", rc);
     905                              "RTR3InitEx failed with rc=%d", rc);
    902906}
    903907
     
    10851089    /*
    10861090     * Load the IPRT, hand the SUPLib part the open driver and
    1087      * call RTR3Init.
     1091     * call RTR3InitEx.
    10881092     */
    10891093    supR3HardenedMainInitRuntime(fFlags);
  • trunk/src/VBox/HostDrivers/Support/testcase/SUPInstall.cpp

    r28800 r38636  
    3737int main(int argc, char **argv)
    3838{
    39     RTR3Init();
     39    RTR3InitExeNoArguments(0);
    4040    int rc = SUPR3Install();
    4141    if (RT_SUCCESS(rc))
  • trunk/src/VBox/HostDrivers/Support/testcase/SUPLoggerCtl.cpp

    r28800 r38636  
    5858int main(int argc, char **argv)
    5959{
    60     RTR3InitAndSUPLib();
     60    RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB);
    6161
    6262    /*
  • trunk/src/VBox/HostDrivers/Support/testcase/SUPUninstall.cpp

    r28800 r38636  
    3737int main(int argc, char **argv)
    3838{
    39     RTR3Init();
     39    RTR3InitExeNoArguments(0);
    4040    int rc = SUPR3Uninstall();
    4141    if (RT_SUCCESS(rc))
  • trunk/src/VBox/HostDrivers/Support/testcase/tstContiguous.cpp

    r28800 r38636  
    4242    int rcRet = 0;
    4343
    44     RTR3Init();
     44    RTR3InitExe(argc, &argv, 0);
    4545    rc = SUPR3Init(NULL);
    4646    RTPrintf("tstContiguous: SUPR3Init -> rc=%Rrc\n", rc);
  • trunk/src/VBox/HostDrivers/Support/testcase/tstGIP-2.cpp

    r33595 r38636  
    4343int main(int argc, char **argv)
    4444{
    45     RTR3Init();
     45    RTR3InitExe(argc, &argv, 0);
    4646
    4747    /*
  • trunk/src/VBox/HostDrivers/Support/testcase/tstGetPagingMode.cpp

    r28800 r38636  
    3838{
    3939    int rc;
    40     RTR3Init();
     40    RTR3InitExe(argc, &argv, 0);
    4141    rc = SUPR3Init(NULL);
    4242    if (RT_SUCCESS(rc))
  • trunk/src/VBox/HostDrivers/Support/testcase/tstInit.cpp

    r28800 r38636  
    3838{
    3939    int rc;
    40     RTR3Init();
     40    RTR3InitExe(argc, &argv, 0);
    4141    rc = SUPR3Init(NULL);
    4242    RTPrintf("tstInit: SUPR3Init -> rc=%d\n", rc);
  • trunk/src/VBox/HostDrivers/Support/testcase/tstInt.cpp

    r35346 r38636  
    7878     * Init.
    7979     */
    80     RTR3Init();
     80    RTR3InitExe(argc, &argv, 0);
    8181    PSUPDRVSESSION pSession;
    8282    rc = SUPR3Init(&pSession);
  • trunk/src/VBox/HostDrivers/Support/testcase/tstLow.cpp

    r28800 r38636  
    4242    int rcRet = 0;
    4343
    44     RTR3Init();
     44    RTR3InitExe(argc, &argv, 0);
    4545    RTPrintf("tstLow: TESTING...\n");
    4646
  • trunk/src/VBox/HostDrivers/Support/testcase/tstPage.cpp

    r28800 r38636  
    3939{
    4040    int cErrors = 0;
    41     int rc = 0;
    42     RTR3InitAndSUPLib();
    43     rc = SUPR3Init(NULL);
     41
     42    RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB);
     43    int rc = SUPR3Init(NULL);
    4444    cErrors += rc != 0;
    4545    if (!rc)
  • trunk/src/VBox/HostDrivers/Support/testcase/tstPin.cpp

    r28800 r38636  
    4646    RTHCPHYS    HCPhys;
    4747
    48     RTR3InitAndSUPLib();
     48    RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB);
    4949    rc = SUPR3Init(NULL);
    5050    RTPrintf("SUPR3Init -> rc=%d\n", rc);
  • trunk/src/VBox/HostDrivers/Support/testcase/tstSupLoadModule.cpp

    r35188 r38636  
    4545     * Init.
    4646     */
    47     int rc = RTR3InitAndSUPLib();
     47    int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB);
    4848    if (RT_FAILURE(rc))
    49     {
    50         RTMsgError("RTR3InitAndSUPLib failed with rc=%Rrc\n", rc);
    51         return 1;
    52     }
     49        return RTMsgInitFailure(rc);
    5350
    5451    /*
  • trunk/src/VBox/HostDrivers/Support/testcase/tstSupSem-Zombie.cpp

    r28800 r38636  
    9595     * Init.
    9696     */
    97     int rc = RTR3InitAndSUPLib();
     97    int rc = RTR3InitExeNoArguments(RTR3INIT_FLAGS_SUPLIB);
    9898    if (RT_FAILURE(rc))
    9999    {
    100         RTPrintf("tstSupSem-Zombie-Child: fatal error: RTR3InitAndSUPLib failed with rc=%Rrc\n", rc);
     100        RTPrintf("tstSupSem-Zombie-Child: fatal error: RTR3InitExeNoArguments failed with rc=%Rrc\n", rc);
    101101        return 1;
    102102    }
  • trunk/src/VBox/HostDrivers/Support/testcase/tstSupSem.cpp

    r33383 r38636  
    3434#include <iprt/err.h>
    3535#include <iprt/initterm.h>
     36#include <iprt/message.h>
    3637#include <iprt/stream.h>
    3738#include <iprt/test.h>
     
    7980     * Init.
    8081     */
    81     int rc = RTR3InitAndSUPLib();
     82    int rc = RTR3InitExe(argc, &argv, RTR3INIT_FLAGS_SUPLIB);
    8283    if (RT_FAILURE(rc))
    83     {
    84         RTPrintf("tstSupSem: fatal error: RTR3InitAndSUPLib failed with rc=%Rrc\n", rc);
    85         return 1;
    86     }
     84        return RTMsgInitFailure(rc);
    8785
    8886    if (argc == 2 && !strcmp(argv[1], "child"))
  • trunk/src/VBox/HostDrivers/Support/win/SUPSvc-win.cpp

    r33540 r38636  
    775775    RTEnvSet("VBOX_LOG_FLAGS", "unbuffered thread msprog");
    776776#endif
    777     int rc = RTR3Init();
     777    int rc = RTR3InitExe(argc, &argv, 0);
    778778    if (RT_FAILURE(rc))
    779779    {
    780         supSvcLogError("RTR3Init failed with rc=%Rrc", rc);
     780        supSvcLogError("RTR3InitExe failed with rc=%Rrc", rc);
    781781        return 1;
    782782    }
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