VirtualBox

Changeset 85962 in vbox


Ignore:
Timestamp:
Aug 31, 2020 6:47:22 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
140157
Message:

bugref:9637. Starting VBoxDRMClient from VBoxService when some geust property is set.

Location:
trunk/src/VBox/Additions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxService.cpp

    r85121 r85962  
    7878# include <iprt/memtracker.h>
    7979#endif
     80#include <iprt/env.h>
    8081#include <iprt/message.h>
    8182#include <iprt/path.h>
     
    9192
    9293#include "VBoxServiceInternal.h"
     94#include "VBoxServiceUtils.h"
    9395#ifdef VBOX_WITH_VBOXSERVICE_CONTROL
    9496# include "VBoxServiceControl.h"
     
    892894}
    893895
     896#ifdef RT_OS_LINUX
     897/**
     898 * Check for a guest property and start VBoxDRMClient if it exists.
     899 *
     900 */
     901static void startDRMResize(void)
     902{
     903    uint32_t uGuestPropSvcClientID;
     904    int rc = VbglR3GuestPropConnect(&uGuestPropSvcClientID);
     905    if (RT_SUCCESS(rc))
     906    {
     907        rc = VGSvcCheckPropExist(uGuestPropSvcClientID, "/VirtualBox/GuestAdd/DRMResize");
     908        if (RT_SUCCESS(rc))
     909        {
     910            RTMsgInfo("Starting DRM resize service");
     911            char szDRMClientPath[RTPATH_MAX];
     912            RTPathExecDir(szDRMClientPath, RTPATH_MAX);
     913            RTPathStripSuffix(szDRMClientPath);
     914            RTPathAppend(szDRMClientPath, RTPATH_MAX, "VBoxDRMClient");
     915            const char *apszArgs[1] = { NULL };
     916            rc = RTProcCreate("VBoxDRMClient", apszArgs, RTENV_DEFAULT,
     917                              RTPROC_FLAGS_DETACHED | RTPROC_FLAGS_SEARCH_PATH, NULL);
     918            if (rc == -1)
     919                RTMsgError("Could not start DRM resize service");
     920        }
     921    }
     922}
     923#endif
    894924
    895925int main(int argc, char **argv)
     
    11571187        return rcExit;
    11581188
     1189#ifdef RT_OS_LINUX
     1190    startDRMResize();
     1191#endif
     1192
    11591193#ifdef RT_OS_WINDOWS
    11601194    /*
     
    12841318    return rcExit;
    12851319}
    1286 
  • trunk/src/VBox/Additions/x11/VBoxClient/display-svga-x11.cpp

    r84832 r85962  
    678678}
    679679
     680/**
     681 * We start VBoxDRMClient from VBoxService in case  some guest property is set.
     682 * We check the same guest property here and dont start this service in case
     683 * it (guest property) is set.
     684 */
     685static bool checkDRMClient()
     686{
     687    return false;
     688    // uint32_t uGuestPropSvcClientID;
     689    // int rc = VbglR3GuestPropConnect(&uGuestPropSvcClientID);
     690    // if (RT_SUCCESS(rc))
     691    // {
     692    //     rc = VGSvcCheckPropExist(uGuestPropSvcClientID, "/VirtualBox/GuestAdd/DRMResize");
     693    //     if (RT_SUCCESS(rc))
     694    //         return true;
     695    // }
     696    // return false;
     697}
     698
    680699static bool init()
    681700{
     701    /* If DRM client is already running don't start this service. */
     702    if (checkDRMClient())
     703        return false;
    682704    if (isXwayland())
    683705    {
    684         VBClLogInfo("The parent session seems to be running on Wayland. Starting DRM client\n");
    685706        char* argv[] = {NULL};
    686707        char* env[] = {NULL};
     
    12551276{
    12561277    RT_NOREF(ppInterface, fDaemonised);
    1257     int rc;
    1258     uint32_t events;
     1278    if (!init())
     1279        return VERR_NOT_AVAILABLE;
     1280
    12591281    /* Do not acknowledge the first event we query for to pick up old events,
    12601282     * e.g. from before a guest reboot. */
    12611283    bool fAck = false;
    12621284    bool fFirstRun = true;
    1263     if (!init())
    1264         return VERR_NOT_AVAILABLE;
    12651285    static struct VMMDevDisplayDef aMonitors[VMW_MAX_HEADS];
    12661286
    1267     rc = VbglR3CtlFilterMask(VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST, 0);
     1287    int rc = VbglR3CtlFilterMask(VMMDEV_EVENT_DISPLAY_CHANGE_REQUEST, 0);
    12681288    if (RT_FAILURE(rc))
    12691289        VBClLogFatalError("Failed to request display change events, rc=%Rrc\n", rc);
     
    13381358            }
    13391359        }
     1360        uint32_t events;
    13401361        do
    13411362        {
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