Increase debug buffer size up to 1024 bytes.
[wine.git] / dlls / version / ver16.c
blob889c153433ead1019b86ea48b2dbc74ee6e3e4cc
1 /*
2 * Implementation of VER.DLL
4 * Copyright 1999 Ulrich Weigand
5 */
7 #include "winbase.h"
8 #include "wine/winbase16.h"
9 #include "winver.h"
10 #include "debugtools.h"
12 DEFAULT_DEBUG_CHANNEL(ver);
15 /*************************************************************************
16 * GetFileVersionInfoSize16 [VER.6]
18 DWORD WINAPI GetFileVersionInfoSize16( LPCSTR lpszFileName, LPDWORD lpdwHandle )
20 TRACE("(%s, %p)\n", debugstr_a(lpszFileName), lpdwHandle );
21 return GetFileVersionInfoSizeA( lpszFileName, lpdwHandle );
24 /*************************************************************************
25 * GetFileVersionInfo16 [VER.7]
27 DWORD WINAPI GetFileVersionInfo16( LPCSTR lpszFileName, DWORD handle,
28 DWORD cbBuf, LPVOID lpvData )
30 TRACE("(%s, %08lx, %ld, %p)\n",
31 debugstr_a(lpszFileName), handle, cbBuf, lpvData );
33 return GetFileVersionInfoA( lpszFileName, handle, cbBuf, lpvData );
36 /*************************************************************************
37 * VerFindFile16 [VER.8]
39 DWORD WINAPI VerFindFile16( UINT16 flags, LPCSTR lpszFilename,
40 LPCSTR lpszWinDir, LPCSTR lpszAppDir,
41 LPSTR lpszCurDir, UINT16 *lpuCurDirLen,
42 LPSTR lpszDestDir, UINT16 *lpuDestDirLen )
44 UINT curDirLen, destDirLen;
45 DWORD retv = VerFindFileA( flags, lpszFilename, lpszWinDir, lpszAppDir,
46 lpszCurDir, &curDirLen, lpszDestDir, &destDirLen );
48 *lpuCurDirLen = (UINT16)curDirLen;
49 *lpuDestDirLen = (UINT16)destDirLen;
50 return retv;
53 /*************************************************************************
54 * VerInstallFile16 [VER.9]
56 DWORD WINAPI VerInstallFile16( UINT16 flags,
57 LPCSTR lpszSrcFilename, LPCSTR lpszDestFilename,
58 LPCSTR lpszSrcDir, LPCSTR lpszDestDir, LPCSTR lpszCurDir,
59 LPSTR lpszTmpFile, UINT16 *lpwTmpFileLen )
61 UINT filelen;
62 DWORD retv = VerInstallFileA( flags, lpszSrcFilename, lpszDestFilename,
63 lpszSrcDir, lpszDestDir, lpszCurDir,
64 lpszTmpFile, &filelen);
66 *lpwTmpFileLen = (UINT16)filelen;
67 return retv;
70 /*************************************************************************
71 * VerLanguageName16 [VER.10]
73 DWORD WINAPI VerLanguageName16( UINT16 uLang, LPSTR lpszLang, UINT16 cbLang )
75 return VerLanguageNameA( uLang, lpszLang, cbLang );
78 /*************************************************************************
79 * VerQueryValue16 [VER.11]
81 DWORD WINAPI VerQueryValue16( SEGPTR spvBlock, LPCSTR lpszSubBlock,
82 SEGPTR *lpspBuffer, UINT16 *lpcb )
84 LPVOID lpvBlock = MapSL( spvBlock );
85 LPVOID buffer = lpvBlock;
86 UINT buflen;
87 DWORD retv;
89 TRACE("(%p, %s, %p, %p)\n",
90 lpvBlock, debugstr_a(lpszSubBlock), lpspBuffer, lpcb );
92 retv = VerQueryValueA( lpvBlock, lpszSubBlock, &buffer, &buflen );
93 if ( !retv ) return FALSE;
95 if ( OFFSETOF( spvBlock ) + ((char *) buffer - (char *) lpvBlock) >= 0x10000 )
97 FIXME("offset %08X too large relative to %04X:%04X\n",
98 (char *) buffer - (char *) lpvBlock, SELECTOROF( spvBlock ), OFFSETOF( spvBlock ) );
99 return FALSE;
102 if (lpcb) *lpcb = buflen;
103 *lpspBuffer = (SEGPTR) ((char *) spvBlock + ((char *) buffer - (char *) lpvBlock));
105 return retv;