1999-01-31 11:08:42 +01:00
|
|
|
/*
|
|
|
|
* Implementation of VER.DLL
|
|
|
|
*
|
|
|
|
* Copyright 1999 Ulrich Weigand
|
2002-03-10 00:29:33 +01: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
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
1999-01-31 11:08:42 +01:00
|
|
|
*/
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
1999-02-17 14:51:06 +01:00
|
|
|
#include "winbase.h"
|
2000-09-27 00:20:14 +02:00
|
|
|
#include "wine/winbase16.h"
|
1999-02-17 14:51:06 +01:00
|
|
|
#include "winver.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
1999-01-31 11:08:42 +01:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(ver);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
1999-01-31 11:08:42 +01:00
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* GetFileVersionInfoSize [VER.6]
|
1999-01-31 11:08:42 +01:00
|
|
|
*/
|
|
|
|
DWORD WINAPI GetFileVersionInfoSize16( LPCSTR lpszFileName, LPDWORD lpdwHandle )
|
|
|
|
{
|
1999-05-14 10:17:14 +02:00
|
|
|
TRACE("(%s, %p)\n", debugstr_a(lpszFileName), lpdwHandle );
|
1999-02-26 12:11:13 +01:00
|
|
|
return GetFileVersionInfoSizeA( lpszFileName, lpdwHandle );
|
1999-01-31 11:08:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* GetFileVersionInfo [VER.7]
|
1999-01-31 11:08:42 +01:00
|
|
|
*/
|
|
|
|
DWORD WINAPI GetFileVersionInfo16( LPCSTR lpszFileName, DWORD handle,
|
|
|
|
DWORD cbBuf, LPVOID lpvData )
|
|
|
|
{
|
2002-06-01 01:06:46 +02:00
|
|
|
TRACE("(%s, %08lx, %ld, %p)\n",
|
1999-01-31 11:08:42 +01:00
|
|
|
debugstr_a(lpszFileName), handle, cbBuf, lpvData );
|
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
return GetFileVersionInfoA( lpszFileName, handle, cbBuf, lpvData );
|
1999-01-31 11:08:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* VerFindFile [VER.8]
|
1999-01-31 11:08:42 +01:00
|
|
|
*/
|
2005-11-03 12:35:11 +01:00
|
|
|
DWORD WINAPI VerFindFile16( UINT16 flags, LPSTR lpszFilename,
|
|
|
|
LPSTR lpszWinDir, LPSTR lpszAppDir,
|
1999-01-31 11:08:42 +01:00
|
|
|
LPSTR lpszCurDir, UINT16 *lpuCurDirLen,
|
|
|
|
LPSTR lpszDestDir, UINT16 *lpuDestDirLen )
|
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
UINT curDirLen, destDirLen;
|
|
|
|
DWORD retv = VerFindFileA( flags, lpszFilename, lpszWinDir, lpszAppDir,
|
1999-01-31 11:08:42 +01:00
|
|
|
lpszCurDir, &curDirLen, lpszDestDir, &destDirLen );
|
|
|
|
|
|
|
|
*lpuCurDirLen = (UINT16)curDirLen;
|
|
|
|
*lpuDestDirLen = (UINT16)destDirLen;
|
|
|
|
return retv;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* VerInstallFile [VER.9]
|
1999-01-31 11:08:42 +01:00
|
|
|
*/
|
2002-06-01 01:06:46 +02:00
|
|
|
DWORD WINAPI VerInstallFile16( UINT16 flags,
|
2005-11-03 12:35:11 +01:00
|
|
|
LPSTR lpszSrcFilename, LPSTR lpszDestFilename,
|
|
|
|
LPSTR lpszSrcDir, LPSTR lpszDestDir, LPSTR lpszCurDir,
|
1999-01-31 11:08:42 +01:00
|
|
|
LPSTR lpszTmpFile, UINT16 *lpwTmpFileLen )
|
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
UINT filelen;
|
2002-06-01 01:06:46 +02:00
|
|
|
DWORD retv = VerInstallFileA( flags, lpszSrcFilename, lpszDestFilename,
|
|
|
|
lpszSrcDir, lpszDestDir, lpszCurDir,
|
1999-01-31 11:08:42 +01:00
|
|
|
lpszTmpFile, &filelen);
|
|
|
|
|
|
|
|
*lpwTmpFileLen = (UINT16)filelen;
|
|
|
|
return retv;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* VerLanguageName [VER.10]
|
1999-01-31 11:08:42 +01:00
|
|
|
*/
|
|
|
|
DWORD WINAPI VerLanguageName16( UINT16 uLang, LPSTR lpszLang, UINT16 cbLang )
|
|
|
|
{
|
1999-02-26 12:11:13 +01:00
|
|
|
return VerLanguageNameA( uLang, lpszLang, cbLang );
|
1999-01-31 11:08:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
2001-07-02 21:59:40 +02:00
|
|
|
* VerQueryValue [VER.11]
|
1999-01-31 11:08:42 +01:00
|
|
|
*/
|
2005-11-03 12:35:11 +01:00
|
|
|
DWORD WINAPI VerQueryValue16( SEGPTR spvBlock, LPSTR lpszSubBlock,
|
1999-01-31 11:08:42 +01:00
|
|
|
SEGPTR *lpspBuffer, UINT16 *lpcb )
|
|
|
|
{
|
2000-12-13 21:20:09 +01:00
|
|
|
LPVOID lpvBlock = MapSL( spvBlock );
|
1999-01-31 11:08:42 +01:00
|
|
|
LPVOID buffer = lpvBlock;
|
1999-02-26 12:11:13 +01:00
|
|
|
UINT buflen;
|
1999-01-31 11:08:42 +01:00
|
|
|
DWORD retv;
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
TRACE("(%p, %s, %p, %p)\n",
|
1999-01-31 11:08:42 +01:00
|
|
|
lpvBlock, debugstr_a(lpszSubBlock), lpspBuffer, lpcb );
|
|
|
|
|
1999-02-26 12:11:13 +01:00
|
|
|
retv = VerQueryValueA( lpvBlock, lpszSubBlock, &buffer, &buflen );
|
1999-01-31 11:08:42 +01:00
|
|
|
if ( !retv ) return FALSE;
|
|
|
|
|
1999-04-25 21:01:52 +02:00
|
|
|
if ( OFFSETOF( spvBlock ) + ((char *) buffer - (char *) lpvBlock) >= 0x10000 )
|
1999-01-31 11:08:42 +01:00
|
|
|
{
|
1999-05-14 10:17:14 +02:00
|
|
|
FIXME("offset %08X too large relative to %04X:%04X\n",
|
1999-04-25 21:01:52 +02:00
|
|
|
(char *) buffer - (char *) lpvBlock, SELECTOROF( spvBlock ), OFFSETOF( spvBlock ) );
|
1999-01-31 11:08:42 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2000-05-11 02:04:36 +02:00
|
|
|
if (lpcb) *lpcb = buflen;
|
1999-04-25 21:01:52 +02:00
|
|
|
*lpspBuffer = (SEGPTR) ((char *) spvBlock + ((char *) buffer - (char *) lpvBlock));
|
1999-01-31 11:08:42 +01:00
|
|
|
|
|
|
|
return retv;
|
|
|
|
}
|