VirtualBox

Ignore:
Timestamp:
Sep 30, 2014 2:45:00 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
96327
Message:

Main: DnsMonitorService: step on unicode rails: store network configuration in unicode-compatible containner (std::wstring) (preliminary tested on Linux, Mac and Windows); DnsMonitorService for Windows: reworked in order to subscribe to correct events and filter-out those ones we don't interested in. (Experimantal, needs more testing and review).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/HostDnsServiceResolvConf.cpp

    r50263 r52897  
    6161}
    6262
    63 
    6463HRESULT HostDnsServiceResolvConf::readResolvConf()
    6564{
    6665    struct rcp_state st;
    67    
     66    wchar_t *pwczTmpStr;
     67
    6868    st.rcps_flags = RCPSF_NO_STR2IPCONV;
    6969    int rc = rcp_parse(&st, m->resolvConfFilename.c_str());
     
    7575    {
    7676        AssertBreak(st.rcps_str_nameserver[i]);
    77         info.servers.push_back(st.rcps_str_nameserver[i]);
     77
     78        pwczTmpStr = NULL;
     79        rc = RTStrToUtf16(st.rcps_str_nameserver[i], (RTUTF16 **)&pwczTmpStr);
     80        if (RT_SUCCESS(rc) && pwczTmpStr)
     81        {
     82            info.servers.push_back(std::wstring(pwczTmpStr));
     83            RTUtf16Free((RTUTF16 *)pwczTmpStr);
     84        }
    7885    }
    79    
     86
    8087    if (st.rcps_domain)
    81         info.domain = st.rcps_domain;
     88    {
     89        pwczTmpStr = NULL;
     90        rc = RTStrToUtf16(st.rcps_domain, (RTUTF16 **)&pwczTmpStr);
     91        if (RT_SUCCESS(rc) && pwczTmpStr)
     92        {
     93            info.domain = std::wstring(pwczTmpStr);
     94            RTUtf16Free((RTUTF16 *)pwczTmpStr);
     95        }
     96    }
    8297
    8398    for (unsigned i = 0; i != st.rcps_num_searchlist; ++i)
    8499    {
    85100        AssertBreak(st.rcps_searchlist[i]);
    86         info.searchList.push_back(st.rcps_searchlist[i]);
     101        pwczTmpStr = NULL;
     102        rc = RTStrToUtf16(st.rcps_searchlist[i], (RTUTF16 **)&pwczTmpStr);
     103        if (RT_SUCCESS(rc) && pwczTmpStr)
     104        {
     105            info.searchList.push_back(std::wstring(pwczTmpStr));
     106            RTUtf16Free((RTUTF16 *)pwczTmpStr);
     107        }
    87108    }
    88109    setInfo(info);
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