// NativeLib DLL (for DotNetHelpers) | C+- (SysRoutine) | Author: Sergei Y.Kitáev
#include "Precompiled.h"
#include "SharedIncludes.h"
namespace NativeLib {
//==================================================================================================

bool NLFailure::SetErrorFmt($A, PCWSTR messageFmt, ... )
{
   $VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   bool rslt = SetErrorFmtVA($ci, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return rslt;
}
bool NLFailure::SetErrorFmt($A, INT code $optional,
                                PCWSTR messageFmt, ... ) $ret_false
{
   $VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   bool rslt = SetErrorFmtVA($ci, code, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return rslt;
}
bool NLFailure::SetErrorFmt($A, UINT uCode $optional,
                                PCWSTR messageFmt, ... ) $ret_false
{
   $VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   bool rslt = SetErrorFmtVA($ci, uCode, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return rslt;
}
bool NLFailure::SetErrorFmt($A, INT code $optional, DWORD value $optional,
                                PCWSTR messageFmt, ... ) $ret_false
{
   $VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   bool rslt = SetErrorFmtVA($ci, code, value, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return rslt;
}
bool NLFailure::SetErrorFmt($A, UINT uCode $optional, DWORD value $optional,
                                PCWSTR messageFmt, ... ) $ret_false
{
   $VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   bool rslt = SetErrorFmtVA($ci, uCode, value, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return rslt;
}

//--------------------------------------------------------------------------------------------------

bool NLFailure::SetErrorFmt($A, NLErrorCat category $optional,
                                PCWSTR messageFmt, ... ) $ret_false
{
   $VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   bool rslt = SetErrorFmtVA($ci, category, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return rslt;
}
bool NLFailure::SetErrorFmt($A, NLErrorCat category $optional, INT code $optional,
                                PCWSTR messageFmt, ... ) $ret_false
{
   $VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   bool rslt = SetErrorFmtVA($ci, category, code, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return rslt;
}
bool NLFailure::SetErrorFmt($A, NLErrorCat category $optional, UINT uCode $optional,
                                PCWSTR messageFmt, ... ) $ret_false
{
   $VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   bool rslt = SetErrorFmtVA($ci, category, uCode, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return rslt;
}
bool NLFailure::SetErrorFmt($A, NLErrorCat category $optional,
                                INT code $optional, DWORD value $optional,
                                PCWSTR messageFmt, ... ) $ret_false
{
   $VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   bool rslt = SetErrorFmtVA($ci, category, code, value, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return rslt;
}
bool NLFailure::SetErrorFmt($A, NLErrorCat category $optional,
                                UINT uCode $optional, DWORD value $optional,
                                PCWSTR messageFmt, ... ) $ret_false
{
   $VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   bool rslt = SetErrorFmtVA($ci, category, uCode, value, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return rslt;
}

//==================================================================================================

bool NLFailure::SetArgumentErrorFmt($A, PCWSTR messageFmt, ... ) $ret_false
{
   $VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   bool rslt = SetArgumentErrorFmtVA($ci, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return rslt;
}

//--------------------------------------------------------------------------------------------------

bool NLFailure::SetSpecialErrorFmt($A, PCWSTR messageFmt, ... )
{
   $VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   bool rslt = SetSpecialErrorFmtVA($ci, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return rslt;
}
bool NLFailure::SetSpecialErrorFmt($A, INT code $optional,
                                       PCWSTR messageFmt, ... ) $ret_false
{
   $VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   bool rslt = SetSpecialErrorFmtVA($ci, code, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return rslt;
}
bool NLFailure::SetSpecialErrorFmt($A, UINT uCode $optional,
                                       PCWSTR messageFmt, ... ) $ret_false
{
   $VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   bool rslt = SetSpecialErrorFmtVA($ci, uCode, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return rslt;
}
bool NLFailure::SetSpecialErrorFmt($A, INT code $optional, DWORD value $optional,
                                       PCWSTR messageFmt, ... ) $ret_false
{
   $VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   bool rslt = SetSpecialErrorFmtVA($ci, code, value, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return rslt;
}
bool NLFailure::SetSpecialErrorFmt($A, UINT uCode $optional, DWORD value $optional,
                                       PCWSTR messageFmt, ... ) $ret_false
{
   $VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   bool rslt = SetSpecialErrorFmtVA($ci, uCode, value, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return rslt;
}

//--------------------------------------------------------------------------------------------------

bool NLFailure::SetSystemErrorFmt($A, PCWSTR messageFmt, ... ) $ret_false
{
   $VERIFY_POINTER_ARG( messageFmt );
   va_list argList;
   bool rslt = SetSystemErrorFmtVA($ci, $VA_COMPLEMENT( messageFmt, argList ) );
   va_end( argList );
   return rslt;
}

bool NLFailure::SetWin32ErrorFmt($A, DWORD dwError, PCWSTR headerMessageFmt, ... ) $ret_false
{
   $VERIFY_POINTER_ARG( headerMessageFmt );
   va_list argList;
   bool rslt = SetWin32ErrorFmtVA($ci, dwError, $VA_COMPLEMENT( headerMessageFmt, argList ) );
   va_end( argList );
   return rslt;
}

bool NLFailure::SetCOMErrorFmt($A, HRESULT hResult, PCWSTR headerMessageFmt, ... ) $ret_false
{
   $VERIFY_POINTER_ARG( headerMessageFmt );
   va_list argList;
   bool rslt = SetCOMErrorFmtVA($ci, hResult, $VA_COMPLEMENT( headerMessageFmt, argList ) );
   va_end( argList );
   return rslt;
}

bool NLFailure::SetFromLastRTErrorFmt($A, PCWSTR headerMessageFmt, ... ) $ret_false
{
   $VERIFY_POINTER_ARG( headerMessageFmt );
   va_list argList;
   bool rslt = SetFromLastRTErrorFmtVA($ci, $VA_COMPLEMENT( headerMessageFmt, argList ) );
   va_end( argList );
   return rslt;
}

//==================================================================================================
} // NativeLib
