~ubuntu-branches/ubuntu/raring/virtualbox-ose/raring

« back to all changes in this revision

Viewing changes to src/VBox/Additions/common/VBoxService/VBoxServicePageSharing.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-01-30 23:27:25 UTC
  • mfrom: (0.3.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20110130232725-2ouajjd2ggdet0zd
Tags: 4.0.2-dfsg-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Add Apport hook.
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Drop *-source packages.
* Drop ubuntu-01-fix-build-gcc45.patch, fixed upstream.
* Drop ubuntu-02-as-needed.patch, added to the Debian package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: VBoxServicePageSharing.cpp $ */
 
1
/* $Id: VBoxServicePageSharing.cpp 35036 2010-12-13 16:56:27Z vboxsync $ */
2
2
/** @file
3
3
 * VBoxService - Guest page sharing.
4
4
 */
588
588
     */
589
589
    for (;;)
590
590
    {
591
 
        uint64_t idNewSession;
592
591
        BOOL fEnabled = VbglR3PageSharingIsEnabled();
593
592
 
594
593
        VBoxServiceVerbose(3, "VBoxServicePageSharingWorker: enabled=%d\n", fEnabled);
613
612
            break;
614
613
        }
615
614
#if defined(RT_OS_WINDOWS) && !defined(TARGET_NT4)
616
 
        idNewSession = g_idSession;
 
615
        uint64_t idNewSession = g_idSession;
617
616
        rc =  VbglR3GetSessionId(&idNewSession);
618
617
        AssertRC(rc);
619
618
 
680
679
        BOOL fEnabled = VbglR3PageSharingIsEnabled();
681
680
        VBoxServiceVerbose(3, "VBoxServicePageSharingWorkerProcess: enabled=%d\n", fEnabled);
682
681
 
 
682
        /*
 
683
         * Start a 2nd VBoxService process to deal with page fusion as we do
 
684
         * not wish to dummy load dlls into this process.  (First load with
 
685
         * DONT_RESOLVE_DLL_REFERENCES, 2nd normal -> dll init routines not called!)
 
686
         */
683
687
        if (    fEnabled
684
688
            &&  hProcess == NIL_RTPROCESS)
685
689
        {
686
690
            char szExeName[256];
687
 
            char *pszExeName;
688
 
            char *pszArgs[3];
689
 
 
690
 
            pszExeName = RTProcGetExecutableName(szExeName, sizeof(szExeName));
691
 
 
 
691
            char *pszExeName = RTProcGetExecutablePath(szExeName, sizeof(szExeName));
692
692
            if (pszExeName)
693
693
            {
694
 
                pszArgs[0] = pszExeName;
695
 
                pszArgs[1] = "-pagefusionfork";
696
 
                pszArgs[2] = NULL;
697
 
                /* Start a 2nd VBoxService process to deal with page fusion as we do not wish to dummy load
698
 
                 * dlls into this process. (first load with DONT_RESOLVE_DLL_REFERENCES, 2nd normal -> dll init routines not called!)
699
 
                 */
700
 
                rc = RTProcCreate(pszExeName, pszArgs, RTENV_DEFAULT, 0 /* normal child */, &hProcess);
701
 
                if (rc != VINF_SUCCESS)
 
694
                char const *papszArgs[3];
 
695
                papszArgs[0] = pszExeName;
 
696
                papszArgs[1] = "--pagefusionfork";
 
697
                papszArgs[2] = NULL;
 
698
                rc = RTProcCreate(pszExeName, papszArgs, RTENV_DEFAULT, 0 /* normal child */, &hProcess);
 
699
                if (RT_FAILURE(rc))
702
700
                    VBoxServiceError("VBoxServicePageSharingWorkerProcess: RTProcCreate %s failed; rc=%Rrc\n", pszExeName, rc);
703
701
            }
704
702
        }