memspy/Driver/Kernel/Include/MemSpyDriverObjectIx.h
branchRCL_3
changeset 59 8ad140f3dd41
parent 49 7fdc9a71d314
equal deleted inserted replaced
49:7fdc9a71d314 59:8ad140f3dd41
   124         */
   124         */
   125 public:
   125 public:
   126 	// common operations
   126 	// common operations
   127     RMemSpyObjectIx();
   127     RMemSpyObjectIx();
   128 
   128 
   129     //static void Wait();
   129     static void Wait();
   130 	//static void Signal();
   130 	static void Signal();
   131 
   131 
   132     inline TInt Count()
   132     inline TInt Count()
   133 		{ return iCount; }
   133 		{ return iCount; }
   134 	inline TInt ActiveCount()
   134 	inline TInt ActiveCount()
   135 		{ return iActiveCount; }
   135 		{ return iActiveCount; }
   136 
   136 
   137 public:
   137 public:
   138 	// uncommon operations
   138 	// uncommon operations
   139 	DObject* operator[](TInt aIndex);
   139 	DObject* operator[](TInt aIndex);
   140 	TBool Find(DObject* aObject);
   140 	TInt At(DObject* aObject);
   141 
   141 
   142 private:
   142 private:
   143 	TRWSpinLock		iRWL;
   143 	TRWSpinLock		iRWL;
   144 	TInt			iAllocated;			// Max entries before realloc needed
   144 	TInt			iAllocated;			// Max entries before realloc needed
   145 	volatile TInt	iCount;				// Points to at least 1 above the highest occupied slot or unoccupied reserved slot
   145 	volatile TInt	iCount;				// Points to at least 1 above the highest occupied slot or unoccupied reserved slot
   169     inline DMemSpyObjectIx() { }
   169     inline DMemSpyObjectIx() { }
   170 
   170 
   171 public:
   171 public:
   172 	DObject* At(TInt aHandle,TInt aUniqueID);
   172 	DObject* At(TInt aHandle,TInt aUniqueID);
   173 	DObject* At(TInt aHandle);
   173 	DObject* At(TInt aHandle);
   174 	TBool Find(DObject* aObject);
   174 	TInt At(DObject* aObject);
   175 	TInt Count(DObject* aObject);
   175 	TInt Count(DObject* aObject);
   176 	DObject* operator[](TInt aIndex);
   176 	DObject* operator[](TInt aIndex);
   177 	//static void Wait( DMemSpyObjectIx* aObjectIndex );
   177 	static void Wait( DMemSpyObjectIx* aObjectIndex );
   178 	//static void Signal( DMemSpyObjectIx* aObjectIndex );
   178 	static void Signal( DMemSpyObjectIx* aObjectIndex );
   179 	inline TInt Count();
   179 	inline TInt Count();
   180 	inline TInt ActiveCount();
   180 	inline TInt ActiveCount();
   181 
   181 
   182 private:
   182 private:
   183 	TInt iNextInstance;
   183 	TInt iNextInstance;
   204 
   204 
   205 
   205 
   206 #if MCL_ROBJECTIX_DUPLICATION
   206 #if MCL_ROBJECTIX_DUPLICATION
   207 
   207 
   208     #define MemSpyObjectIx                                          RMemSpyObjectIx
   208     #define MemSpyObjectIx                                          RMemSpyObjectIx
   209     //#define MemSpyObjectIx_Wait( IX )                               RMemSpyObjectIx::Wait()
   209     #define MemSpyObjectIx_Wait( IX )                               RMemSpyObjectIx::Wait()
   210     //#define MemSpyObjectIx_Signal( IX )                             RMemSpyObjectIx::Signal()
   210     #define MemSpyObjectIx_Signal( IX )                             RMemSpyObjectIx::Signal()
   211     #define MemSpyObjectIx_GetHandlePointer_Thread( DTHREAD )       reinterpret_cast< MemSpyObjectIx* >( &DTHREAD.iHandles )
   211     #define MemSpyObjectIx_GetHandlePointer_Thread( DTHREAD )       reinterpret_cast< MemSpyObjectIx* >( &DTHREAD.iHandles )
   212     #define MemSpyObjectIx_GetHandlePointer_Process( DPROCESS )     reinterpret_cast< MemSpyObjectIx* >( &DPROCESS.iHandles )
   212     #define MemSpyObjectIx_GetHandlePointer_Process( DPROCESS )     reinterpret_cast< MemSpyObjectIx* >( &DPROCESS.iHandles )
   213 
   213 
   214 #elif MCL_DOBJECTIX_DUPLICATION
   214 #elif MCL_DOBJECTIX_DUPLICATION
   215 
   215 
   216     #define MemSpyObjectIx                                          DMemSpyObjectIx
   216     #define MemSpyObjectIx                                          DMemSpyObjectIx
   217     //#define MemSpyObjectIx_Wait( IX )                               DMemSpyObjectIx::Wait( IX )
   217     #define MemSpyObjectIx_Wait( IX )                               DMemSpyObjectIx::Wait( IX )
   218     //#define MemSpyObjectIx_Signal( IX )                             DMemSpyObjectIx::Signal( IX )
   218     #define MemSpyObjectIx_Signal( IX )                             DMemSpyObjectIx::Signal( IX )
   219     #define MemSpyObjectIx_GetHandlePointer_Thread( DTHREAD )       reinterpret_cast< MemSpyObjectIx* >( DTHREAD.iHandles )
   219     #define MemSpyObjectIx_GetHandlePointer_Thread( DTHREAD )       reinterpret_cast< MemSpyObjectIx* >( DTHREAD.iHandles )
   220     #define MemSpyObjectIx_GetHandlePointer_Process( DPROCESS )     reinterpret_cast< MemSpyObjectIx* >( DPROCESS.iHandles )
   220     #define MemSpyObjectIx_GetHandlePointer_Process( DPROCESS )     reinterpret_cast< MemSpyObjectIx* >( DPROCESS.iHandles )
   221 
   221 
   222 #else
   222 #else
   223 
   223 
   224     #define MemSpyObjectIx                  DObjectIx
   224     #define MemSpyObjectIx                  DObjectIx
   225     //#define MemSpyObjectIx_Wait( IX )       
   225     #define MemSpyObjectIx_Wait( IX )       
   226     //#define MemSpyObjectIx_Signal( IX )     
   226     #define MemSpyObjectIx_Signal( IX )     
   227     #define MemSpyObjectIx_IsValid_Thread( DTHREAD )    ( DTHREAD.iHandles != NULL )
   227     #define MemSpyObjectIx_IsValid_Thread( DTHREAD )    ( DTHREAD.iHandles != NULL )
   228     #define MemSpyObjectIx_IsValid_Process( DPROCESS )  ( DPROCESS.iHandles != NULL )
   228     #define MemSpyObjectIx_IsValid_Process( DPROCESS )  ( DPROCESS.iHandles != NULL )
   229     #define MemSpyObjectIx_GetHandlePointer_Thread( DTHREAD )       reinterpret_cast< MemSpyObjectIx* >( DTHREAD.iHandles )
   229     #define MemSpyObjectIx_GetHandlePointer_Thread( DTHREAD )       reinterpret_cast< MemSpyObjectIx* >( DTHREAD.iHandles )
   230     #define MemSpyObjectIx_GetHandlePointer_Process( DPROCESS )     reinterpret_cast< MemSpyObjectIx* >( DPROCESS.iHandles )
   230     #define MemSpyObjectIx_GetHandlePointer_Process( DPROCESS )     reinterpret_cast< MemSpyObjectIx* >( DPROCESS.iHandles )
   231 
   231 
   232 #endif
   232 #endif
   233 
   233 
   234 #define MemSpyObjectIx_HandleLookupLock()							NKern::LockSystem()
   234 #endif
   235 #define MemSpyObjectIx_HandleLookupUnlock()							NKern::UnlockSystem()
       
   236 
       
   237 #endif