×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Feb 2005
    Location
    Belgium (Europe)
    Posts
    1,352

    Thumbs down CreatorHasCapability function return wrong value !

    Hello ,

    I have a problem with value return by this function.
    I have created a little module extension for PyS60 : envy.
    envy test if Python shell has selfsigned or unsigned capabilities.
    has_cap function test if the application has one particular capability. But when I test it it return absurd values.
    For example with PyS60 1.4.1 which has 17 capabilities and Python shell unsigned (13) it returns different caps but not the good ones

    Code:
    static PyObject* envy_hascapability(PyObject* /*self*/, PyObject *args)
    {  
      TInt i; 
      TInt iCapability ;
      TCapability aCapability;
      const char *aDiag ;
      
    
      if (!PyArg_ParseTuple(args, "i", &iCapability))
        return NULL;
      
      aCapability=static_cast<TCapability>(iCapability);  
      if(User::CreatorHasCapability(aCapability,aDiag))
      {
       i=1;
      }
      else{
       i=0;
      }  
     return Py_BuildValue("i", i);
    }
    In PyS60 1.4.1 in Python shell dev cert unsigned with all the 13 caps :
    after symbol # I note result return
    Code:
    from envy import *
    
    print has_cap(ECapabilityReadUserData)  # 1  
    print has_cap(ECapabilityWriteUserData) # 1   
    print has_cap(ECapabilityUserEnvironment) # 1
    print has_cap(ECapabilityNetworkServices) # 1   
    print has_cap(ECapabilityLocalServices) # 1    
    
    print has_cap(ECapabilityReadDeviceData) # 1    
    print has_cap(ECapabilityWriteDeviceData)# 1    
    print has_cap(ECapabilityTrustedUI) # 0 wrong !    
    print has_cap(ECapabilityProtServ) # 0 wrong !   
    print has_cap(ECapabilitySwEvent) # 1
    print has_cap(ECapabilityLocation) # 1  
    print has_cap(ECapabilitySurroundingsDD) # 0 wrong !    
    print has_cap(ECapabilityPowerMgmt)# 0 wrong !    
    
    print has_cap(ECapabilityNetworkControl) # 0
    print has_cap(ECapabilityCommDD)# 0
    print has_cap(ECapabilityMultimediaDD) # 0   
    print has_cap(ECapabilityDiskAdmin) # 0 
    
    print has_cap(ECapabilityDRM) # 0
    print has_cap(ECapabilityTCB) # 0
    print has_cap(ECapabilityAllFiles) # 1 totally wrong !
    Did I make an error in c++ coding ? Or symbian function CreatorHasCapability is bugged ?

    Thanks

    Cyke64
    pys60 1.4.5 and 2.0.0, pygame, PyS60 CE on E90 and 5800 !

    Find my pys60 extension modules on cyke64.googlepages.com

  2. #2
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: CreatorHasCapability function return wrong value !

    Are you sure you understand User::CreatorHasCapability?

    This will be the process that created your process, not your process's capabilties.

    I would think that using RProcess::HasCapability(aCapability, aDiag) would be a better fit

    You can get your process's handle like so:
    RProcess me;
    me.HasCapability(aCapability, aDiag);

  3. #3
    Registered User
    Join Date
    Feb 2005
    Location
    Belgium (Europe)
    Posts
    1,352

    Re: CreatorHasCapability function return wrong value !

    Quote Originally Posted by Paul.Todd View Post
    Are you sure you understand User::CreatorHasCapability?

    This will be the process that created your process, not your process's capabilties.

    I would think that using RProcess::HasCapability(aCapability, aDiag) would be a better fit

    You can get your process's handle like so:
    RProcess me;
    me.HasCapability(aCapability, aDiag);
    Thank you Paul for the solution
    I have misundertood this function

    Now it should works

    Cyke64
    pys60 1.4.5 and 2.0.0, pygame, PyS60 CE on E90 and 5800 !

    Find my pys60 extension modules on cyke64.googlepages.com

Similar Threads

  1. Canvas.getHeight() return wrong values
    By bluebelle_88 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2010-04-22, 07:05
  2. Replies: 12
    Last Post: 2010-04-13, 10:49
  3. Replies: 9
    Last Post: 2006-03-30, 08:36
  4. Replies: 1
    Last Post: 2005-05-26, 14:22
  5. Replies: 0
    Last Post: 2002-06-10, 12:24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •