Skip to content

Commit

Permalink
RHEL-70458: Balloon: Finish WMI requiest properly
Browse files Browse the repository at this point in the history
Signed-off-by: Kostiantyn Kostiuk <[email protected]>
  • Loading branch information
kostyanf14 authored and YanVugenfirer committed Dec 11, 2024
1 parent 1bd248f commit bcd7189
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Balloon/app/memstat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,5 +196,23 @@ BOOL CMemStat::Update()
m_Stats[idx++].val = 0;
}

while (true)
{
if (enumerator == NULL)
break;

if (FAILED(enumerator->Next(WBEM_INFINITE, 1L, &memory, &retcnt)))
{
PrintMessage("Cannot again enumerate results");
break;
}

if (retcnt == 0)
{
PrintMessage("No more results found");
break;
}
}

return TRUE;
}

0 comments on commit bcd7189

Please sign in to comment.