Changeset 52897 in vbox for trunk/src/VBox/Main/src-server/HostDnsServiceResolvConf.cpp
- Timestamp:
- Sep 30, 2014 2:45:00 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 96327
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/HostDnsServiceResolvConf.cpp
r50263 r52897 61 61 } 62 62 63 64 63 HRESULT HostDnsServiceResolvConf::readResolvConf() 65 64 { 66 65 struct rcp_state st; 67 66 wchar_t *pwczTmpStr; 67 68 68 st.rcps_flags = RCPSF_NO_STR2IPCONV; 69 69 int rc = rcp_parse(&st, m->resolvConfFilename.c_str()); … … 75 75 { 76 76 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 } 78 85 } 79 86 80 87 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 } 82 97 83 98 for (unsigned i = 0; i != st.rcps_num_searchlist; ++i) 84 99 { 85 100 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 } 87 108 } 88 109 setInfo(info);
Note:
See TracChangeset
for help on using the changeset viewer.