<div class="content"><p> </p><p>The NetprNameValidate method performs checks to ensure that
the specified name is a valid name for the specified type.</p><dl>
<dd>
<div><pre> NET_API_STATUS NetprNameValidate(
   [in, string, unique] SRVSVC_HANDLE ServerName,
   [in, string] WCHAR* Name,
   [in] DWORD NameType,
   [in] DWORD Flags
 );
</pre></div>
</dd></dl><p><b>ServerName: </b>An <span><a href="5f8329ee-1965-4ea1-ad35-3b29fbb63232" data-linktype="relative-path">SRVSVC_HANDLE (section 2.2.1.1)</a></span>
pointer that identifies the <span><a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_434b0234-e970-4e8c-bdfa-e16a30d96703" data-linktype="relative-path">server</a></span>. The <span><a href="1709f6a7-efb8-4ded-b7ae-5cee9ee36320#gt_60e0e1fa-66fe-41e1-b5e3-ceab97e53506" data-linktype="relative-path">client</a></span>
MUST map this structure to an RPC binding handle (see <span><a href="https://go.microsoft.com/fwlink/?LinkId=89824" data-linktype="external">[C706]</a></span> sections
4.3.5 and 5.1.5.2). The server MUST ignore this parameter.</p><p><b>Name: </b>A pointer to a null-terminated UTF-16
string that specifies the name to check.</p><p><b>NameType: </b>The type of <i>Name</i>. It MUST be
one of the values defined in section <span><a href="2e2d2fb6-3448-4213-94b3-89dcb772d3e6" data-linktype="relative-path">2.2.2.8</a></span>.</p><p><b>Flags: </b>Reserved, MUST be zero.</p><p><b>Return Values: </b>The method returns 0x00000000
(NERR_Success) to indicate success; otherwise, it returns a nonzero error code.
The method can take any specific error code value, as specified in <span><a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a></span>
section <span><a href="../ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d" data-linktype="relative-path">2.2</a></span>.
</p><p>If the Flags parameter is not equal to zero, the server
SHOULD fail the call with an implementation-specific error code.<a id="Appendix_A_Target_119"></a><a aria-label="Product behavior note 119" href="ebb74ff2-abb1-4e1b-a76a-563a5cbbea9a#Appendix_A_119" data-linktype="relative-path">&lt;119&gt;</a></p><p>In response to a NetprNameValidate message, the server MUST
validate the value of the <i>Name</i> parameter to ensure that it contains only
the characters that are allowed for the specified NameType and that the length
of the <i>Name</i> parameter is no greater than the maximum allowed length for
its NameType (as specified in section 2.2.2.8). </p><p>The <i>NameType</i> parameter determines what validation is
done on the name that is specified by the <i>Name</i> parameter. Valid values
for the <i>NameType</i> parameter are as specified in section 2.2.2.8. If the <i>NameType</i>
parameter does not have a valid value, the server MUST fail the call with an
ERROR_INVALID_PARAMETER error code.</p><p>The value of <i>NameType</i> identifies the minimum and
maximum lengths for a particular <i>NameType</i> and the characters that are
permitted in a name for that <i>NameType</i>. The server MUST validate the
specified name by being sure that its length is within the minimum and maximum
lengths for its type and that there are no characters in its name that are
invalid for its type. If any of these checks fail, the server MUST fail the
call with an ERROR_INVALID_NAME error code.</p><p>The server MAY<a id="Appendix_A_Target_120"></a><a aria-label="Product behavior note 120" href="ebb74ff2-abb1-4e1b-a76a-563a5cbbea9a#Appendix_A_120" data-linktype="relative-path">&lt;120&gt;</a>
enforce security measures to verify that the caller has the required
permissions to execute this call. If the server enforces these security
measures and the caller does not have the required credentials, the server
SHOULD<a id="Appendix_A_Target_121"></a><a aria-label="Product behavior note 121" href="ebb74ff2-abb1-4e1b-a76a-563a5cbbea9a#Appendix_A_121" data-linktype="relative-path">&lt;121&gt;</a> fail the call.</p></div>