//**************************************************************************************************
//
// WIN32 ERROR MANIPULATION (TYPES):
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// RuntimeForStatic base library | C+- (SysRoutine) | Author: Sergei Y.Kitáev
#pragma once
#include "include_restrictions.h"
namespace RuntimeForStatic {

//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
//
// "$Win32Error" STATIC CLASS:
//
//==================================================================================================
class $Win32Error
{
$STATIC_CLASS( $Win32Error )
public:
   //static const DWORD UnknownError = $WIN32_ERROR_UNKNOWN; // ((DWORD)-1) // 0xFFFFFFFF
public:
   static $DynText GetErrorMessage( DWORD dwError ) $requires_rt_init $tenacious;
   static bool GetErrorMessage($A, DWORD dwError, $DynText& errorMessage $out ) $last_error;
   static bool GetErrorMessage($A, DWORD dwError, $DynText& errorMessage $out,
                                   bool& isMIDNotFoundError $out ) $last_error;
   static $DynText GetLastErrorMessage() $requires_rt_init $tenacious;
public:
   static $DynText GetErrorMessageOrNull($A, DWORD dwError, $DynText& errorMessage $out,
                                             bool& isMIDNotFoundError $out ) $null_on_success;
   static $DynText GetLastErrorMessageOrNull() $null_on_success;
/*
public:
   static bool IsUnknown(DWORD dwError);
   static bool IsLastSysErrorUnknown();
*/
public:
   static bool SetLastSysError(DWORD dwError) $ret_false;
   //static bool SetLastSysErrorUnknown() $ret_false;
   static bool ResetLastSysError() $ret_true;
}; // $Win32Error
//==================================================================================================

} // RuntimeForStatic
