Commit e84c42d9 authored by Alexandre Julliard's avatar Alexandre Julliard

version: Use the find_resource function instead of the 16-bit entry points to…

version: Use the find_resource function instead of the 16-bit entry points to load 16-bit resources.
parent e04b9984
......@@ -30,6 +30,7 @@
#include "winbase.h"
#include "winver.h"
#include "winternl.h"
#include "lzexpand.h"
#include "wine/winuser16.h"
#include "wine/unicode.h"
#include "winerror.h"
......@@ -37,6 +38,8 @@
WINE_DEFAULT_DEBUG_CHANNEL(ver);
extern DWORD find_resource( HFILE lzfd, LPCSTR type, LPCSTR id, DWORD *reslen, DWORD *offset );
/******************************************************************************
*
* This function will print via standard TRACE, debug info regarding
......@@ -344,23 +347,30 @@ static DWORD VERSION_GetFileVersionInfo_16( LPCSTR filename, DWORD datasize, LPV
}
/* first try without loading a 16-bit module */
if (is_builtin)
len = 0;
else
len = GetFileResourceSize16( filename,
MAKEINTRESOURCEA(VS_FILE_INFO),
MAKEINTRESOURCEA(VS_VERSION_INFO),
&offset );
if (len)
{
if (!data) return len;
len = GetFileResource16( filename,
MAKEINTRESOURCEA(VS_FILE_INFO),
MAKEINTRESOURCEA(VS_VERSION_INFO),
offset, datasize, data );
len = 0;
if (!is_builtin)
{
OFSTRUCT ofs;
HFILE lzfd = LZOpenFileA( (LPSTR)filename, &ofs, OF_READ );
if (lzfd >= 0)
{
if (find_resource( lzfd, MAKEINTRESOURCEA(VS_FILE_INFO), MAKEINTRESOURCEA(VS_VERSION_INFO),
&len, &offset ))
{
if (data)
{
LZSeek( lzfd, offset, 0 /* SEEK_SET */ );
len = LZRead( lzfd, data, min( len, datasize ) );
}
}
LZClose( lzfd );
}
if (len)
{
if (!data) return len;
vffi = (VS_FIXEDFILEINFO *)VersionInfo16_Value( (VS_VERSION_INFO_STRUCT16 *)data );
if ( vffi->dwSignature == VS_FFI_SIGNATURE )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment