2 * Copyright (c) 2005 Robert Reif
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #define DIRECTINPUT_VERSION 0x0700
22 #define NONAMELESSSTRUCT
23 #define NONAMELESSUNION
30 #include "wine/test.h"
35 #include "dinput_test.h"
37 const char * get_file_version(const char * file_name
)
39 static char version
[32];
43 size
= GetFileVersionInfoSizeA(file_name
, &handle
);
45 char * data
= HeapAlloc(GetProcessHeap(), 0, size
);
47 if (GetFileVersionInfoA(file_name
, handle
, size
, data
)) {
48 VS_FIXEDFILEINFO
*pFixedVersionInfo
;
50 if (VerQueryValueA(data
, "\\", (LPVOID
*)&pFixedVersionInfo
, &len
)) {
51 sprintf(version
, "%ld.%ld.%ld.%ld",
52 pFixedVersionInfo
->dwFileVersionMS
>> 16,
53 pFixedVersionInfo
->dwFileVersionMS
& 0xffff,
54 pFixedVersionInfo
->dwFileVersionLS
>> 16,
55 pFixedVersionInfo
->dwFileVersionLS
& 0xffff);
57 sprintf(version
, "not available");
59 sprintf(version
, "failed");
61 HeapFree(GetProcessHeap(), 0, data
);
63 sprintf(version
, "failed");
65 sprintf(version
, "not available");
70 static void keyboard_tests()
78 trace("DLL Version: %s\n", get_file_version("dinput.dll"));