bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: Gisle Vanem <gisle.vanem@gmail.com>
Cc: "bug-gnulib@gnu.org" <bug-gnulib@gnu.org>
Subject: Re: isatty: make it return true in Cygwin consoles on native Windows
Date: Fri, 15 Mar 2019 20:42:09 +0100	[thread overview]
Message-ID: <3424713.h6fLtq0YeZ@omega> (raw)
In-Reply-To: <a341f9e7-a344-e068-e3e5-8b99bb0d02fb@gmail.com>

Gisle Vanem asked:
> > I prefer to avoid the ntdll.dll API when possible.
> 
> Okay, what's wrong with that?

1) It's a violation of abstraction. Diagram:

         Programs
             |
    Windows API (kernel32.dll etc.)
             |
          NT API (ntdll.dll)
             |
        NT kernel

   Programs should use only topmost API layer.
   When you use a mix between two or more layers, i.e. when you circumvent
   the topmost API layer, in my experience this causes big problems in the
   long run.

2) The code you pointed to uses the function NtQueryObject. However, the
   Microsoft documentation
   <https://docs.microsoft.com/en-us/windows/desktop/api/winternl/nf-winternl-ntqueryobject>
   states "This function may be changed or removed from Windows without
   further notice."

3) Probably code will run better on ReactOS or WINE if they don't use the
   lower layers.

Bruno



  reply	other threads:[~2019-03-15 19:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14 22:59 isatty: make it return true in Cygwin consoles on native Windows Bruno Haible
2019-03-15  9:24 ` Gisle Vanem
2019-03-15 11:32   ` Bruno Haible
2019-03-15 18:49     ` Gisle Vanem
2019-03-15 19:42       ` Bruno Haible [this message]
2019-03-15 20:16         ` LRN
2019-03-15 22:24           ` Bruno Haible

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

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to=3424713.h6fLtq0YeZ@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=gisle.vanem@gmail.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).