2 * Internal (rtl/) reactos versioning functions of libcaptive
3 * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; exactly version 2 of June 1991 is required
9 * This program 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
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 /* no include file for RtlGetVersion() in reactos */
23 #include <glib/gmessages.h>
24 #include "reactos/ntos/types.h"
25 #include "reactos/ddk/status.h"
26 #include "captive/macros.h"
29 typedef struct _OSVERSIONINFOW {
30 ULONG dwOSVersionInfoSize;
35 WCHAR szCSDVersion[128];
36 } RTL_OSVERSIONINFOW,*PRTL_OSVERSIONINFOW;
38 typedef struct _OSVERSIONINFOEXW { /* sizeof==284 */
39 ULONG dwOSVersionInfoSize;
44 WCHAR szCSDVersion[128];
45 USHORT wServicePackMajor;
46 USHORT wServicePackMinor;
50 } RTL_OSVERSIONINFOEXW,*PRTL_OSVERSIONINFOEXW;
55 * @lpVersionInformation: Returns system version information.
57 * Functions looks at field #dwOSVersionInfoSize of @lpVersionInformation
58 * containing sizeof() of the passed structure to autodetect what it should
60 * libcaptive currently supports only #RTL_OSVERSIONINFOEXW.
61 * libcaptive returns version info corresponding to Microsoft Windows XP Service Pack 1.
63 * Returns: %STATUS_SUCCESS if @lpVersionInformation was filled successfuly.
65 NTSTATUS RtlGetVersion(OUT PRTL_OSVERSIONINFOW lpVersionInformation)
67 g_return_val_if_fail(lpVersionInformation!=NULL,STATUS_INVALID_PARAMETER);
69 switch (lpVersionInformation->dwOSVersionInfoSize) {
70 case sizeof(RTL_OSVERSIONINFOEXW): {
71 RTL_OSVERSIONINFOEXW *verinfoexw=(RTL_OSVERSIONINFOEXW *)lpVersionInformation;
73 verinfoexw->dwMajorVersion=5; /* NT-5.1 == Microsoft Windows XP */
74 verinfoexw->dwMinorVersion=1;
75 verinfoexw->dwBuildNumber=2600;
76 verinfoexw->dwPlatformId=2; /* ==Wine::VER_PLATFORM_WIN32_NT */
77 CAPTIVE_MEMZERO(verinfoexw->szCSDVersion); /* FIXME: should be L"Service Pack 1" ? */
78 verinfoexw->wServicePackMajor=1; /* Wine uses 0 */
79 verinfoexw->wServicePackMinor=0;
80 verinfoexw->wSuiteMask=0;
81 verinfoexw->wProductType=1; /* ==Wine::VER_NT_WORKSTATION, possible also VER_NT_DOMAIN_CONTROLLER or VER_NT_SERVER */
82 verinfoexw->wReserved=0;
85 g_assert_not_reached(); /* NOT YET IMPLEMENTED */
88 return STATUS_SUCCESS;