X-Recipient: archive-cygwin@delorie.com
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2EFF73858403
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: [ANNOUNCEMENT] Updated: cygutils 1.4.16-7
To: cygwin@cygwin.com
References: <announce.20210923063710.32452-1-mark@maxrnd.com>
 <20210925133125.8f894de4e596a71e7f24961f@nifty.ne.jp>
From: Mark Geisert <mark@maxrnd.com>
Message-ID: <78b28c3f-4604-2805-0b87-a47e0b6437ac@maxrnd.com>
Date: Sun, 26 Sep 2021 02:40:11 -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: <20210925133125.8f894de4e596a71e7f24961f@nifty.ne.jp>
X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
 KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT, NICE_REPLY_A, SPF_HELO_NONE,
 SPF_NONE, TXREP autolearn=no 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@cygwin.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"; Format="flowed"
Errors-To: cygwin-bounces+archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie.com@cygwin.com>

Hi Takashi,

Takashi Yano via Cygwin wrote:
> Sometimes, putclip shows error
> "Unable to open the clipboard"
> when I run 'echo A | putclip'.
> 
> I digged into this problem, and found OpenClipboard() sometimes
> fails with error ERROR_ACCESS_DENIED if it is called just after
> SetClipboardData() and CloseClipboard().
> 
> Currently, putclip calls OpenClipboard()/CloseClipboard() four
> times. Is there any reason why closing and reopening clipboard
> several times?

I don't know why the author coded putclip that way.  Perhaps Windows required 
different clipboard interfacing long ago?  Or the author was being very cautious?

> Is there any problem if you open clipboard once and close it at
> the end of function int putclip() just like the patch attached?
> 
> The problem above disappears if the patch is applied.

I will implement something similar to your patch for -8 in the next few days. 
Thank you for digging into this issue; I had seen evidence the clipboard was busy 
but wondered why Windows itself couldn't serialize access.  It's amusing to find 
that putclip is apparently interfering with itself :-).
Cheers,

..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
