<div class="content" name="SetNtmsRequestOrder" uuid="a3d5eedd-a19b-4a35-9a0b-315e6032bb33"><p>The SetNtmsRequestOrder method sets the order in which a
request will be processed in the library queue.</p><dl>
<dd>
<div><pre> HRESULT SetNtmsRequestOrder(
   [in] LPNTMS_GUID lpRequestId,
   [in] DWORD dwOrderNumber
 );
</pre></div>
</dd></dl><p><b>lpRequestId: </b>A pointer to the identifier of a <a href="8d988f06-72be-47cf-9e09-9060aa8ed897#gt_f8da5142-cddf-49b1-b24c-a352db74cbbb" data-linktype="relative-path">library request</a>.</p><p><b>dwOrderNumber: </b> The order in the queue in
which the request will be processed. This queue MUST start with order 1.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x00000000 S_OK</td>
  <td>The call was successful.</td>
 </tr><tr>
  <td>0x80070005 ERROR_ACCESS_DENIED</td>
  <td>NTMS_CONTROL_ACCESS to the library is denied; other security errors are possible but indicate a security subsystem error.</td>
 </tr><tr>
  <td>0x80070008 ERROR_NOT_ENOUGH_MEMORY</td>
  <td>An allocation failure occurred during processing.</td>
 </tr><tr>
  <td>0x80070057 ERROR_INVALID_PARAMETER</td>
  <td>The library or operation identifiers are missing.</td>
 </tr><tr>
  <td>0x800710D9 ERROR_DATABASE_FAILURE</td>
  <td>The database is inaccessible or damaged.</td>
 </tr></tbody></table>
</dd></dl><p>Upon receiving this message, the server MUST verify that <i>lpRequestId</i>
is not NULL, and dwOrderNumber is valid. If parameter validation fails, the
server MUST immediately fail the operation and return ERROR_INVALID_PARAMETER
(0x80070057).</p><p>If parameter validation succeeds, the server MUST compose a
response to the client after verifying that the user has the required access
rights. If the client does not have the required access rights, the server MUST
return ERROR_ACCESS_DENIED (0x80070005).</p><p>The SetNtmsRequestOrder method sets the order that the
specified request will be processed in the library queue. </p><p>The server MUST maintain the request queue sorted by request
types, as specified in section <a href="1fcfe730-c093-432d-b1cb-67cd94fe87b1" data-linktype="relative-path">2.2.4.3</a>. The server MAY
select its own ordering mechanism within the same type of requests.<a id="Appendix_A_Target_22"></a><a aria-label="Product behavior note 22" href="7184b376-4ee3-4482-b9c4-f87ff22b421f#Appendix_A_22" data-linktype="relative-path">&lt;22&gt;</a></p></div>