You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In build.rs the function fn into_pcwstr(self) -> PCWSTR returns PCWSTR which is basically a pointer to an internal variable that expires immediately after function returns, and even though it's used immediately it's apparently enough for the data it points to get corrupted.
I believe windows-rs library it relies on has already addressed this issue and provided some workaround in release 0.44.0.
Right now winpty-rs is using windows 0.43.0
This is the description of the change microsoft/windows-rs#2239 and apparently you can use HSTRING instead of PCWSTR in most cases now, which is safer.
This seems to work:
GetModuleHandleW(&HSTRING::from("kernel32.dll"))
The text was updated successfully, but these errors were encountered:
In
build.rs
the functionfn into_pcwstr(self) -> PCWSTR
returns PCWSTR which is basically a pointer to an internal variable that expires immediately after function returns, and even though it's used immediately it's apparently enough for the data it points to get corrupted.I believe
windows-rs
library it relies on has already addressed this issue and provided some workaround in release0.44.0
.Right now
winpty-rs
is usingwindows 0.43.0
This is the description of the change microsoft/windows-rs#2239 and apparently you can use HSTRING instead of PCWSTR in most cases now, which is safer.
This seems to work:
The text was updated successfully, but these errors were encountered: