1999-01-31 11:11:54 +01:00
|
|
|
/*
|
|
|
|
* Implementation of VERSION.DLL - Version Info access
|
|
|
|
*
|
|
|
|
* Copyright 1996,1997 Marcus Meissner
|
|
|
|
* Copyright 1997 David Cuthbert
|
|
|
|
* Copyright 1999 Ulrich Weigand
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
1999-02-17 14:51:06 +01:00
|
|
|
#include "winreg.h"
|
|
|
|
#include "winver.h"
|
2000-10-23 03:38:29 +02:00
|
|
|
#include "wine/winuser16.h"
|
2000-06-13 03:10:29 +02:00
|
|
|
#include "wine/unicode.h"
|
1999-01-31 11:11:54 +01:00
|
|
|
#include "winerror.h"
|
1999-05-14 10:17:14 +02:00
|
|
|
#include "debugtools.h"
|
1999-01-31 11:11:54 +01:00
|
|
|
|
2000-08-14 16:41:19 +02:00
|
|
|
DEFAULT_DEBUG_CHANNEL(ver);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
1999-01-31 11:11:54 +01:00
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* This function will print via dprintf[_]ver to stddeb debug info regarding
|
|
|
|
* the file info structure vffi.
|
|
|
|
* 15-Feb-1998 Dimitrie Paun (dimi@cs.toronto.edu)
|
|
|
|
* Added this function to clean up the code.
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
static void print_vffi_debug(VS_FIXEDFILEINFO *vffi)
|
|
|
|
{
|
1999-05-14 10:17:14 +02:00
|
|
|
TRACE(" structversion=%u.%u, fileversion=%u.%u.%u.%u, productversion=%u.%u.%u.%u, flagmask=0x%lx, flags=%s%s%s%s%s%s\n",
|
1999-01-31 11:11:54 +01:00
|
|
|
HIWORD(vffi->dwStrucVersion),LOWORD(vffi->dwStrucVersion),
|
|
|
|
HIWORD(vffi->dwFileVersionMS),LOWORD(vffi->dwFileVersionMS),
|
|
|
|
HIWORD(vffi->dwFileVersionLS),LOWORD(vffi->dwFileVersionLS),
|
|
|
|
HIWORD(vffi->dwProductVersionMS),LOWORD(vffi->dwProductVersionMS),
|
|
|
|
HIWORD(vffi->dwProductVersionLS),LOWORD(vffi->dwProductVersionLS),
|
|
|
|
vffi->dwFileFlagsMask,
|
|
|
|
(vffi->dwFileFlags & VS_FF_DEBUG) ? "DEBUG," : "",
|
|
|
|
(vffi->dwFileFlags & VS_FF_PRERELEASE) ? "PRERELEASE," : "",
|
|
|
|
(vffi->dwFileFlags & VS_FF_PATCHED) ? "PATCHED," : "",
|
|
|
|
(vffi->dwFileFlags & VS_FF_PRIVATEBUILD) ? "PRIVATEBUILD," : "",
|
|
|
|
(vffi->dwFileFlags & VS_FF_INFOINFERRED) ? "INFOINFERRED," : "",
|
|
|
|
(vffi->dwFileFlags & VS_FF_SPECIALBUILD) ? "SPECIALBUILD," : ""
|
|
|
|
);
|
|
|
|
|
1999-08-04 14:22:42 +02:00
|
|
|
TRACE("(");
|
|
|
|
DPRINTF(" OS=0x%x.0x%x ",
|
1999-01-31 11:11:54 +01:00
|
|
|
HIWORD(vffi->dwFileOS),
|
|
|
|
LOWORD(vffi->dwFileOS)
|
|
|
|
);
|
|
|
|
switch (vffi->dwFileOS&0xFFFF0000) {
|
1999-08-04 14:22:42 +02:00
|
|
|
case VOS_DOS:DPRINTF("DOS,");break;
|
|
|
|
case VOS_OS216:DPRINTF("OS/2-16,");break;
|
|
|
|
case VOS_OS232:DPRINTF("OS/2-32,");break;
|
|
|
|
case VOS_NT:DPRINTF("NT,");break;
|
1999-01-31 11:11:54 +01:00
|
|
|
case VOS_UNKNOWN:
|
|
|
|
default:
|
1999-08-04 14:22:42 +02:00
|
|
|
DPRINTF("UNKNOWN(0x%lx),",vffi->dwFileOS&0xFFFF0000);break;
|
1999-01-31 11:11:54 +01:00
|
|
|
}
|
|
|
|
switch (LOWORD(vffi->dwFileOS)) {
|
1999-08-04 14:22:42 +02:00
|
|
|
case VOS__BASE:DPRINTF("BASE");break;
|
|
|
|
case VOS__WINDOWS16:DPRINTF("WIN16");break;
|
|
|
|
case VOS__WINDOWS32:DPRINTF("WIN32");break;
|
|
|
|
case VOS__PM16:DPRINTF("PM16");break;
|
|
|
|
case VOS__PM32:DPRINTF("PM32");break;
|
|
|
|
default:DPRINTF("UNKNOWN(0x%x)",LOWORD(vffi->dwFileOS));break;
|
1999-01-31 11:11:54 +01:00
|
|
|
}
|
1999-08-04 14:22:42 +02:00
|
|
|
DPRINTF(")\n");
|
1999-01-31 11:11:54 +01:00
|
|
|
|
|
|
|
switch (vffi->dwFileType) {
|
|
|
|
default:
|
|
|
|
case VFT_UNKNOWN:
|
1999-08-04 14:22:42 +02:00
|
|
|
TRACE("filetype=Unknown(0x%lx)",vffi->dwFileType);
|
1999-01-31 11:11:54 +01:00
|
|
|
break;
|
1999-08-04 14:22:42 +02:00
|
|
|
case VFT_APP:TRACE("filetype=APP,");break;
|
|
|
|
case VFT_DLL:TRACE("filetype=DLL,");break;
|
1999-01-31 11:11:54 +01:00
|
|
|
case VFT_DRV:
|
1999-08-04 14:22:42 +02:00
|
|
|
TRACE("filetype=DRV,");
|
1999-01-31 11:11:54 +01:00
|
|
|
switch(vffi->dwFileSubtype) {
|
|
|
|
default:
|
|
|
|
case VFT2_UNKNOWN:
|
1999-08-04 14:22:42 +02:00
|
|
|
DPRINTF("UNKNOWN(0x%lx)",vffi->dwFileSubtype);
|
1999-01-31 11:11:54 +01:00
|
|
|
break;
|
|
|
|
case VFT2_DRV_PRINTER:
|
1999-08-04 14:22:42 +02:00
|
|
|
DPRINTF("PRINTER");
|
1999-01-31 11:11:54 +01:00
|
|
|
break;
|
|
|
|
case VFT2_DRV_KEYBOARD:
|
1999-08-04 14:22:42 +02:00
|
|
|
DPRINTF("KEYBOARD");
|
1999-01-31 11:11:54 +01:00
|
|
|
break;
|
|
|
|
case VFT2_DRV_LANGUAGE:
|
1999-08-04 14:22:42 +02:00
|
|
|
DPRINTF("LANGUAGE");
|
1999-01-31 11:11:54 +01:00
|
|
|
break;
|
|
|
|
case VFT2_DRV_DISPLAY:
|
1999-08-04 14:22:42 +02:00
|
|
|
DPRINTF("DISPLAY");
|
1999-01-31 11:11:54 +01:00
|
|
|
break;
|
|
|
|
case VFT2_DRV_MOUSE:
|
1999-08-04 14:22:42 +02:00
|
|
|
DPRINTF("MOUSE");
|
1999-01-31 11:11:54 +01:00
|
|
|
break;
|
|
|
|
case VFT2_DRV_NETWORK:
|
1999-08-04 14:22:42 +02:00
|
|
|
DPRINTF("NETWORK");
|
1999-01-31 11:11:54 +01:00
|
|
|
break;
|
|
|
|
case VFT2_DRV_SYSTEM:
|
1999-08-04 14:22:42 +02:00
|
|
|
DPRINTF("SYSTEM");
|
1999-01-31 11:11:54 +01:00
|
|
|
break;
|
|
|
|
case VFT2_DRV_INSTALLABLE:
|
1999-08-04 14:22:42 +02:00
|
|
|
DPRINTF("INSTALLABLE");
|
1999-01-31 11:11:54 +01:00
|
|
|
break;
|
|
|
|
case VFT2_DRV_SOUND:
|
1999-08-04 14:22:42 +02:00
|
|
|
DPRINTF("SOUND");
|
1999-01-31 11:11:54 +01:00
|
|
|
break;
|
|
|
|
case VFT2_DRV_COMM:
|
1999-08-04 14:22:42 +02:00
|
|
|
DPRINTF("COMM");
|
1999-01-31 11:11:54 +01:00
|
|
|
break;
|
|
|
|
case VFT2_DRV_INPUTMETHOD:
|
1999-08-04 14:22:42 +02:00
|
|
|
DPRINTF("INPUTMETHOD");
|
1999-01-31 11:11:54 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case VFT_FONT:
|
1999-08-04 14:22:42 +02:00
|
|
|
TRACE("filetype=FONT.");
|
1999-01-31 11:11:54 +01:00
|
|
|
switch (vffi->dwFileSubtype) {
|
|
|
|
default:
|
1999-08-04 14:22:42 +02:00
|
|
|
DPRINTF("UNKNOWN(0x%lx)",vffi->dwFileSubtype);
|
1999-01-31 11:11:54 +01:00
|
|
|
break;
|
1999-08-04 14:22:42 +02:00
|
|
|
case VFT2_FONT_RASTER:DPRINTF("RASTER");break;
|
|
|
|
case VFT2_FONT_VECTOR:DPRINTF("VECTOR");break;
|
|
|
|
case VFT2_FONT_TRUETYPE:DPRINTF("TRUETYPE");break;
|
1999-01-31 11:11:54 +01:00
|
|
|
}
|
|
|
|
break;
|
1999-08-04 14:22:42 +02:00
|
|
|
case VFT_VXD:TRACE("filetype=VXD");break;
|
|
|
|
case VFT_STATIC_LIB:TRACE("filetype=STATIC_LIB");break;
|
1999-01-31 11:11:54 +01:00
|
|
|
}
|
1999-08-04 14:22:42 +02:00
|
|
|
DPRINTF("\n");
|
1999-05-14 10:17:14 +02:00
|
|
|
TRACE(" filedata=0x%lx.0x%lx\n",
|
1999-01-31 11:11:54 +01:00
|
|
|
vffi->dwFileDateMS,vffi->dwFileDateLS);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* Version Info Structure
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
WORD wLength;
|
|
|
|
WORD wValueLength;
|
|
|
|
CHAR szKey[1];
|
|
|
|
#if 0 /* variable length structure */
|
|
|
|
/* DWORD aligned */
|
|
|
|
BYTE Value[];
|
|
|
|
/* DWORD aligned */
|
1999-02-17 16:33:17 +01:00
|
|
|
VS_VERSION_INFO_STRUCT16 Children[];
|
1999-01-31 11:11:54 +01:00
|
|
|
#endif
|
1999-02-17 16:33:17 +01:00
|
|
|
} VS_VERSION_INFO_STRUCT16;
|
1999-01-31 11:11:54 +01:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
WORD wLength;
|
|
|
|
WORD wValueLength;
|
|
|
|
WORD bText;
|
|
|
|
WCHAR szKey[1];
|
|
|
|
#if 0 /* variable length structure */
|
|
|
|
/* DWORD aligned */
|
|
|
|
BYTE Value[];
|
|
|
|
/* DWORD aligned */
|
1999-02-17 16:33:17 +01:00
|
|
|
VS_VERSION_INFO_STRUCT32 Children[];
|
1999-01-31 11:11:54 +01:00
|
|
|
#endif
|
1999-02-17 16:33:17 +01:00
|
|
|
} VS_VERSION_INFO_STRUCT32;
|
1999-01-31 11:11:54 +01:00
|
|
|
|
|
|
|
#define VersionInfoIs16( ver ) \
|
1999-02-17 16:33:17 +01:00
|
|
|
( ((VS_VERSION_INFO_STRUCT16 *)ver)->szKey[0] >= ' ' )
|
1999-01-31 11:11:54 +01:00
|
|
|
|
2000-01-08 23:19:46 +01:00
|
|
|
#define DWORD_ALIGN( base, ptr ) \
|
|
|
|
( (LPBYTE)(base) + ((((LPBYTE)(ptr) - (LPBYTE)(base)) + 3) & ~3) )
|
1999-08-21 15:03:34 +02:00
|
|
|
|
1999-01-31 11:11:54 +01:00
|
|
|
#define VersionInfo16_Value( ver ) \
|
2000-08-14 16:41:19 +02:00
|
|
|
DWORD_ALIGN( (ver), (ver)->szKey + strlen((ver)->szKey) + 1 )
|
1999-01-31 11:11:54 +01:00
|
|
|
#define VersionInfo32_Value( ver ) \
|
2000-08-14 16:41:19 +02:00
|
|
|
DWORD_ALIGN( (ver), (ver)->szKey + strlenW((ver)->szKey) + 1 )
|
1999-01-31 11:11:54 +01:00
|
|
|
|
|
|
|
#define VersionInfo16_Children( ver ) \
|
1999-02-17 16:33:17 +01:00
|
|
|
(VS_VERSION_INFO_STRUCT16 *)( VersionInfo16_Value( ver ) + \
|
1999-01-31 11:11:54 +01:00
|
|
|
( ( (ver)->wValueLength + 3 ) & ~3 ) )
|
|
|
|
#define VersionInfo32_Children( ver ) \
|
1999-02-17 16:33:17 +01:00
|
|
|
(VS_VERSION_INFO_STRUCT32 *)( VersionInfo32_Value( ver ) + \
|
1999-01-31 11:11:54 +01:00
|
|
|
( ( (ver)->wValueLength * \
|
|
|
|
((ver)->bText? 2 : 1) + 3 ) & ~3 ) )
|
|
|
|
|
|
|
|
#define VersionInfo16_Next( ver ) \
|
1999-02-17 16:33:17 +01:00
|
|
|
(VS_VERSION_INFO_STRUCT16 *)( (LPBYTE)ver + (((ver)->wLength + 3) & ~3) )
|
1999-01-31 11:11:54 +01:00
|
|
|
#define VersionInfo32_Next( ver ) \
|
1999-02-17 16:33:17 +01:00
|
|
|
(VS_VERSION_INFO_STRUCT32 *)( (LPBYTE)ver + (((ver)->wLength + 3) & ~3) )
|
1999-01-31 11:11:54 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* ConvertVersionInfo32To16 [internal]
|
|
|
|
*/
|
1999-02-17 16:33:17 +01:00
|
|
|
void ConvertVersionInfo32To16( VS_VERSION_INFO_STRUCT32 *info32,
|
|
|
|
VS_VERSION_INFO_STRUCT16 *info16 )
|
1999-01-31 11:11:54 +01:00
|
|
|
{
|
|
|
|
/* Copy data onto local stack to prevent overwrites */
|
|
|
|
WORD wLength = info32->wLength;
|
|
|
|
WORD wValueLength = info32->wValueLength;
|
|
|
|
WORD bText = info32->bText;
|
|
|
|
LPBYTE lpValue = VersionInfo32_Value( info32 );
|
1999-02-17 16:33:17 +01:00
|
|
|
VS_VERSION_INFO_STRUCT32 *child32 = VersionInfo32_Children( info32 );
|
|
|
|
VS_VERSION_INFO_STRUCT16 *child16;
|
1999-01-31 11:11:54 +01:00
|
|
|
|
1999-05-14 10:17:14 +02:00
|
|
|
TRACE("Converting %p to %p\n", info32, info16 );
|
|
|
|
TRACE("wLength %d, wValueLength %d, bText %d, value %p, child %p\n",
|
1999-01-31 11:11:54 +01:00
|
|
|
wLength, wValueLength, bText, lpValue, child32 );
|
|
|
|
|
|
|
|
/* Convert key */
|
2000-11-28 23:40:56 +01:00
|
|
|
WideCharToMultiByte( CP_ACP, 0, info32->szKey, -1, info16->szKey, 0x7fffffff, NULL, NULL );
|
1999-01-31 11:11:54 +01:00
|
|
|
|
1999-05-14 10:17:14 +02:00
|
|
|
TRACE("Copied key from %p to %p: %s\n", info32->szKey, info16->szKey,
|
1999-01-31 11:11:54 +01:00
|
|
|
debugstr_a(info16->szKey) );
|
|
|
|
|
|
|
|
/* Convert value */
|
|
|
|
if ( wValueLength == 0 )
|
|
|
|
{
|
|
|
|
info16->wValueLength = 0;
|
1999-05-14 10:17:14 +02:00
|
|
|
TRACE("No value present\n" );
|
1999-01-31 11:11:54 +01:00
|
|
|
}
|
|
|
|
else if ( bText )
|
|
|
|
{
|
2000-11-28 23:40:56 +01:00
|
|
|
info16->wValueLength = WideCharToMultiByte( CP_ACP, 0, (LPCWSTR)lpValue, -1, NULL, 0, NULL, NULL );
|
|
|
|
WideCharToMultiByte( CP_ACP, 0, (LPCWSTR)lpValue, -1,
|
|
|
|
VersionInfo16_Value( info16 ), info16->wValueLength, NULL, NULL );
|
1999-01-31 11:11:54 +01:00
|
|
|
|
1999-05-14 10:17:14 +02:00
|
|
|
TRACE("Copied value from %p to %p: %s\n", lpValue,
|
1999-01-31 11:11:54 +01:00
|
|
|
VersionInfo16_Value( info16 ),
|
|
|
|
debugstr_a(VersionInfo16_Value( info16 )) );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
info16->wValueLength = wValueLength;
|
|
|
|
memmove( VersionInfo16_Value( info16 ), lpValue, wValueLength );
|
|
|
|
|
1999-05-14 10:17:14 +02:00
|
|
|
TRACE("Copied value from %p to %p: %d bytes\n", lpValue,
|
1999-01-31 11:11:54 +01:00
|
|
|
VersionInfo16_Value( info16 ), wValueLength );
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Convert children */
|
|
|
|
child16 = VersionInfo16_Children( info16 );
|
2001-03-23 20:07:35 +01:00
|
|
|
while ( (DWORD)child32 < (DWORD)info32 + wLength && child32->wLength != 0 )
|
1999-01-31 11:11:54 +01:00
|
|
|
{
|
1999-02-17 16:33:17 +01:00
|
|
|
VS_VERSION_INFO_STRUCT32 *nextChild = VersionInfo32_Next( child32 );
|
1999-01-31 11:11:54 +01:00
|
|
|
|
|
|
|
ConvertVersionInfo32To16( child32, child16 );
|
|
|
|
|
|
|
|
child16 = VersionInfo16_Next( child16 );
|
|
|
|
child32 = nextChild;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Fixup length */
|
|
|
|
info16->wLength = (DWORD)child16 - (DWORD)info16;
|
|
|
|
|
1999-05-14 10:17:14 +02:00
|
|
|
TRACE("Finished, length is %d (%p - %p)\n",
|
1999-01-31 11:11:54 +01:00
|
|
|
info16->wLength, info16, child16 );
|
|
|
|
}
|
|
|
|
|
2001-02-23 21:37:13 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* VERSION_GetFileVersionInfo_PE [internal]
|
|
|
|
*
|
2001-03-14 18:26:16 +01:00
|
|
|
* NOTE: returns size of the PE VERSION resource or 0xFFFFFFFF
|
|
|
|
* in the case if file exists, but VERSION_INFO not found.
|
2001-02-23 21:37:13 +01:00
|
|
|
* FIXME: handle is not used.
|
|
|
|
*/
|
2001-06-06 23:06:12 +02:00
|
|
|
static DWORD VERSION_GetFileVersionInfo_PE( LPCSTR filename, LPDWORD handle,
|
2001-02-23 21:37:13 +01:00
|
|
|
DWORD datasize, LPVOID data )
|
|
|
|
{
|
|
|
|
VS_FIXEDFILEINFO *vffi;
|
|
|
|
DWORD len;
|
|
|
|
BYTE *buf;
|
|
|
|
HMODULE hModule;
|
|
|
|
HRSRC hRsrc;
|
|
|
|
HGLOBAL hMem;
|
|
|
|
BOOL do_free_library = FALSE;
|
|
|
|
|
|
|
|
TRACE("(%s,%p)\n", debugstr_a(filename), handle );
|
|
|
|
|
|
|
|
hModule = GetModuleHandleA(filename);
|
|
|
|
if(!hModule)
|
|
|
|
{
|
|
|
|
hModule = LoadLibraryExA(filename, 0, LOAD_LIBRARY_AS_DATAFILE);
|
|
|
|
do_free_library = TRUE;
|
|
|
|
}
|
|
|
|
if(!hModule)
|
|
|
|
{
|
|
|
|
WARN("Could not load %s\n", debugstr_a(filename));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
hRsrc = FindResourceW(hModule,
|
|
|
|
MAKEINTRESOURCEW(VS_VERSION_INFO),
|
|
|
|
MAKEINTRESOURCEW(VS_FILE_INFO));
|
|
|
|
if(!hRsrc)
|
|
|
|
{
|
|
|
|
WARN("Could not find VS_VERSION_INFO in %s\n", debugstr_a(filename));
|
|
|
|
if(do_free_library) FreeLibrary(hModule);
|
2001-03-14 18:26:16 +01:00
|
|
|
return 0xFFFFFFFF;
|
2001-02-23 21:37:13 +01:00
|
|
|
}
|
|
|
|
len = SizeofResource(hModule, hRsrc);
|
|
|
|
hMem = LoadResource(hModule, hRsrc);
|
|
|
|
if(!hMem)
|
|
|
|
{
|
|
|
|
WARN("Could not load VS_VERSION_INFO from %s\n", debugstr_a(filename));
|
|
|
|
if(do_free_library) FreeLibrary(hModule);
|
2001-03-14 18:26:16 +01:00
|
|
|
return 0xFFFFFFFF;
|
2001-02-23 21:37:13 +01:00
|
|
|
}
|
|
|
|
buf = LockResource(hMem);
|
|
|
|
|
|
|
|
vffi = (VS_FIXEDFILEINFO *)VersionInfo32_Value( (VS_VERSION_INFO_STRUCT32 *)buf );
|
|
|
|
|
|
|
|
if ( vffi->dwSignature != VS_FFI_SIGNATURE )
|
|
|
|
{
|
|
|
|
WARN("vffi->dwSignature is 0x%08lx, but not 0x%08lx!\n",
|
|
|
|
vffi->dwSignature, VS_FFI_SIGNATURE );
|
2001-03-14 18:26:16 +01:00
|
|
|
len = 0xFFFFFFFF;
|
2001-02-23 21:37:13 +01:00
|
|
|
goto END;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( TRACE_ON(ver) )
|
|
|
|
print_vffi_debug( vffi );
|
|
|
|
|
|
|
|
if(data)
|
|
|
|
{
|
2001-03-19 20:15:36 +01:00
|
|
|
if(datasize < len)
|
|
|
|
len = datasize; /* truncate data */
|
|
|
|
if(len)
|
2001-02-23 21:37:13 +01:00
|
|
|
memcpy(data, buf, len);
|
|
|
|
else
|
2001-03-14 18:26:16 +01:00
|
|
|
len = 0xFFFFFFFF;
|
2001-02-23 21:37:13 +01:00
|
|
|
}
|
|
|
|
END:
|
|
|
|
FreeResource(hMem);
|
|
|
|
if(do_free_library) FreeLibrary(hModule);
|
|
|
|
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* VERSION_GetFileVersionInfo_16 [internal]
|
|
|
|
*
|
2001-03-14 18:26:16 +01:00
|
|
|
* NOTE: returns size of the 16-bit VERSION resource or 0xFFFFFFFF
|
|
|
|
* in the case if file exists, but VERSION_INFO not found.
|
2001-02-23 21:37:13 +01:00
|
|
|
* FIXME: handle is not used.
|
|
|
|
*/
|
2001-06-06 23:06:12 +02:00
|
|
|
static DWORD VERSION_GetFileVersionInfo_16( LPCSTR filename, LPDWORD handle,
|
2001-02-23 21:37:13 +01:00
|
|
|
DWORD datasize, LPVOID data )
|
|
|
|
{
|
|
|
|
VS_FIXEDFILEINFO *vffi;
|
|
|
|
DWORD len;
|
|
|
|
BYTE *buf;
|
|
|
|
HMODULE16 hModule;
|
|
|
|
HRSRC16 hRsrc;
|
|
|
|
HGLOBAL16 hMem;
|
|
|
|
BOOL do_free_library = FALSE;
|
|
|
|
|
|
|
|
TRACE("(%s,%p)\n", debugstr_a(filename), handle );
|
|
|
|
|
|
|
|
hModule = GetModuleHandle16(filename);
|
|
|
|
if(hModule < 32)
|
|
|
|
{
|
|
|
|
hModule = LoadLibrary16(filename);
|
|
|
|
do_free_library = TRUE;
|
|
|
|
}
|
|
|
|
if(hModule < 32)
|
|
|
|
{
|
|
|
|
WARN("Could not load %s\n", debugstr_a(filename));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
hRsrc = FindResource16(hModule,
|
|
|
|
MAKEINTRESOURCEA(VS_VERSION_INFO),
|
|
|
|
MAKEINTRESOURCEA(VS_FILE_INFO));
|
|
|
|
if(!hRsrc)
|
|
|
|
{
|
|
|
|
WARN("Could not find VS_VERSION_INFO in %s\n", debugstr_a(filename));
|
|
|
|
if(do_free_library) FreeLibrary16(hModule);
|
2001-03-14 18:26:16 +01:00
|
|
|
return 0xFFFFFFFF;
|
2001-02-23 21:37:13 +01:00
|
|
|
}
|
|
|
|
len = SizeofResource16(hModule, hRsrc);
|
|
|
|
hMem = LoadResource16(hModule, hRsrc);
|
|
|
|
if(!hMem)
|
|
|
|
{
|
|
|
|
WARN("Could not load VS_VERSION_INFO from %s\n", debugstr_a(filename));
|
|
|
|
if(do_free_library) FreeLibrary16(hModule);
|
2001-03-14 18:26:16 +01:00
|
|
|
return 0xFFFFFFFF;
|
2001-02-23 21:37:13 +01:00
|
|
|
}
|
|
|
|
buf = LockResource16(hMem);
|
|
|
|
|
|
|
|
if(!VersionInfoIs16(buf))
|
|
|
|
goto END;
|
|
|
|
|
|
|
|
vffi = (VS_FIXEDFILEINFO *)VersionInfo16_Value( (VS_VERSION_INFO_STRUCT16 *)buf );
|
|
|
|
|
|
|
|
if ( vffi->dwSignature != VS_FFI_SIGNATURE )
|
|
|
|
{
|
|
|
|
WARN("vffi->dwSignature is 0x%08lx, but not 0x%08lx!\n",
|
|
|
|
vffi->dwSignature, VS_FFI_SIGNATURE );
|
2001-03-14 18:26:16 +01:00
|
|
|
len = 0xFFFFFFFF;
|
2001-02-23 21:37:13 +01:00
|
|
|
goto END;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( TRACE_ON(ver) )
|
|
|
|
print_vffi_debug( vffi );
|
|
|
|
|
|
|
|
if(data)
|
|
|
|
{
|
2001-03-19 20:15:36 +01:00
|
|
|
if(datasize < len)
|
|
|
|
len = datasize; /* truncate data */
|
|
|
|
if(len)
|
2001-02-23 21:37:13 +01:00
|
|
|
memcpy(data, buf, len);
|
|
|
|
else
|
2001-03-14 18:26:16 +01:00
|
|
|
len = 0xFFFFFFFF;
|
2001-02-23 21:37:13 +01:00
|
|
|
}
|
|
|
|
END:
|
|
|
|
FreeResource16(hMem);
|
|
|
|
if(do_free_library) FreeLibrary16(hModule);
|
|
|
|
|
|
|
|
return len;
|
|
|
|
}
|
1999-01-31 11:11:54 +01:00
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* GetFileVersionInfoSizeA [VERSION.@]
|
1999-01-31 11:11:54 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
DWORD WINAPI GetFileVersionInfoSizeA( LPCSTR filename, LPDWORD handle )
|
1999-01-31 11:11:54 +01:00
|
|
|
{
|
|
|
|
VS_FIXEDFILEINFO *vffi;
|
1999-02-09 15:18:57 +01:00
|
|
|
DWORD len, ret, offset;
|
1999-01-31 11:11:54 +01:00
|
|
|
BYTE buf[144];
|
|
|
|
|
1999-05-14 10:17:14 +02:00
|
|
|
TRACE("(%s,%p)\n", debugstr_a(filename), handle );
|
1999-01-31 11:11:54 +01:00
|
|
|
|
2001-02-23 21:37:13 +01:00
|
|
|
len = VERSION_GetFileVersionInfo_PE(filename, handle, 0, NULL);
|
2001-03-14 18:26:16 +01:00
|
|
|
/* 0xFFFFFFFF means: file exists, but VERSION_INFO not found */
|
|
|
|
if(len == 0xFFFFFFFF) return 0;
|
2001-02-23 21:37:13 +01:00
|
|
|
if(len) return len;
|
|
|
|
len = VERSION_GetFileVersionInfo_16(filename, handle, 0, NULL);
|
2001-03-14 18:26:16 +01:00
|
|
|
/* 0xFFFFFFFF means: file exists, but VERSION_INFO not found */
|
|
|
|
if(len == 0xFFFFFFFF) return 0;
|
2001-02-23 21:37:13 +01:00
|
|
|
if(len) return len;
|
|
|
|
|
2000-10-23 03:38:29 +02:00
|
|
|
len = GetFileResourceSize16( filename,
|
1999-02-26 12:11:13 +01:00
|
|
|
MAKEINTRESOURCEA(VS_FILE_INFO),
|
|
|
|
MAKEINTRESOURCEA(VS_VERSION_INFO),
|
1999-02-09 15:18:57 +01:00
|
|
|
&offset );
|
1999-01-31 11:11:54 +01:00
|
|
|
if (!len) return 0;
|
|
|
|
|
2000-10-23 03:38:29 +02:00
|
|
|
ret = GetFileResource16( filename,
|
1999-02-26 12:11:13 +01:00
|
|
|
MAKEINTRESOURCEA(VS_FILE_INFO),
|
|
|
|
MAKEINTRESOURCEA(VS_VERSION_INFO),
|
1999-02-09 15:18:57 +01:00
|
|
|
offset, sizeof( buf ), buf );
|
1999-01-31 11:11:54 +01:00
|
|
|
if (!ret) return 0;
|
|
|
|
|
1999-02-09 15:18:57 +01:00
|
|
|
if ( handle ) *handle = offset;
|
1999-01-31 11:11:54 +01:00
|
|
|
|
|
|
|
if ( VersionInfoIs16( buf ) )
|
1999-02-17 16:33:17 +01:00
|
|
|
vffi = (VS_FIXEDFILEINFO *)VersionInfo16_Value( (VS_VERSION_INFO_STRUCT16 *)buf );
|
1999-01-31 11:11:54 +01:00
|
|
|
else
|
1999-02-17 16:33:17 +01:00
|
|
|
vffi = (VS_FIXEDFILEINFO *)VersionInfo32_Value( (VS_VERSION_INFO_STRUCT32 *)buf );
|
1999-01-31 11:11:54 +01:00
|
|
|
|
|
|
|
if ( vffi->dwSignature != VS_FFI_SIGNATURE )
|
|
|
|
{
|
1999-05-14 10:17:14 +02:00
|
|
|
WARN("vffi->dwSignature is 0x%08lx, but not 0x%08lx!\n",
|
1999-01-31 11:11:54 +01:00
|
|
|
vffi->dwSignature, VS_FFI_SIGNATURE );
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
1999-02-17 16:33:17 +01:00
|
|
|
if ( ((VS_VERSION_INFO_STRUCT16 *)buf)->wLength < len )
|
|
|
|
len = ((VS_VERSION_INFO_STRUCT16 *)buf)->wLength;
|
1999-01-31 11:11:54 +01:00
|
|
|
|
1999-05-14 10:17:14 +02:00
|
|
|
if ( TRACE_ON(ver) )
|
1999-01-31 11:11:54 +01:00
|
|
|
print_vffi_debug( vffi );
|
|
|
|
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* GetFileVersionInfoSizeW [VERSION.@]
|
1999-01-31 11:11:54 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
DWORD WINAPI GetFileVersionInfoSizeW( LPCWSTR filename, LPDWORD handle )
|
1999-01-31 11:11:54 +01:00
|
|
|
{
|
2000-11-16 01:28:52 +01:00
|
|
|
DWORD ret, len = WideCharToMultiByte( CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL );
|
|
|
|
LPSTR fn = HeapAlloc( GetProcessHeap(), 0, len );
|
|
|
|
WideCharToMultiByte( CP_ACP, 0, filename, -1, fn, len, NULL, NULL );
|
|
|
|
ret = GetFileVersionInfoSizeA( fn, handle );
|
1999-01-31 11:11:54 +01:00
|
|
|
HeapFree( GetProcessHeap(), 0, fn );
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* GetFileVersionInfoA [VERSION.@]
|
1999-01-31 11:11:54 +01:00
|
|
|
*/
|
2001-03-16 17:42:20 +01:00
|
|
|
BOOL WINAPI GetFileVersionInfoA( LPCSTR filename, DWORD handle,
|
1999-01-31 11:11:54 +01:00
|
|
|
DWORD datasize, LPVOID data )
|
|
|
|
{
|
2001-03-14 18:26:16 +01:00
|
|
|
DWORD len;
|
|
|
|
|
1999-05-14 10:17:14 +02:00
|
|
|
TRACE("(%s,%ld,size=%ld,data=%p)\n",
|
1999-01-31 11:11:54 +01:00
|
|
|
debugstr_a(filename), handle, datasize, data );
|
|
|
|
|
2001-03-14 18:26:16 +01:00
|
|
|
len = VERSION_GetFileVersionInfo_PE(filename, &handle, datasize, data);
|
|
|
|
/* 0xFFFFFFFF means: file exists, but VERSION_INFO not found */
|
|
|
|
if(len == 0xFFFFFFFF) return FALSE;
|
|
|
|
if(len)
|
2001-02-23 21:37:13 +01:00
|
|
|
goto DO_CONVERT;
|
2001-03-14 18:26:16 +01:00
|
|
|
len = VERSION_GetFileVersionInfo_16(filename, &handle, datasize, data);
|
|
|
|
/* 0xFFFFFFFF means: file exists, but VERSION_INFO not found */
|
|
|
|
if(len == 0xFFFFFFFF) return FALSE;
|
|
|
|
if(len)
|
2001-02-23 21:37:13 +01:00
|
|
|
goto DO_CONVERT;
|
|
|
|
|
2000-10-23 03:38:29 +02:00
|
|
|
if ( !GetFileResource16( filename, MAKEINTRESOURCEA(VS_FILE_INFO),
|
1999-02-26 12:11:13 +01:00
|
|
|
MAKEINTRESOURCEA(VS_VERSION_INFO),
|
1999-01-31 11:11:54 +01:00
|
|
|
handle, datasize, data ) )
|
|
|
|
return FALSE;
|
2001-02-23 21:37:13 +01:00
|
|
|
DO_CONVERT:
|
1999-02-17 16:33:17 +01:00
|
|
|
if ( datasize >= sizeof(VS_VERSION_INFO_STRUCT16)
|
|
|
|
&& datasize >= ((VS_VERSION_INFO_STRUCT16 *)data)->wLength
|
1999-01-31 11:11:54 +01:00
|
|
|
&& !VersionInfoIs16( data ) )
|
|
|
|
{
|
|
|
|
/* convert resource from PE format to NE format */
|
1999-02-17 16:33:17 +01:00
|
|
|
ConvertVersionInfo32To16( (VS_VERSION_INFO_STRUCT32 *)data,
|
|
|
|
(VS_VERSION_INFO_STRUCT16 *)data );
|
1999-01-31 11:11:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* GetFileVersionInfoW [VERSION.@]
|
1999-01-31 11:11:54 +01:00
|
|
|
*/
|
2001-03-16 17:42:20 +01:00
|
|
|
BOOL WINAPI GetFileVersionInfoW( LPCWSTR filename, DWORD handle,
|
1999-01-31 11:11:54 +01:00
|
|
|
DWORD datasize, LPVOID data )
|
|
|
|
{
|
2000-11-16 01:28:52 +01:00
|
|
|
DWORD len = WideCharToMultiByte( CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL );
|
|
|
|
LPSTR fn = HeapAlloc( GetProcessHeap(), 0, len );
|
1999-01-31 11:11:54 +01:00
|
|
|
DWORD retv = TRUE;
|
|
|
|
|
2000-11-16 01:28:52 +01:00
|
|
|
WideCharToMultiByte( CP_ACP, 0, filename, -1, fn, len, NULL, NULL );
|
|
|
|
|
1999-05-14 10:17:14 +02:00
|
|
|
TRACE("(%s,%ld,size=%ld,data=%p)\n",
|
2000-11-16 01:28:52 +01:00
|
|
|
debugstr_w(filename), handle, datasize, data );
|
1999-01-31 11:11:54 +01:00
|
|
|
|
2001-02-23 21:37:13 +01:00
|
|
|
if(VERSION_GetFileVersionInfo_PE(fn, &handle, datasize, data))
|
|
|
|
goto END;
|
|
|
|
if(VERSION_GetFileVersionInfo_16(fn, &handle, datasize, data))
|
|
|
|
goto END;
|
|
|
|
|
2000-10-23 03:38:29 +02:00
|
|
|
if ( !GetFileResource16( fn, MAKEINTRESOURCEA(VS_FILE_INFO),
|
1999-02-26 12:11:13 +01:00
|
|
|
MAKEINTRESOURCEA(VS_VERSION_INFO),
|
1999-01-31 11:11:54 +01:00
|
|
|
handle, datasize, data ) )
|
|
|
|
retv = FALSE;
|
|
|
|
|
1999-02-17 16:33:17 +01:00
|
|
|
else if ( datasize >= sizeof(VS_VERSION_INFO_STRUCT16)
|
|
|
|
&& datasize >= ((VS_VERSION_INFO_STRUCT16 *)data)->wLength
|
1999-01-31 11:11:54 +01:00
|
|
|
&& VersionInfoIs16( data ) )
|
|
|
|
{
|
1999-05-14 10:17:14 +02:00
|
|
|
ERR("Cannot access NE resource in %s\n", debugstr_a(fn) );
|
1999-01-31 11:11:54 +01:00
|
|
|
retv = FALSE;
|
|
|
|
}
|
2001-02-23 21:37:13 +01:00
|
|
|
END:
|
1999-01-31 11:11:54 +01:00
|
|
|
HeapFree( GetProcessHeap(), 0, fn );
|
|
|
|
return retv;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* VersionInfo16_FindChild [internal]
|
|
|
|
*/
|
2000-02-25 21:55:54 +01:00
|
|
|
static VS_VERSION_INFO_STRUCT16 *VersionInfo16_FindChild( VS_VERSION_INFO_STRUCT16 *info,
|
1999-02-26 12:11:13 +01:00
|
|
|
LPCSTR szKey, UINT cbKey )
|
1999-01-31 11:11:54 +01:00
|
|
|
{
|
1999-02-17 16:33:17 +01:00
|
|
|
VS_VERSION_INFO_STRUCT16 *child = VersionInfo16_Children( info );
|
1999-01-31 11:11:54 +01:00
|
|
|
|
|
|
|
while ( (DWORD)child < (DWORD)info + info->wLength )
|
|
|
|
{
|
2000-09-26 01:30:56 +02:00
|
|
|
if ( !strncasecmp( child->szKey, szKey, cbKey ) )
|
1999-01-31 11:11:54 +01:00
|
|
|
return child;
|
|
|
|
|
1999-02-19 15:12:16 +01:00
|
|
|
if (!(child->wLength)) return NULL;
|
1999-01-31 11:11:54 +01:00
|
|
|
child = VersionInfo16_Next( child );
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* VersionInfo32_FindChild [internal]
|
|
|
|
*/
|
2000-02-25 21:55:54 +01:00
|
|
|
static VS_VERSION_INFO_STRUCT32 *VersionInfo32_FindChild( VS_VERSION_INFO_STRUCT32 *info,
|
1999-02-26 12:11:13 +01:00
|
|
|
LPCWSTR szKey, UINT cbKey )
|
1999-01-31 11:11:54 +01:00
|
|
|
{
|
1999-02-17 16:33:17 +01:00
|
|
|
VS_VERSION_INFO_STRUCT32 *child = VersionInfo32_Children( info );
|
1999-01-31 11:11:54 +01:00
|
|
|
|
|
|
|
while ( (DWORD)child < (DWORD)info + info->wLength )
|
|
|
|
{
|
2000-06-13 03:10:29 +02:00
|
|
|
if ( !strncmpiW( child->szKey, szKey, cbKey ) )
|
1999-01-31 11:11:54 +01:00
|
|
|
return child;
|
|
|
|
|
|
|
|
child = VersionInfo32_Next( child );
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* VerQueryValueA [VERSION.@]
|
1999-01-31 11:11:54 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
DWORD WINAPI VerQueryValueA( LPVOID pBlock, LPCSTR lpSubBlock,
|
|
|
|
LPVOID *lplpBuffer, UINT *puLen )
|
1999-01-31 11:11:54 +01:00
|
|
|
{
|
1999-02-17 16:33:17 +01:00
|
|
|
VS_VERSION_INFO_STRUCT16 *info = (VS_VERSION_INFO_STRUCT16 *)pBlock;
|
1999-01-31 11:11:54 +01:00
|
|
|
if ( !VersionInfoIs16( info ) )
|
|
|
|
{
|
2001-02-15 22:26:29 +01:00
|
|
|
INT len;
|
|
|
|
LPWSTR wide_str;
|
|
|
|
DWORD give;
|
|
|
|
|
|
|
|
/* <lawson_whitney@juno.com> Feb 2001 */
|
|
|
|
/* AOL 5.0 does this, expecting to get this: */
|
|
|
|
len = MultiByteToWideChar(CP_ACP, 0, lpSubBlock, -1, NULL, 0);
|
|
|
|
wide_str = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, lpSubBlock, -1, wide_str, len);
|
|
|
|
|
|
|
|
give = VerQueryValueW(pBlock, wide_str, lplpBuffer, puLen);
|
|
|
|
HeapFree(GetProcessHeap(), 0, wide_str);
|
|
|
|
return give;
|
1999-01-31 11:11:54 +01:00
|
|
|
}
|
|
|
|
|
1999-05-14 10:17:14 +02:00
|
|
|
TRACE("(%p,%s,%p,%p)\n",
|
1999-01-31 11:11:54 +01:00
|
|
|
pBlock, debugstr_a(lpSubBlock), lplpBuffer, puLen );
|
|
|
|
|
|
|
|
while ( *lpSubBlock )
|
|
|
|
{
|
|
|
|
/* Find next path component */
|
|
|
|
LPCSTR lpNextSlash;
|
|
|
|
for ( lpNextSlash = lpSubBlock; *lpNextSlash; lpNextSlash++ )
|
|
|
|
if ( *lpNextSlash == '\\' )
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Skip empty components */
|
|
|
|
if ( lpNextSlash == lpSubBlock )
|
|
|
|
{
|
|
|
|
lpSubBlock++;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* We have a non-empty component: search info for key */
|
|
|
|
info = VersionInfo16_FindChild( info, lpSubBlock, lpNextSlash-lpSubBlock );
|
|
|
|
if ( !info ) return FALSE;
|
|
|
|
|
|
|
|
/* Skip path component */
|
|
|
|
lpSubBlock = lpNextSlash;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return value */
|
|
|
|
*lplpBuffer = VersionInfo16_Value( info );
|
|
|
|
*puLen = info->wValueLength;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* VerQueryValueW [VERSION.@]
|
1999-01-31 11:11:54 +01:00
|
|
|
*/
|
1999-02-26 12:11:13 +01:00
|
|
|
DWORD WINAPI VerQueryValueW( LPVOID pBlock, LPCWSTR lpSubBlock,
|
|
|
|
LPVOID *lplpBuffer, UINT *puLen )
|
1999-01-31 11:11:54 +01:00
|
|
|
{
|
1999-02-17 16:33:17 +01:00
|
|
|
VS_VERSION_INFO_STRUCT32 *info = (VS_VERSION_INFO_STRUCT32 *)pBlock;
|
1999-01-31 11:11:54 +01:00
|
|
|
if ( VersionInfoIs16( info ) )
|
|
|
|
{
|
1999-05-14 10:17:14 +02:00
|
|
|
ERR("called on NE resource!\n" );
|
1999-01-31 11:11:54 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
1999-05-14 10:17:14 +02:00
|
|
|
TRACE("(%p,%s,%p,%p)\n",
|
1999-01-31 11:11:54 +01:00
|
|
|
pBlock, debugstr_w(lpSubBlock), lplpBuffer, puLen );
|
|
|
|
|
|
|
|
while ( *lpSubBlock )
|
|
|
|
{
|
|
|
|
/* Find next path component */
|
|
|
|
LPCWSTR lpNextSlash;
|
|
|
|
for ( lpNextSlash = lpSubBlock; *lpNextSlash; lpNextSlash++ )
|
|
|
|
if ( *lpNextSlash == '\\' )
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Skip empty components */
|
|
|
|
if ( lpNextSlash == lpSubBlock )
|
|
|
|
{
|
|
|
|
lpSubBlock++;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* We have a non-empty component: search info for key */
|
|
|
|
info = VersionInfo32_FindChild( info, lpSubBlock, lpNextSlash-lpSubBlock );
|
|
|
|
if ( !info ) return FALSE;
|
|
|
|
|
|
|
|
/* Skip path component */
|
|
|
|
lpSubBlock = lpNextSlash;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return value */
|
|
|
|
*lplpBuffer = VersionInfo32_Value( info );
|
|
|
|
*puLen = info->wValueLength;
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|