Sure, that should be possible to recognize redirection.
Probably, using IOCTL (2144). But I completely forgot all (last time I wrote low-level MS-DOS program in 1992).
Why I use pipes ?
This program tests license files, which linked with hardware.
I need info, which I can't get in 32-bit app.
Pipes are used for sequirity reasons.
Added later.
Probably I found the solution. Need to test in all OSes and to find explanation, why bit 5 of DX works, unlike expected bit 7.
Code:
DefInt A-Z If ConsIn = 0 Then i = 1 Else REG 1, &H4400 REG 2, 0 Call Interrupt &H21 Dx?? = Reg(4) If (Dx?? And &H20) Then i = 1 Else i = 0 End If If i Then StdOut "StdIn is redirected" Else StdOut "StdIn is not redirected" If ConsOut = 0 Then i = 1 Else REG 1, &H4400 REG 2, 1 Call Interrupt &H21 Dx?? = Reg(4) If (Dx?? And &H20) Then i = 1 Else i = 0 End If If i Then StdOut "StdOut is redirected" Else StdOut "StdOut is not redirected" StdOut "ConsIn=" + Str$(ConsIn) StdOut "ConsOut=" + Str$(ConsOut)
[This message has been edited by Semen Matusovski (edited April 25, 2005).]
Leave a comment: