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: "
participants (1)
-
Hans Leidekker