Compartilhar via


PREfast Warning 380 (Windows CE 5.0)

Send Feedback

380 - Legacy shutdown API <function> used.

This warning indicates that a legacy shutdown API has been used.

The legacy shutdown APIs include:

  • InitiateSystemShutdown
  • ExitWindowsEx
  • WTSShutdownSystem

It is desirable to minimize the number of shutdowns or restart required; however, if a shutdown or restart is required, use InitiateSystemShutdownEx.

Example

Defective Source

bRet = ExitWindowsEx(EWX_REBOOT,           // Shutdown operation   
   SHTDN_REASON_MAJOR_OPERATINGSYSTEM);    // Shutdown reason

Corrected Source

bRet = InitiateSystemShutdownEx(lpMachineName, // computer name
   lpMessage,    // message to display
   0,            // length of time to display
   FALSE,        // force closed option
   TRUE,         // restart option
   SHTDN_REASON_MAJOR_OPERATINGSYSTEM);    // shutdown reason

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.