Subject: RE: 1.3.10: SendMessage(WM_COPYDATA) in a Win32 program fails within Cygwin
From: "Larry Hall (RFK Partners, Inc)" <[email-masked]>
To: Mitch Davis <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Thu, 30 May 2002 10:27:23 -0400

At 04:24 AM 5/30/2002, Mitch Davis wrote:
>> -----Original Message-----
>> From: Larry Hall (RFK Partners, Inc) [mailto:[email-masked]]
>> 
>> At 12:50 PM 5/29/2002, Mitch Davis wrote:
>> >
>> >I would like to use plink (a command-line 
>> >SSH program from the "PuTTY" suite) to 
>> >connect my W2K PC to a Linux host, using the 
>> >ssh v2 protocol, and RSA keys, via the 
>> >"pageant" key agent. 
>> >
>> >I would also like to be able to invoke plink (a 
>> >conventional "console" Win32 app) both from a 
>> >W2K cmd.exe window, and from a bash window. 
>> >
>> >My problem is, plink works under cmd.exe, but doesn't 
>> >work under bash.  It also doesn't work if I invoke 
>> >cmd.exe inside bash, then invoke plink from the cmd.exe. 
>> >By "doesn't work", I mean plink is unable to fetch any 
>> >keys from "pageant", the SSH key agent. 
>
>[lots deleted]
>
>> >My questions: 
>> >
>> >  - Do you know what the problem might be? 
>> 
>> Perhaps.
>> 
>> >  - Do you know what might be causing SendMessage to 
>> >    fail?  (I'm not a Windows programmer). 
>> 
>> Yes.  I expect it's that send message expects there is a 
>> window to process this message, with its own message loop.
>> cmd.exe may provide one.  Cygwin does not.  
>
>That's a good hypothesis; I've sent it to the PuTTY people.
>
>As I mentioned yesterday, if I invoke bash, then cmd.exe,
>then plink, the problem still happens.  But this might be
>because a secondary cmd.exe is somehow different to a primary
>cmd.exe.
>
>So today I invoked cmd.exe, then bash, then plink.  Same
>problem.  Then I invoked cmd.exe, then bash, then cmd.exe
>then plink.  Also the same problem.
>
>Do you know how I can further test your hypothesis?

No, not really.  I think given the root of the problem is that puTTY is 
designed to be a Windows solution for SSH, etc.  Cygwin leverages
UNIX functionality and ways of doing things so there is bound to be a 
mismatch in assumptions when you mix applications.  This can be seen in 
other areas as well (take the 'tty' setting in the Cygwin environment
variable as an example).  Anyway, I think the native Cygwin OpenSSH facilities
pointed out by others is a better approach for an immediate solution.  I'd 
suggest this as well if you're looking for the "quick fix".

Larry Hall               [email-masked]
RFK Partners, Inc.       http://www.rfk.com
838 Washington Street    (508) 560-1285 - cell phone 
Holliston, MA 01746      (508) 893-9889 - FAX
                         (508) 893-9779 - RFK Office (messages only)          

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/