microsoft / microsoft/win32metadata
Add buffer size attribute/struct for FindFirstFileEx family
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1.5k
- Forks
- 149
- Avg merge
- 5d 16h
- Merged PRs (30d)
- 4
Description
The FindFirstFileEx family of functions (FindFirstFileExW, FindFirstFileExA, FindFirstFileExFromAppW, FindFirstFileTransactedA, FindFirstFileTransactedW) all have an out ```void* lpFindFileData``` parameter where the size and structure of the buffer written is documented to be based on the ```fInfoLevelId``` enum parameter (documented at https://learn.microsoft.com/en-us/windows/win32/api/minwinbase/ne-minwinbase-findex_info_levels). However, both values of that enum have the same result of writing a WIN32_FIND_DATA (there are A and W versions). The SAL annotations also acknowledge this -- for example FindFirstFileExW is annotated ```_Out_writes_bytes_(sizeof(WIN32_FIND_DATAW)) LPVOID lpFindFileData```.
Ideally the type for ```lpFindFileData``` could change to ```WIN32_FIND_DATA``` for the greatest clarity, but if not, annotating it with ```NativeArrayInfoAttribute``` would help with marshaling.
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 metadata definitions for FindFirstFileExW/A, FindFirstFileExFromAppW, and FindFirstFileTransactedA/W, along with the NativeArrayInfoAttribute handling. Compare the documented fInfoLevelId buffer requirements with the existing generated representation; done means the metadata clearly describes the WIN32_FIND_DATA buffer size and structure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- operating-systems, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100