Simplified Detection for Windows 2000 Only Applications




Download 197,5 Kb.
bet45/49
Sana29.03.2021
Hajmi197,5 Kb.
#13691
1   ...   41   42   43   44   45   46   47   48   49

Simplified Detection for Windows 2000 Only Applications


If your application or service runs exclusively on the Windows 2000 operating system, you can simplify the IsTerminalServicesEnabled function by directly linking with the Windows 2000 product suite API VerifyVersionInfo (defined in WINBASE.H) and specifying a wSuiteMask of VER_SUITE_TERMINAL (defined in WINNT.H). This simplified code is as follows:

#include

#include
// This code will only work on the Windows 2000 platform
BOOL IsTerminalServicesEnabled(void)

{

OSVERSIONINFOEX osVersionInfo;



DWORDLONG dwlConditionMask = 0;
ZeroMemory(&osVersionInfo, sizeof(OSVERSIONINFOEX));

osVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);

osVersionInfo.wSuiteMask = VER_SUITE_TERMINAL;
VER_SET_CONDITION( dwlConditionMask, VER_SUITENAME, VER_AND );
return VerifyVersionInfo(

&osVersionInfo,

VER_SUITENAME,

dwlConditionMask

);

}


Download 197,5 Kb.
1   ...   41   42   43   44   45   46   47   48   49




Download 197,5 Kb.

Bosh sahifa
Aloqalar

    Bosh sahifa



Simplified Detection for Windows 2000 Only Applications

Download 197,5 Kb.