当前位置: 首页>>代码示例>>C++>>正文


C++ TFsPluginRequest类代码示例

本文整理汇总了C++中TFsPluginRequest的典型用法代码示例。如果您正苦于以下问题:C++ TFsPluginRequest类的具体用法?C++ TFsPluginRequest怎么用?C++ TFsPluginRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了TFsPluginRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FsReadFileSectionL

void CPreModifierPlugin::FsReadFileSectionL(TFsPluginRequest& aRequest)
	{
	TInt err = KErrNone;
	TInt length = 0;
	TInt64 pos = 0;
	TFileName filename;
	TParse parse;
	TBuf<256> testfilename1;

	//setting up test files
	testfilename1.Append(iDriveToTest);
	testfilename1.Append(_L(":\\Data\\test.txt"));

	filename = aRequest.Src().FullName();

	err = aRequest.Read(TFsPluginRequest::ELength, length);
	iLastError = err;
	iLineNumber = __LINE__;
	if(err!=KErrNone)
		User::Leave(err); //trapped in DoRequestL
	
	err = aRequest.Read(TFsPluginRequest::EPosition, pos);
	iLastError = err;
	iLineNumber = __LINE__;
	if(err!=KErrNone)
		User::Leave(err); //trapped in DoRequestL

    parse.Set(filename, NULL, NULL);

	_LOG2(_L("CPreModifierPlugin::FsReadFileSectionL, file: %S"), &filename);
	
	if (aRequest.IsPostOperation())
		{
		_LOG(_L("CPreModifierPlugin::FsReadFileSectionL, post intercept - enter"));
		RFilePlugin fileplugin2(aRequest,ETrue);
		//open a second file
		err = fileplugin2.Open(testfilename1, EFileWrite);
		_LOG3(_L("CPreModifierPlugin::FsReadFileSectionL - RFilePlugin::Open for %S returned %d"), &testfilename1, err);
		iLastError = err;
		iLineNumber = __LINE__;
		if(err!=KErrNone)
			User::Leave(err); //trapped in DoRequestL
								
		TInt64 size=0;
		err = fileplugin2.Size(size);
		_LOG3(_L("CPreModifierPlugin::FsReadFileSectionL - RFilePlugin::Size for %S returned %d"), &testfilename1, err);
		iLastError = err;
		iLineNumber = __LINE__;
		if(err!=KErrNone)
			User::Leave(err); //trapped in DoRequestL

		//close the second file
		fileplugin2.Close();
		_LOG(_L("CPreModifierPlugin::FsReadFileSectionL - post intercept - exit"));
		}
	else
		{
			User::Invariant();
		}
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:60,代码来源:premodifier_plugin.cpp

示例2: Deliver

/**
Delivers the request to the end of plugin thread's queue. 
In certain circumstances, where the request requires priority handling
it adds it to the front of the queue.

@param	aRequest: The request to be delivered
@return KErrNone
*/
EXPORT_C TInt CFsPlugin::Deliver(TFsPluginRequest& aRequest)
	{
	__ASSERT_ALWAYS(iThreadP != NULL, User::Panic(_L("CFsPlugin::Dispatch"),999));

	TInt function = aRequest.Function();

	if(function == EFsPluginOpen)
		{
		// Don't dispatch open requests to the plugin thread
		return KPluginMessageForward;
		}

	if(function == EFsPluginDoRequest ||
	   function == EFsPluginDoControl ||
	   function == EFsPluginDoCancel)
		{
		iThreadP->DeliverFront(aRequest.Request());
		}
	else
		{
		iThreadP->DeliverBack(aRequest.Request());
		}

	return KErrNone;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:33,代码来源:sf_plugin.cpp

示例3: DoRequestL

/**
Handle requests to Dismount the plugin only.
This plugin is designed such that its removal is not allowed.
@internalComponent
*/
TInt CUnremovablePlugin::DoRequestL(TFsPluginRequest& aRequest)
	{
	TInt err = KErrNone;

	TInt function = aRequest.Function();

	if (aRequest.IsPostOperation())
		{
		_LOG2(_L("CUnremovablePlugin post intercept for function %d"), function);
		//We should never get here
		//Is it even correct to post-intercept a EFsDismountPlugin ??
		User::Invariant();
		}
	else
		{
		_LOG2(_L("CUnremovablePlugin pre intercept for function %d"), function);

		//If a user is trying to dismount this plugin and this plugin doesn't want
		//to be dismounted then we should eb able to intecept this and return KErrAccessDenied or some
		//appropriate error code.

		if(iRemovable)
			{
			return KErrNone;
			}
		else
			{
			return KErrPermissionDenied;	
			}
		
		}

	return err;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:39,代码来源:unremovable_plugin.cpp

示例4: DoRequestL

/**
@internalComponent
*/
TInt CTestHexHook::DoRequestL(TFsPluginRequest& aRequest)
	{
	TInt err = KErrNotSupported;

	TInt function = aRequest.Function();
	
	iDrvNumber = aRequest.DriveNumber();

	switch(function)
		{
		case EFsFileOpen:
			err = HexFileOpen(aRequest);
			break;

		case EFsFileRead:
			// Post intercept does nothing except prove that it is possible and that no deadlock occurs.
			// plugin always calls FileRead() when receiving a EFsFileRead, and so the mesage gets completed
			// by the plugin and has to be post intercepted by the plugin (if registered to post-intercept the request) 
			// and any plugins above it.

			if (!(aRequest.IsPostOperation()))
				err = HexFileRead(aRequest);
			break;

		default:
			break;
		}

	return err;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:33,代码来源:t_hexhook.cpp

示例5: FsFileWriteL

/**
@internalComponent
*/
void CPreModifierPlugin::FsFileWriteL(TFsPluginRequest& aRequest)
	{
	TInt err = KErrNone;
	TInt length = 0;
	TInt64 pos = 0;
	TFileName filename;
	TParse parse;

	TBuf<256> testfilename1;
	TBuf<256> testfilename2;

	//setting up test files
	testfilename1.Append(iDriveToTest);
	testfilename1.Append(_L(":\\Data\\test.txt"));

	testfilename2.Append(iDriveToTest);
	testfilename2.Append(_L(":\\Data\\createcreate3.txt"));

	err = aRequest.FileName(filename);
	iLastError = err;
	iLineNumber = __LINE__;
	if(err!=KErrNone)
		User::Leave(err); //trapped in DoRequestL

	err = aRequest.Read(TFsPluginRequest::ELength, length);
	iLastError = err;
	iLineNumber = __LINE__;
	if(err!=KErrNone)
		User::Leave(err); //trapped in DoRequestL
	
	err = aRequest.Read(TFsPluginRequest::EPosition, pos);
	iLastError = err;
	iLineNumber = __LINE__;
	if(err!=KErrNone)
		User::Leave(err); //trapped in DoRequestL

    parse.Set(filename, NULL, NULL);

	_LOG4(_L("CPreModifierPlugin::FsFileWriteL, file: %S, pos: %d, length: %d"), &filename, pos, length);
	
	if (aRequest.IsPostOperation())
		{
		_LOG(_L("CPreModifierPlugin::FsFileWriteL, post intercept"));
		}
	else
		{
			User::Invariant();
		}
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:52,代码来源:premodifier_plugin.cpp

示例6: ValidateRequest

/**
Validate that nobody is trying to touch the virus scanner files.

@internalComponent

@return A value depending on whethe the virus scanner files are
being fiddled with.

@param aDriveNum The drive number of the request which called into
the test virus scanning hook.

@param aName The full pathname of the file being accessed by the
request to the file server hook.
*/
TInt CTestVirusHook::ValidateRequest(TFsPluginRequest& aRequest, TFileName& aFileName)
	{
	TInt driveNumber = aRequest.DriveNumber();
	
	TInt err = GetName(&aRequest, aFileName);
	if(err != KErrNone)
		return(err);
	
	if (driveNumber == EDriveC)
		{
		TInt r = aFileName.Find(_L("\\virusdef.txt"));

		if (r != KErrNotFound)
			{
			//Do not allow the deletion of the virus definition file.
			return KErrAccessDenied;
			}

		r = aFileName.Find(_L("\\system\\libs\\t_vshook.pxt"));
		if (r != KErrNotFound)
			{
			//Do not allow the deletion of the this dll
			return KErrAccessDenied;
			}
		r = aFileName.Find(_L("\\sys\\bin\\t_vshook.pxt"));
		if (r != KErrNotFound)
			{
			//Do not allow the deletion of the this dll
			return KErrAccessDenied;
			}
		}
	return KErrNone;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:47,代码来源:t_vshook.cpp

示例7: DoRequestL

/**
Handle requests
@internalComponent
*/
TInt CTemplatePlugin::DoRequestL(TFsPluginRequest& aRequest)
	{
	TInt err = KErrNone;

	TInt function = aRequest.Function();

	if (aRequest.IsPostOperation())
		{
		_LOG2(_L("CTemplatePlugin post intercept for function %d"), function);
		}
	else
		{
		_LOG2(_L("CTemplatePlugin pre intercept for function %d"), function);
		}

	return err;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:21,代码来源:template_plugin.cpp

示例8: FsDirReadOneL

void CPreModifierPlugin::FsDirReadOneL(TFsPluginRequest& aRequest)
	{

	TFileName name;
	TInt err = aRequest.FileName(name);
	iLastError = err;
	iLineNumber = __LINE__;
	if(err!=KErrNone)
		User::Leave(err); //trapped in DoRequestL
	
	if (aRequest.IsPostOperation())
		{
		_LOG(_L("CPreModifierPlugin::FsDirReadOneL, post intercept"));
		}
	else
		{
		User::Invariant();
		}
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:19,代码来源:premodifier_plugin.cpp

示例9: FsRenameL

void CPreModifierPlugin::FsRenameL(TFsPluginRequest& aRequest)
	{
	TInt err = KErrNone;
	TFileName oldfilename;
	TFileName newfilename;

	oldfilename = aRequest.Src().FullName();
	newfilename = aRequest.Dest().FullName();

	TBuf<256> testfilename1;

	//setting up test files
	testfilename1.Append(iDriveToTest);
	testfilename1.Append(_L(":\\Data\\test.txt"));

	if (aRequest.IsPostOperation())
		{
		_LOG(_L("CPreModifierPlugin::FsRenameL, post intercept"));
		RFilePlugin fileplugin2(aRequest);
		//open a second file
		err = fileplugin2.Open(testfilename1, EFileWrite);
		_LOG3(_L("CPreModifierPlugin::FsRenameL, RFilePlugin::Open for %S returned %d"), &testfilename1, err);
		iLastError = err;
		iLineNumber = __LINE__;
		if(err!=KErrNone)
			User::Leave(err); //trapped in DoRequestL
								
		TInt64 size=0;
		err = fileplugin2.Size(size);
		iLastError = err;
		iLineNumber = __LINE__;
		if(err!=KErrNone)
			User::Leave(err); //trapped in DoRequestL		

		//close the second file
		fileplugin2.Close();
		_LOG2(_L("CPreModifierPlugin::FsRenameL, RFilePlugin::Close to the second file returned %d"), err);
		}
	else
		{
		User::Invariant();
		}
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:43,代码来源:premodifier_plugin.cpp

示例10: FsFileTempL

void CPreModifierPlugin::FsFileTempL(TFsPluginRequest& aRequest)
	{
	TBuf<256> testfilename1;

	//setting up test files
	testfilename1.Append(iDriveToTest);
	testfilename1.Append(_L(":\\Data\\"));

	if (aRequest.IsPostOperation())
		{
		_LOG(_L("CPreModifierPlugin::FsFileTempL, post intercept"));

		RFilePlugin fileplugin(aRequest);
		TInt err = fileplugin.AdoptFromClient();
		iLastError = err;
		iLineNumber = __LINE__;
		if(err!=KErrNone)
			User::Leave(err); //trapped in DoRequestL
		
		//write to the newly created temp file
		TBuf8<64> wbuffer;
		wbuffer.Copy(_L8("TestTestTest"));
		err = fileplugin.Write(0, wbuffer);
		_LOG2(_L("CPreModifierPlugin::FsFileTempL, RFilePlugin::Write to the newly created temp file returned %d"), err);
		iLastError = err;
		iLineNumber = __LINE__;
		if(err!=KErrNone)
			User::Leave(err); //trapped in DoRequestL

		TInt length = wbuffer.Length();
		HBufC8* tempBuf = HBufC8::NewMaxLC(length);
		TPtr8 tempBufPtr((TUint8 *)tempBuf->Des().Ptr(), length, length);
		err = fileplugin.Read(0, tempBufPtr);
		_LOG2(_L("CPreModifierPlugin::FsFileTempL, RFilePlugin::Read returned %d"), err);
		iLastError = err;
		iLineNumber = __LINE__;
		if(err!=KErrNone)
			User::Leave(err); //trapped in DoRequestL
		
		fileplugin.Close();

		//testing the correct thing has been written to the drive
		err = wbuffer.Compare(tempBufPtr);
		iLastError = err;
		iLineNumber = __LINE__;
		if(err!=KErrNone)
			User::Leave(err); //trapped in DoRequestL
			
		CleanupStack::PopAndDestroy();
		}
	else
		{
		User::Invariant();
		}
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:55,代码来源:premodifier_plugin.cpp

示例11: FsDirReadPackedL

/**
@internalComponent
*/
void CPreModifierPlugin::FsDirReadPackedL(TFsPluginRequest& aRequest)
	{
	if (aRequest.IsPostOperation())
		{
		_LOG(_L("CPreModifierPlugin::FsDirReadPackedL, post intercept"));
		}
	else
		{
		User::Invariant();
		}
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:14,代码来源:premodifier_plugin.cpp

示例12: FsFileSubCloseL

/**
@internalComponent
*/
void CPreModifierPlugin::FsFileSubCloseL(TFsPluginRequest& aRequest)
	{
	if (aRequest.IsPostOperation())
		{
		_LOG(_L("CPreModifierPlugin::FsFileSubCloseL, post intercept"));
		}
	else
		{
		User::Invariant();
		}
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:14,代码来源:premodifier_plugin.cpp

示例13: FsFileRenameL

/**
@internalComponent
*/
void CPreModifierPlugin::FsFileRenameL(TFsPluginRequest& aRequest)
	{
	TFileName oldfilename, newfilename;
	TParse parse;

	oldfilename = aRequest.Src().FullName();
	newfilename = aRequest.Dest().FullName();
	
    parse.Set(oldfilename, NULL, NULL);
	TPtrC extension(parse.Ext());

	_LOG3(_L("CPreModifierPlugin::FsFileRenameL, old name: %S, new name: %S"), &oldfilename, &newfilename);
	
	if (aRequest.IsPostOperation())
		{
		_LOG(_L("CPreModifierPlugin::FsFileRenameL, post intercept"));

		if (extension.CompareF(_L(".tst")) == 0)
			{
			TBuf8<32> tempBuf = (_L8("Rename Post Intercept"));
			RFilePlugin fileplugin(aRequest);
			TInt err = fileplugin.AdoptFromClient();
			iLastError = err;
			iLineNumber = __LINE__;
			if(err!=KErrNone)
				User::Leave(err); //trapped in DoRequestL

			err = fileplugin.Write(20, tempBuf);
			_LOG2(_L("CPreModifierPlugin::FsFileRenameL, FileWrite returned %d"), err);
			iLastError = err;
			iLineNumber = __LINE__;
			if(err!=KErrNone)
				User::Leave(err); //trapped in DoRequestL
			fileplugin.Close();
			}
		}
	else
		{
			User::Invariant();
		}
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:44,代码来源:premodifier_plugin.cpp

示例14: FsFileUnLockL

/**
@internalComponent
*/
void CPreModifierPlugin::FsFileUnLockL(TFsPluginRequest& aRequest)
	{
	TInt length = 0;
	TInt64 pos = 0;
	TFileName filename;
	TParse parse;

	TInt err = aRequest.FileName(filename);
	iLastError = err;
	iLineNumber = __LINE__;
	if(err!=KErrNone)
		User::Leave(err); //trapped in DoRequestL

	err = aRequest.Read(TFsPluginRequest::ELength, length);
	iLastError = err;
	iLineNumber = __LINE__;
	if(err!=KErrNone)
		User::Leave(err); //trapped in DoRequestL

	err = aRequest.Read(TFsPluginRequest::EPosition, pos);
	iLastError = err;
	iLineNumber = __LINE__;
	if(err!=KErrNone)
		User::Leave(err); //trapped in DoRequestL
	
    parse.Set(filename, NULL, NULL);
	//TPtrC extension(parse.Ext());

	_LOG4(_L("CPreModifierPlugin::FsFileUnLockL, file: %S, pos: %d, length: %d"), &filename, pos, length);
	
	if (aRequest.IsPostOperation())
		{
		_LOG(_L("CPreModifierPlugin::FsFileUnLockL, post intercept"));
		}
	else
		{
			User::Invariant();
		}
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:42,代码来源:premodifier_plugin.cpp

示例15: DispatchOperation

/**
@internalTechnology
@prototype
@deprecated

Pushes a msgop, dispatches it and waits for it to complete
*/
TInt CFsPlugin::DispatchOperation(TFsPluginRequest& aRequest, TDes8& aDes, TInt64 aPos, TInt aFunction)
	{
	if (aRequest.Function() != EFsFileRead && aRequest.Function() != EFsFileWrite)
		return KErrNotSupported;
	if (aFunction != EFsFileRead && aFunction != EFsFileWrite)
		return KErrNotSupported;

	CFsMessageRequest& msgRequest = * (CFsMessageRequest*) aRequest.Request();


	TInt len = aDes.Length();
	if (len <= 0)
		return CFsRequest::EReqActionComplete;

	TUint8* ptr = (TUint8*) aDes.Ptr();

	TInt r = msgRequest.PushOperation(
		aPos, len, ptr,
		0,			// aOffset
		Complete,	// callback
		0,			// next state
		aFunction);
	if (r != KErrNone)
		return r;


	CFsPlugin* plugin = this;
	FsPluginManager::ReadLockChain();
	FsPluginManager::NextPlugin(plugin, &msgRequest);
	msgRequest.iCurrentPlugin = plugin;
	msgRequest.Dispatch();
	FsPluginManager::UnlockChain();
	iThreadP->OperationLockWait();

	aDes.SetLength(len);
	
	return msgRequest.LastError();	// KErrNone;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:45,代码来源:sf_plugin.cpp


注:本文中的TFsPluginRequest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。