title: How to know if native method is safe / unsafe?
body: <p>I implement this function : <a href="http://msdn.microsoft.com/en-us/library/ms955703.aspx" rel="noreferrer">GetSystemPowerStatusEx</a> &amp; <a href="http://msdn.microsoft.com/en-us/library/ms955711.aspx" rel="noreferrer">GetSystemPowerStatusEx2</a></p>
  
  <p>according to this article on <a href="http://msdn.microsoft.com/en-us/library/ms182161.aspx" rel="noreferrer">MSDN</a>, I should create a class named according to the functions I will use, but my question is : How can I know in which class I should put GetSystemPowerStatusEx &amp; GetSystemPowerStatusEx2 ?</p>
  
  <p>I'm lost...</p>
  
  <p>Thanks for help.</p>
  
  <p><strong>[EDIT]</strong> My question is : which of these three class names are the good one for me (NativeMethods / SafeNativeMethods / UnsafeNativeMethods) ?</p>
  
  <blockquote>
    <p>These methods should be in one of the following classes:</p>
    
    <p>NativeMethods - This class does not
    suppress stack walks for unmanaged
    code permission.
    (System.Security.SuppressUnmanagedCodeSecurityAttribute
    must not be applied to this class.)
    This class is for methods that can be
    used anywhere because a stack walk
    will be performed.</p>
    
    <p>SafeNativeMethods - This class
    suppresses stack walks for unmanaged
    code permission.
    (System.Security.SuppressUnmanagedCodeSecurityAttribute
    is applied to this class.) This class
    is for methods that are safe for
    anyone to call. Callers of these
    methods are not required to perform a
    full security review to make sure that
    the usage is secure because the
    methods are harmless for any caller.</p>
    
    <p>UnsafeNativeMethods - This class
    suppresses stack walks for unmanaged
    code permission.
    (System.Security.SuppressUnmanagedCodeSecurityAttribute
    is applied to this class.) This class
    is for methods that are potentially
    dangerous. Any caller of these methods
    must perform a full security review to
    make sure that the usage is secure
    because no stack walk will be
    performed.</p>
  </blockquote>