×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor
    Join Date
    Oct 2004
    Posts
    98

    Publish&Subscribe problem: RProperty:Set returns KErrPermissionDenied

    Hi, I basically use the following code:
    Code:
    _LIT_SECURITY_POLICY_PASS(KSecurityPolicyPass);
    const TUint KPropertyKey = 0x00000001
    RProcess myProcess;
    TUid propertyCategory = myProcess.SecureId();
    RProperty property;
    
    TInt err = RProperty::Define(
        KPropertyKey, 
        RProperty::EInt, 
        KSecurityPolicyPass, 
        KSecurityPolicyPass); // returns with KErrNone
    
    err = property.Attach(
        propertyCategory, 
        KPropertyKey); // returns with KErrNone
    
    err = property.Set(42); // returns with KErrPermissionDenied
    property.Close();
    My question is whether you need some special capability or other trick in order to define and set a property if the category equals to the SID of the process? What is the problem with the code above, why does Set return KErrPermissionDenied?

    Thanks.

  2. #2
    Super Contributor
    Join Date
    Jul 2006
    Location
    Oulu, Finland.
    Posts
    1,174

    Re: Publish&Subscribe problem: RProperty:Set returns KErrPermissionDenied

    Atleast document says this for RProperty :: Define():

    Capability: WriteDeviceData if aCategory==KUidSystemCategoryValue. WriteDeviceData if aCategory not equal to the current process's Secure ID and aCategory < KUidSecurityThresholdCategoryValue.
    Last edited by vasant21; 2008-08-01 at 18:22. Reason: added the function

  3. #3
    Regular Contributor
    Join Date
    Oct 2004
    Posts
    98

    Re: Publish&Subscribe problem: RProperty:Set returns KErrPermissionDenied

    Hi, thanks for the answer. As far as I understand the overloaded version of Define() that does not take a category parameter defaults the category to the SID of the process. By the way Define() call succeeds. However I added WriteDeviceData to the process but it resulted no change, Set() still leaves with -46.

  4. #4
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: Publish&Subscribe problem: RProperty:Set returns KErrPermissionDenied

    Why don't you run this in the emulator and see what *PlatSec* messages are dumped into epocwind.out (Carbide.c++ has a dedicated plug-in for this).

    Once you know what is the reason for the KErrPermissionDenied you will also know how to fix it and save the time spent on speculations.
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  5. #5
    Regular Contributor
    Join Date
    Oct 2004
    Posts
    98

    Re: Publish&Subscribe problem: RProperty:Set returns KErrPermissionDenied

    Hi, I switched on all PlatSec related checks in epoc.ini but in the emulator everything goes ok, Set() succeeds with KErrNone, and I found no *PlatSec* warnings in epocwind.out. Meanwhile on the devices Set() fails with -46.

  6. #6
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,359

    Re: Publish&Subscribe problem: RProperty:Set returns KErrPermissionDenied

    It is likely that you have switched on too many things. The default configuration of the emulator was perfect for the task.
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  7. #7
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,692

    Re: Publish&Subscribe problem: RProperty:Set returns KErrPermissionDenied

    What is KSecurityPolicyPass?
    Remember that Define and Attach do not check the policies.

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

    Re: Publish&Subscribe problem: RProperty:Set returns KErrPermissionDenied

    What is the UID3 of the exe and what is the secureid. You will need to look at these in the mmp file.
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  9. #9
    Regular Contributor
    Join Date
    Oct 2004
    Posts
    98

    Thumbs up Re: Publish&Subscribe problem: RProperty:Set returns KErrPermissionDenied

    Hi, thank you for the replies, guys. The problem was with the not appropriate UID3 category, as Paul pointed out.

Similar Threads

  1. 7210 Silent Problem
    By MarkMckim in forum Mobile Java General
    Replies: 1
    Last Post: 2003-03-18, 12:36
  2. What is the real problem to receive data calls with Nokia TDMA cel modems?
    By jackal_jr in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2002-12-09, 09:02
  3. What is the real problem to receive data calls with Nokia TDMA cell modem?
    By jackal_jr in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2002-12-04, 16:05
  4. Replies: 0
    Last Post: 2002-12-04, 15:46
  5. PJava runtime problem within Nokia 9210, Hrlp~!
    By Nokia_Archive in forum PersonalJava
    Replies: 1
    Last Post: 2002-05-28, 13:15

Posting Permissions

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