[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Re: MsiGetFileHash
From: Hans Leidekker <hans () codeweavers ! com>
Date: 2012-03-29 18:24:47
Message-ID: 1333045487.6699.87.camel () t400
[Download RAW message or body]
On Thu, 2012-03-29 at 18:29 +0200, Robert van Herk wrote:
> + mapping = CreateFileMappingW( handle, NULL, PAGE_READONLY, 0, 0, NULL );
> + if (mapping)
> + {
> + p = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, length );
> + if (p)
> + {
> + MD5_CTX ctx;
> +
> + MD5Init( &ctx );
> + MD5Update( &ctx, p, length );
> + MD5Final( &ctx );
> + UnmapViewOfFile( p );
> +
> + memcpy( pHash->dwData, ctx.digest, sizeof pHash->dwData );
> + r = ERROR_SUCCESS;
> + }
> + CloseHandle( mapping );
> + }
> + } else {
> + /* Empty file -> set hash to 0 */
> + memset( pHash->dwData, 0, sizeof pHash->dwData );
> + r = ERROR_SUCCESS;
> }
> +
> CloseHandle( handle );
Please use 4 space indentation and put brackets on a new line like in the
rest of that function. Same for the test.
Please also provide a more descriptive subject line and prefix it with "msi: "
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic