2 * Use the GetVersionEx() Win32 API call to show information about
3 * which version of Windows we're running (or which version of Windows
4 * Wine believes it is masquerading as).
6 * Copyright 1999 by Morten Eriksen <mailto:mortene@sim.no>
21 lasterr
= GetLastError();
23 result
= FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER
|
24 FORMAT_MESSAGE_FROM_SYSTEM
|
25 FORMAT_MESSAGE_IGNORE_INSERTS
,
34 fprintf(stderr
, "Win32 API error (%ld):\t%s", lasterr
, buffer
);
35 LocalFree((HLOCAL
)buffer
);
38 fprintf(stderr
, "Win32 API error (%ld)", lasterr
);
43 wine_main(int argc
, char ** argv
)
48 /* FIXME: GetVersionEx() is a Win32 API call, so there should be a
49 preliminary check to see if we're running bare-bones Windows3.xx
50 (or even lower?). 19990916 mortene. */
52 oiv
.dwOSVersionInfoSize
= sizeof(OSVERSIONINFO
);
53 result
= GetVersionEx(&oiv
);
55 if (result
== FALSE
) {
59 char * platforms
[] = {
60 "Win32s on Windows 3.1",
61 "Win32 on Windows 95 or Windows 98",
62 "Win32 on Windows NT/Windows 2000",
67 switch (oiv
.dwPlatformId
) {
68 case VER_PLATFORM_WIN32s
: platformval
= 0; break;
69 case VER_PLATFORM_WIN32_WINDOWS
: platformval
= 1; break;
70 case VER_PLATFORM_WIN32_NT
: platformval
= 2; break;
74 "MajorVersion: %ld\nMinorVersion: %ld\nBuildNumber: 0x%lx\n"
75 "Platform: %s\nCSDVersion: '%s'\n",
76 oiv
.dwMajorVersion
, oiv
.dwMinorVersion
, oiv
.dwBuildNumber
,
77 platforms
[platformval
], oiv
.szCSDVersion
);