IsWindowsServer function

Indicates if the current OS is a Windows Server release. Applications that need to distinguish between server and client versions of Windows should call this function.

Syntax


BOOL WINAPI IsWindowsServer(void);

Parameters

This function has no parameters.

Return value

True if the current OS is a Windows Server version; otherwise, false.

Examples

The inline functions defined in the VersionHelpers.h header file let you verify the operating system version by returning a Boolean value when testing for a version of Windows.

For example, if your application requires Windows Server, use the following test.


#include <VersionHelpers.h>
…
    if (!IsWindowsServer())
    {
       MessageBox(NULL, "You need a Windows Server release", "Version Not Supported", MB_OK);
    }


Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

VersionHelpers.h (include Windows.h)

Library

Kernel32.lib;
Ntdll.lib

DLL

Kernel32.dll;
Ntdll.dll

See also

IsWindowsXPOrGreater
IsWindowsXPSP1OrGreater
IsWindowsXPSP2OrGreater
IsWindowsXPSP3OrGreater
IsWindowsVistaOrGreater
IsWindowsVistaSP1OrGreater
IsWindowsVistaSP2OrGreater
IsWindows7OrGreater
IsWindows7SP1OrGreater
IsWindows8OrGreater
IsWindows8Point1OrGreater

 

 

Show: