|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-C135B8D8-DA5A-5852-9C2D-18622404FE99" xml:lang="en"><title>UID Protection</title><shortdesc>Describes the identifiers used in a polymorphic DLL.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
13 <p>All files have an associated compound identifier, a <xref href="GUID-B6D6B0AD-B15C-339A-8540-40540885089A.dita"><apiname>TUidType</apiname></xref>, |
|
14 comprising three component UIDs that together identify the file. A compound |
|
15 identifier is also commonly known as a UID type.</p> |
|
16 <p>For a polymorphic DLL, the first UID component always has the value <codeph>KDynamicLibraryUidValue</codeph>. |
|
17 The second UID component is used to verify that the DLL satisfies the protocol |
|
18 defined by the programming interface. Indeed, this UID <i>identifies</i> that |
|
19 protocol. The third UID component is used to identify a specific implementation; |
|
20 the use of the third component UID depends on the protocol.</p> |
|
21 <p>For a UI application, the second UID component takes the value <codeph>KAppUidValue</codeph>. |
|
22 The third UID component must be defined and must be unique in order to differentiate |
|
23 it from all other applications. In contrast, a DLL which implements a printer |
|
24 driver does not require a third UID component.</p> |
|
25 <p>The use of UIDs in DLLs provides a guarantee that the loaded DLL is the |
|
26 correct type. This prevents files which just happen to have the right name |
|
27 from being loaded inadvertently.</p> |
|
28 <p>A polymorphic interface DLL is loaded dynamically. The handle to the DLL |
|
29 is encapsulated by an <codeph>RLibrary</codeph> object. The <codeph>Type()</codeph> member |
|
30 function of <codeph>RLibrary</codeph> is used to return the DLL's <codeph>TUidType</codeph> from |
|
31 which the individual UID components can be extracted.</p> |
|
32 <p><codeph>KDynamicLibraryUidValue</codeph> is defined in <filepath>e32uid.h</filepath> and <codeph>KAppUidValue</codeph> is |
|
33 defined in <filepath>apadef.h</filepath>.</p> |
|
34 </conbody></concept> |