'Start talking to standard IO with the given protocol.
Also, put it stdin/stdout/stderr into binary mode.'

def __init__(self, proto, reactor=None):

    if (reactor is None):
        from twisted.internet import reactor
    for stdfd in range(0, 1, 2):
        msvcrt.setmode(stdfd, os.O_BINARY)
    _pollingfile._PollingTimer.__init__(self, reactor)
    self.proto = proto
    hstdin = win32api.GetStdHandle(win32api.STD_INPUT_HANDLE)
    hstdout = win32api.GetStdHandle(win32api.STD_OUTPUT_HANDLE)
    self.stdin = _pollingfile._PollableReadPipe(hstdin, self.dataReceived, self.readConnectionLost)
    self.stdout = _pollingfile._PollableWritePipe(hstdout, self.writeConnectionLost)
    self._addPollableResource(self.stdin)
    self._addPollableResource(self.stdout)
    self.proto.makeConnection(self)
