MCPcopy Create free account
hub / github.com/Kitware/CMake / EnumerateVSInstancesWithCOM

Method EnumerateVSInstancesWithCOM

Source/cmVSSetupHelper.cxx:372–404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370}
371
372bool cmVSSetupAPIHelper::EnumerateVSInstancesWithCOM(
373 std::vector<VSInstanceInfo>& VSInstances)
374{
375 if (initializationFailure || !setupConfig || !setupConfig2 || !setupHelper) {
376 return false;
377 }
378
379 SmartCOMPtr<IEnumSetupInstances> enumInstances = nullptr;
380 if (FAILED(
381 setupConfig2->EnumInstances((IEnumSetupInstances**)&enumInstances)) ||
382 !enumInstances) {
383 return false;
384 }
385
386 SmartCOMPtr<ISetupInstance> instance;
387 while (SUCCEEDED(enumInstances->Next(1, &instance, nullptr)) && instance) {
388 SmartCOMPtr<ISetupInstance2> instance2 = nullptr;
389 if (FAILED(
390 instance->QueryInterface(IID_ISetupInstance2, (void**)&instance2)) ||
391 !instance2) {
392 instance = nullptr;
393 continue;
394 }
395
396 VSInstanceInfo instanceInfo;
397 bool isInstalled = GetVSInstanceInfo(instance2, instanceInfo);
398 instance = instance2 = nullptr;
399 if (isInstalled) {
400 VSInstances.push_back(instanceInfo);
401 }
402 }
403 return true;
404}
405
406bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
407{

Callers

nothing calls this directly

Calls 3

QueryInterfaceMethod · 0.80
push_backMethod · 0.80
NextMethod · 0.45

Tested by

no test coverage detected