-
Notifications
You must be signed in to change notification settings - Fork 534
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
PCWSTR arguments/fields are generated as PWSTR in in Rust bindings #777
Comments
Bindings to DirectWrite have the same issue: for example, IDWriteFactory::CreateTextLayout, which takes a
gets translated into a function that takes a PWSTR (
|
Sorry for the delay in responding. The metadata that drives the |
@kennykerr - I found at least 1 parameter that should be pub fn MultiByteToWideChar(codepage: u32, dwflags: MULTI_BYTE_TO_WIDE_CHAR_FLAGS, lpmultibytestr: super::Foundation::PSTR, cbmultibyte: i32, lpwidecharstr: super::Foundation::PWSTR, cchwidechar: i32) -> i32; Version: [dependencies.windows-sys]
version = "0.27.0"
default-features = false
features = ["Win32_Globalization", "Win32_Foundation"] |
@lzybkr thanks for the reminder - I should be able to generate |
#1550 adds first-class types for |
I'm currently using the
windows
crate to generate bindings the the Projected Filesystem API, and I noticed that parts of the API that usePCWSTR
(both function arguments and struct fields) are being treated asPWSTR
(i.e. they mutable wide strings instead of const wide strings).A simple example of this is the
PRJ_GET_DIRECTORY_ENUMERATION_CB
type, which is generated as follows withwindows
0.9:Note that the
searchExpression
argument is declared as aPWSTR
in the generated Rust bindings, but the original definition declares it as aPCWSTR
.To reproduce this, you can create a build script that generates the ProjFS bindings:
The text was updated successfully, but these errors were encountered: