Skip to content

Call EndEnumeration on normal completion in WMI QueryRows. - #243

Open
grrrrrrrrr wants to merge 1 commit into
google:masterfrom
grrrrrrrrr:fix-wmi-end-enumeration
Open

Call EndEnumeration on normal completion in WMI QueryRows.#243
grrrrrrrrr wants to merge 1 commit into
google:masterfrom
grrrrrrrrr:fix-wmi-end-enumeration

Conversation

@grrrrrrrrr

Copy link
Copy Markdown
Collaborator

In wmi::QueryRows::next, property iteration begins with
IWbemClassObject::BeginEnumeration and iterates using Next. When
Next returned WBEM_S_NO_MORE_DATA, the loop terminated without
calling EndEnumeration.

Microsoft WMI COM documentation specifies that EndEnumeration must be
called to release internal enumeration resources before starting a new
enumeration or releasing the object.

This change adds the missing EndEnumeration call upon loop completion.

In `wmi::QueryRows::next`, property iteration begins with
`IWbemClassObject::BeginEnumeration` and iterates using `Next`. When
`Next` returned `WBEM_S_NO_MORE_DATA`, the loop terminated without
calling `EndEnumeration`.

Microsoft WMI COM documentation specifies that `EndEnumeration` must be
called to release internal enumeration resources before starting a new
enumeration or releasing the object.

This change adds the missing `EndEnumeration` call upon loop completion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant