Hello, This is my first post here. I am learning MASM :) , I was also told to watch out for the Hiroshiman-man !

Anyway, I thought I would start my first post with a simple question.

I have a buffer, call it buffer A where the user inputs anything.
I want my program to call another process, for examples sake, ftp 100.200.100.200.

Then I want to be able to pipe forwards and backwards buffer A to the ftp session to 100.200.100.200

here is part of the code,...


invoke GetStartupInfo, ADDR ParentStruct
mov eax, hWrite
mov ParentStruct.hStdOutput,eax
mov ParentStruct.hStdError,eax
mov ParentStruct.dwFlags, STARTF_USESHOWWINDOW+ STARTF_USESTDHANDLES
mov ParentStruct.wShowWindow,SW_HIDE

; CREATE THE APPROPRIATE PROCESS
invoke CreateProcess,ADDR Shell,NULL,NULL,NULL,TRUE,\
NORMAL_PRIORITY_CLASS,\
NULL,NULL,ADDR ParentStruct,ADDR processInfo



but I don't know how to pipe from buffer A to the FTP session. I
Can anyone offer any advice or a link to somewhere with an example ?

Thanks much in advance...
Posted on 2002-01-09 21:04:40 by prana
If I get you right, you want to launch (for instance) ftp.exe and
use that to... what? It shouldn't be too hard to relay output from
your app as input to the other process (as long as it uses standard
readfile on it's input handle) - iczelions tut on piping shows how
to accomplish this.

If you want to use the pipe for sending actual file data, you'll probably
run into trouble, as I don't know any readily available ftp program
that accepts file data from stdin :).
Posted on 2002-01-09 21:15:42 by f0dder
yeah, you were told to watch for me by me lol :grin:

got to love IRC :alright:
Posted on 2002-01-09 21:19:06 by Hiroshimator
yeah Iczellions tutorial pipes it with an example of compiling a piece an example.asm. However, it only sends the buffer and then receives the buffer before terminating.

However in my case, the ftp.exe, I need it to be interactive, and continuous... err not sure if you know what I mean. Maybe it only needs a small tweak but I dunno how to do it.... :(
Posted on 2002-01-09 21:19:39 by prana
Hiro man, err umm where did ya get the piccie of the cat from ? I like it.

Hmmm this is a great site,many good information. Just gotta get to know the place and its inhabitants :)
Posted on 2002-01-09 21:25:41 by prana
You might want to look at PeekNamedPipe (which, contrary to it's
name, can also be used for unnamed pipes). Also, since windows
is pretty Object Oriented in nature, you might be able to WaitForSingleObject
on the pipe handle to wait for data - haven't tried this, but it's worth
a try, and might beat a polling approach.
Posted on 2002-01-09 21:32:48 by f0dder
ok thanks :) I go and check it out.
Posted on 2002-01-09 21:51:04 by prana