<div class="content"><p> </p><p>The NetprPathCompare method performs comparison of two
paths.</p><dl>
<dd>
<div><pre> long NetprPathCompare(
   [in, string, unique] SRVSVC_HANDLE ServerName,
   [in, string] WCHAR* PathName1,
   [in, string] WCHAR* PathName2,
   [in] DWORD PathType,
   [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>PathName1: </b>A pointer to a null-terminated
UTF-16 string that contains the first PathName to compare.</p><p><b>PathName2: </b>A pointer to a null-terminated
UTF-16 string that contains the second PathName to compare.</p><p><b>PathType: </b>The type of PathName, as specified
in section <span><a href="03f17df3-ad31-4aed-a677-30261ac206a5" data-linktype="relative-path">2.2.2.9</a></span>.</p><p><b>Flags: </b>A bitmask that MUST contain the bitwise
OR of zero or more of the following values that specify controlling flags.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>0x00000001</p>
  </td>
  <td>
  <p>SHOULD be set if both of the paths have already been
  canonicalized.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p><b>Return Values: </b>Upon successful processing, the
server MUST return 0 if both paths are the same, –1 if the first is less than
the second, and 1 otherwise. If the method fails, it can return 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>In response to a NetprPathCompare message, the server MUST
compare the two paths that are specified as parameters to see if they match and
return this result or return an error code. If the supplied names are not
canonicalized, the server MUST do the canonicalization of the path names before
a comparison can occur. This does not modify the input path names. The clients
SHOULD call this method with canonicalized path names only, because the
canonicalization operation can be expensive. If uncanonicalized path names are
passed in, the caller SHOULD be aware that a nonzero result could be due to an
error that occurred during canonicalization.</p><p>The <i>PathName1</i> and <i>PathName2</i> parameters specify
the two path names to be compared.</p><p>The <i>Flags</i> parameter MUST be either 0 or 1. If the <i>Flags</i>
parameter has any other value, the server MUST fail the call with
ERROR_INVALID_PARAMETER. If the <i>Flags</i> parameter is 1, it implies that
the specified path names are already canonicalized and the server MUST not try
to canonicalize them.</p><p>Any combination of Name1 (canonicalized or not), Name2
(canonicalized or not), and <i>Flags</i> (0 or 1) is valid.</p><p>If <i>Flags</i> is set to 0, the server MUST first attempt
to canonicalize both Name1 and Name2 (and MUST respond with an error if
canonicalization fails) before comparing the names.</p><p>If <i>Flags</i> is set to 1, the server MUST compare the
names without first attempting canonicalization. Using Flags=1 could optimize
performance because it eliminates the need for the server to repeatedly
canonicalize a path name if it is being compared multiple times. If the <i>Flags</i>
parameter does not have a valid value, the server MUST fail the call with an
ERROR_INVALID_PARAMETER error code.</p><p>If the <i>Flags</i> parameter is 1, the <i>PathType</i>
parameter MUST specify the path type for the two path names. Valid values for
the <i>PathType</i> parameter are as specified in section 2.2.2.9. If the <i>PathType</i>
parameter does not have a valid value, the server MAY<a id="Appendix_A_Target_115"></a><a aria-label="Product behavior note 115" href="ebb74ff2-abb1-4e1b-a76a-563a5cbbea9a#Appendix_A_115" data-linktype="relative-path">&lt;115&gt;</a> fail the call.</p><p>If the <i>Flags</i> parameter is 0, the server MUST
canonicalize the specified path names and obtain their <i>PathTypes</i> first,
as specified in section <span><a href="9281f528-e2e7-4113-abd8-6db7255e4387" data-linktype="relative-path">3.1.4.30</a></span>. If this
fails, the server MUST fail the call with ERROR_INVALID_NAME. If the <i>PathTypes</i>
for the two path names thus obtained are different, the server MUST return 1.</p><p>The server then compares the canonicalized path names by
using an implementation-specific<a id="Appendix_A_Target_116"></a><a aria-label="Product behavior note 116" href="ebb74ff2-abb1-4e1b-a76a-563a5cbbea9a#Appendix_A_116" data-linktype="relative-path">&lt;116&gt;</a>
comparison and MUST return 0 to the caller if the paths match, –1 if <i>PathName1</i>
is less than <i>PathName2</i>, and 1 if <i>PathName1</i> is greater than <i>PathName2</i>.</p><p>The server MAY<a id="Appendix_A_Target_117"></a><a aria-label="Product behavior note 117" href="ebb74ff2-abb1-4e1b-a76a-563a5cbbea9a#Appendix_A_117" data-linktype="relative-path">&lt;117&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_118"></a><a aria-label="Product behavior note 118" href="ebb74ff2-abb1-4e1b-a76a-563a5cbbea9a#Appendix_A_118" data-linktype="relative-path">&lt;118&gt;</a> fail the call.</p></div>