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

Add buffer size attribute/struct for FindFirstFileEx family #2047

Open
morganbr opened this issue Jan 16, 2025 · 0 comments
Open

Add buffer size attribute/struct for FindFirstFileEx family #2047

morganbr opened this issue Jan 16, 2025 · 0 comments

Comments

@morganbr
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant