microsoft / microsoft/win32metadata

"Atom" methods should include overload or metadata to indicate that an Atom is an option

Open
#124 23 comments 0 reactions 1 assignee Claimed by @mikebattista View on GitHub
usability
Dominant language
C++
Stars
1.5k
Forks
149
Avg merge
5d 16h
Merged PRs (30d)
4

Description

Consider the [`GetPropW'](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getpropw) method, which allegedly takes a string pointer as a second parameter but documentation allows for an atom instead. From the doc:

> The atom, a 16-bit value, must be placed in the low-order word of the lpString parameter; the high-order word must be zero.

For the C# projection, this is *very* unnatural to pass an arbitrary 32-bit value (expanded from 16-bits) in as if it were a pointer. Such methods merit a friendly overload that accepts a `ushort` (to match the type returned from `GlobalAddAtomW`).

We will need an attribute on the atom-accepting pointer parameter in the metadata in order to know to generate this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.