Skip to content

LoadImage's returned HANDLE must be released in ONE of THREE ways #611

@AArnott

Description

@AArnott

LoadImageW/LoadImageA in the metadata currently return a HANDLE type, which would be closed with CloseHandle.
However the docs state that one of DeleteObject, DeleteCursor or DeleteIcon should be used to release the handle, and only if the LR_SHARED flag was not passed in. The metadata returning HANDLE means CloseHandle will always be called, which is the wrong method and the wrong conditions.

How can we model this in the metadata?

Metadata

Metadata

Labels

broken apiAn API is inaccurate and could lead to runtime failurespecial caseA special case to consider in metadata and/or projections.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions