VirtualBox

Changeset 93330 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Jan 18, 2022 5:36:02 PM (3 years ago)
Author:
vboxsync
Message:

Additions: Guest Lib: VBoxGuestR3LibDrmClient: do not expose Linux specific code to other platforms, bugref:10134.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibDrmClient.cpp

    r93237 r93330  
    3535#include <iprt/process.h>
    3636
     37#if defined(RT_OS_LINUX)
     38
    3739/** Defines the DRM client executable (image). */
    38 #define VBOX_DRMCLIENT_EXECUTABLE           "/usr/bin/VBoxDRMClient"
    39 #define VBOX_DRMCLIENT_LEGACY_EXECUTABLE    "/usr/bin/VBoxClient"
     40# define VBOX_DRMCLIENT_EXECUTABLE           "/usr/bin/VBoxDRMClient"
     41# define VBOX_DRMCLIENT_LEGACY_EXECUTABLE    "/usr/bin/VBoxClient"
    4042/** Defines the guest property that defines if the DRM resizing client needs to be active or not. */
    41 #define VBOX_DRMCLIENT_GUEST_PROP_RESIZE    "/VirtualBox/GuestAdd/DRMResize"
     43# define VBOX_DRMCLIENT_GUEST_PROP_RESIZE    "/VirtualBox/GuestAdd/DRMResize"
     44
     45#endif /* RT_OS_LINUX */
    4246
    4347/**
     
    4953VBGLR3DECL(bool) VbglR3DrmClientIsNeeded(void)
    5054{
     55#if defined(RT_OS_LINUX)
    5156    bool fStartClient = false;
    5257
    53 #ifdef VBOX_WITH_GUEST_PROPS
     58# ifdef VBOX_WITH_GUEST_PROPS
    5459    uint32_t idClient;
    5560    int rc = VbglR3GuestPropConnect(&idClient);
     
    5964        VbglR3GuestPropDisconnect(idClient);
    6065    }
     66# endif
     67    return fStartClient;
     68
     69#else /* !RT_OS_LINUX */
     70    return false;
    6171#endif
    62 
    63     return fStartClient;
    6472}
    6573
     
    7785static int VbglR3DrmStart(const char *pszCmd, const char **apszArgs)
    7886{
     87#if defined(RT_OS_LINUX)
    7988    return RTProcCreate(pszCmd, apszArgs, RTENV_DEFAULT,
    8089                        RTPROC_FLAGS_DETACHED | RTPROC_FLAGS_SEARCH_PATH, NULL);
     90#else
     91    return VERR_NOT_SUPPORTED;
     92#endif
    8193}
    8294
     
    88100VBGLR3DECL(int) VbglR3DrmClientStart(void)
    89101{
     102#if defined(RT_OS_LINUX)
    90103    const char *apszArgs[1] = { NULL }; /** @todo r=andy Pass path + process name as argv0? */
    91104    return VbglR3DrmStart(VBOX_DRMCLIENT_EXECUTABLE, apszArgs);
     105#else
     106    return VERR_NOT_SUPPORTED;
     107#endif
    92108}
    93109
     
    99115VBGLR3DECL(int) VbglR3DrmLegacyClientStart(void)
    100116{
     117#if defined(RT_OS_LINUX)
    101118    const char *apszArgs[3] = { VBOX_DRMCLIENT_LEGACY_EXECUTABLE, "--vmsvga", NULL };
    102119    return VbglR3DrmStart(VBOX_DRMCLIENT_LEGACY_EXECUTABLE, apszArgs);
     120#else
     121    return VERR_NOT_SUPPORTED;
     122#endif
    103123}
    104124
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