<s>
In	O
computer	B-General_Concept
programming	I-General_Concept
,	O
the	O
IUnknown	B-Application
interface	B-Application
is	O
the	O
fundamental	O
interface	B-Application
in	O
the	O
Component	B-Application
Object	I-Application
Model	I-Application
(	O
COM	O
)	O
.	O
</s>
<s>
The	O
COM	O
specification	O
mandates	O
that	O
COM	B-Application
objects	I-Application
must	O
implement	O
this	O
interface	B-Application
.	O
</s>
<s>
Furthermore	O
,	O
every	O
other	O
COM	O
interface	B-Application
must	O
be	O
derived	O
from	O
IUnknown	B-Application
.	O
</s>
<s>
IUnknown	B-Application
exposes	O
two	O
essential	O
features	O
of	O
all	O
COM	B-Application
objects	I-Application
:	O
object	O
lifetime	O
management	O
through	O
reference	B-General_Concept
counting	I-General_Concept
,	O
and	O
access	O
to	O
object	O
functionality	O
through	O
other	O
interfaces	B-Application
.	O
</s>
<s>
An	O
IUnknown	B-Application
(	O
or	O
IUnknown-derived	O
)	O
interface	B-Application
consists	O
of	O
a	O
pointer	O
to	O
a	O
virtual	B-Language
method	I-Language
table	I-Language
that	O
contains	O
a	O
list	O
of	O
pointers	O
to	O
the	O
functions	O
that	O
implement	O
the	O
functions	O
declared	O
in	O
the	O
interface	B-Application
,	O
in	O
the	O
order	O
that	O
they	O
are	O
declared	O
in	O
the	O
interface	B-Application
.	O
</s>
<s>
The	O
in-process	O
invocation	O
call	O
overhead	O
is	O
therefore	O
identical	O
to	O
virtual	O
method	B-Language
calls	I-Language
in	O
C++	B-Language
.	O
</s>
<s>
The	O
IUnknown	B-Application
interface	B-Application
exposes	O
three	O
methods	B-Language
:	O
QueryInterface	O
,	O
AddRef	O
,	O
and	O
Release	O
:	O
</s>
<s>
QueryInterface	O
allows	O
the	O
caller	O
to	O
retrieve	O
references	O
to	O
the	O
interfaces	B-Application
that	O
the	O
component	O
implements	O
.	O
</s>
<s>
It	O
is	O
similar	O
to	O
dynamic_castxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1	O
in	O
C++	B-Language
or	O
casts	O
in	O
Java	B-Language
and	O
C#	B-Application
.	O
</s>
<s>
Specifically	O
,	O
it	O
is	O
used	O
to	O
obtain	O
a	O
pointer	O
to	O
another	O
interface	B-Application
,	O
given	O
a	O
GUID	O
that	O
uniquely	O
identifies	O
that	O
interface	B-Application
(	O
commonly	O
known	O
as	O
an	O
interface	B-Application
ID	O
,	O
or	O
IID	O
)	O
.	O
</s>
<s>
If	O
the	O
COM	B-Application
object	I-Application
does	O
not	O
implement	O
that	O
interface	B-Application
,	O
an	O
E_NOINTERFACE	O
error	O
is	O
returned	O
instead	O
.	O
</s>
<s>
AddRef	O
is	O
used	O
to	O
increment	O
the	O
reference	B-General_Concept
count	I-General_Concept
when	O
a	O
new	O
client	O
is	O
acquiring	O
the	O
object	O
.	O
</s>
<s>
It	O
returns	O
the	O
new	O
reference	B-General_Concept
count	I-General_Concept
.	O
</s>
<s>
Release	O
is	O
used	O
to	O
decrement	O
the	O
reference	B-General_Concept
count	I-General_Concept
when	O
clients	O
have	O
finished	O
using	O
the	O
object	O
.	O
</s>
<s>
It	O
returns	O
the	O
new	O
reference	B-General_Concept
count	I-General_Concept
.	O
</s>
<s>
The	O
object	O
will	O
delete	O
itself	O
during	O
release	O
when	O
the	O
reference-count	O
reaches	O
zero	O
,	O
which	O
means	O
that	O
the	O
caller	O
must	O
never	O
use	O
an	O
interface	B-Application
after	O
calling	O
Release	O
.	O
</s>
<s>
The	O
IUnknown	B-Application
interface	B-Application
ID	O
is	O
defined	O
as	O
a	O
GUID	O
with	O
the	O
value	O
of	O
 { 00000000-0000-0000-C000-000000000046 } 	O
.	O
</s>
<s>
A	O
COM	O
component	O
's	O
interfaces	B-Application
are	O
required	O
to	O
exhibit	O
the	O
reflexive	O
,	O
symmetric	O
,	O
and	O
transitive	O
properties	O
.	O
</s>
<s>
The	O
reflexive	O
property	O
refers	O
to	O
the	O
ability	O
for	O
the	O
QueryInterface	O
call	O
on	O
a	O
given	O
interface	B-Application
with	O
the	O
interface	B-Application
's	O
ID	O
to	O
return	O
the	O
same	O
instance	O
of	O
the	O
interface	B-Application
.	O
</s>
<s>
The	O
symmetric	O
property	O
requires	O
that	O
when	O
interface	B-Application
B	O
is	O
retrieved	O
from	O
interface	B-Application
A	O
via	O
QueryInterface	O
,	O
interface	B-Application
A	O
is	O
retrievable	O
from	O
interface	B-Application
B	O
as	O
well	O
.	O
</s>
<s>
The	O
transitive	O
property	O
requires	O
that	O
if	O
interface	B-Application
B	O
is	O
obtainable	O
from	O
interface	B-Application
A	O
and	O
interface	B-Application
C	O
is	O
obtainable	O
from	O
interface	B-Application
B	O
,	O
then	O
interface	B-Application
C	O
should	O
be	O
retrievable	O
from	O
interface	B-Application
A	O
.	O
</s>
<s>
Components	O
designed	O
under	O
the	O
ActiveX	B-Application
visual	O
component	O
standard	O
must	O
,	O
at	O
a	O
minimum	O
,	O
implement	O
the	O
IUnknown	B-Application
interface	B-Application
.	O
</s>
<s>
IUnknown	B-Application
serves	O
as	O
the	O
base	O
for	O
Mac	B-Operating_System
OS	I-Operating_System
X	I-Operating_System
's	O
Core	B-Operating_System
Foundation	I-Operating_System
CFPlugIn	O
framework	O
.	O
</s>
<s>
In	O
Mozilla	O
's	O
XPCOM	B-Application
component	O
model	O
,	O
this	O
interface	B-Application
is	O
also	O
known	O
as	O
nsISupports	O
.	O
</s>
