Discussion Board

Results 1 to 15 of 16

Hybrid View

  1. #1
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    233

    failed to load library

    Hi all,

    I have created a plugin which loads a library using RLibrary::Load function. It is working correctly in emulator (Symbian 9.2 Series 60 FP1), but doesn't in device. I have logged the error being that a -46 (KErrPermissionDenied). The capabilities are correct, so I don't know what could be the problem...

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: failed to load library

    Quote Originally Posted by felixksp
    Hi all,

    I have created a plugin which loads a library using RLibrary::Load function. It is working correctly in emulator (Symbian 9.2 Series 60 FP1), but doesn't in device. I have logged the error being that a -46 (KErrPermissionDenied). The capabilities are correct, so I don't know what could be the problem...
    for using RLibrary::Load() you req. ALLFILES capability.
    Try using ECOM

  3. #3
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    233

    Re: failed to load library

    My plugin has the following capabilities:

    CAPABILITY ReadDeviceData WriteDeviceData ProtServ NetworkControl NetworkServices SwEvent LocalServices ReadUserData WriteUserData UserEnvironment

    and the dll:

    capability NetworkServices ReadUserData


    Why do I need ALLFILES? I have used some times RLibrary::Load in my applications, and I have never needed this capability.

  4. #4
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: failed to load library

    With those capabilities can you access \sys\bin\

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

    Re: failed to load library

    You don't need "all files" to load the library. You cannot however get a list of dll's which is a different problem.

    Your dll must have at least or more capabilties than your process which is where you have gone wrong.

    What do you mean by plugin? Capabiltiies are enforced by exe, not the dll

  6. #6
    Regular Contributor
    Join Date
    Apr 2007
    Posts
    233

    Re: failed to load library

    A plugin is a plugin.... (TARGETTYPE plugin) . It is a dll loaded by browser in some cases. So imagine that I have two dlls, A and B.

    If A loads B using RLibrary, does B need to have at least the same capabilities than A? Or is A which needs to have at least the same capabilities than B?

  7. #7
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: failed to load library

    Quote Originally Posted by felixksp
    A plugin is a plugin.... (TARGETTYPE plugin) . It is a dll loaded by browser in some cases. So imagine that I have two dlls, A and B.

    If A loads B using RLibrary, does B need to have at least the same capabilities than A? Or is A which needs to have at least the same capabilities than B?
    Sorry my mistake you donot req. ALLFiles for RLibray::Load
    From Docs
    http://forum.nokia.com/document/Foru...m_security.htm
    P.EXE holds Cap1 & Cap2

    L1.DLL holds Cap1 & Cap2 & Cap3

    L0.DLL holds Cap1 & Cap2

    The load succeeds because P.EXE can load L1.DLL and L0.DLL. Rule 1 does apply, but here the loading executable is the process P.EXE, not the library L1.DLL: the Rlibrary::Load request that the loader processes is sent by the process P.EXE. Here, the fact that the call is within L1.DLL is irrelevant. Rule 2 applies as before and P.EXE does not acquire Cap3 by loading L1.DLL.

  8. #8
    Regular Contributor
    Join Date
    May 2007
    Posts
    463

    Re: failed to load library

    Well, that's a wrinkle you didn't mention in your original post, you're loading this DLL from a plugin?

    My guess is that the DLL doesn't have the requisite capabilities to be loaded in to the executable you're loading it in to.

    Remember, DLL capabilities basically mean "This is a list of capabilities I can be trusted not to leak", if an executable has a capability, any DLL it tries to load must have it too.

    Nokia have been idiots, in that they've turned off platsec enforcement on the emulator. This confuses an awful lot of people. It's best to either turn platsec enforcement back on, or at least get in to the habit of checking epocwind.out for platsec errors.

    BTW, you don't need ALLFILES to use RLibrary::Load, but Mr. Rao is right about one thing, use ECOM. That's what it's for.
    Get Resolvr - The Zeroconf framework for Symbian OS free today. Make your IP networking applications fun and easy to use. http://www.novelinteractions.com/resolvr/
    Proud to be the only autorickshaw owner in Cambridge - http://blog.novelinteractions.com/images/tuktuk.jpg

Similar Threads

  1. GoogleIt
    By deepika.mangla in forum Symbian
    Replies: 5
    Last Post: 2011-05-28, 11:04
  2. S60 2nd to 3rd/ PlatformSecurity / Capabilities
    By jarkoos in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 4
    Last Post: 2007-04-14, 14:08
  3. SyExpat + problem + memmove + Carbide Express
    By pearman in forum Symbian
    Replies: 2
    Last Post: 2006-10-14, 22:21
  4. Compilation series 60 3rd edition
    By asmobease in forum Symbian Tools & SDKs
    Replies: 32
    Last Post: 2006-09-13, 09:46
  5. Can’t launch application on 6630
    By kaffemannen in forum Symbian
    Replies: 8
    Last Post: 2005-06-29, 10:49

Posting Permissions

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