﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
3589	GDIPlus.au3 contains unecessary string conversions	Imp		"_GDIPlus_Encoders may be rewritten without using _WinAPI_WideCharsToMultibyte()

{{{
Func _GDIPlus_Encoders()
    Local $iCount = _GDIPlus_EncodersGetCount()
    Local $iSize = _GDIPlus_EncodersGetSize()
    Local $tBuffer = DllStructCreate(""byte["" & $iSize & ""]"")
    Local $aResult = DllCall($__g_hGDIPDll, ""int"", ""GdipGetImageEncoders"", ""uint"", $iCount, ""uint"", $iSize, ""struct*"", $tBuffer)
    If @error Then Return SetError(@error, @extended, 0)
    If $aResult[0] Then Return SetError(10, $aResult[0], 0)

    Local $pBuffer = DllStructGetPtr($tBuffer)
    Local $tCodec, $aInfo[$iCount + 1][14]
    $aInfo[0][0] = $iCount
    For $iI = 1 To $iCount
        $tCodec = DllStructCreate($tagGDIPIMAGECODECINFO, $pBuffer)
        $aInfo[$iI][1] = _WinAPI_StringFromGUID(DllStructGetPtr($tCodec, ""CLSID""))
        $aInfo[$iI][2] = _WinAPI_StringFromGUID(DllStructGetPtr($tCodec, ""FormatID""))
        $aInfo[$iI][3] = DllStructGetData( DllStructCreate( ""wchar[128]"", DllStructGetData($tCodec, ""CodecName"")), 1 )
        $aInfo[$iI][4] = DllStructGetData( DllStructCreate( ""wchar[128]"", DllStructGetData($tCodec, ""DllName"")), 1 )
        $aInfo[$iI][5] = DllStructGetData( DllStructCreate( ""wchar[128]"", DllStructGetData($tCodec, ""FormatDesc"")), 1 )
        $aInfo[$iI][6] = DllStructGetData( DllStructCreate( ""wchar[128]"", DllStructGetData($tCodec, ""FileExt"")), 1 )
        $aInfo[$iI][7] = DllStructGetData( DllStructCreate( ""wchar[128]"", DllStructGetData($tCodec, ""MimeType"")), 1 )
        $aInfo[$iI][8] = DllStructGetData($tCodec, ""Flags"")
        $aInfo[$iI][9] = DllStructGetData($tCodec, ""Version"")
        $aInfo[$iI][10] = DllStructGetData($tCodec, ""SigCount"")
        $aInfo[$iI][11] = DllStructGetData($tCodec, ""SigSize"")
        $aInfo[$iI][12] = DllStructGetData($tCodec, ""SigPattern"")
        $aInfo[$iI][13] = DllStructGetData($tCodec, ""SigMask"")
        $pBuffer += DllStructGetSize($tCodec)
    Next
    Return $aInfo
EndFunc   ;==>_GDIPlus_Encoders
}}}

And _GDIPlus_Decoders():


{{{
Func _GDIPlus_Decoders()
    Local $iCount = _GDIPlus_DecodersGetCount()
    Local $iSize = _GDIPlus_DecodersGetSize()
    Local $tBuffer = DllStructCreate(""byte["" & $iSize & ""]"")
    Local $aResult = DllCall($__g_hGDIPDll, ""int"", ""GdipGetImageDecoders"", ""uint"", $iCount, ""uint"", $iSize, ""struct*"", $tBuffer)
    If @error Then Return SetError(@error, @extended, 0)
    If $aResult[0] Then Return SetError(10, $aResult[0], 0)

    Local $pBuffer = DllStructGetPtr($tBuffer)
    Local $tCodec, $aInfo[$iCount + 1][14]
    $aInfo[0][0] = $iCount
    For $iI = 1 To $iCount
        $tCodec = DllStructCreate($tagGDIPIMAGECODECINFO, $pBuffer)
        $aInfo[$iI][1] = _WinAPI_StringFromGUID(DllStructGetPtr($tCodec, ""CLSID""))
        $aInfo[$iI][2] = _WinAPI_StringFromGUID(DllStructGetPtr($tCodec, ""FormatID""))
        $aInfo[$iI][3] = DllStructGetData( DllStructCreate( ""wchar[128]"", DllStructGetData($tCodec, ""CodecName"")), 1 )
        $aInfo[$iI][4] = DllStructGetData( DllStructCreate( ""wchar[128]"", DllStructGetData($tCodec, ""DllName"")), 1 )
        $aInfo[$iI][5] = DllStructGetData( DllStructCreate( ""wchar[128]"", DllStructGetData($tCodec, ""FormatDesc"")), 1 )
        $aInfo[$iI][6] = DllStructGetData( DllStructCreate( ""wchar[128]"", DllStructGetData($tCodec, ""FileExt"")), 1 )
        $aInfo[$iI][7] = DllStructGetData( DllStructCreate( ""wchar[128]"", DllStructGetData($tCodec, ""MimeType"")), 1 )
        $aInfo[$iI][8] = DllStructGetData($tCodec, ""Flags"")
        $aInfo[$iI][9] = DllStructGetData($tCodec, ""Version"")
        $aInfo[$iI][10] = DllStructGetData($tCodec, ""SigCount"")
        $aInfo[$iI][11] = DllStructGetData($tCodec, ""SigSize"")
        $aInfo[$iI][12] = DllStructGetData($tCodec, ""SigPattern"")
        $aInfo[$iI][13] = DllStructGetData($tCodec, ""SigMask"")
        $pBuffer += DllStructGetSize($tCodec)
    Next
    Return $aInfo
EndFunc   ;==>_GDIPlus_Decoders
}}}

Also #include ""WinAPIConv.au3"" may be removed from top of file."	Bug	closed		AutoIt	3.3.14.3	None	No Bug		
