ReactOS 0.4.17-dev-470-gf9e3448
IsOS.c File Reference
#include <apitest.h>
#include <shlwapi.h>
#include <versionhelpers.h>
Include dependency graph for IsOS.c:

Go to the source code of this file.

Classes

struct  ISOS_ENTRY
 

Macros

#define OS_WIN32SORGREATER   0x00
 
#define ISOS_ENTRY_LEVEL(level)   { level, #level }
 

Typedefs

typedef BOOL(WINAPIPFNISOS) (DWORD)
 

Functions

 START_TEST (IsOS)
 

Macro Definition Documentation

◆ ISOS_ENTRY_LEVEL

#define ISOS_ENTRY_LEVEL (   level)    { level, #level }

◆ OS_WIN32SORGREATER

#define OS_WIN32SORGREATER   0x00

Definition at line 13 of file IsOS.c.

Typedef Documentation

◆ PFNISOS

typedef BOOL(WINAPI * PFNISOS) (DWORD)

Definition at line 22 of file IsOS.c.

Function Documentation

◆ START_TEST()

START_TEST ( IsOS  )

Definition at line 24 of file IsOS.c.

25{
27 PFNISOS pIsOS;
28 size_t i;
29
30#define ISOS_ENTRY_LEVEL(level) { level, #level }
31 const ISOS_ENTRY FALSE_OS_Levels[] =
32 {
39 };
40
41 const ISOS_ENTRY TRUE_OS_Levels[] =
42 {
48 };
49#undef ISOS_ENTRY_LEVEL
50
51 hShlwapi = GetModuleHandleW(L"shlwapi.dll");
52 if (!hShlwapi)
53 {
54 skip(FALSE, "shlwapi.dll is not available\n");
55 return;
56 }
57
58 pIsOS = (PFNISOS)GetProcAddress(hShlwapi, "IsOS");
59 if (!pIsOS && !IsWindowsVistaOrGreater())
60 pIsOS = (PFNISOS)GetProcAddress(hShlwapi, (LPCSTR)437);
61 if (!pIsOS)
62 {
63 skip(FALSE, "IsOS is not available\n");
64 return;
65 }
66
67 for (i = 0; i < _countof(FALSE_OS_Levels); i++)
68 {
69 ok(pIsOS(FALSE_OS_Levels[i].Value) == FALSE, "Expected IsOS(%s) to return FALSE, got TRUE\n", FALSE_OS_Levels[i].Name);
70 }
71
72 for (i = 0; i < _countof(TRUE_OS_Levels); i++)
73 {
74 ok(pIsOS(TRUE_OS_Levels[i].Value) == TRUE, "Expected IsOS(%s) to return TRUE, got FALSE\n", TRUE_OS_Levels[i].Name);
75 }
76}
BOOL(WINAPI * PFNISOS)(DWORD)
Definition: IsOS.c:22
#define OS_WIN32SORGREATER
Definition: IsOS.c:13
#define ISOS_ENTRY_LEVEL(level)
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
static HMODULE hShlwapi
Definition: clsid.c:38
LPWSTR Name
Definition: desk.c:124
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
#define L(x)
Definition: resources.c:13
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define OS_WIN98_GOLD
Definition: shlwapi.h:232
#define OS_WIN95ORGREATER
Definition: shlwapi.h:228
#define OS_WIN95_GOLD
Definition: shlwapi.h:242
#define OS_WIN98ORGREATER
Definition: shlwapi.h:231
#define OS_NT
Definition: shlwapi.h:227
#define OS_MEORGREATER
Definition: shlwapi.h:243
#define OS_XPORGREATER
Definition: shlwapi.h:244
#define OS_WIN2000ORGREATER
Definition: shlwapi.h:233
#define OS_NT4ORGREATER
Definition: shlwapi.h:229
#define OS_FASTUSERSWITCHING
Definition: shlwapi.h:252
#define _countof(array)
Definition: sndvol32.h:70
Definition: IsOS.c:17
const char * LPCSTR
Definition: typedefs.h:52
VERSIONHELPERAPI IsWindowsVistaOrGreater()
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413