HaikuArchives / VMwareAddons

VMwareAdd-ons is a set of tools to enhance interaction with Haiku running in VMware
MIT License
7 stars 9 forks source link

Clipboard size limit? #26

Open asmaloney opened 3 years ago

asmaloney commented 3 years ago

I'm guessing that this is a VMwareAddons issue...

If I select a bunch of text in Haiku running in VMWare, copy it, and paste it on the macOS side, only 65,436 characters are pasted (which looks like it's getting close to a special number 😄 ).

(Haiku was installed from the Haiku R1/Beta2 x86_64 image and everything is up-to-date.)

adamfowleruk commented 2 years ago

Some interesting size_t/long/ulong conversions going off in here: https://github.com/HaikuArchives/VMwareAddons/blob/aed6f601f0d71e9240c71b987a30ea38f03f8c72/enhanced_backdoor/VMWBackdoor.cpp#L351

Shouldn't be the cause given the datatype sizes in play, but worth looking at generally... backdoor_call expects a ulong.

Failing that, need to look into the copy function link between Haiku and this plugin...

adamfowleruk commented 2 years ago

Called from within the AddonsTray C++ file here: https://github.com/HaikuArchives/VMwareAddons/blob/aed6f601f0d71e9240c71b987a30ea38f03f8c72/vmware_tray/VMWAddOnsTray.cpp#L179

This uses std::size_t too though. So unless the clipboard message from Haiku is limited in length (seems unlikely...) there must be a logic/datatype issue in one of the above functions.

adamfowleruk commented 2 years ago

Confirmed the bug occurs on Haiku Beta3 64 bit with Depot version of vmware addon (1.2.0-4) and Windows 10 host with VMware Workstation 16 Player. It copies 65221 characters only from Haiku to the Win10 host.

Also confirmed a similar bug copying from a Win10 host to a Haiku Beta3 guest, but it copies up to 216636 characters