Redirecting Output...

  • Follow


When you use Function 46h of the DOS function request interrupt,
to force duplicating a handle for a open file to handle 1
to redirect Stdout, how do you restore Stdout so that output will be
sent to the console
as normal, while the program is running?

0
Reply wolf3y3 11/28/2008 5:01:10 PM

wolf3y3  <spamtrap@crayne.org> writes:

>When you use Function 46h of the DOS function request interrupt,
>to force duplicating a handle for a open file to handle 1
>to redirect Stdout, how do you restore Stdout so that output will be
>sent to the console
>as normal, while the program is running?

   I thought that open file, redirect output, write to file,
close file, open CON device, redirect output, and write
to output would work, and it does.  I coded that up to
test it.

   Checking "Undocumented DOS" 2nd ed., shows
they did it completely differently.  They muck about
with the file table in the PSP.  Oh well.

Steve N.

0
Reply Steve 11/29/2008 1:54:16 PM


Sorry, figured it out.
Made duplicate of Stdin, and restored the console using function 46h,
making a forced duplicate of the Stdin backup back to handle 0.
Thanks...

0
Reply wolf3y3 11/30/2008 3:29:33 AM

2 Replies
122 Views

(page loaded in 0.035 seconds)

Similiar Articles:













7/24/2012 9:31:41 AM


Reply: