sl@0: // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // EPOC Server providing access to Win32 stdin/stdout/stderr sl@0: // sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: enum TWin32Stream { sl@0: EWin32Read, sl@0: EWin32Write, sl@0: EWin32Flush sl@0: }; sl@0: sl@0: // sl@0: class CWin32Stream sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: { sl@0: public: sl@0: static TInt StreamName(TInt aStream, TDes& aBuf); sl@0: static void StartServer(TInt aStream); sl@0: static TInt ThreadFunction(TAny* aPtr); sl@0: private: sl@0: TInt Init(TInt aStream, const TDesC& aStreamName); sl@0: void HandleMessage(); sl@0: TInt ReadStream(RMessage2& aMessage); sl@0: TInt WriteStream(RMessage2& aMessage); sl@0: void FlushStream(); sl@0: TInt MapWin32Error(TInt aDefault); sl@0: sl@0: RServer2 iServer; sl@0: RMessage2 iMessage; sl@0: TAny* iHandle; sl@0: TAny* iLogHandle; // used to log a copy of stream output, for debug purposes sl@0: }; sl@0: sl@0: //