Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeleteObjectSafeHandle can't be passed to GetObject (again) #275

Closed
jnm2 opened this issue May 21, 2021 · 1 comment · Fixed by #1111
Closed

DeleteObjectSafeHandle can't be passed to GetObject (again) #275

jnm2 opened this issue May 21, 2021 · 1 comment · Fixed by #1111
Assignees
Labels
bug Something isn't working

Comments

@jnm2
Copy link
Contributor

jnm2 commented May 21, 2021

A separate issue was previously fixed (#116).

When updating from 0.1.445-beta to 0.1.474-beta, GetObject starts taking only HGDIOBJ with no overloads that accept the (owned) DeleteObjectSafeHandle that I had been passing.

Targeting net35;net48;net5.0-windows. Using C# 9.

No overloads no matter which target framework context I use:

image

@jnm2 jnm2 added the bug Something isn't working label May 21, 2021
@AArnott AArnott self-assigned this May 21, 2021
@AArnott
Copy link
Member

AArnott commented May 21, 2021

HGDIOBJ isn't recognized as a handle typedef because it has no [RAIIFree("DeleteObject")] attribute as all its "derived types" do.
We have a hard-coded bit to treat it as a handle anyway for one case, but not for generating friendly overloads. If this ever worked, I suppose this was because the metadata used some other struct for GetObject.
But we should make this work, certainly.

AArnott added a commit that referenced this issue May 21, 2021
…s generated.

Regression test for #275. It currently fails.
AArnott added a commit that referenced this issue Jul 5, 2022
…s generated.

Regression test for #275. It currently fails.
AArnott pushed a commit that referenced this issue Jul 17, 2024
Bumps [powershell](https://github.com/PowerShell/PowerShell) from 7.4.2 to 7.4.3.
- [Release notes](https://github.com/PowerShell/PowerShell/releases)
- [Commits](PowerShell/PowerShell@v7.4.2...v7.4.3)

---
updated-dependencies:
- dependency-name: powershell
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants