Fixed header dependencies to be fully compatible with the Windows
[wine/multimedia.git] / dlls / version / ver16.c
blobab9ff3deb1272aa0affcecf73a3e51c17a0237c0
1 /*
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
21 #include <stdarg.h>
23 #include "windef.h"
24 #include "winbase.h"
25 #include "wine/winbase16.h"
26 #include "winver.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 /*************************************************************************
54 * VerFindFile [VER.8]
56 DWORD WINAPI VerFindFile16( UINT16 flags, LPCSTR lpszFilename,
57 LPCSTR lpszWinDir, LPCSTR 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;
67 return retv;
70 /*************************************************************************
71 * VerInstallFile [VER.9]
73 DWORD WINAPI VerInstallFile16( UINT16 flags,
74 LPCSTR lpszSrcFilename, LPCSTR lpszDestFilename,
75 LPCSTR lpszSrcDir, LPCSTR lpszDestDir, LPCSTR lpszCurDir,
76 LPSTR lpszTmpFile, UINT16 *lpwTmpFileLen )
78 UINT filelen;
79 DWORD retv = VerInstallFileA( flags, lpszSrcFilename, lpszDestFilename,
80 lpszSrcDir, lpszDestDir, lpszCurDir,
81 lpszTmpFile, &filelen);
83 *lpwTmpFileLen = (UINT16)filelen;
84 return retv;
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, LPCSTR lpszSubBlock,
99 SEGPTR *lpspBuffer, UINT16 *lpcb )
101 LPVOID lpvBlock = MapSL( spvBlock );
102 LPVOID buffer = lpvBlock;
103 UINT buflen;
104 DWORD retv;
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 ) );
116 return FALSE;
119 if (lpcb) *lpcb = buflen;
120 *lpspBuffer = (SEGPTR) ((char *) spvBlock + ((char *) buffer - (char *) lpvBlock));
122 return retv;