Changeset 17694 in vbox for trunk/src/VBox/Main
- Timestamp:
- Mar 11, 2009 1:46:23 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/win/NetIfList-win.cpp
r17679 r17694 231 231 ) 232 232 { 233 HRESULT hres ;233 HRESULT hres = S_OK; 234 234 // Step 6: -------------------------------------------------- 235 235 // Use the IWbemServices pointer to make requests of WMI ---- 236 236 237 IWbemClassObject* pInParamsDefinition = NULL; 238 hres = pClass->GetMethod(MethodName, 0, 239 &pInParamsDefinition, NULL); 237 ComPtr<IWbemClassObject> pInParamsDefinition; 238 ComPtr<IWbemClassObject> pClassInstance; 239 240 if(cArgs) 241 { 242 hres = pClass->GetMethod(MethodName, 0, 243 pInParamsDefinition.asOutParam(), NULL); 244 if(SUCCEEDED(hres)) 245 { 246 hres = pInParamsDefinition->SpawnInstance(0, pClassInstance.asOutParam()); 247 248 if(SUCCEEDED(hres)) 249 { 250 for(UINT i = 0; i < cArgs; i++) 251 { 252 // Store the value for the in parameters 253 hres = pClassInstance->Put(pArgNames[i], 0, 254 pArgs[i], 0); 255 if(FAILED(hres)) 256 { 257 break; 258 } 259 } 260 } 261 } 262 } 263 240 264 if(SUCCEEDED(hres)) 241 265 { 242 IWbemClassObject* p ClassInstance= NULL;243 hres = p InParamsDefinition->SpawnInstance(0, &pClassInstance);244 266 IWbemClassObject* pOutParams = NULL; 267 hres = pSvc->ExecMethod(ObjPath, MethodName, 0, 268 NULL, pClassInstance, &pOutParams, NULL); 245 269 if(SUCCEEDED(hres)) 246 270 { 247 for(UINT i = 0; i < cArgs; i++) 248 { 249 // Store the value for the in parameters 250 hres = pClassInstance->Put(pArgNames[i], 0, 251 pArgs[i], 0); 252 if(FAILED(hres)) 253 { 254 break; 255 } 256 } 257 258 if(SUCCEEDED(hres)) 259 { 260 IWbemClassObject* pOutParams = NULL; 261 hres = pSvc->ExecMethod(ObjPath, MethodName, 0, 262 NULL, pClassInstance, &pOutParams, NULL); 263 if(SUCCEEDED(hres)) 264 { 265 *ppOutParams = pOutParams; 266 } 267 } 268 269 pClassInstance->Release(); 270 } 271 272 pInParamsDefinition->Release(); 271 *ppOutParams = pOutParams; 272 } 273 273 } 274 274 … … 396 396 if(SUCCEEDED(hr)) 397 397 { 398 Assert(varReturnValue.vt == VT_UINT);398 // Assert(varReturnValue.vt == VT_UINT); 399 399 int winEr = varReturnValue.uintVal; 400 400 switch(winEr) … … 2288 2288 ComObjPtr <Progress> progress; 2289 2289 progress.createObject(); 2290 ComPtr<IHost> host;2291 HRESULT rc = vBox->COMGETTER(Host)(host.asOutParam());2292 if(SUCCEEDED(rc))2293 { 2294 rc = progress->init (vBox, host,2290 // ComPtr<IHost> host; 2291 // HRESULT rc = vBox->COMGETTER(Host)(host.asOutParam()); 2292 // if(SUCCEEDED(rc)) 2293 { 2294 rc = progress->init (vBox, (IHostNetworkInterface*)pIf, 2295 2295 Bstr ("Enabling Dynamic Ip Configuration"), 2296 2296 FALSE /* aCancelable */); … … 2321 2321 /* d is now owned by netIfNetworkInterfaceHelperClient(), so release it */ 2322 2322 d.release(); 2323 2324 progress->WaitForCompletion(-1); 2323 2325 } 2324 2326 } … … 2344 2346 ComObjPtr <Progress> progress; 2345 2347 progress.createObject(); 2346 ComPtr<IHost> host;2347 HRESULT rc = vBox->COMGETTER(Host)(host.asOutParam());2348 if(SUCCEEDED(rc))2349 { 2350 rc = progress->init (vBox, host,2348 // ComPtr<IHost> host; 2349 // HRESULT rc = vBox->COMGETTER(Host)(host.asOutParam()); 2350 // if(SUCCEEDED(rc)) 2351 { 2352 rc = progress->init (vBox, (IHostNetworkInterface*)pIf, 2351 2353 Bstr ("Enabling Dynamic Ip Configuration"), 2352 2354 FALSE /* aCancelable */); … … 2377 2379 /* d is now owned by netIfNetworkInterfaceHelperClient(), so release it */ 2378 2380 d.release(); 2381 2382 progress->WaitForCompletion(-1); 2379 2383 } 2380 2384 } … … 2400 2404 ComObjPtr <Progress> progress; 2401 2405 progress.createObject(); 2402 ComPtr<IHost> host;2403 HRESULT rc = vBox->COMGETTER(Host)(host.asOutParam());2404 if(SUCCEEDED(rc))2405 { 2406 rc = progress->init (vBox, host,2406 // ComPtr<IHost> host; 2407 // HRESULT rc = vBox->COMGETTER(Host)(host.asOutParam()); 2408 // if(SUCCEEDED(rc)) 2409 { 2410 rc = progress->init (vBox, (IHostNetworkInterface*)pIf, 2407 2411 Bstr ("Enabling Dynamic Ip Configuration"), 2408 2412 FALSE /* aCancelable */); … … 2431 2435 /* d is now owned by netIfNetworkInterfaceHelperClient(), so release it */ 2432 2436 d.release(); 2437 2438 progress->WaitForCompletion(-1); 2433 2439 } 2434 2440 }
Note:
See TracChangeset
for help on using the changeset viewer.