delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/10/13/16:57:39

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Wed, 13 Oct 2004 16:57:59 -0400
From: Christopher Faylor <cgf-no-personal-reply-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: When is WinXP not WinXP?? - not *really* OT
Message-ID: <20041013205759.GI8866@trixie.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <Xns958070E64AD1Adancarddupercom AT 80 DOT 91 DOT 229 DOT 5> <Xns95815D0F71AA5dancarddupercom AT 80 DOT 91 DOT 229 DOT 5> <Xns95816351E4587dancarddupercom AT 80 DOT 91 DOT 229 DOT 5>
Mime-Version: 1.0
In-Reply-To: <Xns95816351E4587dancarddupercom@80.91.229.5>
User-Agent: Mutt/1.4.1i

On Wed, Oct 13, 2004 at 04:45:46PM +0000, Daniel Miller wrote:
>Daniel Miller <dan AT imi-test DOT com> wrote in
>news:Xns95815D0F71AA5dancarddupercom AT 80 DOT 91 DOT 229 DOT 5: 
>
>> Daniel Miller <dan AT imi-test DOT com> wrote in
>> news:Xns958070E64AD1Adancarddupercom AT 80 DOT 91 DOT 229 DOT 5: 
>> 
>> I propose that this is *not* really off-topic, since the problems that
>> I'm experiencing do not occur in cmd.exe, nor in 4NT, only in Bash. 
>> So it's something Bash is doing in its environment that is breaking
>> StdOut, at least relative to whatever Win32 looks at.
>> 
>> BTW, I did not install Cygwin on the Home machine by copying from the
>> other machine, I installed it using setup.exe, downloaded from Cygwin.
>> 
>> Also, in response to Dave Korn's previous message, GetLastError() is 
>> returning error 6 (The handle is Invalid)...
>> 
>A further note is that handles returned by GetStdHandle() always have 
>GENERIC_READ and GENERIC_WRITE access, "unless SetStdHandle function was 
>used to set a standard handle to be some handle with a lesser access." 
>(per MSDN).  Certainly  I didn't use SetStdHandle for *any* purpose, 
>which is why the utility works under other shells.  Does Bash use 
>SetStdHandle or some equivalent to change the console environment??

Why does it matter?  If that was the case, are you asking if we will
change cygwin to help get your application working?  If so, the answer
is "no".

You've found your problem.  Don't use STD_OUTPUT_HANDLE for this purpose.
Use STD_INPUT_HANDLE instead.  Problem solved.

cgf

>//  repeating the offending code snippet:
>   /* get the standard handles */
>   hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
>   PERR(hStdOut != INVALID_HANDLE_VALUE, "GetStdHandle");
>
>   //  get screen information.
>   //  If this call fails, assume we are re-directing output.
>   bSuccess = GetConsoleScreenBufferInfo(hStdOut, &sinfo) ;
>   // PERR(bSuccess, "GetConsoleScreenBufferInfo");
>   if (bSuccess == false) {
>      fprintf(stderr, "gcsbi error: %s\n", get_system_message()) ;
>      exit(1) ;
>      redirected = 1 ;
>      return ; 
>   }
>
>
>--
>Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>Problem reports:       http://cygwin.com/problems.html
>Documentation:         http://cygwin.com/docs.html
>FAQ:                   http://cygwin.com/faq/
>

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019