Added preferences to dinput drivers (so we can have two joystick
[wine/hacks.git] / dlls / version / ver16.c
blob85f1397680d04ae0da6fab8ab91d599528afcc1d
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 "ldt.h"
11 #include "debugtools.h"
13 DEFAULT_DEBUG_CHANNEL(ver);
16 /*************************************************************************
17 * GetFileVersionInfoSize16 [VER.6]
19 DWORD WINAPI GetFileVersionInfoSize16( LPCSTR lpszFileName, LPDWORD lpdwHandle )
21 TRACE("(%s, %p)\n", debugstr_a(lpszFileName), lpdwHandle );
22 return GetFileVersionInfoSizeA( lpszFileName, lpdwHandle );
25 /*************************************************************************
26 * GetFileVersionInfo16 [VER.7]
28 DWORD WINAPI GetFileVersionInfo16( LPCSTR lpszFileName, DWORD handle,
29 DWORD cbBuf, LPVOID lpvData )
31 TRACE("(%s, %08lx, %ld, %p)\n",
32 debugstr_a(lpszFileName), handle, cbBuf, lpvData );
34 return GetFileVersionInfoA( lpszFileName, handle, cbBuf, lpvData );
37 /*************************************************************************
38 * VerFindFile16 [VER.8]
40 DWORD WINAPI VerFindFile16( UINT16 flags, LPCSTR lpszFilename,
41 LPCSTR lpszWinDir, LPCSTR lpszAppDir,
42 LPSTR lpszCurDir, UINT16 *lpuCurDirLen,
43 LPSTR lpszDestDir, UINT16 *lpuDestDirLen )
45 UINT curDirLen, destDirLen;
46 DWORD retv = VerFindFileA( flags, lpszFilename, lpszWinDir, lpszAppDir,
47 lpszCurDir, &curDirLen, lpszDestDir, &destDirLen );
49 *lpuCurDirLen = (UINT16)curDirLen;
50 *lpuDestDirLen = (UINT16)destDirLen;
51 return retv;
54 /*************************************************************************
55 * VerInstallFile16 [VER.9]
57 DWORD WINAPI VerInstallFile16( UINT16 flags,
58 LPCSTR lpszSrcFilename, LPCSTR lpszDestFilename,
59 LPCSTR lpszSrcDir, LPCSTR lpszDestDir, LPCSTR lpszCurDir,
60 LPSTR lpszTmpFile, UINT16 *lpwTmpFileLen )
62 UINT filelen;
63 DWORD retv = VerInstallFileA( flags, lpszSrcFilename, lpszDestFilename,
64 lpszSrcDir, lpszDestDir, lpszCurDir,
65 lpszTmpFile, &filelen);
67 *lpwTmpFileLen = (UINT16)filelen;
68 return retv;
71 /*************************************************************************
72 * VerLanguageName16 [VER.10]
74 DWORD WINAPI VerLanguageName16( UINT16 uLang, LPSTR lpszLang, UINT16 cbLang )
76 return VerLanguageNameA( uLang, lpszLang, cbLang );
79 /*************************************************************************
80 * VerQueryValue16 [VER.11]
82 DWORD WINAPI VerQueryValue16( SEGPTR spvBlock, LPCSTR lpszSubBlock,
83 SEGPTR *lpspBuffer, UINT16 *lpcb )
85 LPVOID lpvBlock = PTR_SEG_TO_LIN( spvBlock );
86 LPVOID buffer = lpvBlock;
87 UINT buflen;
88 DWORD retv;
90 TRACE("(%p, %s, %p, %p)\n",
91 lpvBlock, debugstr_a(lpszSubBlock), lpspBuffer, lpcb );
93 retv = VerQueryValueA( lpvBlock, lpszSubBlock, &buffer, &buflen );
94 if ( !retv ) return FALSE;
96 if ( OFFSETOF( spvBlock ) + ((char *) buffer - (char *) lpvBlock) >= 0x10000 )
98 FIXME("offset %08X too large relative to %04X:%04X\n",
99 (char *) buffer - (char *) lpvBlock, SELECTOROF( spvBlock ), OFFSETOF( spvBlock ) );
100 return FALSE;
103 if (lpcb) *lpcb = buflen;
104 *lpspBuffer = (SEGPTR) ((char *) spvBlock + ((char *) buffer - (char *) lpvBlock));
106 return retv;