390 lines
16 KiB
HTML
390 lines
16 KiB
HTML
<html>
|
|
|
|
<head>
|
|
<title>Interface IWbemProviderInit</title>
|
|
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<p> <font FACE="Arial Narrow" SIZE="6" COLOR="#800000"></p>
|
|
|
|
<p></font><b><font FACE="Arial Narrow" SIZE="6">Interface IWbemProviderInit</font><font
|
|
FACE="Arial Narrow" SIZE="1" COLOR="#800000">¦@¦</font></b><font SIZE="2"
|
|
COLOR="#ff00ff"></p>
|
|
|
|
<p><span style=color:#FF0000></font><font FACE="Arial" SIZE="2" COLOR="#ff0000">[This
|
|
is preliminary documentation and subject to change.]</font><font SIZE="2" COLOR="#ff00ff"></span></font><font
|
|
FACE="Arial" SIZE="2"> </p>
|
|
|
|
<p>The <b>IWbemProviderInit</b> interface is called by CIMOM to initialize providers. All
|
|
providers are required to implement <b>IWbemProviderInit</b>. </p>
|
|
|
|
<p> <b></p>
|
|
|
|
<p>Methods in Vtable Order</b></font></p>
|
|
|
|
<table CELLSPACING="0" BORDER="0" WIDTH="463">
|
|
<tr>
|
|
<td WIDTH="37%" VALIGN="TOP"><font FACE="Arial" SIZE="2"><b>IUnknown Methods</b></font></td>
|
|
<td WIDTH="63%" VALIGN="TOP"><font FACE="Arial" SIZE="2"><b>Description</b></font></td>
|
|
</tr>
|
|
<tr>
|
|
<td WIDTH="37%" VALIGN="TOP"><font FACE="Arial" SIZE="2"><u><b>QueryInterface</b></u></font><font
|
|
FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemProviderInit_QueryInterface</font></td>
|
|
<td WIDTH="63%" VALIGN="TOP"><font FACE="Arial" SIZE="2">Determines if the current object
|
|
supports a given interface.</font></td>
|
|
</tr>
|
|
<tr>
|
|
<td WIDTH="37%" VALIGN="TOP"><font FACE="Arial" SIZE="2"><u><b>Addref</b></u></font><font
|
|
FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemProviderInit_Addref</font></td>
|
|
<td WIDTH="63%" VALIGN="TOP"><font FACE="Arial" SIZE="2">Increases the object's reference
|
|
count by 1.</font></td>
|
|
</tr>
|
|
<tr>
|
|
<td WIDTH="37%" VALIGN="TOP"><font FACE="Arial" SIZE="2"><u><b>Release</b></u></font><font
|
|
FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemProviderInit_Release</font></td>
|
|
<td WIDTH="63%" VALIGN="TOP"><font FACE="Arial" SIZE="2">Decrements the object's reference
|
|
count by 1, and frees the object when the reference count is zero.</font></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p> </p>
|
|
|
|
<table CELLSPACING="0" BORDER="0" WIDTH="463">
|
|
<tr>
|
|
<td VALIGN="TOP" COLSPAN="2"></td>
|
|
</tr>
|
|
<tr>
|
|
<td WIDTH="37%" VALIGN="TOP"><font FACE="Arial" SIZE="2"><b>IWbemProviderInit Methods</b></font></td>
|
|
<td WIDTH="63%" VALIGN="TOP"><font FACE="Arial" SIZE="2"><b>Description</b></font></td>
|
|
</tr>
|
|
<tr>
|
|
<td WIDTH="37%" VALIGN="TOP"><font FACE="Arial" SIZE="2"><u><b>Initialize</b></u></font><font
|
|
FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemProviderInit_Initialize</font></td>
|
|
<td WIDTH="63%" VALIGN="TOP"><font FACE="Arial" SIZE="2">Called by CIMOM to initialize a
|
|
provider.</font></td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p> <font FACE="Arial" SIZE="1"></p>
|
|
|
|
<p> </font><font FACE="Arial Narrow" SIZE="5" COLOR="#800000"></p>
|
|
|
|
<p>‹^</font><font FACE="Arial Narrow" SIZE="5"><b># $ K + </b></font><font
|
|
FACE="Arial Narrow" SIZE="5" COLOR="#800000">›</font><b><font FACE="Arial Narrow"
|
|
SIZE="5">IWbemProviderInit::QueryInterface</font><font FACE="Arial Narrow" SIZE="1"
|
|
COLOR="#800000">¦@¦</font></b><font SIZE="2" COLOR="#ff00ff"></p>
|
|
|
|
<p><span style=color:#FF0000></font><font FACE="Arial" SIZE="2" COLOR="#ff0000">[This
|
|
is preliminary documentation and subject to change.]</font><font SIZE="2" COLOR="#ff00ff"></span></font><font
|
|
FACE="Arial" SIZE="2"> </p>
|
|
|
|
<p>The <b>IWbemProviderInit::QueryInterface</b> method determines if the object supports a
|
|
particular COM interface. If it does, the system increases the object's reference count,
|
|
and the application can use that interface immediately.</font><font
|
|
FACE="Lucida Sans Typewriter" SIZE="2"><b></p>
|
|
|
|
<p>HRESULT IWbemProviderInit::QueryInterface(</p>
|
|
|
|
<p>[in] REFIID</b><i> riid</i><b>,</p>
|
|
|
|
<p>[out] LPVOID</b><i> *ppv</i><b></p>
|
|
|
|
<p>);</b></p>
|
|
|
|
<p></font><font FACE="Arial Narrow"><b> </p>
|
|
|
|
<p>Parameters</b></font><font FACE="Arial" SIZE="2"><i></p>
|
|
|
|
<p>riid</p>
|
|
|
|
<blockquote>
|
|
</i><p>The COM interface identifier of the requested interface.</p>
|
|
</blockquote>
|
|
|
|
<p> <i></p>
|
|
|
|
<p>obp</p>
|
|
|
|
<blockquote>
|
|
</i><p>Address of a pointer that will be filled with the interface pointer if the query
|
|
succeeds.</p>
|
|
</font><font FACE="Arial" SIZE="1"><p></font> </p>
|
|
</blockquote>
|
|
|
|
<p> <font FACE="Arial Narrow"><b></p>
|
|
|
|
<p>Return Values</b></font><font FACE="Arial" SIZE="2"></p>
|
|
|
|
<p>Returns standard COM error codes for <b>QueryInterface</b>. It returns WBEM_S_NO_ERROR
|
|
if the call succeeds. If the call fails because the requested interface was not supported,
|
|
the method returns E_NOINTERFACE.</font><font FACE="Arial Narrow"><b></p>
|
|
|
|
<p>Remarks</b></font><font FACE="Arial" SIZE="2"></p>
|
|
|
|
<p>When the application no longer needs the interface retrieved by a call to this method,
|
|
it must call the <b>Release</b> method for that interface to free it. The <b>QueryInterface</b>
|
|
method allows the extension of objects without interfering with each object's existing or
|
|
future functionality.</p>
|
|
|
|
<p>This method is part of the <b>IUnknown</b> interface inherited by the object. For more
|
|
information about this method, see the COM documentation in the Microsoft Platform SDK.</font><b><font
|
|
FACE="Arial Narrow"></p>
|
|
|
|
<p>See Also</font><font FACE="Arial" SIZE="2"><u></p>
|
|
|
|
<p>IUnknown Interface Basics</u></font></b><font FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IUnknown_Interface_Basics</font><font
|
|
FACE="Arial" SIZE="2"> </font><font FACE="Arial Narrow" SIZE="5" COLOR="#800000"></p>
|
|
|
|
<p>‹^</font><font FACE="Arial Narrow" SIZE="5"><b># $ K + </b></font><font
|
|
FACE="Arial Narrow" SIZE="5" COLOR="#800000">›</font><b><font FACE="Arial Narrow"
|
|
SIZE="5">IWbemProviderInit::AddRef</font><font FACE="Arial Narrow" SIZE="1"
|
|
COLOR="#800000">¦@¦</font></b><font SIZE="2" COLOR="#ff00ff"></p>
|
|
|
|
<p><span style=color:#FF0000></font><font FACE="Arial" SIZE="2" COLOR="#ff0000">[This
|
|
is preliminary documentation and subject to change.]</font><font SIZE="2" COLOR="#ff00ff"></span></font><font
|
|
FACE="Arial" SIZE="2"> </p>
|
|
|
|
<p>The <b>IWbemProviderInit::AddRef</b> method increases the object's reference count by
|
|
1.</font><font FACE="Lucida Sans Typewriter" SIZE="2"><b></p>
|
|
|
|
<p>ULONG AddRef( );</b></p>
|
|
|
|
<p></font><font FACE="Arial Narrow"><b> </p>
|
|
|
|
<p>Parameters</b></font><font FACE="Arial" SIZE="2"></p>
|
|
|
|
<p>None.</font><font FACE="Arial Narrow"><b></p>
|
|
|
|
<p>Return Values</b></font><font FACE="Arial" SIZE="2"></p>
|
|
|
|
<p>Returns the new reference count.</font><font FACE="Arial Narrow"><b></p>
|
|
|
|
<p>Remarks</b></font><font FACE="Arial" SIZE="2"></p>
|
|
|
|
<p>When the object is created, its reference count is set to 1. Every time an application
|
|
obtains an interface to the object or calls the <b>AddRef</b> method, the object's
|
|
reference count is increased by 1. Use the <u><b>Release</b></u></font><font FACE="Arial"
|
|
SIZE="2" COLOR="#800000">_hmm_IWbemProviderInit_Release</font><font FACE="Arial" SIZE="2">
|
|
method to decrease the object's reference count by 1. </p>
|
|
|
|
<p>This method is part of the <b>IUnknown</b> interface inherited by the object. For a
|
|
complete discussion of <b>IUnknown</b> methods, see <b>IUnknown Programming Basics</b>.</p>
|
|
|
|
<p>For more information about this method, see the COM documentation in the Microsoft
|
|
Platform SDK.</font><b><font FACE="Arial Narrow"></p>
|
|
|
|
<p>See Also</font><font FACE="Arial" SIZE="2"><u></p>
|
|
|
|
<p>IUnknown Interface Basics</u></font></b><font FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IUnknown_Interface_Basics</font><font
|
|
FACE="Arial" SIZE="2"> </font><font FACE="Arial Narrow" SIZE="5" COLOR="#800000"></p>
|
|
|
|
<p>‹^</font><font FACE="Arial Narrow" SIZE="5"><b># $ K + </b></font><font
|
|
FACE="Arial Narrow" SIZE="5" COLOR="#800000">›</font><b><font FACE="Arial Narrow"
|
|
SIZE="5">IWbemProviderInit::Release</font><font FACE="Arial Narrow" SIZE="1"
|
|
COLOR="#800000">¦@¦</font></b><font SIZE="2" COLOR="#ff00ff"></p>
|
|
|
|
<p><span style=color:#FF0000></font><font FACE="Arial" SIZE="2" COLOR="#ff0000">[This
|
|
is preliminary documentation and subject to change.]</font><font SIZE="2" COLOR="#ff00ff"></span></font><font
|
|
FACE="Arial" SIZE="2"> </p>
|
|
|
|
<p>The <b>IWbemProviderInit::Release</b> method decreases the object's reference count by
|
|
1.</font><b><font FACE="Lucida Sans Typewriter" SIZE="2"></p>
|
|
|
|
<p>ULONG IWbemProviderInit::Release( );</p>
|
|
|
|
<p></font><font FACE="Arial Narrow"> </p>
|
|
|
|
<p>Parameters</font></b><font FACE="Arial" SIZE="2"></p>
|
|
|
|
<p>None.</font><font FACE="Arial Narrow"><b></p>
|
|
|
|
<p>Return Values</b></font><font FACE="Arial" SIZE="2"></p>
|
|
|
|
<p>Returns the new reference count.</font><font FACE="Arial Narrow"><b></p>
|
|
|
|
<p>Remarks</b></font><font FACE="Arial" SIZE="2"></p>
|
|
|
|
<p>The object deallocates itself when its reference count reaches zero. Use the <u><b>AddRef</b></u></font><font
|
|
FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemProviderInit_AddRef</font><font
|
|
FACE="Arial" SIZE="2"> method to increase the object's reference count by 1.</p>
|
|
|
|
<p>This method is part of the <b>IUnknown</b> interface inherited by the object. For more
|
|
information about this method, see the COM documentation in the Microsoft Platform SDK.</font><b><font
|
|
FACE="Arial Narrow"></p>
|
|
|
|
<p>See Also</font><font FACE="Arial" SIZE="2"><u></p>
|
|
|
|
<p>IUnknown Interface Basics</u></font></b><font FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IUnknown_Interface_Basics</font><font
|
|
FACE="Arial" SIZE="2"> </font><font FACE="Arial Narrow" SIZE="5" COLOR="#800000"></p>
|
|
|
|
<p>‹^</font><font FACE="Arial Narrow" SIZE="5"><b># $ K + </b></font><font
|
|
FACE="Arial Narrow" SIZE="5" COLOR="#800000">›</font><b><font FACE="Arial Narrow"
|
|
SIZE="5">IWbemProviderInit::Initialize</font><font FACE="Arial Narrow" SIZE="1"
|
|
COLOR="#800000">¦@¦</font></b><font SIZE="2" COLOR="#ff00ff"></p>
|
|
|
|
<p><span style=color:#FF0000></font><font FACE="Arial" SIZE="2" COLOR="#ff0000">[This
|
|
is preliminary documentation and subject to change.]</font><font SIZE="2" COLOR="#ff00ff"></span></font><font
|
|
FACE="Arial" SIZE="2"> </p>
|
|
|
|
<p>The <b>IWbemProviderInit::Initialize</b> method is called by CIMOM to initialize a
|
|
provider and deem it ready to receive client requests. All types of providers must
|
|
implement this method. </font><font FACE="Lucida Sans Typewriter" SIZE="2"><b></p>
|
|
|
|
<p>HRESULT IWbemProviderInit::Initialize(</p>
|
|
|
|
<p>[in] LPWSTR</b><i> pszUser</i><b>, </p>
|
|
|
|
<p>[in] LONG </b><i>lFlags</i><b>,</p>
|
|
|
|
<p>[in] LPWSTR</b><i> pszNamespace</i><b>,</p>
|
|
|
|
<p>[in] LPWSTR</b><i> pszLocale</i><b>,</p>
|
|
|
|
<p>[in] IWbemServices</b><i> *pNamespace</i><b>,</p>
|
|
|
|
<p>[in] IWbemContext</b><i> *pCtx</i><b>,</p>
|
|
|
|
<p>[in] IWbemProviderInitSink</b><i> *pInitSink</i><b></p>
|
|
|
|
<p>);</b></p>
|
|
|
|
<p></font><font FACE="Arial Narrow"><b> </p>
|
|
|
|
<p>Parameters </b></font><font FACE="Arial" SIZE="2"><i></p>
|
|
|
|
<p>pszUser</p>
|
|
|
|
<blockquote>
|
|
</i><p>Pointer to the user name, if per-user initialization was requested in the <u><b>__Win32Provider</b></u></font><font
|
|
FACE="Arial" SIZE="2" COLOR="#800000">_hmm___Win32Provider</font><font FACE="Arial"
|
|
SIZE="2"> registration</font><font FACE="Arial" SIZE="2" COLOR="#008000"> </font><font
|
|
FACE="Arial" SIZE="2">instance for this provider. Otherwise, this will be NULL. </p>
|
|
</blockquote>
|
|
|
|
<p> <i></p>
|
|
|
|
<p>lFlags</p>
|
|
|
|
<blockquote>
|
|
</i><p>Reserved. It must be zero.</p>
|
|
</blockquote>
|
|
|
|
<p> <i></p>
|
|
|
|
<p>pszNamespace</p>
|
|
|
|
<blockquote>
|
|
</i><p>The namespace name for which the provider is being initialized.</p>
|
|
</blockquote>
|
|
|
|
<p> <i></p>
|
|
|
|
<p>pszLocale</p>
|
|
|
|
<blockquote>
|
|
</i><p>The locale name for which the provider is being initialized. This is typically a
|
|
string of the following format, where the hex value is a Microsoft standard LCID value:</p>
|
|
<p>"<b>MS\\0x409</b>"</p>
|
|
</blockquote>
|
|
|
|
<p> <i></p>
|
|
|
|
<p>pNamespace</p>
|
|
|
|
<blockquote>
|
|
</i><p>An <u><b>IWbemServices</b></u></font><font FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemServices</font><font
|
|
FACE="Arial" SIZE="2"> pointer back into CIMOM. This pointer is capable of servicing any
|
|
requests made by the provider. The provider should use the <u><b>AddRef</b></u></font><font
|
|
FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemProviderInit_AddRef</font><font
|
|
FACE="Arial" SIZE="2"> method on this pointer if it is going to need to call back into
|
|
CIMOM during its execution. </p>
|
|
</blockquote>
|
|
|
|
<p> <i></p>
|
|
|
|
<p>pCtx</p>
|
|
|
|
<blockquote>
|
|
</i><p>An <u><b>IWbemContext</b></u></font><font FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemContext</font><font
|
|
FACE="Arial" SIZE="2"> pointer associated with initialization. If the provider needs to
|
|
make requests back into CIMOM before completing initialization, it should use the <u><b>AddRef</b></u></font><font
|
|
FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemProviderInit_Addref</font><font
|
|
FACE="Arial" SIZE="2"> method on this pointer. This pointer must be passed by the provider
|
|
in all future <b>IWbemServices</b> calls that it makes to CIMOM. For more information, see
|
|
<u>Making Calls to CIMOM</u></font><font FACE="Arial" SIZE="2" COLOR="#800000">_hmm_Making_Calls_to_CIMOM</font><font
|
|
FACE="Arial" SIZE="2">. </p>
|
|
</blockquote>
|
|
|
|
<p> <i></p>
|
|
|
|
<p>pInitSink</p>
|
|
|
|
<blockquote>
|
|
</i><p>An <u><b>IWbemProviderInitSink</b></u></font><font FACE="Arial" SIZE="2"
|
|
COLOR="#800000">_hmm_IWbemProviderInitSink</font><font FACE="Arial" SIZE="2"> pointer that
|
|
is used by the provider to report initialization status. </p>
|
|
</font><font FACE="Arial" SIZE="1"><p></font> </p>
|
|
</blockquote>
|
|
|
|
<p> <font FACE="Arial Narrow"><b></p>
|
|
|
|
<p>Return Values</b></font><font FACE="Arial" SIZE="2"></p>
|
|
|
|
<p>The provider should return WBEM_S_NO_ERROR and indicate its status using the supplied
|
|
object sink in the <i>pInitSink </i>parameter. However, if a provider returns
|
|
WBEM_E_FAILED and does not use the sink, then the provider initialization will be
|
|
considered as failed.</font><font FACE="Arial Narrow"><b></p>
|
|
|
|
<p>Remarks</b></font><font FACE="Arial" SIZE="2"></p>
|
|
|
|
<p>Typically, the provider will implement a COM object using multiple inheritance in order
|
|
to support both the <b>IWbemProviderInit</b> interface as well as its primary interface,
|
|
such as <u><b>IWbemServices</b></u></font><font FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemServices</font><font
|
|
FACE="Arial" SIZE="2"> or <u><b>IWbemEventProvider</b></u></font><font FACE="Arial"
|
|
SIZE="2" COLOR="#800000">_hmm_IWbemEventProvider</font><font FACE="Arial" SIZE="2">.</p>
|
|
|
|
<p>Initialization status is reported by calling <u><b>IWbemProviderInitSink::SetStatus</b></u></font><font
|
|
FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemProviderInitSink_SetStatus</font><font
|
|
FACE="Arial" SIZE="2">. This method can be called repeatedly to report incremental status
|
|
if necessary. The provider must increment the reference count on this pointer by calling
|
|
its <u><b>AddRef</b></u></font><font FACE="Arial" SIZE="2" COLOR="#800000">_hmm_IWbemProviderInit_Addref</font><font
|
|
FACE="Arial" SIZE="2"> method before using it to communicate status to CIMOM.</p>
|
|
|
|
<p>The provider may use the <u><b>IWbemProviderInitSink</b></u></font><font FACE="Arial"
|
|
SIZE="2" COLOR="#800000">_hmm_IWbemProviderInitSink</font><font FACE="Arial" SIZE="2">
|
|
pointer synchronously as in the following example:</p>
|
|
|
|
<blockquote>
|
|
</font><font FACE="Lucida Sans Typewriter" SIZE="1"><p>HRESULT SampleProvider::Initialize(
|
|
</p>
|
|
<p>/* [unique][in] */ LPWSTR wszUser,</p>
|
|
<p>/* [in] */ LONG lFlags,</p>
|
|
<p>/* [in] */ LPWSTR wszNamespace,</p>
|
|
<p>/* [unique][in] */ LPWSTR wszLocale,</p>
|
|
<p>/* [in] */ IWbemServices __RPC_FAR *pNamespace,</p>
|
|
<p>/* [in] */ IWbemContext __RPC_FAR *pCtx,</p>
|
|
<p>/* [in] */ IWbemProviderInitSink __RPC_FAR *pInitSink</p>
|
|
<p>)</p>
|
|
<p>{</p>
|
|
<p>// AddRef the pNamespace pointer, if required</p>
|
|
<p>// Analyze other parameters</p>
|
|
<p>// Tell CIMOM that we are initialized</p>
|
|
<p>pInitSink->SetStatus(0, WBEM_S_INITIALIZED);</p>
|
|
<p>return WBEM_S_NO_ERROR;</p>
|
|
<p>}</font></p>
|
|
</blockquote>
|
|
|
|
<p> <font FACE="Arial" SIZE="2"></p>
|
|
|
|
<p>The provider may also use the <b>AddRef </b>method on<b> </b>the pointer and create a
|
|
separate thread to complete its initialization and immediately return from the call.</font><font
|
|
FACE="Arial Narrow"><b></p>
|
|
|
|
<p>See Also</b></font><font FACE="Arial" SIZE="2"><u></p>
|
|
|
|
<p>Initializing a Provider</u></font><font FACE="Arial" SIZE="2" COLOR="#800000">_hmm_Initializing_a_Provider</font></p>
|
|
</body>
|
|
</html>
|