Sweden-Number/dlls/version/ver16.c

124 lines
4.3 KiB
C
Raw Normal View History

/*
* Implementation of VER.DLL
*
* Copyright 1999 Ulrich Weigand
*
* 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
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "wine/winbase16.h"
#include "winver.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ver);
/*************************************************************************
2001-07-02 21:59:40 +02:00
* GetFileVersionInfoSize [VER.6]
*/
DWORD WINAPI GetFileVersionInfoSize16( LPCSTR lpszFileName, LPDWORD lpdwHandle )
{
TRACE("(%s, %p)\n", debugstr_a(lpszFileName), lpdwHandle );
return GetFileVersionInfoSizeA( lpszFileName, lpdwHandle );
}
/*************************************************************************
2001-07-02 21:59:40 +02:00
* GetFileVersionInfo [VER.7]
*/
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",
debugstr_a(lpszFileName), handle, cbBuf, lpvData );
return GetFileVersionInfoA( lpszFileName, handle, cbBuf, lpvData );
}
/*************************************************************************
2001-07-02 21:59:40 +02:00
* VerFindFile [VER.8]
*/
2005-11-03 12:35:11 +01:00
DWORD WINAPI VerFindFile16( UINT16 flags, LPSTR lpszFilename,
LPSTR lpszWinDir, LPSTR lpszAppDir,
LPSTR lpszCurDir, UINT16 *lpuCurDirLen,
LPSTR lpszDestDir, UINT16 *lpuDestDirLen )
{
UINT curDirLen, destDirLen;
DWORD retv = VerFindFileA( flags, lpszFilename, lpszWinDir, lpszAppDir,
lpszCurDir, &curDirLen, lpszDestDir, &destDirLen );
*lpuCurDirLen = (UINT16)curDirLen;
*lpuDestDirLen = (UINT16)destDirLen;
return retv;
}
/*************************************************************************
2001-07-02 21:59:40 +02:00
* VerInstallFile [VER.9]
*/
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,
LPSTR lpszTmpFile, UINT16 *lpwTmpFileLen )
{
UINT filelen;
2002-06-01 01:06:46 +02:00
DWORD retv = VerInstallFileA( flags, lpszSrcFilename, lpszDestFilename,
lpszSrcDir, lpszDestDir, lpszCurDir,
lpszTmpFile, &filelen);
*lpwTmpFileLen = (UINT16)filelen;
return retv;
}
/*************************************************************************
2001-07-02 21:59:40 +02:00
* VerLanguageName [VER.10]
*/
DWORD WINAPI VerLanguageName16( UINT16 uLang, LPSTR lpszLang, UINT16 cbLang )
{
return VerLanguageNameA( uLang, lpszLang, cbLang );
}
/*************************************************************************
2001-07-02 21:59:40 +02:00
* VerQueryValue [VER.11]
*/
2005-11-03 12:35:11 +01:00
DWORD WINAPI VerQueryValue16( SEGPTR spvBlock, LPSTR lpszSubBlock,
SEGPTR *lpspBuffer, UINT16 *lpcb )
{
LPVOID lpvBlock = MapSL( spvBlock );
LPVOID buffer = lpvBlock;
UINT buflen;
DWORD retv;
2002-06-01 01:06:46 +02:00
TRACE("(%p, %s, %p, %p)\n",
lpvBlock, debugstr_a(lpszSubBlock), lpspBuffer, lpcb );
retv = VerQueryValueA( lpvBlock, lpszSubBlock, &buffer, &buflen );
if ( !retv ) return FALSE;
1999-04-25 21:01:52 +02:00
if ( OFFSETOF( spvBlock ) + ((char *) buffer - (char *) lpvBlock) >= 0x10000 )
{
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 ) );
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));
return retv;
}