[2/2] Try2: imagehlp: Implement ImageGetDigestStream

Paul Vriens paul.vriens.wine at gmail.com
Sat Jul 31 15:49:48 CDT 2010


Hi Andrey,

On 07/18/2010 12:39 PM, Andrey Turkin wrote:
> +static BOOL IMAGEHLP_ReportImportSection( IMAGE_SECTION_HEADER *hdr,
> +    DWORD num_sections, BYTE *map, DWORD fileSize, DWORD DigestLevel,
> +    DIGEST_FUNCTION DigestFunction, DIGEST_HANDLE DigestHandle )
> +{
> +    BOOL ret = FALSE;
> +    DWORD offset, size, base;
> +    PBYTE import;

import is defined here but not used any further down the line.

> +
> +    /* Get import data */
> +    offset = IMAGEHLP_GetSectionOffset( hdr, num_sections, ".idata",&size,
> +&base );
> +    if( !offset )
> +        return FALSE;
> +
> +    /* If CERT_PE_IMAGE_DIGEST_ALL_IMPORT_INFO is set, the entire
> +     * section is reported.  Otherwise, the debug info section is
> +     * decoded and reported piecemeal.  See tests.  However, I haven't been
> +     * able to figure out how the native implementation decides which values
> +     * to report.  Either it's buggy or my understanding is flawed.
> +     */
> +    if( DigestLevel&  CERT_PE_IMAGE_DIGEST_ALL_IMPORT_INFO )
> +        ret = IMAGEHLP_ReportSectionFromOffset( offset, size, map, fileSize,
> +                DigestFunction, DigestHandle );
> +    else
> +    {
> +        FIXME("not supported except for CERT_PE_IMAGE_DIGEST_ALL_IMPORT_INFO\n");
> +        SetLastError(ERROR_INVALID_PARAMETER);
> +        ret = FALSE;
> +    }
> +    HeapFree( GetProcessHeap(), 0, import );

Only freed.

Can 'import' be removed? Coverity complained.

-- 
Cheers,

Paul.



More information about the wine-devel mailing list