Offer friendly overloads that retain typedef struct handles
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2.5k
- Forks
- 124
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 9
Description
It looks like the HICON overload might have showed up as a followup to https://github.com/microsoft/CsWin32/issues/125#issuecomment-781058118:
We may offer non-SafeHandle overloads as well, since that sounds like something that will help in some cases.
This overload saves me from the boilerplate of having to declare my own SafeHandle type to wrap my unowned handle value I got from GetCursorInfo, if I use that overload, now I have to add extra unsafe boilerplate instead of using out var for the second parameter.
Could there be a non-SafeHandle overload with a second out parameter?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the HICON overload behavior described here and the linked discussion in issue 125, then trace how CsWin32 generates that overload. Done means a non-SafeHandle overload can accept an unowned handle from GetCursorInfo and expose the second value through an out parameter without requiring a custom SafeHandle or unsafe boilerplate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100