-
Notifications
You must be signed in to change notification settings - Fork 122
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
Possible misbinding #1957
Comments
Looks like the Win32 metadata invents the |
The enum comes from mfreadwrite.idl that's compiled to mfreadwrite.h. If this was an integer literal |
using T = std::underlying_type<__MIDL___MIDL_itf_mfreadwrite_0000_0001_0001>::type;
std::cout << typeid(T).name() << std::endl; > int In C and, the underlying type is always |
The issue is more about what the API expects than the limitations of the C and C++ languages. The API expects unsigned arguments and C/C++ compilers were happy to smooth things over. Same with |
This enum is not an invented enum. It's scraped from the headers so the type is whatever ClangSharp detects. We just give it a friendly name based on the recommendation from ClangSharp. win32metadata/generation/WinSDK/RecompiledIdlHeaders/um/mfreadwrite.h Lines 324 to 332 in a133cf4
We've had feedback in the past that we shouldn't deviate from the original types as scraped by ClangSharp. If we add |
@kennykerr any updates here? See my earlier question. |
Summary
I belive I have found a misbinding in the Win32_Media_MediaFoundation feature.
The IMFSourceReader::SetCurrentMediaType(arg , . . .) expects arg to be of type u32. The documentation provided my microsoft says there are 3 variants of arg:
0–0xFFFFFFFB | The zero-based index of a stream.
MF_SOURCE_READER_FIRST_VIDEO_STREAM 0xFFFFFFFC | The first video stream.
MF_SOURCE_READER_FIRST_AUDIO_STREAM 0xFFFFFFFD | The first audio stream.
But in the create all of them have an i32 type. Which can still be casted to a u32, but it was confusing for me at first and I dont think this is intended behavior.
Crate manifest
Crate code
The text was updated successfully, but these errors were encountered: