-
Notifications
You must be signed in to change notification settings - Fork 489
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
Request for implementations of From/Into to convert between PWSTR/PCWSTR and OsString/&OsStr #710
Comments
This should be safe to do so I think we should it. We do allow compilation on Linux, so we should be careful to document things properly as if we ever allow for the use of this crate on all platforms, this will not work on Linux. |
@rylev Does windows-rs work on non-windows platforms at all? I can see you may allow cross-compilation so you can build the crate on linux but I assumed it would still have OsStr as u16 for the sake of that compilation. |
@enebo currently the crate is only useable on Windows (though it builds on Linux). This might be the case forever, but it might not be. I personally don't want to get in a situation where we have very subtle reliance on platform specific behavior where a comment could easily make that apparent. |
I had the same question today and found this example https://github.com/microsoft/windows-rs/blob/master/examples/clock/src/main.rs#L414 So you probably don't need to do the conversion and can pass in the |
Following https://github.com/microsoft/windows-rs/discussions/566 this crate is perfectly usable on Linux and allows to retrieve an interface from DXC without hassle. I hope to share a working example in the coming days :) Wide strings are tricky because they are 32-bit on Linux platforms, and even DXC treats them like that. The |
The |
Similar to #645. I am working with raw command-line info as OsStr/OsString and I want to pass that to CreateProcessW. Here is mostly the gist of how I am dealing with PWSTR now:
c is passed as second param to CreateProcessW but it would be nice to just to pass command_line itself.
The text was updated successfully, but these errors were encountered: