<div class="content"><p>The RQueryServiceConfig2W <a id="Appendix_A_Target_64"></a><a aria-label="Product behavior note 64" href="041d2a89-9d7d-4f79-91a1-c336d0a668f6#Appendix_A_64" data-linktype="relative-path">&lt;64&gt;</a> method
returns the optional configuration parameters of the specified service based on
the specified information level.</p><dl>
<dd>
<div><pre> DWORD RQueryServiceConfig2W(
   [in] SC_RPC_HANDLE hService,
   [in] DWORD dwInfoLevel,
   [out, size_is(cbBufSize)] LPBYTE lpBuffer,
   [in, range(0, 1024*8)] DWORD cbBufSize,
   [out] LPBOUNDED_DWORD_8K pcbBytesNeeded
 );
</pre></div>
</dd></dl><p><b>hService: </b>An <a href="b5f0a0a8-887c-4097-af1c-71ef9f214ce4" data-linktype="relative-path">SC_RPC_HANDLE (section 2.2.4)</a>
data type that defines the handle to the <a href="4f66d32e-2f4f-4482-998e-e5ccbb445223#gt_1fbb7936-8437-4e3d-b62f-47df3be07721" data-linktype="relative-path">service record</a> that MUST
have been created previously, using one of the open methods specified in
section <a href="0d7a7011-9f41-470d-ad52-8535b47ac282" data-linktype="relative-path">3.1.4</a>. The
SERVICE_QUERY_CONFIG access right MUST have been granted to the caller when the
<a href="4f66d32e-2f4f-4482-998e-e5ccbb445223#gt_9dfe84e3-a772-4ad1-9a25-1255c1dc0f84" data-linktype="relative-path">RPC context handle</a> to
the service record was created.</p><table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>SERVICE_CONFIG_DESCRIPTION</p>
  <p>0x00000001</p>
  </td>
  <td>
  <p>The <i>lpBuffer</i> parameter is a pointer to a <a href="90b40ea4-c24f-42a2-8150-3b5173bfc90a" data-linktype="relative-path">SERVICE_DESCRIPTION_WOW64 (section 2.2.36)</a>
  structure.</p>
  </td>
 </tr><tr>
  <td>
  <p>SERVICE_CONFIG_FAILURE_ACTIONS</p>
  <p>0x00000002</p>
  </td>
  <td>
  <p>The <i>lpBuffer</i> parameter is a pointer to a <a href="9489030e-dd82-49db-8505-b3d72c6a9271" data-linktype="relative-path">SERVICE_FAILURE_ACTIONS_WOW64 (section 2.2.37)</a>
  structure.</p>
  </td>
 </tr><tr>
  <td>
  <p>SERVICE_CONFIG_DELAYED_AUTO_START_INFO</p>
  <p>0x00000003<a id="Appendix_A_Target_65"></a><a aria-label="Product behavior note 65" href="041d2a89-9d7d-4f79-91a1-c336d0a668f6#Appendix_A_65" data-linktype="relative-path">&lt;65&gt;</a></p>
  </td>
  <td>
  <p>The <i>lpBuffer</i> parameter is a pointer to a <a href="805b8296-863d-4d1e-8ae8-f639adf8c6cb" data-linktype="relative-path">SERVICE_DELAYED_AUTO_START_INFO</a>
  structure.</p>
  </td>
 </tr><tr>
  <td>
  <p>SERVICE_CONFIG_FAILURE_ACTIONS_FLAG</p>
  <p>0x00000004<a id="Appendix_A_Target_66"></a><a aria-label="Product behavior note 66" href="041d2a89-9d7d-4f79-91a1-c336d0a668f6#Appendix_A_66" data-linktype="relative-path">&lt;66&gt;</a></p>
  </td>
  <td>
  <p>The <i>lpBuffer</i> parameter is a pointer to a <a href="9b244e2e-82fc-4c54-8f4f-b19034faa2c4" data-linktype="relative-path">SERVICE_FAILURE_ACTIONS_FLAG</a>
  structure.</p>
  </td>
 </tr><tr>
  <td>
  <p>SERVICE_CONFIG_SERVICE_SID_INFO</p>
  <p>0x00000005<a id="Appendix_A_Target_67"></a><a aria-label="Product behavior note 67" href="041d2a89-9d7d-4f79-91a1-c336d0a668f6#Appendix_A_67" data-linktype="relative-path">&lt;67&gt;</a></p>
  </td>
  <td>
  <p>The <i>lpBuffer</i> parameter is a pointer to a <a href="ea1a9acd-4bb2-473f-ae5b-55969c5960fc" data-linktype="relative-path">SERVICE_SID_INFO</a>
  structure.</p>
  </td>
 </tr><tr>
  <td>
  <p>SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO</p>
  <p>0x00000006<a id="Appendix_A_Target_68"></a><a aria-label="Product behavior note 68" href="041d2a89-9d7d-4f79-91a1-c336d0a668f6#Appendix_A_68" data-linktype="relative-path">&lt;68&gt;</a></p>
  </td>
  <td>
  <p>The <i>lpBuffer</i> parameter is a pointer to a <a href="99ecc0e7-b2d1-466c-8e22-7f2b71786ff6" data-linktype="relative-path">SERVICE_REQUIRED_PRIVILEGES_INFO_WOW64 (section 2.2.38)</a>
  structure.</p>
  </td>
 </tr><tr>
  <td>
  <p>SERVICE_CONFIG_PRESHUTDOWN_INFO</p>
  <p>0x00000007<a id="Appendix_A_Target_69"></a><a aria-label="Product behavior note 69" href="041d2a89-9d7d-4f79-91a1-c336d0a668f6#Appendix_A_69" data-linktype="relative-path">&lt;69&gt;</a></p>
  </td>
  <td>
  <p>The <i>lpBuffer</i> parameter is a pointer to a <a href="6b55ad95-df3e-498f-b107-e77f831ba467" data-linktype="relative-path">SERVICE_PRESHUTDOWN_INFO</a>
  structure.</p>
  </td>
 </tr><tr>
  <td>
  <p>SERVICE_CONFIG_PREFERRED_NODE</p>
  <p>0x00000009<a id="Appendix_A_Target_70"></a><a aria-label="Product behavior note 70" href="041d2a89-9d7d-4f79-91a1-c336d0a668f6#Appendix_A_70" data-linktype="relative-path">&lt;70&gt;</a></p>
  </td>
  <td>
  <p>The <i>lpBuffer</i> parameter is a pointer to a <a href="3767259f-f054-4076-acd3-9f7ecb79cab3" data-linktype="relative-path">SERVICE_PREFERRED_NODE_INFO</a>
  structure.<a id="Appendix_A_Target_71"></a><a aria-label="Product behavior note 71" href="041d2a89-9d7d-4f79-91a1-c336d0a668f6#Appendix_A_71" data-linktype="relative-path">&lt;71&gt;</a></p>
  </td>
 </tr></tbody></table><p><b>dwInfoLevel: </b>A value that specifies the
configuration information to query. This MUST be one of the following values.</p><p><b>lpBuffer: </b>A pointer to the buffer that
contains the service configuration information. The format of this data depends
on the value of the <i>dwInfoLevel</i> parameter.</p><dl>
<dd>
<p>When <i>dwInfoLevel</i> is
SERVICE_CONFIG_DESCRIPTION, or SERVICE_CONFIG_FAILURE_ACTIONS or
SERVICE_CONFIG_REQUIRED_PRIVILEGES_INFO, the server returns an <i>lpBuffer</i>
parameter that has the requested data and the offset to the start of the data
from the top of the buffer. The API converts the offset into pointers that it
returns to the caller by means of the <i>lpBuffer</i> parameter.</p>
</dd></dl><p><b>cbBufSize: </b>The size, in bytes, of the <i>lpBuffer</i>
parameter.</p><p><b>pcbBytesNeeded: </b>An <a href="1720ed6e-d907-41c6-8d98-fb6e4877d761" data-linktype="relative-path">LPBOUNDED_DWORD_8K (section 2.2.8)</a>
data type that defines the pointer to a variable that receives the number of
bytes needed to return the configuration information.</p><p><b>Return Values: </b>The method returns 0x00000000
(ERROR_SUCCESS) on success; otherwise, it returns one of the following error
codes.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>0x00000005</p>
  <p>ERROR_ACCESS_DENIED</p>
  </td>
  <td>
  <p>The SERVICE_QUERY_CONFIG access right had not been
  granted to the caller when the RPC context handle to the service record was
  created. </p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000006</p>
  <p>ERROR_INVALID_HANDLE</p>
  </td>
  <td>
  <p>The handle is no longer valid.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000087</p>
  <p>ERROR_INVALID_PARAMETER</p>
  </td>
  <td>
  <p>A parameter that was specified is invalid.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000122</p>
  <p>ERROR_INSUFFICIENT_BUFFER</p>
  </td>
  <td>
  <p>The data area passed to a system call is too small.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000124</p>
  <p>ERROR_INVALID_LEVEL</p>
  </td>
  <td>
  <p>The <i>dwInfoLevel</i> parameter contains an
  unsupported value.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00001115</p>
  <p>ERROR_SHUTDOWN_IN_PROGRESS</p>
  </td>
  <td>
  <p>The system is shutting down.</p>
  </td>
 </tr></tbody></table>
</dd></dl><p>In response to this request from the client, for a
successful operation the server MUST query the specific configuration
information stored in the <a href="4f66d32e-2f4f-4482-998e-e5ccbb445223#gt_afc3f782-a908-486d-9c05-8a054cd9cc84" data-linktype="relative-path">SCM</a>
database associated with the service record identified by the <i>hService</i>
parameter, using the information level and the corresponding values associated
with that information level as specified in the <i>dwInfoLevel</i> parameter of
the client request. The server MUST return this configuration data by setting
the <i>lpBuffer</i> parameter with the appropriate structure filled with the
configuration data based on <i>dwInfoLevel</i>.</p><p>The server MUST set the required buffer size in the <i>pcbBytesNeeded</i>
parameter.</p><p>If the buffer pointed to by <i>lpBuffer</i> is insufficient
to hold all the configuration data, the server MUST fail the call with
ERROR_INSUFFICIENT_BUFFER (122).</p><p>The server MUST return ERROR_INVALID_PARAMETER (87) if
either or both <i>lpBuffer</i> and <i>pcbBytesNeeded</i> are NULL.<a id="Appendix_A_Target_72"></a><a aria-label="Product behavior note 72" href="041d2a89-9d7d-4f79-91a1-c336d0a668f6#Appendix_A_72" data-linktype="relative-path">&lt;72&gt;</a></p></div>