Commit edd49c78 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

Implemented IsOS function.

parent 0a4d8f7f
......@@ -49,6 +49,7 @@
#include "winreg.h"
#include "wine/debug.h"
#include "shlwapi.h"
#include "winnt.h"
WINE_DEFAULT_DEBUG_CHANNEL(shell);
......@@ -3659,12 +3660,118 @@ HRESULT WINAPI CLSIDFromStringWrap(LPCWSTR idstr, CLSID *id)
* TRUE If the feature is available.
* FALSE If the feature is not available.
*/
DWORD WINAPI IsOS(DWORD feature)
BOOL WINAPI IsOS(DWORD feature)
{
FIXME("(0x%08lx) stub\n", feature);
if (feature == 4)
return TRUE;
return FALSE;
OSVERSIONINFOA osvi;
DWORD platform, majorv, minorv;
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
if(!GetVersionExA(&osvi)) {
ERR("GetVersionEx failed");
return FALSE;
}
majorv = osvi.dwMajorVersion;
minorv = osvi.dwMinorVersion;
platform = osvi.dwPlatformId;
#define ISOS_RETURN(x) \
TRACE("(0x%lx) ret=%d\n",feature,(x)); \
return (x);
switch(feature) {
case OS_WIN32SORGREATER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32s
|| platform == VER_PLATFORM_WIN32_WINDOWS)
case OS_NT:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT)
case OS_WIN95ORGREATER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_WINDOWS)
case OS_NT4ORGREATER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT && majorv >= 4)
case OS_WIN2000ORGREATER_ALT:
case OS_WIN2000ORGREATER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT && majorv >= 5)
case OS_WIN98ORGREATER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_WINDOWS && minorv >= 10)
case OS_WIN98_GOLD:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_WINDOWS && minorv == 10)
case OS_WIN2000PRO:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT && majorv >= 5)
case OS_WIN2000SERVER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT && (minorv == 0 || minorv == 1))
case OS_WIN2000ADVSERVER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT && (minorv == 0 || minorv == 1))
case OS_WIN2000DATACENTER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT && (minorv == 0 || minorv == 1))
case OS_WIN2000TERMINAL:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT && (minorv == 0 || minorv == 1))
case OS_EMBEDDED:
FIXME("(OS_EMBEDDED) What should we return here?\n");
return FALSE;
case OS_TERMINALCLIENT:
FIXME("(OS_TERMINALCLIENT) What should we return here?\n");
return FALSE;
case OS_TERMINALREMOTEADMIN:
FIXME("(OS_TERMINALREMOTEADMIN) What should we return here?\n");
return FALSE;
case OS_WIN95_GOLD:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_WINDOWS && minorv == 0)
case OS_MEORGREATER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_WINDOWS && minorv >= 90)
case OS_XPORGREATER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT && majorv >= 5 && minorv >= 1)
case OS_HOME:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT && majorv >= 5 && minorv >= 1)
case OS_PROFESSIONAL:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT)
case OS_DATACENTER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT)
case OS_ADVSERVER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT && majorv >= 5)
case OS_SERVER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT)
case OS_TERMINALSERVER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT)
case OS_PERSONALTERMINALSERVER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT && minorv >= 1 && majorv >= 5)
case OS_FASTUSERSWITCHING:
FIXME("(OS_FASTUSERSWITCHING) What should we return here?\n");
return TRUE;
case OS_WELCOMELOGONUI:
FIXME("(OS_WELCOMELOGONUI) What should we return here?\n");
return FALSE;
case OS_DOMAINMEMBER:
FIXME("(OS_DOMAINMEMBER) What should we return here?\n");
return TRUE;
case OS_ANYSERVER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT)
case OS_WOW6432:
FIXME("(OS_WOW6432) Should we check this?\n");
return FALSE;
case OS_WEBSERVER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT)
case OS_SMALLBUSINESSSERVER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT)
case OS_TABLETPC:
FIXME("(OS_TABLEPC) What should we return here?\n");
return FALSE;
case OS_SERVERADMINUI:
FIXME("(OS_SERVERADMINUI) What should we return here?\n");
return FALSE;
case OS_MEDIACENTER:
FIXME("(OS_MEDIACENTER) What should we return here?\n");
return FALSE;
case OS_APPLIANCE:
FIXME("(OS_APPLIANCE) What should we return here?\n");
return FALSE;
}
#undef ISOS_RETURN
WARN("(0x%lx) unknown parameter\n",feature);
return FALSE;
}
/*************************************************************************
......
......@@ -939,6 +939,49 @@ typedef struct _DLLVERSIONINFO2 {
HRESULT WINAPI DllInstall(BOOL,LPCWSTR);
/* IsOS definitions */
#define OS_WIN32SORGREATER 0x00
#define OS_NT 0x01
#define OS_WIN95ORGREATER 0x02
#define OS_NT4ORGREATER 0x03
#define OS_WIN2000ORGREATER_ALT 0x04
#define OS_WIN98ORGREATER 0x05
#define OS_WIN98_GOLD 0x06
#define OS_WIN2000ORGREATER 0x07
#define OS_WIN2000PRO 0x08
#define OS_WIN2000SERVER 0x09
#define OS_WIN2000ADVSERVER 0x0A
#define OS_WIN2000DATACENTER 0x0B
#define OS_WIN2000TERMINAL 0x0C
#define OS_EMBEDDED 0x0D
#define OS_TERMINALCLIENT 0x0E
#define OS_TERMINALREMOTEADMIN 0x0F
#define OS_WIN95_GOLD 0x10
#define OS_MEORGREATER 0x11
#define OS_XPORGREATER 0x12
#define OS_HOME 0x13
#define OS_PROFESSIONAL 0x14
#define OS_DATACENTER 0x15
#define OS_ADVSERVER 0x16
#define OS_SERVER 0x17
#define OS_TERMINALSERVER 0x18
#define OS_PERSONALTERMINALSERVER 0x19
#define OS_FASTUSERSWITCHING 0x1A
#define OS_WELCOMELOGONUI 0x1B
#define OS_DOMAINMEMBER 0x1C
#define OS_ANYSERVER 0x1D
#define OS_WOW6432 0x1E
#define OS_WEBSERVER 0x1F
#define OS_SMALLBUSINESSSERVER 0x20
#define OS_TABLETPC 0x21
#define OS_SERVERADMINUI 0x22
#define OS_MEDIACENTER 0x23
#define OS_APPLIANCE 0x24
BOOL WINAPI IsOS(DWORD);
#include <poppack.h>
#ifdef __cplusplus
......
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