2 * Implementation of VER.DLL
4 * Copyright 1999 Ulrich Weigand
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "wine/winbase16.h"
27 #include "wine/debug.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(ver);
32 /*************************************************************************
33 * GetFileVersionInfoSize [VER.6]
35 DWORD WINAPI GetFileVersionInfoSize16( LPCSTR lpszFileName, LPDWORD lpdwHandle )
37 TRACE("(%s, %p)\n", debugstr_a(lpszFileName), lpdwHandle );
38 return GetFileVersionInfoSizeA( lpszFileName, lpdwHandle );
41 /*************************************************************************
42 * GetFileVersionInfo [VER.7]
44 DWORD WINAPI GetFileVersionInfo16( LPCSTR lpszFileName, DWORD handle,
45 DWORD cbBuf, LPVOID lpvData )
47 TRACE("(%s, %08lx, %ld, %p)\n",
48 debugstr_a(lpszFileName), handle, cbBuf, lpvData );
50 return GetFileVersionInfoA( lpszFileName, handle, cbBuf, lpvData );
53 /*************************************************************************
56 DWORD WINAPI VerFindFile16( UINT16 flags, LPSTR lpszFilename,
57 LPSTR lpszWinDir, LPSTR lpszAppDir,
58 LPSTR lpszCurDir, UINT16 *lpuCurDirLen,
59 LPSTR lpszDestDir, UINT16 *lpuDestDirLen )
61 UINT curDirLen, destDirLen;
62 DWORD retv = VerFindFileA( flags, lpszFilename, lpszWinDir, lpszAppDir,
63 lpszCurDir, &curDirLen, lpszDestDir, &destDirLen );
65 *lpuCurDirLen = (UINT16)curDirLen;
66 *lpuDestDirLen = (UINT16)destDirLen;
70 /*************************************************************************
71 * VerInstallFile [VER.9]
73 DWORD WINAPI VerInstallFile16( UINT16 flags,
74 LPSTR lpszSrcFilename, LPSTR lpszDestFilename,
75 LPSTR lpszSrcDir, LPSTR lpszDestDir, LPSTR lpszCurDir,
76 LPSTR lpszTmpFile, UINT16 *lpwTmpFileLen )
79 DWORD retv = VerInstallFileA( flags, lpszSrcFilename, lpszDestFilename,
80 lpszSrcDir, lpszDestDir, lpszCurDir,
81 lpszTmpFile, &filelen);
83 *lpwTmpFileLen = (UINT16)filelen;
87 /*************************************************************************
88 * VerLanguageName [VER.10]
90 DWORD WINAPI VerLanguageName16( UINT16 uLang, LPSTR lpszLang, UINT16 cbLang )
92 return VerLanguageNameA( uLang, lpszLang, cbLang );
95 /*************************************************************************
96 * VerQueryValue [VER.11]
98 DWORD WINAPI VerQueryValue16( SEGPTR spvBlock, LPSTR lpszSubBlock,
99 SEGPTR *lpspBuffer, UINT16 *lpcb )
101 LPVOID lpvBlock = MapSL( spvBlock );
102 LPVOID buffer = lpvBlock;
106 TRACE("(%p, %s, %p, %p)\n",
107 lpvBlock, debugstr_a(lpszSubBlock), lpspBuffer, lpcb );
109 retv = VerQueryValueA( lpvBlock, lpszSubBlock, &buffer, &buflen );
110 if ( !retv ) return FALSE;
112 if ( OFFSETOF( spvBlock ) + ((char *) buffer - (char *) lpvBlock) >= 0x10000 )
114 FIXME("offset %08X too large relative to %04X:%04X\n",
115 (char *) buffer - (char *) lpvBlock, SELECTOROF( spvBlock ), OFFSETOF( spvBlock ) );
119 if (lpcb) *lpcb = buflen;
120 *lpspBuffer = (SEGPTR) ((char *) spvBlock + ((char *) buffer - (char *) lpvBlock));