userlibandfileserver/fileserver/sfile/sf_std.h
changeset 286 48e57fb1237e
parent 273 6a75fa55495f
child 299 b5a01337d018
equal deleted inserted replaced
285:ff5437e4337c 286:48e57fb1237e
   920 	TBool ReservedAccess(TInt aDriveNumber) const;
   920 	TBool ReservedAccess(TInt aDriveNumber) const;
   921 	void SetReservedAccess(const TInt aDriveNumber, const TBool aReservedAccess);
   921 	void SetReservedAccess(const TInt aDriveNumber, const TBool aReservedAccess);
   922 private:
   922 private:
   923 	CSessionFs();
   923 	CSessionFs();
   924 	~CSessionFs();
   924 	~CSessionFs();
       
   925 	void Cleanup();
   925 
   926 
   926 private:
   927 private:
   927 	TInt iResourceCountMark;
   928 	TInt iResourceCountMark;
   928 	TInt iResourceCount;
   929 	TInt iResourceCount;
   929 	TInt iSessionFlags;
   930 	TInt iSessionFlags;
   930 	RFastLock iSessionFlagsLock;
       
   931 	CFsObjectIx* iHandles;
   931 	CFsObjectIx* iHandles;
   932 	HBufC* iPath;
   932 	HBufC* iPath;
   933 	RArray<TReservedDriveAccess> iReservedDriveAccess;
   933 	RArray<TReservedDriveAccess> iReservedDriveAccess;
   934 	TThreadId iId;
   934 	TThreadId iId;
   935 	TInt iCloseRequestCount;	// number of close requests owned by this sessions on the RequestAllocator close queue
   935 	TInt iCloseRequestCount;	// number of close requests owned by this sessions on the RequestAllocator close queue
  1464     enum TInfoType {EDiskSpace,EStdChange,EExtChange,EDebugChange,EDismount};
  1464     enum TInfoType {EDiskSpace,EStdChange,EExtChange,EDebugChange,EDismount};
  1465 
  1465 
  1466 public:
  1466 public:
  1467 	~CNotifyInfo();
  1467 	~CNotifyInfo();
  1468 	void Initialise(TInfoType aType,TRequestStatus* aStatus,const RMessagePtr2& aMessage,CSessionFs* aSession);
  1468 	void Initialise(TInfoType aType,TRequestStatus* aStatus,const RMessagePtr2& aMessage,CSessionFs* aSession);
  1469 	void Complete(TInt aError);
  1469 	virtual void Complete(TInt aError);
  1470 	//
  1470 	//
  1471 	inline CSessionFs* Session();
  1471 	inline CSessionFs* Session();
  1472 	inline TRequestStatus* Status();
  1472 	inline TRequestStatus* Status();
  1473 	inline TInfoType Type() const {return(iType);}
  1473 	inline TInfoType Type() {return(iType);}
       
  1474 	inline TBool Completed() {return iMessage.IsNull();}
  1474 public:
  1475 public:
  1475 	TDblQueLink iLink;
  1476 	TDblQueLink iLink;
  1476 protected:
  1477 protected:
  1477 	TInfoType iType;
  1478 	TInfoType iType;
  1478 	TRequestStatus* iStatus;
  1479 	TRequestStatus* iStatus;
  1520 
  1521 
  1521 NONSHARABLE_CLASS(CDismountNotifyInfo) : public CNotifyInfo
  1522 NONSHARABLE_CLASS(CDismountNotifyInfo) : public CNotifyInfo
  1522 	{
  1523 	{
  1523 public:
  1524 public:
  1524 	~CDismountNotifyInfo();
  1525 	~CDismountNotifyInfo();
       
  1526 	virtual void Complete(TInt aError);
  1525 	void Initialise(TNotifyDismountMode aMode, TInt aDriveNumber,TRequestStatus* iStatus,const RMessagePtr2& aMessage,CSessionFs* aSession);
  1527 	void Initialise(TNotifyDismountMode aMode, TInt aDriveNumber,TRequestStatus* iStatus,const RMessagePtr2& aMessage,CSessionFs* aSession);
  1526 	TBool IsMatching(TNotifyDismountMode aMode, TInt aDriveNumber, CSessionFs* aSession);
  1528 	TBool IsMatching(TNotifyDismountMode aMode, TInt aDriveNumber, CSessionFs* aSession);
  1527 	inline TInt DriveNumber() {return iDriveNumber;}
  1529 	inline TInt DriveNumber() {return iDriveNumber;}
       
  1530 	inline TNotifyDismountMode Mode() {return iMode;}
       
  1531 
  1528 private:
  1532 private:
  1529 	TNotifyDismountMode iMode;
  1533 	TNotifyDismountMode iMode;
  1530 	TInt iDriveNumber;
  1534 	TInt iDriveNumber;
  1531 	};
  1535 	};
  1532 
  1536 
  1539 	TBaseQue();
  1543 	TBaseQue();
  1540 	~TBaseQue();
  1544 	~TBaseQue();
  1541 	void DoAddNotify(CNotifyInfo* aInfo);
  1545 	void DoAddNotify(CNotifyInfo* aInfo);
  1542 	TBool DoCancelSession(CSessionFs* aSession,TInt aCompletionCode,TRequestStatus* aStatus=NULL);
  1546 	TBool DoCancelSession(CSessionFs* aSession,TInt aCompletionCode,TRequestStatus* aStatus=NULL);
  1543 	void DoCancelAll(TInt aCompletionCode);
  1547 	void DoCancelAll(TInt aCompletionCode);
  1544 	CNotifyInfo* DoFindEntry(CSessionFs* aSession, TRequestStatus* aStatus=NULL);
       
  1545 	TBool IsEmpty();
  1548 	TBool IsEmpty();
  1546 protected:
  1549 protected:
  1547 	TDblQue<CNotifyInfo> iHeader;
  1550 	TDblQue<CNotifyInfo> iHeader;
  1548 	RFastLock iQLock;
  1551 	RFastLock iQLock;
  1549 	};
  1552 	};
  1587 
  1590 
  1588 class TDismountNotifyQue : public TBaseQue
  1591 class TDismountNotifyQue : public TBaseQue
  1589 	{
  1592 	{
  1590 public:
  1593 public:
  1591 	TInt AddNotify(CNotifyInfo* aInfo);
  1594 	TInt AddNotify(CNotifyInfo* aInfo);
  1592 	TInt CancelSession(CSessionFs* aSession,TInt aCompletionCode,TRequestStatus* aStatus=NULL);
  1595 	void CancelSession(CSessionFs* aSession,TInt aCompletionCode,TRequestStatus* aStatus=NULL);
  1593 	void CancelAll(TInt aCompletionCode);
  1596 	void CancelAll(TInt aCompletionCode);
  1594 	void CheckDismount(TNotifyDismountMode aMode, TInt aDrive, TBool aRemove, TInt aError);
  1597 	void CheckDismount(TNotifyDismountMode aMode, TInt aDrive, TBool aRemove, TInt aError);
  1595 	TBool HandlePendingDismount(CSessionFs* aSession, TInt aDrive);
  1598 	TBool HandlePendingDismount(CSessionFs* aSession, TInt aDrive);
  1596 	};
  1599 	};
  1597 
  1600 
  1610 	static void HandleDebug(TUint aFunction);
  1613 	static void HandleDebug(TUint aFunction);
  1611 	static void HandleDismount(TNotifyDismountMode aMode, TInt aDrive, TBool aRemove, TInt err);
  1614 	static void HandleDismount(TNotifyDismountMode aMode, TInt aDrive, TBool aRemove, TInt err);
  1612 	static void CancelChangeSession(CSessionFs* aSession,TRequestStatus* aStatus=NULL);
  1615 	static void CancelChangeSession(CSessionFs* aSession,TRequestStatus* aStatus=NULL);
  1613 	static void CancelDiskSpaceSession(CSessionFs* aSession,TRequestStatus* aStatus=NULL);
  1616 	static void CancelDiskSpaceSession(CSessionFs* aSession,TRequestStatus* aStatus=NULL);
  1614 	static void CancelDebugSession(CSessionFs* aSession, TRequestStatus* aStatus=NULL);
  1617 	static void CancelDebugSession(CSessionFs* aSession, TRequestStatus* aStatus=NULL);
  1615 	static TInt CancelDismountNotifySession(CSessionFs* aSession, TRequestStatus* aStatus=NULL);
  1618 	static void CancelDismountNotifySession(CSessionFs* aSession, TRequestStatus* aStatus=NULL);
  1616 	static void CancelSession(CSessionFs* aSession);
  1619 	static void CancelSession(CSessionFs* aSession);
  1617 	static TBool HandlePendingDismount(CSessionFs* aSession, TInt aDriveNumber);
  1620 	static TBool HandlePendingDismount(CSessionFs* aSession, TInt aDriveNumber);
  1618 	static TBool IsChangeQueEmpty(TInt aDrive);
  1621 	static TBool IsChangeQueEmpty(TInt aDrive);
  1619 	static TBool IsDiskSpaceQueEmpty(TInt aDrive);
  1622 	static TBool IsDiskSpaceQueEmpty(TInt aDrive);
  1620 private:
  1623 private:
  1702 extern SCapabilitySet DisabledCapabilities;
  1705 extern SCapabilitySet DisabledCapabilities;
  1703 
  1706 
  1704 const TInt KDispatchObjectClose=KMaxTInt-1;
  1707 const TInt KDispatchObjectClose=KMaxTInt-1;
  1705 const TInt KSessionInternalReserved2=KMaxTInt-2;	// not used any more - placeholder
  1708 const TInt KSessionInternalReserved2=KMaxTInt-2;	// not used any more - placeholder
  1706 const TInt KSessionInternalReserved3=KMaxTInt-3;	// not used any more - placeholder
  1709 const TInt KSessionInternalReserved3=KMaxTInt-3;	// not used any more - placeholder
  1707 const TInt KSessionInternalReserved4=KMaxTInt-4;	// not used any more - placeholder
  1710 const TInt KDeferredDismount=KMaxTInt-4;
  1708 const TInt KFileShareClose=KMaxTInt-5;
  1711 const TInt KFileShareClose=KMaxTInt-5;
  1709 const TInt KFlushDirtyData=KMaxTInt-6;
  1712 const TInt KFlushDirtyData=KMaxTInt-6;
  1710 
  1713 
  1711 const TOperation DispatchObjectCloseOp=	{KDispatchObjectClose,	EInternalRequest,	&TFsCloseObject::Initialise,		NULL,	&TFsCloseObject::DoRequestL			};
  1714 const TOperation DispatchObjectCloseOp=	{KDispatchObjectClose,	EInternalRequest,	&TFsCloseObject::Initialise,		NULL,	&TFsCloseObject::DoRequestL			};
  1712 const TOperation FileShareCloseOp=		{KFileShareClose,		EInternalRequest,	&TFsCloseFileShare::Initialise,		NULL,	&TFsCloseFileShare::DoRequestL		};
  1715 const TOperation FileShareCloseOp=		{KFileShareClose,		EInternalRequest,	&TFsCloseFileShare::Initialise,		NULL,	&TFsCloseFileShare::DoRequestL		};
       
  1716 const TOperation DeferredDismountOp=	{KDeferredDismount,		EInternalRequest,	&TFsDeferredDismount::Initialise,	NULL,	&TFsDeferredDismount::DoRequestL	};
  1713 
  1717 
  1714 extern TBool OpenOnDriveZOnly;
  1718 extern TBool OpenOnDriveZOnly;
  1715 extern TBool LocalFileSystemInitialized;
  1719 extern TBool LocalFileSystemInitialized;
  1716 extern TBool StartupInitCompleted;
  1720 extern TBool StartupInitCompleted;
  1717 extern TBool RefreshZDriveCache;
  1721 extern TBool RefreshZDriveCache;