symbian v9 capabilties with DLLs | how to build static library
| Wed, 2007-01-24 09:42 | |
|
Hello,
1) I set PlatSecEnforcement ON in epoc.ini to see, why my app cannot run in the phone. Launching my app fails with: "Menu: unable to execute file for security reasons". On emulator with security ON, I have (epocwind.out): 622.730 *PlatSec* ERROR - Capability check failed - Can't load MyApp.exe because it links to thirdPartyDll.dll which has the following capabilities missing: NetworkServices LocalServices thirdPartyDll.dll (static interface DLL) has CAPABILITY NONE, since it doesn't need any caps. My question: if in thirdPartyDll.dll project to set CAPABILITY ALL, will it help to make my .exe independent of thirdPartyDll.dll caps? thirstPartyDll.mmp: CAPABILITY ALL MyExe.mmp: CAPABILITY NetworkServices etc. I cannot ask 3rd party everytime to re-build a DLL evertytime my .exe needs new capabilities. What am I missing here? Another question 2) How do we make static libraries on Symbian v9? I found a document here: http://sw.nokia.com/id/79242fb7-ec4c-4fba-99b7-06747ef8b799/Symbian_OS_Platform_Independent_Engine_Development_v1_0_en.pdf However, setting the target and target type to lib does not help: TARGET staticlib.lib TARGETTYPE lib The build process still produces a DLL (and a .lib (static interface DLL)) and the line /* is added to .mmp file I'm using Visual studio with carbide Thanks Regards, Jevgenij |
|






Forum posts: 174
http://ptrmobile.blogspot.com/
Forum posts: 3
"Capabilities are granted to programs (i.e. processes) only. Where a program (an .EXE file)
loads a library (a .DLL file), the library is loaded only if it is authorised for all the capabilities
already possessed by the loading program; if not, the program will fail. Capabilities of both
programs and libraries are assigned in the source code (the .MMP file)...
If a process that has been assigned specific capabilities calls code inside a DLL, that DLL must
have been granted the same (or more) capabilities as those given to the calling program. .... Therefore, the DLL must
contain sufficient capabilities itself in order to ensure that the requirements of all callers are
fulfilled.
For example:
The program P.EXE is linked to the library L1.DLL.
The library L1.DLL is linked to the library L0.DLL.
Case 1:
P.EXE holds Cap1 & Cap2
L1.DLL holds Cap1 & Cap3
L0.DLL holds Cap1 & Cap2.
The load fails because P.EXE cannot load L1.DLL (no Cap2)."
My situation is:
Case my:
P.EXE holds Cap1 & Cap2
L1.DLL holds no caps
The load fails because P.EXE cannot load L1.DLL (no Caps1, no Cap2).
It's a shared DLL, I'm using. And my program will change with the time and will require more capabilities. As fas as I understand, the DLL will have to be rebuilt (with new caps) each time, I add new caps to my exe.
That's why I was asking if it was possible to give all caps to DLL in advance, so there is no need to rebuild and grant new caps, so it matches (or more) exe's caps.
Forum posts: 3
"Capabilities aren't what an app needs, but what they can be trusted with.
A general DLL needs all the capabilities of every app, and dll, that (may)
use it.
The result is that general purpose DLLs are usually specified as
CAPABILITY ALL -TCB
(or CAPABILITY CAP_GENERAL_DLL)"
1) I set PlatSecEnforcement ON in epoc.ini to see, why my app cannot run in
the phone. Launching my app fails with:
"Menu: unable to execute file for security reasons".
On emulator with security ON, I have (epocwind.out):
622.730 *PlatSec* ERROR - Capability check failed - Can't load MyApp.exe
because it links to thirdPartyDll.dll which has the following capabilities
missing: NetworkServices LocalServices
thirdPartyDll.dll (static interface DLL) has CAPABILITY NONE, since it
doesn't need any caps.
My question: if in thirdPartyDll.dll project to set CAPABILITY ALL, will it
help to make my .exe independent of thirdPartyDll.dll caps?
thirstPartyDll.mmp: CAPABILITY ALL
MyExe.mmp: CAPABILITY NetworkServices etc.
I cannot ask 3rd party everytime to re-build a DLL evertytime my .exe needs
new capabilities. What am I missing here?
Another question
2) How do we make static libraries on Symbian v9?
I found a document here:
http://sw.nokia.com/id/79242fb7-ec4c-4fba-99b7-06747ef8b799/Symbian_OS_Platform_Independent_Engine_Development_v1_0_en.pdf
However, setting the target and target type to lib does not help:
TARGET staticlib.lib
TARGETTYPE lib
The build process still produces a DLL (and a .lib (static interface DLL))
and the line
/*
is added to .mmp file
I'm using Visual studio with carbide
Thanks
Regards,
Jevgenij