X-Recipient: archive-cygwin AT delorie DOT com X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4756C3858439 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=maxrnd.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=maxrnd.com Subject: Re: Incompatible clipboard format between 32bit and 64bit cygwin To: cygwin AT cygwin DOT com References: <20210926103325 DOT 5c17eb11c3c8a56c377199a8 AT nifty DOT ne DOT jp> <584f536c-b108-b562-b940-798ec2847c68 AT maxrnd DOT com> <0b13b9ac-583f-ab72-4202-f8b187946d93 AT towo DOT net> From: Mark Geisert Message-ID: <498f0cfb-c6c1-cb61-2e88-fcb9ce61f4d4@maxrnd.com> Date: Mon, 27 Sep 2021 21:49:27 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.4 MIME-Version: 1.0 In-Reply-To: X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, BODY_8BITS, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 18S4oBCg023822 Hi Thomas, Thomas Wolff wrote: > > Am 26.09.2021 um 20:37 schrieb Thomas Wolff: >> >> Am 26.09.2021 um 11:50 schrieb Mark Geisert: >>> Hi Takashi, >>> >>> Takashi Yano via Cygwin wrote: >>>> I noticed that cygwin clipboard is not compatible >>>> between 32bit and 64bit cygwin. >>>> >>>> If I run 'echo AAAAAAAA > /dev/clipboard' in 32bit cygwin, >>>> and run 'cat /dev/clipboard' in 64bit cygwin, this result in >>>> cat: /dev/clipboard: Bad address >>>> >>>> This is because the structure >>>> typedef struct >>>> { >>>>    timestruc_t   timestamp; >>>>    size_t    len; >>>>    char      data[1]; >>>> } cygcb_t; >>>> defined in fhandler_clipboard.cc has different size. >>>> >>>> Is this the known issue? >>> >>> I doubt anybody has ever tried what you did. >> I have and it failed; I just didn't find it important enough to report it >> here... Thanks for the plan to fix it. >> >>> I have been testing getclip and putclip between 32- and 64-bit environments, >>> but neglected to test Cygwin-internal clipboard format that prepends cygcb_t to >>> the user-supplied data. > As we're at it, what's the purpose of a cygwin-internal clipboard format at all? > Copy/paste between 32bit/64bit mintty works; mintty uses Windows CF_UNICODETEXT > clipboard format. The cygwin-internal clipboard format records a timestamp and content length when Cygwin (or putclip) updates the clipboard contents. This allows 'stat' and fstat() to show something sensible for /dev/clipboard. The latter feature went into Cygwin 1.7.13. Other than that, not much difference to CF_UNICODETEXT ;-). ..mark -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple