public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: cygwin@cygwin.com
Subject: Re: [PATCH] fhandler_pipe: add sanity limit to handle loops
Date: Thu, 13 Jan 2022 09:39:23 -0500	[thread overview]
Message-ID: <f9f51cfe-fa29-8918-3f54-50c963a150fa@cornell.edu> (raw)
In-Reply-To: <20220113195638.d64430e6b03159c70721fb45@nifty.ne.jp>

On 1/13/2022 5:56 AM, Takashi Yano wrote:
> Ken Brown wrote:
>> 2. You can use the ReturnLength parameter of NtQueryInformationProcess to see
>> how big a buffer is needed.  This might be more efficient than repeatedly
>> doubling the buffer size.
> 
> Even if ReturnLength is used, the first NtQueryInformationProcess()
> call and the second NtQueryInformationProcess() call will not be
> done in atomic, so retrying is still necessary. However, it may be
> more efficient as you mentioned.
> 
> The similar is true also for NtQuerySystemInformation().
> 
> Do you still think it is better to use ReturnLength rather than
> doubling the buffer?

I'm not sure.  I only mentioned it because I saw that that's what Process Hacker 
did, but still in a retry loop as you said.

I suspect it doesn't make a lot of difference in practice, since we call the 
function once and then cache the value.  Do whatever you think is best.

Thanks.

Ken

      reply	other threads:[~2022-01-13 14:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.BSO.2.21.2112231503400.11760@resin.csoft.net>
     [not found] ` <f97bba17-16ab-d7be-01f6-1c057fb5f1a5@cornell.edu>
     [not found]   ` <alpine.BSO.2.21.2112231623490.11760@resin.csoft.net>
     [not found]     ` <c5115e9b-6475-d30e-04d3-cb84cfa92b3a@cornell.edu>
     [not found]       ` <alpine.BSO.2.21.2112241136160.11760@resin.csoft.net>
     [not found]         ` <622d3ac6-fa5d-965c-52da-db7a4463fffd@cornell.edu>
     [not found]           ` <alpine.BSO.2.21.2112241638280.11760@resin.csoft.net>
     [not found]             ` <20211225121902.54b82f1bb0d4f958d34a8bb7@nifty.ne.jp>
     [not found]               ` <alpine.BSO.2.21.2112241945060.11760@resin.csoft.net>
     [not found]                 ` <20211225131242.adef568db53d561a6b134612@nifty.ne.jp>
     [not found]                   ` <alpine.BSO.2.21.2112242101520.11760@resin.csoft.net>
     [not found]                     ` <20211226021010.a2b2ad28f12df9ffb25b6584@nifty.ne.jp>
     [not found]                       ` <alpine.BSO.2.21.2112251111580.11760@resin.csoft.net>
     [not found]                         ` <alpine.BSO.2.21.2112251457480.11760@resin.csoft.net>
     [not found]                           ` <8172019c-e048-4fe2-79c9-0b3262057d3e@cornell.edu>
     [not found]                             ` <alpine.BSO.2.21.2112252054310.11760@resin.csoft.net>
     [not found]                               ` <c7664703-0ec2-388f-64e3-8c46d4590b3e@cornell.edu>
2022-01-13 10:56                                 ` Takashi Yano
2022-01-13 14:39                                   ` Ken Brown [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f9f51cfe-fa29-8918-3f54-50c963a150fa@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).