bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: isatty: make it return true in Cygwin consoles on native Windows


From: Bruno Haible
Subject: Re: isatty: make it return true in Cygwin consoles on native Windows
Date: Fri, 15 Mar 2019 20:42:09 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-141-generic; KDE/5.18.0; x86_64; ; )

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 via email to

[Prev in Thread] Current Thread [Next in Thread]