VirtualBox

Changeset 78030 in vbox


Ignore:
Timestamp:
Apr 5, 2019 7:08:10 PM (6 years ago)
Author:
vboxsync
Message:

Main/HostDnsServiceDarwin: Preliminary fix to make VBoxSVC start on MacOS again; more work needed in that area, code still is too convoluted.

Location:
trunk/src/VBox/Main/src-server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/HostDnsService.h

    r78014 r78030  
    154154private:
    155155
    156     HRESULT updateInfo();
     156    int updateInfo(void);
    157157    static void hostDnsServiceStoreCallback(void *store, void *arrayRef, void *info);
    158158    struct Data;
  • trunk/src/VBox/Main/src-server/darwin/HostDnsServiceDarwin.cpp

    r78013 r78030  
    6666HRESULT HostDnsServiceDarwin::init(HostDnsMonitorProxy *pProxy)
    6767{
    68     HRESULT hrc = HostDnsServiceBase::init(pProxy);
    69     AssertComRCReturn(hrc, hrc);
    70 
    7168    SCDynamicStoreContext ctx;
    7269    RT_ZERO(ctx);
     
    9693    CFRunLoopAddSource(m->m_RunLoopRef, m->m_SourceStop, kCFRunLoopCommonModes);
    9794
    98     return updateInfo();
     95    HRESULT hrc = HostDnsServiceBase::init(pProxy);
     96    return hrc;
    9997}
    10098
     
    143141    {
    144142        CFRelease(m->m_DnsWatcher);
    145         return E_OUTOFMEMORY;
     143        return VERR_NO_MEMORY;
    146144    }
    147145
     
    153151    onMonitorThreadInitDone();
    154152
     153    /* Trigger initial update. */
     154    int rc = updateInfo();
     155    AssertRC(rc); /* Not fatal in release builds. */
     156
    155157    while (!ASMAtomicReadBool(&m->m_fStop))
    156158    {
     
    164166}
    165167
    166 HRESULT HostDnsServiceDarwin::updateInfo(void)
     168int HostDnsServiceDarwin::updateInfo(void)
    167169{
    168170    CFPropertyListRef propertyRef = SCDynamicStoreCopyValue(m->m_store, kStateNetworkGlobalDNSKey);
     
    186188
    187189    if (!propertyRef)
    188         return S_OK;
     190        return VINF_SUCCESS;
    189191
    190192    HostDnsInformation info;
     
    245247    setInfo(info);
    246248
    247     return S_OK;
    248 }
    249 
    250 void HostDnsServiceDarwin::hostDnsServiceStoreCallback(void *, void *, void *info)
    251 {
    252     HostDnsServiceDarwin *pThis = (HostDnsServiceDarwin *)info;
     249    return VINF_SUCCESS;
     250}
     251
     252void HostDnsServiceDarwin::hostDnsServiceStoreCallback(void *, void *, void *pInfo)
     253{
     254    HostDnsServiceDarwin *pThis = (HostDnsServiceDarwin *)pInfo;
     255    AssertPtrReturnVoid(pThis);
    253256
    254257    RTCLock grab(pThis->m_LockMtx);
     
    258261void HostDnsServiceDarwin::Data::performShutdownCallback(void *pInfo)
    259262{
    260     HostDnsServiceDarwin::Data *pThis = static_cast<HostDnsServiceDarwin::Data *>(pInfo);
     263    HostDnsServiceDarwin *pThis = (HostDnsServiceDarwin *)pInfo;
    261264    AssertPtrReturnVoid(pThis);
    262     pThis->m_fStop = true;
    263 }
    264 
     265
     266    AssertPtrReturnVoid(pThis->m);
     267    ASMAtomicXchgBool(&pThis->m->m_fStop, true);
     268}
     269
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