Symbian中的UID

UID1, UID2 and UID3 have thefollowing general characteristics:

  • UID1 indicates the structure of the file, for example, whether it is an executable, or a DLL.
  • The meaning of UID2 depends on the type of object it applies to. For polymorphic interface DLLs (plug-in framework), UID2 identifies the interface that the DLL implements. For static interface DLLs (shared library), the UID2 value is always the same. For executables (with the exception of GUI applications), the UID2 value is ignored.
  • UID3 distinguishes between objects with the same UID2 and can be thought of as a project identifier.

Symbian predefines all possible UID1 andUID2 values used for GUI applications and static interface DLLs.

·        UID1: examples include KExecutableImageUid, KDynamicLibraryUid andKDirectFileStoreLayoutUid

·        UID2: examples include KSharedLibraryUid (0x1000008d) for a static interface DLL andKUidApp(0x100039CE) for a GUI application

        Note that inproject (.mmp) files, UID2 and UID3 values can be specified, but UID1 valuescannot; the UID1 value is implied by the project's target type.

        For platformsecurity, the Secure ID (SID) for a binary is taken to be the same as the UID3.If an application (EXE) does not specify a UID3 or specifies it as zero, thenthe Secure ID is undefined for the application. This has several consequences,including lack of privacy for data used by that application.

With the introduction of platform security, UIDs are alsosplit into protected and unprotected ranges. UID values falling below0x7FFFFFFF are classed as "protected" and are only intended for usewith signed applications (or those pre-installed in ROM). The softwareinstaller will refuse to install an unsigned application if it uses a UID inthe protected range.

 

1.    EXE targets and UIDs

All executable targets have a UID1of KExecutableImageUid. This is automatically built intoany executable target based on the exe target type declared in the project(.mmp) file.

A UID2 value should be specified byGUI applications (.EXE) and MUST be KUidApp (0x100039CE). Console applications(also .EXE) do not need to specify a UID2.

All executables should howeverspecify a UID3 value, in part because it is used as the secure ID (SID) of theprocess, which is used as the executable's private directory name.

2.    DLLs and UIDs

All DLLs, whether they have staticor polymorphic interfaces, have a UID1 of KDynamicLibraryUid. This is automatically built intoany DLL target based on the dll target type declared in the project(.mmp) file.

For static interface DLLs, the UID2is KSharedLibraryUid. The UID3, which is used to identifythe interface to the library, must be allocated by Symbian Signed.

For polymorphic DLLs, the UID2identifies the interface that the DLL implements. UID3 which is used toidentify a specific implementation of that interface, must be allocated bySymbian Signed.

3.    Documents and UIDs

In Symbian OS, documents are reallyfile-stores: stores which can be closed and re-opened. There are two differentkinds of file store,direct file stores which are write-once-read-many,and permanent file stores which are write-many-read-many.

A document's UID1 will therefore beone of KDirectFileStoreLayoutUid or KPermanentFileStoreLayoutUid. The UID2 and/or UID3 will beapplication dependent.

Every native document must have anappropriate UID1 which should be set by the application which creates thedocument. Typically documents may have a UID2 of KUidAppDllDoc and a UID3 shared with the creatingapplication. More precisely, a documents UID3 should match that of theapplication which will open it.

Only the UID1 is required, but inmost cases developers will want to specify second and third UIDs for thedocuments their applications create and use. These UIDs are used by theapplication architecture framework to manage associations between applicationsand their documents. This allows an application to be found and launched when afile is opened, and it also allows an application icon to be associated withdocuments in system shell displays. Conversely, it allows an application, whenopening files, to select only applicable files.

Symbian OS also allows default fileassociations with the implication that in some cases users may want to select adifferent application to open a file. Applications which support this musttherefore be able to open documents whose third UID differs from their own.

Applications may also want to opennon-native documents which have no UIDs, and may wish to be specified asdefault applications for these documents.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值