Hi, I'm Paul, but you can also call me Todd and I won't get upset.
Paul.Todd | 29 July, 2009 16:02
Ok its been a long time since I blogged since I have been overworked getting a couple of apps ready for OVI.
However there is some info on a useful little but well hidden class:
There are two basic ways of getting the process info at runtime, rather than compile time
The main method is to use the less than well known TSecurityInfo
This T class will get the capabilties, VID and SID of the current process, current message or current thread. bviously all these need to be within the scope of the current process rather than system wide if platsec is enabled.
There are some useful methods as well:
There are other ways to get the creator info by using the "Creator*" methods in the User library but doing it via TSecurityInfo is a lot simpler to understand.
The process info can also be retrieved if the name, path and drive of the executable is known which is quite difficult without the "all files" capability.
RLibrary::TInfo info;
TPckg<RLibrary::TInfo> pkg(info);
User::LeaveIfError(RLibrary::GetInfo(_L("c:\\sys\\bin\\PhoNetInfo.exe"), pkg));
The creator info is quite useful as it allows the application to stop being launched by "unapproved" applications since the SID of the creating process can be checked to see if is a known one that is allowed or to ensure a creating process has the correct capabilty(ies).
Symbian C++ |
Next |
Previous |
Comments (2) |
Trackbacks (0)
Paul.Todd | 29/07/2009, 22:29
Will do
Cool info
vaibhavjain | 29/07/2009, 19:08
Thanks for sharing this cool info Todd. Can you please publish a wiki article on this. This makes for a great article in platform security section.