1999-01-31 10:08:42 +00:00
|
|
|
/*
|
|
|
|
* Implementation of VER.DLL
|
|
|
|
*
|
|
|
|
* Copyright 1999 Ulrich Weigand
|
2002-03-09 23:29:33 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 12:49:52 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
1999-01-31 10:08:42 +00:00
|
|
|
*/
|
|
|
|
|
2003-09-05 23:08:26 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
2000-09-26 22:20:14 +00:00
|
|
|
#include "wine/winbase16.h"
|
1999-02-17 13:51:06 +00:00
|
|
|
#include "winver.h"
|
2002-03-09 23:29:33 +00:00
|
|
|
#include "wine/debug.h"
|
1999-01-31 10:08:42 +00:00
|
|
|
|
2002-03-09 23:29:33 +00:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(ver);
|
1999-04-19 14:56:29 +00:00
|
|
|
|
1999-01-31 10:08:42 +00:00
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* GetFileVersionInfoSize [VER.6]
|
1999-01-31 10:08:42 +00:00
|
|
|
*/
|
|
|
|
DWORD WINAPI GetFileVersionInfoSize16( LPCSTR lpszFileName, LPDWORD lpdwHandle )
|
|
|
|
{
|
1999-05-14 08:17:14 +00:00
|
|
|
TRACE("(%s, %p)\n", debugstr_a(lpszFileName), lpdwHandle );
|
1999-02-26 11:11:13 +00:00
|
|
|
return GetFileVersionInfoSizeA( lpszFileName, lpdwHandle );
|
1999-01-31 10:08:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* GetFileVersionInfo [VER.7]
|
1999-01-31 10:08:42 +00:00
|
|
|
*/
|
|
|
|
DWORD WINAPI GetFileVersionInfo16( LPCSTR lpszFileName, DWORD handle,
|
|
|
|
DWORD cbBuf, LPVOID lpvData )
|
|
|
|
{
|
2006-10-08 17:35:18 +00:00
|
|
|
TRACE("(%s, %08x, %d, %p)\n",
|
1999-01-31 10:08:42 +00:00
|
|
|
debugstr_a(lpszFileName), handle, cbBuf, lpvData );
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
return GetFileVersionInfoA( lpszFileName, handle, cbBuf, lpvData );
|
1999-01-31 10:08:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* VerFindFile [VER.8]
|
1999-01-31 10:08:42 +00:00
|
|
|
*/
|
2005-11-03 11:35:11 +00:00
|
|
|
DWORD WINAPI VerFindFile16( UINT16 flags, LPSTR lpszFilename,
|
|
|
|
LPSTR lpszWinDir, LPSTR lpszAppDir,
|
1999-01-31 10:08:42 +00:00
|
|
|
LPSTR lpszCurDir, UINT16 *lpuCurDirLen,
|
|
|
|
LPSTR lpszDestDir, UINT16 *lpuDestDirLen )
|
|
|
|
{
|
1999-02-26 11:11:13 +00:00
|
|
|
UINT curDirLen, destDirLen;
|
|
|
|
DWORD retv = VerFindFileA( flags, lpszFilename, lpszWinDir, lpszAppDir,
|
1999-01-31 10:08:42 +00:00
|
|
|
lpszCurDir, &curDirLen, lpszDestDir, &destDirLen );
|
|
|
|
|
|
|
|
*lpuCurDirLen = (UINT16)curDirLen;
|
|
|
|
*lpuDestDirLen = (UINT16)destDirLen;
|
|
|
|
return retv;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* VerInstallFile [VER.9]
|
1999-01-31 10:08:42 +00:00
|
|
|
*/
|
2002-05-31 23:06:46 +00:00
|
|
|
DWORD WINAPI VerInstallFile16( UINT16 flags,
|
2005-11-03 11:35:11 +00:00
|
|
|
LPSTR lpszSrcFilename, LPSTR lpszDestFilename,
|
|
|
|
LPSTR lpszSrcDir, LPSTR lpszDestDir, LPSTR lpszCurDir,
|
1999-01-31 10:08:42 +00:00
|
|
|
LPSTR lpszTmpFile, UINT16 *lpwTmpFileLen )
|
|
|
|
{
|
1999-02-26 11:11:13 +00:00
|
|
|
UINT filelen;
|
2002-05-31 23:06:46 +00:00
|
|
|
DWORD retv = VerInstallFileA( flags, lpszSrcFilename, lpszDestFilename,
|
|
|
|
lpszSrcDir, lpszDestDir, lpszCurDir,
|
1999-01-31 10:08:42 +00:00
|
|
|
lpszTmpFile, &filelen);
|
|
|
|
|
|
|
|
*lpwTmpFileLen = (UINT16)filelen;
|
|
|
|
return retv;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* VerLanguageName [VER.10]
|
1999-01-31 10:08:42 +00:00
|
|
|
*/
|
|
|
|
DWORD WINAPI VerLanguageName16( UINT16 uLang, LPSTR lpszLang, UINT16 cbLang )
|
|
|
|
{
|
1999-02-26 11:11:13 +00:00
|
|
|
return VerLanguageNameA( uLang, lpszLang, cbLang );
|
1999-01-31 10:08:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 19:59:40 +00:00
|
|
|
* VerQueryValue [VER.11]
|
1999-01-31 10:08:42 +00:00
|
|
|
*/
|
2005-11-03 11:35:11 +00:00
|
|
|
DWORD WINAPI VerQueryValue16( SEGPTR spvBlock, LPSTR lpszSubBlock,
|
1999-01-31 10:08:42 +00:00
|
|
|
SEGPTR *lpspBuffer, UINT16 *lpcb )
|
|
|
|
{
|
2000-12-13 20:20:09 +00:00
|
|
|
LPVOID lpvBlock = MapSL( spvBlock );
|
1999-01-31 10:08:42 +00:00
|
|
|
LPVOID buffer = lpvBlock;
|
1999-02-26 11:11:13 +00:00
|
|
|
UINT buflen;
|
1999-01-31 10:08:42 +00:00
|
|
|
DWORD retv;
|
|
|
|
|
2002-05-31 23:06:46 +00:00
|
|
|
TRACE("(%p, %s, %p, %p)\n",
|
1999-01-31 10:08:42 +00:00
|
|
|
lpvBlock, debugstr_a(lpszSubBlock), lpspBuffer, lpcb );
|
|
|
|
|
1999-02-26 11:11:13 +00:00
|
|
|
retv = VerQueryValueA( lpvBlock, lpszSubBlock, &buffer, &buflen );
|
1999-01-31 10:08:42 +00:00
|
|
|
if ( !retv ) return FALSE;
|
|
|
|
|
1999-04-25 19:01:52 +00:00
|
|
|
if ( OFFSETOF( spvBlock ) + ((char *) buffer - (char *) lpvBlock) >= 0x10000 )
|
1999-01-31 10:08:42 +00:00
|
|
|
{
|
1999-05-14 08:17:14 +00:00
|
|
|
FIXME("offset %08X too large relative to %04X:%04X\n",
|
1999-04-25 19:01:52 +00:00
|
|
|
(char *) buffer - (char *) lpvBlock, SELECTOROF( spvBlock ), OFFSETOF( spvBlock ) );
|
1999-01-31 10:08:42 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2000-05-11 00:04:36 +00:00
|
|
|
if (lpcb) *lpcb = buflen;
|
1999-04-25 19:01:52 +00:00
|
|
|
*lpspBuffer = (SEGPTR) ((char *) spvBlock + ((char *) buffer - (char *) lpvBlock));
|
1999-01-31 10:08:42 +00:00
|
|
|
|
|
|
|
return retv;
|
|
|
|
}
|