Jump to content

Binary pipes


piccaso
 Share

Recommended Posts

The Std* functions cant read past the NULL character so i tried to do something myself.

I made _ConsoleWrite() but i have defenetly no idea where i can get the handles from the subprocces from.

Func _ConsoleWrite($sBuff)
    Local $STD_OUTPUT_HANDLE = -11
    Local $INVALID_HANDLE_VALUE = -1
    Local $hStdOut = DllCall("kernel32.dll", "ptr", "GetStdHandle", "dword", $STD_OUTPUT_HANDLE)
    $hStdOut = $hStdOut[0]
    Local $vBuff = DllStructCreate("byte[" & StringLen($sBuff) & "]")
    DllStructSetData($vBuff, 1, $sBuff)
    If $hStdOut = $INVALID_HANDLE_VALUE Then Return SetError(1, 0, 0)
    Local $fWriteFile = DllCall("kernel32.dll", "int", "WriteFile", "ptr", $hStdOut, "ptr", DllStructGetPtr($vBuff), "dword", StringLen($sBuff), "int_ptr", 0, "ptr", 0)
    $fWriteFile = $fWriteFile[0]
    If $fWriteFile = 0 Then
        Return SetError(2, 0, 0)
    Else
        Return 1
    EndIf
EndFunc   ;==>_ConsoleWrite

ConsoleWrite("test" & Chr(0) & "Test") ; Scite doesent show it, but if you pipe it into a file...

any idea how i could get the handles if i only have the pid (From run) ?

is there an api i didnt find?

or do i have to do CreateProcess() and stuff... (this looks hard ;))

CoProc Multi Process Helper libraryTrashBin.nfshost.com store your AutoIt related files here!AutoIt User Map
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...