Commit 240b0a9b authored by Alexandre Julliard's avatar Alexandre Julliard

Moved the Windows version code to dlls/ntdll, and implemented

RtlGetVersion and RtlVerifyVersionInfo. Moved the 16-bit and DOS version support to dlls/kernel.
parent fe455456
......@@ -64,6 +64,7 @@ C_SRCS = \
time.c \
toolhelp.c \
utthunk.c \
version.c \
vxd.c \
win87em.c \
windebug.c \
......
......@@ -2074,10 +2074,20 @@ BOOL WINAPI WriteProcessMemory( HANDLE process, LPVOID addr, LPCVOID buffer, SIZ
return !status;
}
/****************************************************************************
* FlushInstructionCache (KERNEL32.@)
*/
BOOL WINAPI FlushInstructionCache(HANDLE hProcess, LPCVOID lpBaseAddress, SIZE_T dwSize)
{
if (GetVersion() & 0x80000000) return TRUE; /* not NT, always TRUE */
FIXME("(%p,%p,0x%08lx): stub\n",hProcess, lpBaseAddress, dwSize);
return TRUE;
}
/******************************************************************
* GetProcessIoCounters (KERNEL32.@)
*
*
*/
BOOL WINAPI GetProcessIoCounters(HANDLE hProcess, PIO_COUNTERS ioc)
{
......
......@@ -25,7 +25,6 @@ C_SRCS = \
$(TOPOBJDIR)/misc/cpu.c \
$(TOPOBJDIR)/misc/options.c \
$(TOPOBJDIR)/misc/registry.c \
$(TOPOBJDIR)/misc/version.c \
$(TOPOBJDIR)/msdos/dpmi.c \
$(TOPOBJDIR)/scheduler/handle.c \
$(TOPOBJDIR)/scheduler/process.c \
......@@ -62,6 +61,7 @@ C_SRCS = \
string.c \
sync.c \
sysdeps.c \
version.c \
thread.c \
time.c \
virtual.c \
......
......@@ -500,49 +500,6 @@ void WINAPI RtlAssert(LPVOID x1,LPVOID x2,DWORD x3, DWORD x4)
FIXME("(%p,%p,0x%08lx,0x%08lx),stub\n",x1,x2,x3,x4);
}
/******************************************************************************
* RtlGetNtVersionNumbers [NTDLL.@]
*
* Get the version numbers of the run time library.
*
* PARAMS
* major [O] Destination for the Major version
* minor [O] Destination for the Minor version
* build [O] Destination for the Build version
*
* RETURNS
* Nothing.
*
* NOTES
* Introduced in Windows XP (NT5.1)
*/
void WINAPI RtlGetNtVersionNumbers(LPDWORD major, LPDWORD minor, LPDWORD build)
{
OSVERSIONINFOEXW versionInfo;
versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXW);
GetVersionExW((OSVERSIONINFOW*)&versionInfo);
if (major)
{
/* msvcrt.dll as released with XP Home fails in DLLMain() if the
* major version is not 5. So, we should never set a version < 5 ...
* This makes sense since this call didn't exist before XP anyway.
*/
*major = versionInfo.dwMajorVersion < 5 ? 5 : versionInfo.dwMajorVersion;
}
if (minor)
{
*minor = versionInfo.dwMinorVersion;
}
if (build)
{
/* FIXME: Does anybody know the real formula? */
*build = (0xF0000000 | versionInfo.dwBuildNumber);
}
}
/*************************************************************************
* RtlFillMemoryUlong [NTDLL.@]
*
......
......@@ -1061,7 +1061,7 @@ static DWORD CDROM_Data_GetSerial(int drive)
if (offs)
{
BYTE buf[2048];
OSVERSIONINFOA ovi;
RTL_OSVERSIONINFOEXW ovi;
int i;
lseek(dev, offs, SEEK_SET);
......@@ -1071,8 +1071,8 @@ static DWORD CDROM_Data_GetSerial(int drive)
* Me$$ysoft chose to reverse the serial number in NT4/W2K.
* It's true and nobody will ever be able to change it.
*/
ovi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
GetVersionExA(&ovi);
ovi.dwOSVersionInfoSize = sizeof(ovi);
RtlGetVersion(&ovi);
if ((ovi.dwPlatformId == VER_PLATFORM_WIN32_NT) && (ovi.dwMajorVersion >= 4))
{
b0 = 3; b1 = 2; b2 = 1; b3 = 0;
......@@ -1674,9 +1674,9 @@ BOOL WINAPI GetDiskFreeSpaceExW( LPCWSTR root,
FIXME messages, so don't print the FIXME unless Wine is
actually masquerading as Windows2000. */
OSVERSIONINFOA ovi;
ovi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
if (GetVersionExA(&ovi))
RTL_OSVERSIONINFOEXW ovi;
ovi.dwOSVersionInfoSize = sizeof(ovi);
if (RtlGetVersion(&ovi))
{
if (ovi.dwPlatformId == VER_PLATFORM_WIN32_NT && ovi.dwMajorVersion > 4)
FIXME("no per-user quota support yet\n");
......
......@@ -833,100 +833,6 @@ typedef DWORD (CALLBACK *LPPROGRESS_ROUTINE)(LARGE_INTEGER, LARGE_INTEGER, LARGE
#define FORMAT_MESSAGE_ARGUMENT_ARRAY 0x00002000
#define FORMAT_MESSAGE_MAX_WIDTH_MASK 0x000000FF
typedef struct {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
CHAR szCSDVersion[128];
} OSVERSIONINFOA, *POSVERSIONINFOA, *LPOSVERSIONINFOA;
typedef struct {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
WCHAR szCSDVersion[128];
} OSVERSIONINFOW, *POSVERSIONINFOW, *LPOSVERSIONINFOW;
DECL_WINELIB_TYPE_AW(OSVERSIONINFO)
DECL_WINELIB_TYPE_AW(POSVERSIONINFO)
DECL_WINELIB_TYPE_AW(LPOSVERSIONINFO)
typedef struct {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
CHAR szCSDVersion[128];
WORD wServicePackMajor;
WORD wServicePackMinor;
WORD wSuiteMask;
BYTE wProductType;
BYTE wReserved;
} OSVERSIONINFOEXA, *POSVERSIONINFOEXA, *LPOSVERSIONINFOEXA;
typedef struct {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
WCHAR szCSDVersion[128];
WORD wServicePackMajor;
WORD wServicePackMinor;
WORD wSuiteMask;
BYTE wProductType;
BYTE wReserved;
} OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW;
DECL_WINELIB_TYPE_AW(OSVERSIONINFOEX)
DECL_WINELIB_TYPE_AW(POSVERSIONINFOEX)
DECL_WINELIB_TYPE_AW(LPOSVERSIONINFOEX)
ULONGLONG WINAPI VerSetConditionMask(ULONGLONG,DWORD,BYTE);
#define VER_SET_CONDITION(_m_,_t_,_c_) ((_m_)=VerSetConditionMask((_m_),(_t_),(_c_)))
#define VER_PLATFORM_WIN32s 0
#define VER_PLATFORM_WIN32_WINDOWS 1
#define VER_PLATFORM_WIN32_NT 2
#define VER_MINORVERSION 0x00000001
#define VER_MAJORVERSION 0x00000002
#define VER_BUILDNUMBER 0x00000004
#define VER_PLATFORMID 0x00000008
#define VER_SERVICEPACKMINOR 0x00000010
#define VER_SERVICEPACKMAJOR 0x00000020
#define VER_SUITENAME 0x00000040
#define VER_PRODUCT_TYPE 0x00000080
#define VER_NT_WORKSTATION 1
#define VER_NT_DOMAIN_CONTROLLER 2
#define VER_NT_SERVER 3
#define VER_SUITE_SMALLBUSINESS 0x00000001
#define VER_SUITE_ENTERPRISE 0x00000002
#define VER_SUITE_BACKOFFICE 0x00000004
#define VER_SUITE_COMMUNICATIONS 0x00000008
#define VER_SUITE_TERMINAL 0x00000010
#define VER_SUITE_SMALLBUSINESS_RESTRICTED 0x00000020
#define VER_SUITE_EMBEDDEDNT 0x00000040
#define VER_SUITE_DATACENTER 0x00000080
#define VER_SUITE_SINGLEUSERTS 0x00000100
#define VER_SUITE_PERSONAL 0x00000200
#define VER_EQUAL 1
#define VER_GREATER 2
#define VER_GREATER_EQUAL 3
#define VER_LESS 4
#define VER_LESS_EQUAL 5
#define VER_AND 6
#define VER_OR 7
typedef struct tagCOMSTAT
{
DWORD fCtsHold : 1;
......@@ -1102,11 +1008,6 @@ typedef enum _COMPUTER_NAME_FORMAT
ComputerNameMax
} COMPUTER_NAME_FORMAT;
/*DWORD WINAPI GetVersion( void );*/
BOOL WINAPI GetVersionExA(OSVERSIONINFOA*);
BOOL WINAPI GetVersionExW(OSVERSIONINFOW*);
#define GetVersionEx WINELIB_NAME_AW(GetVersionEx)
#define HW_PROFILE_GUIDLEN 39
#define MAX_PROFILE_LEN 80
......@@ -1725,7 +1626,10 @@ UINT WINAPI GetTempFileNameW(LPCWSTR,LPCWSTR,UINT,LPWSTR);
UINT WINAPI GetTempPathA(UINT,LPSTR);
UINT WINAPI GetTempPathW(UINT,LPWSTR);
#define GetTempPath WINELIB_NAME_AW(GetTempPath)
LONG WINAPI GetVersion(void);
DWORD WINAPI GetVersion(void);
BOOL WINAPI GetVersionExA(OSVERSIONINFOA*);
BOOL WINAPI GetVersionExW(OSVERSIONINFOW*);
#define GetVersionEx WINELIB_NAME_AW(GetVersionEx)
BOOL WINAPI GetVolumeInformationA(LPCSTR,LPSTR,DWORD,LPDWORD,LPDWORD,LPDWORD,LPSTR,DWORD);
BOOL WINAPI GetVolumeInformationW(LPCWSTR,LPWSTR,DWORD,LPDWORD,LPDWORD,LPDWORD,LPWSTR,DWORD);
#define GetVolumeInformation WINELIB_NAME_AW(GetVolumeInformation)
......
......@@ -179,8 +179,6 @@ typedef unsigned long DWORD, *PDWORD, *LPDWORD;
typedef unsigned long ULONG, *PULONG;
typedef float FLOAT, *PFLOAT;
#include <winnt.h>
/* Macros to map Winelib names to the correct implementation name */
/* Note that Winelib is purely Win32. */
......@@ -202,6 +200,7 @@ typedef float FLOAT, *PFLOAT;
# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
#endif /* __WINESRC__ */
#include <winnt.h>
/* Polymorphic types */
......
......@@ -309,7 +309,7 @@ DWORD WINAPI GetSelectorBase(WORD);
BOOL16 WINAPI GetStringType16(LCID,DWORD,LPCSTR,INT16,LPWORD);
UINT16 WINAPI GetSystemDirectory16(LPSTR,UINT16);
UINT16 WINAPI GetTempFileName16(BYTE,LPCSTR,UINT16,LPSTR);
LONG WINAPI GetVersion16(void);
DWORD WINAPI GetVersion16(void);
BOOL16 WINAPI GetVersionEx16(OSVERSIONINFO16*);
BOOL16 WINAPI GetWinDebugInfo16(LPWINDEBUGINFO16,UINT16);
UINT16 WINAPI GetWindowsDirectory16(LPSTR,UINT16);
......
......@@ -3610,4 +3610,98 @@ typedef struct _IO_COUNTERS {
} IO_COUNTERS;
typedef IO_COUNTERS *PIO_COUNTERS;
typedef struct {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
CHAR szCSDVersion[128];
} OSVERSIONINFOA, *POSVERSIONINFOA, *LPOSVERSIONINFOA;
typedef struct {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
WCHAR szCSDVersion[128];
} OSVERSIONINFOW, *POSVERSIONINFOW, *LPOSVERSIONINFOW, RTL_OSVERSIONINFOW, *PRTL_OSVERSIONINFOW;
DECL_WINELIB_TYPE_AW(OSVERSIONINFO)
DECL_WINELIB_TYPE_AW(POSVERSIONINFO)
DECL_WINELIB_TYPE_AW(LPOSVERSIONINFO)
typedef struct {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
CHAR szCSDVersion[128];
WORD wServicePackMajor;
WORD wServicePackMinor;
WORD wSuiteMask;
BYTE wProductType;
BYTE wReserved;
} OSVERSIONINFOEXA, *POSVERSIONINFOEXA, *LPOSVERSIONINFOEXA;
typedef struct {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
WCHAR szCSDVersion[128];
WORD wServicePackMajor;
WORD wServicePackMinor;
WORD wSuiteMask;
BYTE wProductType;
BYTE wReserved;
} OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW, RTL_OSVERSIONINFOEXW, *PRTL_OSVERSIONINFOEXW;
DECL_WINELIB_TYPE_AW(OSVERSIONINFOEX)
DECL_WINELIB_TYPE_AW(POSVERSIONINFOEX)
DECL_WINELIB_TYPE_AW(LPOSVERSIONINFOEX)
ULONGLONG WINAPI VerSetConditionMask(ULONGLONG,DWORD,BYTE);
#define VER_SET_CONDITION(_m_,_t_,_c_) ((_m_)=VerSetConditionMask((_m_),(_t_),(_c_)))
#define VER_PLATFORM_WIN32s 0
#define VER_PLATFORM_WIN32_WINDOWS 1
#define VER_PLATFORM_WIN32_NT 2
#define VER_MINORVERSION 0x00000001
#define VER_MAJORVERSION 0x00000002
#define VER_BUILDNUMBER 0x00000004
#define VER_PLATFORMID 0x00000008
#define VER_SERVICEPACKMINOR 0x00000010
#define VER_SERVICEPACKMAJOR 0x00000020
#define VER_SUITENAME 0x00000040
#define VER_PRODUCT_TYPE 0x00000080
#define VER_NT_WORKSTATION 1
#define VER_NT_DOMAIN_CONTROLLER 2
#define VER_NT_SERVER 3
#define VER_SUITE_SMALLBUSINESS 0x00000001
#define VER_SUITE_ENTERPRISE 0x00000002
#define VER_SUITE_BACKOFFICE 0x00000004
#define VER_SUITE_COMMUNICATIONS 0x00000008
#define VER_SUITE_TERMINAL 0x00000010
#define VER_SUITE_SMALLBUSINESS_RESTRICTED 0x00000020
#define VER_SUITE_EMBEDDEDNT 0x00000040
#define VER_SUITE_DATACENTER 0x00000080
#define VER_SUITE_SINGLEUSERTS 0x00000100
#define VER_SUITE_PERSONAL 0x00000200
#define VER_EQUAL 1
#define VER_GREATER 2
#define VER_GREATER_EQUAL 3
#define VER_LESS 4
#define VER_LESS_EQUAL 5
#define VER_AND 6
#define VER_OR 7
#endif /* __WINE_WINNT_H */
......@@ -1147,6 +1147,7 @@ BOOLEAN WINAPI RtlGetNtProductType(LPDWORD);
NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
NTSTATUS WINAPI RtlGetVersion(RTL_OSVERSIONINFOEXW*);
PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID);
PVOID WINAPI RtlImageDirectoryEntryToData(HMODULE,BOOL,WORD,ULONG *);
......@@ -1269,6 +1270,7 @@ NTSTATUS WINAPI RtlValidSecurityDescriptor(PSECURITY_DESCRIPTOR);
BOOLEAN WINAPI RtlValidAcl(PACL);
BOOLEAN WINAPI RtlValidSid(PSID);
BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,LPCVOID);
NTSTATUS WINAPI RtlVerifyVersionInfo(const RTL_OSVERSIONINFOEXW*,DWORD,DWORDLONG);
NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID);
......
......@@ -45,17 +45,6 @@ at a later date. */
WINE_DEFAULT_DEBUG_CHANNEL(win32);
/****************************************************************************
* FlushInstructionCache (KERNEL32.@)
*/
BOOL WINAPI FlushInstructionCache(HANDLE hProcess, LPCVOID lpBaseAddress, SIZE_T dwSize)
{
if (GetVersion() & 0x80000000) return TRUE; /* not NT, always TRUE */
FIXME("(%p,%p,0x%08lx): stub\n",hProcess, lpBaseAddress, dwSize);
return TRUE;
}
/******************************************************************************
* GetCompressedFileSizeA [KERNEL32.@]
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment