userlibandfileserver/fileserver/sfile/sf_plugin_shim.cpp
changeset 45 329ab0095843
parent 43 96e5fb8b040d
child 134 95847726fe57
equal deleted inserted replaced
44:36bfc973b146 45:329ab0095843
   117 #else
   117 #else
   118 	return(RFs::ReadFileSection(aName,aPos,aDes,aLength));
   118 	return(RFs::ReadFileSection(aName,aPos,aDes,aLength));
   119 #endif
   119 #endif
   120 	}
   120 	}
   121 
   121 
       
   122 EXPORT_C TInt RFsPlugin::Volume(TVolumeInfo &aVol, TInt aDrive) const
       
   123 /**
       
   124 Gets volume information for a formatted device.
       
   125 
       
   126 @see RFs::Volume
       
   127 */
       
   128 	{
       
   129 	return (RFs::Volume(aVol, aDrive));
       
   130 	}
       
   131 
   122 TInt RFsPlugin::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const
   132 TInt RFsPlugin::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const
   123 	{
   133 	{
   124 	return iSessionHelper.SendReceive(aFunction, aArgs);
   134 	return iSessionHelper.SendReceive(aFunction, aArgs);
   125 	}
   135 	}
   126 
   136 
   127 TInt RFs::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const
   137 TInt RFs::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const
   128 	{
   138 	{
   129 	if(Handle())
   139 	if(Handle())
   130 		return RSessionBase::SendReceive(aFunction, aArgs);
   140 		return RSessionBase::SendReceive(aFunction, aArgs);
   131 		
   141 
   132 	return ((RFsPlugin*) this)->SendReceive(aFunction, aArgs);
   142 	return ((RFsPlugin*) this)->SendReceive(aFunction, aArgs);
   133 	}
   143 	}
   134 
   144 
   135 
   145 
   136 /*******************************************************
   146 /*******************************************************
   234 
   244 
   235 	SetSubSessionHandle(SubSessionHandle() ^ KSubSessionMangleBit);
   245 	SetSubSessionHandle(SubSessionHandle() ^ KSubSessionMangleBit);
   236 
   246 
   237 	return err;
   247 	return err;
   238 	}
   248 	}
   239     
   249 
   240 EXPORT_C TInt RFilePlugin::TransferToClient()
   250 EXPORT_C TInt RFilePlugin::TransferToClient()
   241 /**
   251 /**
   242 Closes the file.
   252 Closes the file.
   243 
   253 
   244 @see RFile::TransferToClient
   254 @see RFile::TransferToClient
   304 #endif
   314 #endif
   305 	}
   315 	}
   306 
   316 
   307 EXPORT_C TInt RFilePlugin::Read(TInt64 aPos,TDes8& aDes,TInt aLen) const
   317 EXPORT_C TInt RFilePlugin::Read(TInt64 aPos,TDes8& aDes,TInt aLen) const
   308 /**
   318 /**
   309 Reads the specified number of bytes of binary data from the file at a specified 
   319 Reads the specified number of bytes of binary data from the file at a specified
   310 offset within the file.
   320 offset within the file.
   311 
   321 
   312 @see RFile::Read
   322 @see RFile::Read
   313 */
   323 */
   314 	{
   324 	{
   397 #endif
   407 #endif
   398 	}
   408 	}
   399 
   409 
   400 EXPORT_C TInt RFilePlugin::Flush()
   410 EXPORT_C TInt RFilePlugin::Flush()
   401 /**
   411 /**
   402 Commits data to the storage device and flushes internal buffers without closing 
   412 Commits data to the storage device and flushes internal buffers without closing
   403 the file.
   413 the file.
   404 
   414 
   405 @see RFile::Flush
   415 @see RFile::Flush
   406 */
   416 */
   407 	{
   417 	{
   521 	return RSubSessionBase::CreateSubSession(aSession, aFunction, aArgs);
   531 	return RSubSessionBase::CreateSubSession(aSession, aFunction, aArgs);
   522 	}
   532 	}
   523 
   533 
   524 void RFile::CloseSubSession(TInt aFunction)
   534 void RFile::CloseSubSession(TInt aFunction)
   525 	{
   535 	{
   526 	if((Session().Handle() ^ CObjectIx::ENoClose) != KErrBadHandle) 
   536 	if((Session().Handle() ^ CObjectIx::ENoClose) != KErrBadHandle)
   527 		RSubSessionBase::CloseSubSession(aFunction);
   537 		RSubSessionBase::CloseSubSession(aFunction);
   528 	else
   538 	else
   529 		((RFilePlugin*) this)->CloseSubSession(aFunction);
   539 		((RFilePlugin*) this)->CloseSubSession(aFunction);
   530 	}
   540 	}
   531 
   541 
   532 TInt RFile::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const
   542 TInt RFile::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const
   533 	{
   543 	{
   534 	if((Session().Handle() ^ CObjectIx::ENoClose) != KErrBadHandle) 
   544 	if((Session().Handle() ^ CObjectIx::ENoClose) != KErrBadHandle)
   535 		return RSubSessionBase::SendReceive(aFunction, aArgs);
   545 		return RSubSessionBase::SendReceive(aFunction, aArgs);
   536 		
   546 
   537 	return ((RFilePlugin*) this)->SendReceive(aFunction, aArgs);
   547 	return ((RFilePlugin*) this)->SendReceive(aFunction, aArgs);
   538 	}
   548 	}
   539 
   549 
   540 
   550 
   541 /*******************************************************
   551 /*******************************************************
   582 
   592 
   583 	TUidType uidType(TUid::Null(),TUid::Null(),TUid::Null());
   593 	TUidType uidType(TUid::Null(),TUid::Null(),TUid::Null());
   584 	TPckgC<TUidType> pckgUid(uidType);
   594 	TPckgC<TUidType> pckgUid(uidType);
   585 	return(CreateSubSession(fs,EFsDirOpen,TIpcArgs(&aMatchName,anAttMask,&pckgUid)));
   595 	return(CreateSubSession(fs,EFsDirOpen,TIpcArgs(&aMatchName,anAttMask,&pckgUid)));
   586 	}
   596 	}
   587     
   597 
   588 EXPORT_C void RDirPlugin::Close()
   598 EXPORT_C void RDirPlugin::Close()
   589 /**
   599 /**
   590 Closes the the directory.
   600 Closes the the directory.
   591 
   601 
   592 @see RDir::Close
   602 @see RDir::Close
   651 	return iSessionHelper.SendReceive(aFunction, aArgs, ((RDirPlugin*) this)->SubSessionHandle());
   661 	return iSessionHelper.SendReceive(aFunction, aArgs, ((RDirPlugin*) this)->SubSessionHandle());
   652 	}
   662 	}
   653 
   663 
   654 TInt RDir::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const
   664 TInt RDir::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const
   655 	{
   665 	{
   656 	if((Session().Handle() ^ CObjectIx::ENoClose) != KErrBadHandle) 
   666 	if((Session().Handle() ^ CObjectIx::ENoClose) != KErrBadHandle)
   657 		return RSubSessionBase::SendReceive(aFunction, aArgs);
   667 		return RSubSessionBase::SendReceive(aFunction, aArgs);
   658 
   668 
   659 	return ((RDirPlugin*) this)->SendReceive(aFunction, aArgs);
   669 	return ((RDirPlugin*) this)->SendReceive(aFunction, aArgs);
   660 	}
   670 	}
   661 
   671 
   728 	newRequest->iOwnerPlugin   = iPlugin;
   738 	newRequest->iOwnerPlugin   = iPlugin;
   729 	newRequest->iDirectToDrive = iDirectToDrive;
   739 	newRequest->iDirectToDrive = iDirectToDrive;
   730 
   740 
   731 	newRequest->Dispatch();
   741 	newRequest->Dispatch();
   732 
   742 
   733 	// NOTE : newRequest will be free'd by the File Server before completing the 
   743 	// NOTE : newRequest will be free'd by the File Server before completing the
   734 	//        request so it's not safe to touch the request from now on...
   744 	//        request so it's not safe to touch the request from now on...
   735 	
   745 	
   736 	return(iPlugin->WaitForRequest());
   746 	return(iPlugin->WaitForRequest());
   737 	}
   747 	}
   738 
   748