本文整理汇总了C++中TFsPluginRequest::Function方法的典型用法代码示例。如果您正苦于以下问题:C++ TFsPluginRequest::Function方法的具体用法?C++ TFsPluginRequest::Function怎么用?C++ TFsPluginRequest::Function使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TFsPluginRequest
的用法示例。
在下文中一共展示了TFsPluginRequest::Function方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: FsFileWriteL
/**
Handle requests
@internalComponent
*/
TInt CStacked3Plugin::DoRequestL(TFsPluginRequest& aRequest)
{
TInt err = KErrNone;
TInt function = aRequest.Function();
switch(function)
{
case EFsFileRead:
break;
case EFsFileWrite:
TRAP(err, FsFileWriteL(aRequest));
break;
default:
break;
}
return err;
}
示例7: DoRequestL
/**
@internalComponent
*/
TInt CTestVirusHook::DoRequestL(TFsPluginRequest& aRequest)
{
TInt err = KErrNotSupported;
TInt function = aRequest.Function();
iDrvNumber = aRequest.DriveNumber();
switch(function)
{
case EFsFileOpen:
err = VsFileOpen(aRequest);
break;
case EFsFileSubClose:
VsFileClose(aRequest);
break;
case EFsFileRename:
case EFsRename:
case EFsReplace:
err = VsFileRename(aRequest);
break;
case EFsDelete:
err = VsFileDelete(aRequest);
break;
case EFsReadFileSection:
err = VsReadFileSection(aRequest);
break;
default:
break;
}
return err;
}
示例8: DoRequestL
/**
Handle requests
@internalComponent
*/
TInt CPreModifierPlugin::DoRequestL(TFsPluginRequest& aRequest)
{
TInt err = KErrNone;
TInt function = aRequest.Function();
switch(function)
{
case EFsFileRead:
TRAP(err, FsFileReadL(aRequest));
break;
case EFsFileWrite:
TRAP(err, FsFileWriteL(aRequest));
break;
case EFsFileRename:
TRAP(err, FsFileRenameL(aRequest));
break;
case EFsFileCreate:
TRAP(err, FsFileCreateL(aRequest));
break;
case EFsFileSize:
TRAP(err, FsFileSizeL(aRequest));
break;
case EFsFileSetSize:
TRAP(err, FsFileSetSizeL(aRequest));
break;
case EFsFileLock:
TRAP(err, FsFileLockL(aRequest));
break;
case EFsFileUnLock:
TRAP(err, FsFileUnLockL(aRequest));
break;
case EFsFileSeek:
TRAP(err, FsFileSeekL(aRequest));
break;
case EFsDirReadOne:
TRAP(err,FsDirReadOneL(aRequest));
break;
case EFsDirReadPacked:
TRAP(err,FsDirReadPackedL(aRequest));
break;
case EFsFileOpen:
TRAP(err, FsFileOpenL(aRequest));
break;
case EFsFileReplace:
TRAP(err, FsFileReplaceL(aRequest));
break;
case EFsReadFileSection:
TRAP(err, FsReadFileSectionL(aRequest));
break;
case EFsFileSubClose:
TRAP(err, FsFileSubCloseL(aRequest));
break;
case EFsDirOpen:
TRAP(err, FsDirOpenL(aRequest));
break;
case EFsFileTemp:
TRAP(err, FsFileTempL(aRequest));
break;
case EFsDelete:
TRAP(err, FsDeleteL(aRequest));
break;
case EFsReplace:
TRAP(err, FsReplaceL(aRequest));
break;
case EFsRename:
TRAP(err, FsRenameL(aRequest));
break;
case EFsEntry:
TRAP(err, FsEntryL(aRequest));
break;
case EFsSetEntry:
TRAP(err, FsSetEntryL(aRequest));
break;
//.........这里部分代码省略.........