X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; q=dns; s=default; b=sAoDLCcqA46dCos4
	6I49WJYHigDqZZha/DhIlj/JUBjmE8VmRJ++Nff4QVHMxMht13RZrdjclRRWwNl6
	4/+LUkufYfLW00pkNVBUFpONcjMEqSMhEOVUJYfTYpuFqtdDL4PtBNx1zssC1tsU
	V9IQJloDiQLOZLQxur8pf929u8E=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:date:from:reply-to:message-id:to:subject
	:in-reply-to:references:mime-version:content-type
	:content-transfer-encoding; s=default; bh=0vZ+9ZzMQG5u8PtRbhYlzr
	Na8+w=; b=GOfc9ZkQ3kJQkAu5kvfjD/89qi2LuTLWhRRZvOLWNRiJga4/6KjqwG
	hUlw5GF8GZgbnasdr0t9MEnwOpTTcXNXrpUWEKHkrFXlINhtbL9Nd8h7OeXt0QPy
	QXfOVuqdLX6lIEJywccgSD8G4hR6foWujEfOLuoe3WU5M+0IHuZMQ=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_THEBAT,MIME_BASE64_BLANKS,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.1 spammy=UD:ru, terrible, H*M:yandex, Wednesday
X-HELO: forward106j.mail.yandex.net
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1552427401;	bh=dTZe5OGAXONsau3SN0xQthxP8Fz2rCz+7vuNYmK9UIQ=;	h=In-Reply-To:Subject:To:Reply-To:From:Message-ID:References:Date;	b=OTL3eYDUe+xtaHNMruiQOJjTlW3G80uuuiC/10DSOiT5jkaXE+VTzGxYUloBf2Dpu	 pL7WNjnDh5uHHdc2MgzueKNtLPvHNec9Ls30dXPrU7DNUoyF+31aGQSVzzAbZctmb2	 jO3ByxiVnTC4dIBUnF03KMCkpurZouNSpVV5KVFI=
Authentication-Results: mxback13g.mail.yandex.net; dkim=pass header.i=@yandex.ru
Date: Wed, 13 Mar 2019 00:39:55 +0300
From: Andrey Repin <anrdaemon@yandex.ru>
Reply-To: cygwin@cygwin.com
Message-ID: <1713374829.20190313003955@yandex.ru>
To: Corinna Vinschen <cygwin@cygwin.com>, cygwin@cygwin.com
Subject: Re: Privilege(s) needed to run top command
In-Reply-To: <20190312205929.GQ3785@calimero.vinschen.de>
References: <20190312111411.GH3785@calimero.vinschen.de>   <1552391701449-0.post@n5.nabble.com>  <167740c9afacd1bd4f914cae2e19eb01@smtp-cloud9.xs4all.net>  <1552405511657-0.post@n5.nabble.com>  <20190312164725.GK3785@calimero.vinschen.de>  <1552410026803-0.post@n5.nabble.com>  <20190312171339.GM3785@calimero.vinschen.de>  <20190312173901.GN3785@calimero.vinschen.de>  <20190312202802.GP3785@calimero.vinschen.de>  <512910309.20190312233554@yandex.ru>  <20190312205929.GQ3785@calimero.vinschen.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
X-IsSubscribed: yes
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id x2CLoFXw007879

Greetings, Corinna Vinschen!

> On Mar 12 23:35, Andrey Repin wrote:
>> Greetings, Corinna Vinschen!
>> 
>> > This was complete nonsense.
>> 
>> > Actually, the problem was entirely in Cygwin's ps.exe, and it's a
>> > long-standing problem at that.
>> 
>> > While the Cygwin DLL collected the complete process list for ps, ps then
>> > didn't print any process it failed to call OpenProcess on.  These are a
>> > *lot* of processes and the result looked a lot like the list of
>> > processes in or connected to the current session.
>> 
>> > The reason for this behaviour was that the image path of a process could
>> > only be fetched when opening the process.  Today I found new
>> > functionality since Vista which allows to fetch the image path without
>> > having to open the process, so `ps -W' will print all processes again,
>> > just as in the good old XP times :}
>> 
>> Err, but why? PSAPI was available since… a long time since.
>> And it is public API except for isolated processes.

> Same problem:

> https://docs.microsoft.com/en-us/windows/desktop/psapi/enumerating-all-processes

My bad. I checked the code on hand, but missed that last OpenProcess call.
My code working with visible windows and, indeed, is unable to catch
elevated window's path.


-- 
With best regards,
Andrey Repin
Wednesday, March 13, 2019 0:37:12

Sorry for my terrible english...
--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


