-
Notifications
You must be signed in to change notification settings - Fork 16
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
windows: fix accept/deny prompt on Windows #55
Conversation
bitbox-bridge/release/Makefile
Outdated
@@ -17,7 +17,7 @@ release-linux: | |||
docker run --user ${USER} --interactive --tty -v ${MOUNT} -w /bitbox-bridge ${CONTAINER} bitbox-bridge/release/linux/release.sh | |||
|
|||
release-windows: | |||
docker run --user ${USER} --interactive --tty -v ${MOUNT} -w /bitbox-bridge ${CONTAINER} bitbox-bridge/release/windows/release.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, no - I locally removed the user as I am using podman. The other repos we have are compatible with either, but this one not yet. Reverted
bitbox-bridge/src/web.rs
Outdated
message_c.as_ptr() as *const u8, | ||
message_c.as_c_str().count_bytes() as u32, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondered about encoding.
WTSSendMessageA uses ANSI encoding, while WTSSendMessageW uses UTF-16 encoding.
The message includes the origin.host()
string, which could include utf8 right? In the worst case the message box would show a borked string.
I should probably try to figure out how to convert it to UTF16 and switch to WTSSendMessageW 🤔 The only question is if the WTSSendMessageW version also works in the service, the docs only mention WTSSendMessageA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NickeZ I did this now and it works better than expected. I tested with this modified msg including some random unicode chars:
format!("Allow {} to connect to your BitBox Ɯ ⓴ ▗ ◕ ⚲ ⛵ ✅ ?", host),
and the unicode symbols were actually all shown on my Win11:
PR updated and ready for review again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow cool
Launching the browser is prohibited from a Windows service. `WTSSendMessageA` seems to be the only thing that works. See comments in the commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK!
Launching the browser is prohibited from a Windows service.
WTSSendMessageA
seems to be the only thing that works. See comments in the commit.