diff -r 67c6ff54ec25 -r a009639409f5 memspy/MemSpyClient/inc/memspysession.h --- a/memspy/MemSpyClient/inc/memspysession.h Fri May 14 17:25:03 2010 +0300 +++ b/memspy/MemSpyClient/inc/memspysession.h Thu May 27 14:26:55 2010 +0300 @@ -27,61 +27,26 @@ //user includes #include //for Processes #include + #include //for Threads #include +#include +#include +#include + #include //for KernelObjects #include + #include //for KernelObjectItems + #include //for Heap #include +#include + // Constants const TInt KMemSpyVersion = 2; -// Literal constants -_LIT( KMemSpyServer2, "MemSpyServer.exe" ); - - -// -enum TMemSpyOperations - { - //Output operations - -// EGetSinkType, -// EOutputToDebug, -// EOutputToFile, -// EOutputKernelObjects, -// ESetServerTimeOutStatus, -// EOutputProcessInfo, - - //Processes operations - - EGetProcessCount, - EGetProcesses, - EGetThreadCount, - EGetThreads, - ESetThreadPriority, - EProcessSystemPermanentOrCritical, - EEndProcess, - ESwitchToProcess, -// EOpenCloseCurrentProcess - - //Threads operations - EThreadSystemPermanentOrCritical, - EEndThread, - ESwitchToThread, - - //Kernel Objects operations - EGetKernelObjectTypeCount, - EGetKernelObjects, - EGetKernelObjectItemsCount, - EGetKernelObjectItems, - //EOutputKernelObjects - - //Heap operations - EGetHeap - }; - enum TSortType { ESortProcById, @@ -92,12 +57,12 @@ ESortProcByStackUsage }; -enum TEndType - { - ETerminate, - EKill, - EPanic -}; +enum TMemSpyOutputType + { + EOutputTypeDebug = 0, + EOutputTypeFile + }; + NONSHARABLE_CLASS( RMemSpySession ) : public RSessionBase { @@ -106,29 +71,26 @@ IMPORT_C TInt Connect(); public: //API - //Output operations - //inline TMemSpySinkType GetSinkType(); - //inline void OutputToDebug(); - //inline void OutputToFile(); - //inline void OutputKernelObjects(); - //inline void SetServerTimeOutStatus( TUint32 aValue, TBool aEnabled ); - //inline void OutputProcessInfo( TMemSpyProcess aProcess ); + IMPORT_C void OutputKernelHeapDataL(TMemSpyOutputType aOutputType); //EMemSpyClientServerOpHeapData + IMPORT_C void OutputThreadHeapDataL(TMemSpyOutputType aOutputType, TThreadId aThreadId); //EMemSpyClientServerOpHeapData + IMPORT_C void OutputThreadCellListL(TMemSpyOutputType aOutputType, TThreadId aThreadId);//EMemSpyClientServerOpHeapCellListing + IMPORT_C void OutputKernelObjectsL(TMemSpyOutputType aOutputType);// EMemSpyClientServerOpEnumerateKernelContainerAll + IMPORT_C void OutputCompactStackInfoL(TMemSpyOutputType aOutputType);// EMemSpyClientServerOpStackInfoCompact + IMPORT_C void OutputCompactHeapInfoL(TMemSpyOutputType aOutputType);// EMemSpyClientServerOpHeapInfoCompact - //Processes operations - /** - * - */ - IMPORT_C void GetProcessesL(RArray &aProcesses, TSortType aSortType = ESortProcById); + IMPORT_C void GetProcessesL(RArray &aProcesses, TSortType aSortType = ESortProcById); + + IMPORT_C TProcessId GetProcessIdByNameL(const TDesC& aProcessName); IMPORT_C void GetThreadsL(TProcessId aProcessId, RArray &aThreads, TSortType aSortType = ESortProcById); + IMPORT_C TInt ProcessSystemPermanentOrCritical( TProcessId aId, TBool aValue ); //aValue -> return value IMPORT_C void SetThreadPriorityL(TThreadId aId, TInt aPriority); - IMPORT_C TInt EndProcess( TProcessId aId, TEndType aType ); + IMPORT_C TInt EndProcess( TProcessId aId, TMemSpyEndType aType ); IMPORT_C TInt SwitchToProcess( TProcessId aId, TBool aBrought ); - //inline void OpenCloseCurrentProcess( TProcessId aId, TBool aOpen ); //Threads operations /** @@ -138,10 +100,14 @@ IMPORT_C TInt ThreadSystemPermanentOrCritical( TThreadId aId, TBool aValue ); - IMPORT_C TInt EndThread( TThreadId aId, TEndType aType ); + IMPORT_C TInt EndThread( TThreadId aId, TMemSpyEndType aType ); IMPORT_C TInt SwitchToThread( TThreadId aId, TBool aBrought ); + IMPORT_C TInt GetInfoItemType( TInt aIndex, TThreadId aId, TMemSpyThreadInfoItemType &aType ); + + IMPORT_C void GetThreadInfoItems( RArray &aInfoItems, TThreadId aId, TMemSpyThreadInfoItemType aType ); + //KernelObjects operations /** * @@ -150,15 +116,19 @@ IMPORT_C TInt GetKernelObjectItems( RArray &aKernelObjectItems, TMemSpyDriverContainerType aForContainer ); + IMPORT_C void OutputAllContainerContents(); + /** * - */ - //IMPORT_C TInt GetHeap( RArray &aHeap ); - //IMPORT_C TInt GetHeap( CMemSpyApiHeap* aHeap ); + */ IMPORT_C CMemSpyApiHeap* GetHeap(); + + IMPORT_C void DumpKernelHeap(); private: TInt StartServer(); + + void SetOutputTypeL(TMemSpyOutputType aOutputType); }; #endif // MEMSPYSESSION_H