<div class="content" name="SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA" uuid="003621fc-656f-41be-9368-324587f3904a"><p>The SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA structure<a id="Appendix_A_Target_8"></a><a aria-label="Product behavior note 8" href="041d2a89-9d7d-4f79-91a1-c336d0a668f6#Appendix_A_8" data-linktype="relative-path">&lt;8&gt;</a> contains the reason associated
with the SERVICE_CONTROL_STOP control. String values are in ANSI.</p><dl>
<dd>
<div><pre> typedef struct _SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA {
   DWORD dwReason;
   [string, range(0, SC_MAX_COMMENT_LENGTH)] 
     LPSTR pszComment;
 } SERVICE_CONTROL_STATUS_REASON_IN_PARAMSA,
  *PSERVICE_CONTROL_STATUS_REASON_IN_PARAMSA;
</pre></div>
</dd></dl><p><b>dwReason:</b>  The reason associated
with the SERVICE_CONTROL_STOP control. This member MUST be set to a combination
of one general reason code, one major reason code, and one minor reason code.</p><dl>
<dd>
<p><img id="MS-SCMR_pictab385ec8-2c8a-6af2-52ba-cf98e7479a62.png" src="ms-scmr_files/image001.png" data-linktype="relative-path"/></p>
</dd>
<dd>
<p>The following are the general
reason codes.</p>
</dd>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>SERVICE_STOP_CUSTOM 0x20000000</td>
  <td>The reason code is defined by the user. If this flag is not present, the reason code is defined by the system. If this flag is specified with a system reason code, the function call fails. Users can create custom major reason codes in the range SERVICE_STOP_REASON_MAJOR_MIN_CUSTOM (0x00400000) through SERVICE_STOP_REASON_MAJOR_MAX_CUSTOM (0x00ff0000) and minor reason codes in the range SERVICE_STOP_REASON_MINOR_MIN_CUSTOM (0x00000100) through SERVICE_STOP_REASON_MINOR_MAX_CUSTOM (0x0000FFFF).</td>
 </tr><tr>
  <td>SERVICE_STOP_PLANNED 0x40000000</td>
  <td>The service stop was planned.</td>
 </tr><tr>
  <td>SERVICE_STOP_UNPLANNED 0x10000000</td>
  <td>The service stop was not planned.</td>
 </tr></tbody></table>
</dd>
<dd>
<p>The following are the major reason
codes.</p>
</dd>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>SERVICE_STOP_REASON_MAJOR_APPLICATION 0x00050000</td>
  <td>Application issue</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MAJOR_HARDWARE 0x00020000</td>
  <td>Hardware issue</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MAJOR_NONE 0x00060000</td>
  <td>No major reason</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MAJOR_OPERATINGSYSTEM 0x00030000</td>
  <td>Operating system issue</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MAJOR_OTHER 0x00010000</td>
  <td>Other issue</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MAJOR_SOFTWARE 0x00040000</td>
  <td>Software issue</td>
 </tr></tbody></table>
</dd>
<dd>
<p>The following are the minor reason
codes.</p>
</dd>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>SERVICE_STOP_REASON_MINOR_DISK 0x00000008</td>
  <td>Disk</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_ENVIRONMENT 0x0000000a</td>
  <td>Environment</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_HARDWARE_DRIVER 0x0000000b</td>
  <td>Driver</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_HUNG 0x00000006</td>
  <td>Unresponsive</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_INSTALLATION 0x00000003</td>
  <td>Installation</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_MAINTENANCE 0x00000002</td>
  <td>Maintenance</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_MMC 0x00000016</td>
  <td>MMC issue</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_NETWORK_CONNECTIVITY 0x00000011</td>
  <td>Network connectivity</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_NETWORKCARD 0x00000009</td>
  <td>Network card</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_NONE 0x00000017</td>
  <td>No minor reason</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_OTHER 0x00000001</td>
  <td>Other issue</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_OTHERDRIVER 0x0000000c</td>
  <td>Other driver event</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_RECONFIG 0x00000005</td>
  <td>Reconfigure</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_SECURITY 0x00000010</td>
  <td>Security issue</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_SECURITYFIX 0x0000000f</td>
  <td>Security update</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_SECURITYFIX_UNINSTALL 0x00000015</td>
  <td>Security update uninstall</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_SERVICEPACK 0x0000000d</td>
  <td>Service pack</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_SERVICEPACK_UNINSTALL 0x00000013</td>
  <td>Service pack uninstall</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE 0x0000000e</td>
  <td>Software update</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_SOFTWARE_UPDATE_UNINSTALL 0x00000014</td>
  <td>Software update uninstall</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_UNSTABLE 0x00000007</td>
  <td>Unstable</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_UPGRADE 0x00000004</td>
  <td>Installation of software</td>
 </tr><tr>
  <td>SERVICE_STOP_REASON_MINOR_WMI 0x00000012</td>
  <td>WMI issue</td>
 </tr></tbody></table>
</dd></dl><p><b>pszComment:</b>  A pointer to a string
that specifies a comment associated with the <i>dwReason</i> parameter. String
values are in ANSI.</p></div>