本文整理汇总了C++中TSecurityInfo类的典型用法代码示例。如果您正苦于以下问题:C++ TSecurityInfo类的具体用法?C++ TSecurityInfo怎么用?C++ TSecurityInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TSecurityInfo类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: _L
/**
Constructor called from the respective Suite.cpp from their "AddTestStep" function
Each test step initialises it's own name
*/
CEASShdOpCodeGetAlarmCharacteristics1Step::CEASShdOpCodeGetAlarmCharacteristics1Step()
{
// The server name and IPC number is obtained and all messages are checked Sync
iSrServerName = _L("!AlarmServer");
iSrMessageType = 2;
iSrMessageId = 5;
iSrMessageMask = 0;
iServerPanic = _L("ALARMSERVER");
TCapability cap[] = {ECapability_None, ECapability_Limit};
TSecurityInfo info;
info.Set(RProcess());
TBool result = EFalse;
TInt i;
for (i = 0; cap[i] != ECapability_Limit; i++)
{
if (!(info.iCaps.HasCapability(cap[i])))
{
result=ETrue;
}
}
iExpectRejection = result;
iStepCap = 0;
// Get a unique thread name
iSrChildThread.Format(_L("ChildThread_%S_%d"),&iSrServerName,iSrMessageId);
}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:34,代码来源:EASShdOpCodeGetAlarmCharacteristics1_CStep.cpp
示例2: INFO_PRINTF1
void CT_StartAppTestStep::TestDeleteDataTypeL()
{
INFO_PRINTF1(_L("Test RApaLsSession::DeleteDataMapping....Check data type mapping deletion"));
TRequestStatus status;
//Register for notification when data type mappings are restored from the data store ini file
iApaLsSession.NotifyOnDataMappingChange(status);
TInt err=iApaLsSession.DeleteDataMapping(TDataType(KLitPlainText));
INFO_PRINTF2(_L("returned, %d"), err);
TSecurityInfo info;
info.Set(RProcess());
info.iCaps.HasCapability(ECapabilityWriteDeviceData) ? TEST(err==KErrNone) : TEST(err==KErrPermissionDenied);
if (err==KErrNone)
{
// Waits till the data type mappings are restored from the data store ini file
User::WaitForRequest(status);
TEST(status.Int()==KErrNone);
}
else
{
iApaLsSession.CancelNotifyOnDataMappingChange();
TEST(status.Int()==KErrCancel);
}
INFO_PRINTF1(_L("Test RApaLsSession::DeleteDataMapping....Check data type mapping deletion....Done"));
}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:29,代码来源:T_StartAppStep.cpp
示例3: _L
CHWRMFmTxClearRtDataStep::CHWRMFmTxClearRtDataStep()
/** Each test step initialises it's own name
*/
{
// store the name of this test case
// this is the name that is used by the script file
//DEF iTestStepName = _L("CPARAM_MESS_NAMEStep");
const TUint32 KCapabilityWriteUserDataBitMask = 0x10000; // 65536LL;
const TUint32 KCapabilityCapabilityMultimediaDDBitMask = 0x8; //8LL;
//The server name and IPC number is obtained and all messages are checked Sync
SR_ServerName = KServerProcessName;
SR_MESSAGE_TYPE = KSyncMessage; //Is it Async or sync?
SR_MESSAGE_ID = EHWRMFmTxClearRtData ; //It holds the IPC number
SR_MESSAGE_MASK = KCapabilityCapabilityMultimediaDDBitMask + KCapabilityWriteUserDataBitMask; //Holds the cap mask for the message
//The iServer_Panic is a unique name from Server,but always truncated to KMaxExitCategoryName
iServer_Panic = _L("HWRM Server");
//TCapability cap[] = {ECapabilityPARAM_MESS_NAMECAP, ECapability_Limit};
TCapability cap[] = {ECapabilityMultimediaDD, ECapabilityWriteUserData, ECapability_Limit};
TSecurityInfo info;
info.Set(RProcess());
TBool result = EFalse;
for (TInt i = 0; cap[i] != ECapability_Limit; i++)
{
if (!(info.iCaps.HasCapability(cap[i])))
{
result=ETrue;
}
}
#ifdef HWRM_FMTX_POLICY_CHECKING_DISABLED
result = EFalse;
#endif
iExpect_Rejection = result;
iStepCap = KCapabilityCapabilityMultimediaDDBitMask + KCapabilityWriteUserDataBitMask;
//Get a unique thread name
ChildThread_SR.Format(_L("ChildThread_%S_%d"),&SR_ServerName,SR_MESSAGE_ID);
}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:56,代码来源:HWRMFmTxClearRtData_CStep.cpp
示例4: DeleteDataMapping
/**
@SYMTestCaseID APPFWK-APPARC-0010
@SYMPREQ PREQ967
@SYMREQ REQ3889
@SYMTestCaseDesc Tests DeleteDataMapping() which removes the linking of a datatype to the UID of an associated application
@SYMTestPriority High
@SYMTestStatus Implemented
@SYMTestActions Call RApaLsSession::DeleteDataMapping() with datatype and service UID
API Calls:\n
RApaLsSession::DeleteDataMapping(const TDataType& aDataType, TUid aServiceUid)
@SYMTestExpectedResults DeleteDataMapping() causes Main Panic KERN-EXEC 0
*/
void CSysStartApparcTestCase::TestDeleteDataTypeL()
{
RDebug::Print(_L("CSysStartApparcTestCase: Test RApaLsSession::DeleteDataMapping....Check data type mapping deletion"));
_LIT8(KLitPlainText,"text/plain");
TSecurityInfo info;
info.Set(RProcess());
//Main Panic KERN-EXEC 0
iApaLsSession.DeleteDataMapping(TDataType(KLitPlainText));
}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:31,代码来源:SysStartApparcTestCases.cpp
示例5: InsertDataMapping
/**
@SYMTestCaseID APPFWK-APPARC-0008
@SYMPREQ PREQ967
@SYMREQ REQ3889
@SYMTestCaseDesc Tests InsertDataMapping() which links a datatype to the UID of an associated application
for launching assigns adds a low priority.
Tests InsertDataMappingIfHigher() which remaps the datatype to the specified UID if the
specified priority is higher.
The "added" parameter indicates if the mapping was successful.
@SYMTestPriority High
@SYMTestStatus Implemented
@SYMTestActions Call RApaLsSession::InsertDataMapping() with datatype, application UID and low priority
API Calls:\n
RApaLsSession::InsertDataMapping(const TDataType& aDataType, TDataTypePriority aPriority, TUid aUid)
@SYMTestExpectedResults InsertDataMapping() causes Main Panic KERN-EXEC 0
*/
void CSysStartApparcTestCase::TestInsertDataTypeL()
{
RDebug::Print(_L("CSysStartApparcTestCase: Test RApaLsSession::InsertDataMapping....Check data type mapping addition"));
const TDataTypePriority KPriLow = 1;
_LIT8(KLitPlainText,"text/plain");
TSecurityInfo info;
info.Set(RProcess());
//Main Panic KERN-EXEC 0
iApaLsSession.InsertDataMapping(TDataType(KLitPlainText), KPriLow, KUidTestApp);
}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:37,代码来源:SysStartApparcTestCases.cpp
示例6: _L
CHWRMFmTxGetNextClearFreqStep::CHWRMFmTxGetNextClearFreqStep()
/** Each test step initialises it's own name
*/
{
// store the name of this test case
// this is the name that is used by the script file
//DEF iTestStepName = _L("CPARAM_MESS_NAMEStep");
TUint32 KCapabilityNoneBitMask = 0x80000000; // 2147483648LL;
//The server name and IPC number is obtained and all messages are checked Sync
SR_ServerName = KServerProcessName;
SR_MESSAGE_TYPE = KSyncMessage; //Is it Async or sync?
SR_MESSAGE_ID = EHWRMFmTxGetNextClearFreq ; //It holds the IPC number
SR_MESSAGE_MASK = KCapabilityNoneBitMask; //Holds the cap mask for the message
//The iServer_Panic is a unique name from Server,but always truncated to KMaxExitCategoryName
iServer_Panic = _L("HWRM Server");
//TCapability cap[] = {ECapabilityPARAM_MESS_NAMECAP, ECapability_Limit};
TCapability cap[] = {ECapability_None, ECapability_Limit};
TSecurityInfo info;
info.Set(RProcess());
TBool result = EFalse;
for (TInt i = 0; cap[i] != ECapability_Limit; i++)
{
if (!(info.iCaps.HasCapability(cap[i])))
{
result=ETrue;
}
}
iExpect_Rejection = result;
iStepCap = KCapabilityNoneBitMask;
//Get a unique thread name
ChildThread_SR.Format(_L("ChildThread_%S_%d"),&SR_ServerName,SR_MESSAGE_ID);
}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:46,代码来源:HWRMFmTxGetNextClearFreq_CStep.cpp
示例7: _L
CECntGetOwnCard1Step::CECntGetOwnCard1Step()
/** Each test step initialises it's own name
*/
{
// store the name of this test case
// this is the name that is used by the script file
//DEF iTestStepName = _L("CECntGetOwnCard1Step");
//The server name and IPC number is obtained and all messages are checked Sync
SR_ServerName = _L("CNTSRV");
SR_MESSAGE_TYPE = 2;
SR_MESSAGE_ID = 40;
SR_MESSAGE_MASK = 2147483648LL;
//The iServer_Panic is a unique name from Server,but always truncated to KMaxExitCategoryName
iServer_Panic = _L("CNTMODEL");
TCapability cap[] = {ECapability_None, ECapability_Limit};
TSecurityInfo info;
info.Set(RProcess());
TBool result = EFalse;
for (TInt i = 0; cap[i] != ECapability_Limit; i++)
{
if (!(info.iCaps.HasCapability(cap[i])))
{
result=ETrue;
}
}
iExpect_Rejection = result;
iStepCap = 2147483648LL;
//Get a unique thread name
ChildThread_SR.Format(_L("ChildThread_%S_%d"),&SR_ServerName,SR_MESSAGE_ID);
}
开发者ID:Esclapion,项目名称:qt-mobility,代码行数:44,代码来源:ecntgetowncard1_cstep.cpp
示例8: _L
CPARAM_MESS_NAMEStep::CPARAM_MESS_NAMEStep(TBool aUpsAuthorisationGranted)
/** Each test step initialises it's own name
*/
{
// store the name of this test case
// this is the name that is used by the script file
//DEF iTestStepName = _L("CPARAM_MESS_NAMEStep");
//The server name and IPC number is obtained and all messages are checked Sync
SR_ServerName = _L("PARAM_SVR_NAME");
SR_MESSAGE_TYPE = 2;
SR_MESSAGE_ID = PARAM_MESS_VALUE;
SR_MESSAGE_MASK = PARAM_MESS_CAPMASK;
//The iServer_Panic is a unique name from Server,but always truncated to KMaxExitCategoryName
iServer_Panic = _L("PARAM_SVR_T16_PANIC");
TCapability cap[] = {ECapabilityPARAM_MESS_NAMECAP, ECapability_Limit};
TSecurityInfo info;
info.Set(RProcess());
TBool result = EFalse;
for (TInt i = 0; cap[i] != ECapability_Limit; i++)
{
if ((!aUpsAuthorisationGranted || cap[i] != ECapabilityNetworkServices) &&
!(info.iCaps.HasCapability(cap[i])))
{
result=ETrue;
}
}
iExpect_Rejection = result;
iStepCap = (TUint32)PARAM_MESS_CAPMASK;
//Get a unique thread name
ChildThread_SR.Format(_L("ChildThread_%S_%d"),&SR_ServerName,SR_MESSAGE_ID);
}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:44,代码来源:CStep.cpp
示例9: _L
CEAddEntrySizes1Step::CEAddEntrySizes1Step()
/** Each test step initialises it's own name
*/
{
// store the name of this test case
// this is the name that is used by the script file
//DEF iTestStepName = _L("CEAddEntrySizes1Step");
//The server name and IPC number is obtained and all messages are checked Sync
SR_ServerName = _L("!AgendaServer");
SR_MESSAGE_ID = 203;
SR_MESSAGE_MASK = 65536LL;
//The iServer_Panic is a unique name from Server,but always truncated to KMaxExitCategoryName
iServer_Panic = _L("AgnServer");
TCapability cap[] = {ECapabilityWriteUserData, ECapability_Limit};
TSecurityInfo info;
info.Set(RProcess());
TBool result = EFalse;
for (TInt i = 0; cap[i] != ECapability_Limit; i++)
{
if (!(info.iCaps.HasCapability(cap[i])))
{
result=ETrue;
}
}
SR_MESSAGE_TYPE = GetSyncOrAsync(SR_MESSAGE_ID);
iExpect_Rejection = result;
iStepCap = 65536LL;
//Get a unique thread name
ChildThread_SR.Format(_L("ChildThread_%S_%d"),&SR_ServerName,SR_MESSAGE_ID);
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:41,代码来源:EAddEntrySizes1_CStep.cpp
示例10: _L
CELbsPrivacyServerCompleteRequest1Step::CELbsPrivacyServerCompleteRequest1Step()
/** Each test step initialises it's own name
*/
{
// store the name of this test case
// this is the name that is used by the script file
//DEF iTestStepName = _L("CELbsPrivacyServerCompleteRequest1Step");
//The server name and IPC number is obtained and all messages are checked Sync
SR_ServerName = _L("LBSPrivacyServer");
SR_MESSAGE_TYPE = 2;
SR_MESSAGE_ID = 9;
SR_MESSAGE_MASK = 131088;
//The iServer_Panic is a unique name from Server,but always truncated to KMaxExitCategoryName
iServer_Panic = _L("EPos privacy");
TCapability caplist1[] = {ECapabilityLocation,ECapabilityReadDeviceData, ECapability_Limit};
TSecurityInfo info;
info.Set(RProcess());
TBool result = EFalse;
// capability policing rules are all caps from list1 OR all caps from list2
for (TInt i = 0; caplist1[i] != ECapability_Limit; i++)
{
if (!(info.iCaps.HasCapability(caplist1[i])))
{
result=ETrue;
}
}
iExpect_Rejection = result;
iStepCap = 131088;
//Get a unique thread name
ChildThread_SR.Format(_L("ChildThread_%S_%d"),&SR_ServerName,SR_MESSAGE_ID);
}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:40,代码来源:ELbsPrivacyServerCompleteRequest1_CStep.cpp
示例11: GetVerdict
/*
TVerdict GetVerdict(TInt aAPIretValue)
Called by: "MainThread" for returning verdict
Parameters(TInt aRetValue) : 0 if API call gets thru without any rejection
1 if API call is rejected for capability error
*/
enum TVerdict CCapabilityTestStep::GetVerdict(TInt aAPIretValue)
{
TSecurityInfo info;
info.Set(RProcess());
// INFO_PRINTF4(_L("The loaded Process has: capability: %x with SID:%x and VID: %x"), info.iCaps,info.iSecureId, info.iVendorId);
INFO_PRINTF1(_L(" "));
INFO_PRINTF2(_L("The capability of the loaded Process is [%x] "), info.iCaps);
INFO_PRINTF2(_L("The required capability for the test step is [%x] "), iStepCap);
INFO_PRINTF1(_L("Therefore ... "));
TVerdict vVerdict[] = {EPass, EFail};
//please leave the following if/else block as the information printed by INFO_PRINTF1 is used bu CapTestSumm
if(iExpect_Rejection)//[Inverse Test] EPass for 1 while EFail for 0
{
INFO_PRINTF1(_L("Test Expected to Fail due to lack of capabilities"));
return vVerdict[(aAPIretValue)?0:1];
}
else //[Direct Test] EPass for 0 while EFail for 1
{
INFO_PRINTF1(_L("Test Expected to Pass with correct capabilities"));
return vVerdict[(aAPIretValue)?1:0];
}
}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:32,代码来源:CSuite.cpp
示例12: _L
/**
Each test step initialises it's own name
*/
CRSDbgMbufFreeSpace1Step::CRSDbgMbufFreeSpace1Step()
{
// store the name of this test case
// this is the name that is used by the script file
//DEF iTestStepName = _L("CRSDbgMbufFreeSpace1Step");
//The server name and IPC number is obtained and all messages are checked Sync
SR_ServerName = _L("!RootServer");
SR_MESSAGE_TYPE = 2;
SR_MESSAGE_ID = RootServer::RSDbgMbufFreeSpace;
SR_MESSAGE_MASK = 1024;
// Added to support SID/VID testing
SR_MESSAGE_SID = TSecureId (0x00000000);
SR_MESSAGE_VID = TVendorId (0x70000001);
//The iServer_Panic is a unique name from Server,but always truncated to KMaxExitCategoryName
iServer_Panic = _L("Root Server Test");
TCapability cap[] = {ECapabilityNetworkControl, ECapability_Limit};
TSecurityInfo info;
info.Set(RProcess());
TBool result = EFalse;
// Skip check if no caps are required
if (cap[0] != ECapability_None)
{
for (TInt i = 0; cap[i] != ECapability_Limit; i++)
{
if (!(info.iCaps.HasCapability(cap[i])))
{
// this process doesn't have required caps - expect fail
result=ETrue;
break;
}
}
}
if (!result && SR_MESSAGE_SID != 0)
{
if (info.iSecureId != SR_MESSAGE_SID)
{
// this process doesn't have the required SID - expect fail
result=ETrue;
}
}
if (!result && SR_MESSAGE_VID != 0)
{
if (info.iVendorId != SR_MESSAGE_VID)
{
// this process doesn't have the required SID - expect fail
result=ETrue;
}
}
iExpect_Rejection = result;
iStepCap = 1024;
//Get a unique thread name
ChildThread_SR.Format(_L("ChildThread_%S_%d"),&SR_ServerName,SR_MESSAGE_ID);
}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:70,代码来源:RSDbgMbufFreeSpace1_CStep.cpp
示例13: MainThread
/*
TVerdict MainThread()
Called by: "doTestStepL"
Purpose: Creates the child thread(which calls the respective function with regard
to the server and also implements the Message Call). Then this fn.waits for the
completion of the childthread( doesnt matter how the thread did die!)
Return Value(Verdict of the TestStep):
A.Reporting PASS/FAIL
Direct Test:
When a message call gets thru. Please note that in such cases
actually the implementation of the message has started. As we
are passing "0" Parameters, server may panic, though our botheration
stops once the call gets thru.
NOTE: The style is the same when CONNECTION capabilities
are tested, the only diff is you dont have to expect a
panic from server
Inverse Test:
The call should be either failed or panicked with
"KErrPermissionDenied" flag.
General Case:
If a thread creation failed or if the server couldnt be connected
apart from the above two cases, then a FAIL is reported
B.Reporting INCONCLUSIVE
Any panic say from unexpected source (eg:KERN-EXEC) will be
reported INCONCLUSIVE
*/
TVerdict CCapabilityTestStep::MainThread()
{
TBuf<100> tExitCategory;
TInt tExitReason = 0;
TBuf<100> TestStyle;
iExpect_Rejection?TestStyle = _L("Inverse"):TestStyle = _L("Direct");
TCapabilitySet theCaps = TSecurityInfo(RProcess()).iCaps ;
const TInt KMaxTestThreadHeapSize = 0x10000;
//Initialize return values
iResult_SR = iResult_Server = KErrNone;
// Create a child thread, with a new heap
TInt nRes_Thread = tChildThread.Create(
ChildThread_SR,
ThreadStartFn,
KDefaultStackSize,
KMinHeapSize,
KMaxTestThreadHeapSize,
this,
EOwnerProcess);
if(nRes_Thread == KErrNone)//Thread Created
{
//Let me know when the thread is dead
TRequestStatus ThreadStatus;
tChildThread.Logon(ThreadStatus);
tChildThread.Resume();
//Is the thread dead?
User::WaitForRequest( ThreadStatus );
//yes, he is dead. RIP! Now the Killer's profile
tExitCategory = tChildThread.ExitCategory();
tExitReason = tChildThread.ExitReason();
//Somebody Please say what are we testing!!
if(iSessionCreated && (SR_MESSAGE_ID >=0))//Flag set by Child thread when connected to Server
{
//INFO_PRINTF5(_L("Connected to Server(%S) for %S Test [MessageID: %d,Req.Cap: 0x%x,Present.Cap: 0x%x]"),&SR_ServerName,&TestStyle,SR_MESSAGE_ID,iStepCap,TSecurityInfo(RProcess()));
}
else if(SR_MESSAGE_ID < 0)
{
//DEF INFO_PRINTF5(_L("Testing Connection capabilities[%S Test] for Server(%S) [Req.Cap: 0x%x,Present.Cap: 0x%x]"),&TestStyle,
//&SR_ServerName,TSecurityInfo(RProcess()));
}
else if(!iSessionCreated)// NO Connection
{
TSecurityInfo info;
info.Set(RProcess());
RRsConfigurator iConfigurator;
TInt result = iConfigurator.Connect();
INFO_PRINTF1(_L("iConfigurator Connection Sucessful"));
INFO_PRINTF2(_L("Rejected for insufficient capabilities [Return Value : %d] "),tExitReason);
//INFO_PRINTF4(_L("connected to the Server(%S) ErrorCode - ServerRet: %d C32ret: %d"),&SR_ServerName,iResult_Server,iResult_C32);
INFO_PRINTF2(_L("The capability of the loaded Process is [%x] "), info.iCaps);
INFO_PRINTF2(_L("The required capability for the test step is [%x] "), iStepCap);
INFO_PRINTF1(_L("Therefore ... "));
INFO_PRINTF1(_L("Test Expected to Fail due to lack of capabilities"));
//INFO_PRINTF3(_L("Child Thread: ExitCategory : %S ExitReason : %d"),&tExitCategory,tExitReason);
return EPass;
}
//.........这里部分代码省略.........
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:101,代码来源:CSuite.cpp
注:本文中的TSecurityInfo类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论