wined3d: Do not activate vertex shaders needlessly.
[wine] / dlls / version / ver16.c
1 /*
2  * Implementation of VER.DLL
3  *
4  * Copyright 1999 Ulrich Weigand
5  *
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.
10  *
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.
15  *
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20
21 #include <stdarg.h>
22
23 #include "windef.h"
24 #include "winbase.h"
25 #include "wine/winbase16.h"
26 #include "winver.h"
27 #include "wine/debug.h"
28
29 WINE_DEFAULT_DEBUG_CHANNEL(ver);
30
31
32 /*************************************************************************
33  * GetFileVersionInfoSize                  [VER.6]
34  */
35 DWORD WINAPI GetFileVersionInfoSize16( LPCSTR lpszFileName, LPDWORD lpdwHandle )
36 {
37     TRACE("(%s, %p)\n", debugstr_a(lpszFileName), lpdwHandle );
38     return GetFileVersionInfoSizeA( lpszFileName, lpdwHandle );
39 }
40
41 /*************************************************************************
42  * GetFileVersionInfo                      [VER.7]
43  */
44 DWORD WINAPI GetFileVersionInfo16( LPCSTR lpszFileName, DWORD handle,
45                                    DWORD cbBuf, LPVOID lpvData )
46 {
47     TRACE("(%s, %08x, %d, %p)\n",
48                 debugstr_a(lpszFileName), handle, cbBuf, lpvData );
49
50     return GetFileVersionInfoA( lpszFileName, handle, cbBuf, lpvData );
51 }
52
53 /*************************************************************************
54  * VerFindFile                             [VER.8]
55  */
56 DWORD WINAPI VerFindFile16( UINT16 flags, LPSTR lpszFilename,
57                             LPSTR lpszWinDir, LPSTR lpszAppDir,
58                             LPSTR lpszCurDir, UINT16 *lpuCurDirLen,
59                             LPSTR lpszDestDir, UINT16 *lpuDestDirLen )
60 {
61     UINT curDirLen, destDirLen;
62     DWORD retv = VerFindFileA( flags, lpszFilename, lpszWinDir, lpszAppDir,
63                                  lpszCurDir, &curDirLen, lpszDestDir, &destDirLen );
64
65     *lpuCurDirLen = (UINT16)curDirLen;
66     *lpuDestDirLen = (UINT16)destDirLen;
67     return retv;
68 }
69
70 /*************************************************************************
71  * VerInstallFile                          [VER.9]
72  */
73 DWORD WINAPI VerInstallFile16( UINT16 flags,
74                                LPSTR lpszSrcFilename, LPSTR lpszDestFilename,
75                                LPSTR lpszSrcDir, LPSTR lpszDestDir, LPSTR lpszCurDir,
76                                LPSTR lpszTmpFile, UINT16 *lpwTmpFileLen )
77 {
78     UINT filelen;
79     DWORD retv = VerInstallFileA( flags, lpszSrcFilename, lpszDestFilename,
80                                     lpszSrcDir, lpszDestDir, lpszCurDir,
81                                     lpszTmpFile, &filelen);
82
83     *lpwTmpFileLen = (UINT16)filelen;
84     return retv;
85 }
86
87 /*************************************************************************
88  * VerLanguageName                        [VER.10]
89  */
90 DWORD WINAPI VerLanguageName16( UINT16 uLang, LPSTR lpszLang, UINT16 cbLang )
91 {
92     return VerLanguageNameA( uLang, lpszLang, cbLang );
93 }
94
95 /*************************************************************************
96  * VerQueryValue                          [VER.11]
97  */
98 DWORD WINAPI VerQueryValue16( SEGPTR spvBlock, LPSTR lpszSubBlock,
99                               SEGPTR *lpspBuffer, UINT16 *lpcb )
100 {
101     LPVOID lpvBlock = MapSL( spvBlock );
102     LPVOID buffer = lpvBlock;
103     UINT buflen;
104     DWORD retv;
105
106     TRACE("(%p, %s, %p, %p)\n",
107                 lpvBlock, debugstr_a(lpszSubBlock), lpspBuffer, lpcb );
108
109     retv = VerQueryValueA( lpvBlock, lpszSubBlock, &buffer, &buflen );
110     if ( !retv ) return FALSE;
111
112     if ( OFFSETOF( spvBlock ) + ((char *) buffer - (char *) lpvBlock) >= 0x10000 )
113     {
114         FIXME("offset %08X too large relative to %04X:%04X\n",
115                (char *) buffer - (char *) lpvBlock, SELECTOROF( spvBlock ), OFFSETOF( spvBlock ) );
116         return FALSE;
117     }
118
119     if (lpcb) *lpcb = buflen;
120     *lpspBuffer = (SEGPTR) ((char *) spvBlock + ((char *) buffer - (char *) lpvBlock));
121
122     return retv;
123 }