<div class="content" name="NTLMLogin" uuid="40d194a2-c28a-485b-97f6-11a7c08f147e"><p>The IWbemLevel1Login::NTLMLogin method MUST connect a user
to the management services interface in a specified namespace.</p><dl>
<dd>
<div><pre> HRESULT NTLMLogin(
   [in, unique, string] LPWSTR wszNetworkResource,
   [in, unique, string] LPWSTR wszPreferredLocale,
   [in] long lFlags,
   [in] IWbemContext* pCtx,
   [out] IWbemServices** ppNamespace
 );
</pre></div>
</dd></dl><p><b>wszNetworkResource: </b>The string MUST represent
the namespace on the server to which the returned <a href="7a50647a-5311-41c2-8f4f-83bcfb497877" data-linktype="relative-path">IWbemServices</a> object is
associated. This parameter MUST NOT be NULL and MUST match the namespace syntax
as specified in section <a href="5c9b4c67-6ef7-4e07-9c6e-300a678bc8ec" data-linktype="relative-path">2.2.2</a>.</p><p><b>wszPreferredLocale: </b>MUST be a pointer to a
string that MUST specify the locale values in the preferred order, separated by
a comma. If the client does not supply it, the server creates a default list
which is implementation-specific.<a id="Appendix_A_Target_29"></a><a aria-label="Product behavior note 29" href="27182640-aa3f-43b6-941f-a77d25f798e8#Appendix_A_29" data-linktype="relative-path">&lt;29&gt;</a> Each
locale format SHOULD conform to the WMI locale format, as specified in <a href="259edd31-d6eb-4bc9-a2c4-2891b78bb51d" data-linktype="relative-path">WMI Locale
Formats (section 2.2.29)</a>. Any subsequent calls that request <a href="6837a7cb-ba2d-46b1-802c-fce2fd5a6ad6#gt_f82a4363-0099-479c-b42c-a8d398a90443" data-linktype="relative-path">CIM localizable information</a>
(<a href="2bbdf995-93d8-4902-a39d-38f2a9790b85" data-linktype="relative-path">WBEM_FLAG_USE_AMENDED_QUALIFIERS</a>)
SHOULD return the localized information in the order of preference if the
information is available in the <a href="6837a7cb-ba2d-46b1-802c-fce2fd5a6ad6#gt_c7f99c66-592f-4053-b62a-878c189653b6" data-linktype="relative-path">LCID</a>.<a id="Appendix_A_Target_30"></a><a aria-label="Product behavior note 30" href="27182640-aa3f-43b6-941f-a77d25f798e8#Appendix_A_30" data-linktype="relative-path">&lt;30&gt;</a> The server MUST save this
information in <b>ClientPreferredLocales</b>.</p><p><b>lFlags: </b>MUST be 0. The server SHOULD consider
any other value as not valid and return WBEM_E_INVALID_PARAMETER; otherwise,
the server behavior is implementation-specific.<a id="Appendix_A_Target_31"></a><a aria-label="Product behavior note 31" href="27182640-aa3f-43b6-941f-a77d25f798e8#Appendix_A_31" data-linktype="relative-path">&lt;31&gt;</a></p><p><b>pCtx: </b>MUST be a pointer to an <a href="18c8f1a1-652f-43b7-9186-6098bc303a8d" data-linktype="relative-path">IWbemContext</a> interface,
which MUST contain additional information sent by the client. If <i>pCtx</i> is
NULL, the parameter MUST be ignored.</p><p><b>ppNamespace: </b>If the call succeeds, <i>ppNamespace</i>
MUST return a pointer to an IWbemServices <a href="6837a7cb-ba2d-46b1-802c-fce2fd5a6ad6#gt_e5ba77ec-1a10-4a4e-a980-c81942237b34" data-linktype="relative-path">interface pointer</a>. This
parameter MUST be set to NULL when an error occurs.</p><p><b>Return Values: </b>This method MUST return an
HRESULT value that MUST indicate the status of the method call. The server MUST
return WBEM_S_NO_ERROR, as specified in section <a href="a2899649-a5a3-4b13-9ffa-d8394dcdac63" data-linktype="relative-path">2.2.11</a>, to indicate the
successful completion of the method.</p><dl>
<dd>
<p><b>WBEM_S_NO_ERROR</b> (0x00)</p>
</dd></dl><p>The server MUST return WBEM_E_INITIALIZATION_FAILURE if <b>InitSuccess</b>
is false.</p><p>The server MUST determine the client&#39;s access rights by
comparing <b>RpcImpersonationAccessToken.Sids[UserIndex]</b> as defined in <a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a>
section <a href="../ms-rpce/29b8217a-0bda-4fdb-a3ea-48560125ae8d" data-linktype="relative-path">3.3.3.4.3</a>
against the security descriptor stored in <b>NamespaceConnection</b>.</p><p>The <a href="6837a7cb-ba2d-46b1-802c-fce2fd5a6ad6#gt_f3ef2572-95cf-4c5c-b3c9-551fd648f409" data-linktype="relative-path">security
principal</a> that makes the call MUST have WBEM_REMOTE_ENABLE and WBEM_ENABLE
access to the namespace; otherwise, WBEM_ACCESS_DENIED MUST be returned.</p><p>In response to the IWbemLevel1Login::NTLMLogin method, the
server MUST return an IWbemServices interface that corresponds to the <i>wszNetworkResource</i>
parameter.</p><p>The server SHOULD enforce a maximum length for the <i>wszNetworkResource</i>
parameter, and return WBEM_E_QUOTA_VIOLATION if the limit is exceeded.<a id="Appendix_A_Target_32"></a><a aria-label="Product behavior note 32" href="27182640-aa3f-43b6-941f-a77d25f798e8#Appendix_A_32" data-linktype="relative-path">&lt;32&gt;</a></p><p>When the call succeeds, the server MUST create an <b>IWbemServices</b>
object. The server MUST store the <i>wszPreferredLocale</i> inside the object.
The server MUST find the <b>NamespaceConnection</b> object for <i>wszNetworkResource</i>
passed into the <b>NamespaceConnectionTable</b>, and store its reference in the
<b>IWbemServices</b> object. The server MUST return WBEM_E_INVALID_NAMESPACE if
the <b>NamespaceConnection</b> object cannot be found. The server MUST set <b>GrantedAccess</b>
to the set of access rights granted to the client by the namespace security
descriptor.</p><p>All subsequent IWbemServices method invocations that request
localized information MUST return the information in the language that is
specified in <i>wszPreferredLocale</i>. When the preferred locale is NULL, the
server SHOULD<a id="Appendix_A_Target_33"></a><a aria-label="Product behavior note 33" href="27182640-aa3f-43b6-941f-a77d25f798e8#Appendix_A_33" data-linktype="relative-path">&lt;33&gt;</a> use implementation-specific
logic to decide the locale.</p><p>The successful method execution MUST fill the <i>ppNamespace</i>
parameter with an IWbemServices interface pointer and MUST return
WBEM_S_NO_ERROR.</p><p>The failed method execution MUST set the output parameter to
NULL and MUST return an error in the format specified in section <a href="4bcecea2-b587-4ce4-8961-f8919387c38a" data-linktype="relative-path">2.2.3</a>. If the namespace
does not exist, the server MUST return a <b>WBEM_E_INVALID_NAMESPACE</b>
HRESULT value.</p></div>