microsoft / microsoft/win32metadata

Functions in `windows::Win32::Graphics::Gdi` should return `Result`

Open
#1,758 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.5k
Forks
149
Avg merge
5d 16h
Merged PRs (30d)
4

Description

In `windows::Win32::Graphics::Gdi`, there are many functions like [`CreateSolidBrush()`](https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/Graphics/Gdi/fn.CreateSolidBrush.html), [`CreateBitmap()`](https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/Graphics/Gdi/fn.CreateBitmap.html), [`CreateBitmapIndirect()`](https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/Graphics/Gdi/fn.CreateBitmapIndirect.html), [`CreateEllipticRgn()`](https://microsoft.github.io/windows-docs-rs/doc/windows/Win32/Graphics/Gdi/fn.CreateEllipticRgn.html) etc. that return handles, although the docs at [learn.microsoft.com](https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-createsolidbrush) say, they can fail. So, they should return `Result`s like many other fallible functions in the `windows` crate already do.

Contributor guide

Open the contributing guide

Research direction

Start with the listed GDI entry points, including CreateSolidBrush(), CreateBitmap(), CreateBitmapIndirect(), and CreateEllipticRgn(), and compare their Microsoft documentation with the existing fallible functions in the windows crate. Done means the affected functions in windows::Win32::Graphics::Gdi return Result values consistently with their documented failure behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, rust
Domain
api, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.