Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License
"Eclipse Public License v1.0" which accompanies this distribution,
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
Nokia Corporation - initial contribution.
Contributors:
-->
<!DOCTYPE concept
PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-4C406E49-7726-5620-AAAA-84C33DADAF4B" xml:lang="en"><title>Opening
a handle to an existing global Kernel object</title><shortdesc>This document describes how to find a global kernel object by using
a handle.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>A handle can be opened on an existing global Kernel object.</p>
<p>Global Kernel objects are explicitly named by their creators; the technique
for finding these objects involves using a search pattern to search for objects
with matching full names. The <codeph>TFindHandleBase</codeph> provides the
basic behavior.</p>
<p>In practice, each specific type has its own class derived from <codeph>TFindHandleBase</codeph>,
for example, semaphores have <codeph>TFindSemaphore</codeph>, mutexes have <codeph>TFindMutex</codeph> and
so on.</p>
<p>For example, the following code fragment searches for the first global
semaphore whose full name ends with the characters "day" and opens a thread-relative
handle on that semaphore:</p>
<codeblock id="GUID-C1C801A9-4B15-5369-8007-17BB7DC3E0A9" xml:space="preserve">_LIT(KDay,"*day");
...
TFindSemaphore finder(KDay); // derived from TFindHandleBase
TFullName theName;
RSemaphore theSem; // derived from RHandleBase
...
if ((finder.Next(thename))==KErrNone)
{
theSem.Open(finder,EOwnerThread);
...
}
...
</codeblock>
</conbody></concept>