Changeset 59087 in vbox for trunk/src/VBox/Main/src-server/win/NetIf-win.cpp
- Timestamp:
- Dec 11, 2015 11:04:51 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/win/NetIf-win.cpp
r59082 r59087 46 46 #include "VirtualBoxImpl.h" 47 47 #include "netif.h" 48 #include "ThreadTask.h" 48 49 49 50 #ifdef VBOX_WITH_NETFLT … … 237 238 }; 238 239 239 struct NetworkInterfaceHelperClientData 240 { 240 class NetworkInterfaceHelperClientData : public ThreadVoidData 241 { 242 public: 243 NetworkInterfaceHelperClientData(){}; 244 ~NetworkInterfaceHelperClientData(){}; 245 241 246 SVCHlpMsg::Code msgCode; 242 247 /* for SVCHlpMsg::CreateHostOnlyNetworkInterface */ … … 253 258 } u; 254 259 255 256 260 }; 257 261 … … 269 273 AssertReturn(aUser, E_POINTER); 270 274 271 std::auto_ptr<NetworkInterfaceHelperClientData> 272 d(static_cast<NetworkInterfaceHelperClientData *>(aUser)); 275 NetworkInterfaceHelperClientData* d = static_cast<NetworkInterfaceHelperClientData *>(aUser); 273 276 274 277 if (aClient == NULL) … … 1161 1164 1162 1165 /* create the networkInterfaceHelperClient() argument */ 1163 std::auto_ptr<NetworkInterfaceHelperClientData> 1164 d(new NetworkInterfaceHelperClientData()); 1165 AssertReturn(d.get(), E_OUTOFMEMORY); 1166 NetworkInterfaceHelperClientData* d = new NetworkInterfaceHelperClientData(); 1166 1167 1167 1168 d->msgCode = SVCHlpMsg::CreateHostOnlyNetworkInterface; … … 1172 1173 rc = pVirtualBox->i_startSVCHelperClient(IsUACEnabled() == TRUE /* aPrivileged */, 1173 1174 netIfNetworkInterfaceHelperClient, 1174 static_cast<void *>(d .get()),1175 static_cast<void *>(d), 1175 1176 progress); 1176 if (SUCCEEDED(rc)) 1177 { 1178 /* d is now owned by netIfNetworkInterfaceHelperClient(), so release it */ 1179 d.release(); 1180 } 1177 /* d is now owned by netIfNetworkInterfaceHelperClient(), no need to delete one here */ 1178 1181 1179 } 1182 1180 } … … 1208 1206 1209 1207 /* create the networkInterfaceHelperClient() argument */ 1210 std::auto_ptr<NetworkInterfaceHelperClientData> 1211 d(new NetworkInterfaceHelperClientData()); 1212 AssertReturn(d.get(), E_OUTOFMEMORY); 1208 NetworkInterfaceHelperClientData* d = new NetworkInterfaceHelperClientData(); 1213 1209 1214 1210 d->msgCode = SVCHlpMsg::RemoveHostOnlyNetworkInterface; … … 1217 1213 rc = pVirtualBox->i_startSVCHelperClient(IsUACEnabled() == TRUE /* aPrivileged */, 1218 1214 netIfNetworkInterfaceHelperClient, 1219 static_cast<void *>(d .get()),1215 static_cast<void *>(d), 1220 1216 progress); 1221 1222 if (SUCCEEDED(rc)) 1223 { 1224 /* d is now owned by netIfNetworkInterfaceHelperClient(), so release it */ 1225 d.release(); 1226 } 1217 /* d is now owned by netIfNetworkInterfaceHelperClient(), no need to delete one here */ 1218 1227 1219 } 1228 1220 } … … 1262 1254 1263 1255 /* create the networkInterfaceHelperClient() argument */ 1264 std::auto_ptr<NetworkInterfaceHelperClientData> 1265 d(new NetworkInterfaceHelperClientData()); 1266 AssertReturn(d.get(), E_OUTOFMEMORY); 1256 NetworkInterfaceHelperClientData* d = new NetworkInterfaceHelperClientData(); 1267 1257 1268 1258 d->msgCode = SVCHlpMsg::EnableStaticIpConfig; … … 1274 1264 rc = vBox->i_startSVCHelperClient(IsUACEnabled() == TRUE /* aPrivileged */, 1275 1265 netIfNetworkInterfaceHelperClient, 1276 static_cast<void *>(d .get()),1266 static_cast<void *>(d), 1277 1267 progress); 1268 /* d is now owned by netIfNetworkInterfaceHelperClient(), no need to delete one here */ 1278 1269 1279 1270 if (SUCCEEDED(rc)) 1280 1271 { 1281 /* d is now owned by netIfNetworkInterfaceHelperClient(), so release it */1282 d.release();1283 1284 1272 progress->WaitForCompletion(-1); 1285 1273 } … … 1324 1312 1325 1313 /* create the networkInterfaceHelperClient() argument */ 1326 std::auto_ptr<NetworkInterfaceHelperClientData> 1327 d(new NetworkInterfaceHelperClientData()); 1328 AssertReturn(d.get(), E_OUTOFMEMORY); 1314 NetworkInterfaceHelperClientData* d = new NetworkInterfaceHelperClientData(); 1329 1315 1330 1316 d->msgCode = SVCHlpMsg::EnableStaticIpConfigV6; … … 1336 1322 rc = vBox->i_startSVCHelperClient(IsUACEnabled() == TRUE /* aPrivileged */, 1337 1323 netIfNetworkInterfaceHelperClient, 1338 static_cast<void *>(d .get()),1324 static_cast<void *>(d), 1339 1325 progress); 1326 /* d is now owned by netIfNetworkInterfaceHelperClient(), no need to delete one here */ 1340 1327 1341 1328 if (SUCCEEDED(rc)) 1342 1329 { 1343 /* d is now owned by netIfNetworkInterfaceHelperClient(), so release it */1344 d.release();1345 1346 1330 progress->WaitForCompletion(-1); 1347 1331 } … … 1385 1369 1386 1370 /* create the networkInterfaceHelperClient() argument */ 1387 std::auto_ptr<NetworkInterfaceHelperClientData> 1388 d(new NetworkInterfaceHelperClientData()); 1389 AssertReturn(d.get(), E_OUTOFMEMORY); 1371 NetworkInterfaceHelperClientData* d = new NetworkInterfaceHelperClientData(); 1390 1372 1391 1373 d->msgCode = SVCHlpMsg::EnableDynamicIpConfig; … … 1395 1377 rc = vBox->i_startSVCHelperClient(IsUACEnabled() == TRUE /* aPrivileged */, 1396 1378 netIfNetworkInterfaceHelperClient, 1397 static_cast<void *>(d .get()),1379 static_cast<void *>(d), 1398 1380 progress); 1381 /* d is now owned by netIfNetworkInterfaceHelperClient(), no need to delete one here */ 1399 1382 1400 1383 if (SUCCEEDED(rc)) 1401 1384 { 1402 /* d is now owned by netIfNetworkInterfaceHelperClient(), so release it */1403 d.release();1404 1405 1385 progress->WaitForCompletion(-1); 1406 1386 } … … 1444 1424 1445 1425 /* create the networkInterfaceHelperClient() argument */ 1446 std::auto_ptr<NetworkInterfaceHelperClientData> 1447 d(new NetworkInterfaceHelperClientData()); 1448 AssertReturn(d.get(), E_OUTOFMEMORY); 1426 NetworkInterfaceHelperClientData* d = new NetworkInterfaceHelperClientData(); 1449 1427 1450 1428 d->msgCode = SVCHlpMsg::DhcpRediscover; … … 1454 1432 rc = vBox->i_startSVCHelperClient(IsUACEnabled() == TRUE /* aPrivileged */, 1455 1433 netIfNetworkInterfaceHelperClient, 1456 static_cast<void *>(d .get()),1434 static_cast<void *>(d), 1457 1435 progress); 1436 /* d is now owned by netIfNetworkInterfaceHelperClient(), no need to delete one here */ 1458 1437 1459 1438 if (SUCCEEDED(rc)) 1460 1439 { 1461 /* d is now owned by netIfNetworkInterfaceHelperClient(), so release it */1462 d.release();1463 1464 1440 progress->WaitForCompletion(-1); 1465 1441 }
Note:
See TracChangeset
for help on using the changeset viewer.