The function was not properly accessing the Arguments list when the
FORMAT_MESSAGE_ARGUMENT_ARRAY flag was set. The va_list on Linux is
a struct with four members, so indexing Arguments array without
casting it first to a WCHAR** gets completely wrong results.
if ( !bIsVaList )
{
- lpInsertString = (LPWSTR)Arguments[ Index - 1 ];
+ lpInsertString = ((LPWSTR*)Arguments)[ Index - 1 ];
}
else
{
if ( !bIsVaList )
{
- lpInsert = (LPWSTR)Arguments[ Index - 1 ];
+ lpInsert = ((LPWSTR*)Arguments)[Index - 1];
}
else
{