Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.7 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996-1999 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // IsTerminalServicesInstalled.cpp
  7. //
  8. // Abstract:
  9. // This module includes the functions necessary to determine whether
  10. // Terminal Serivces is installed.
  11. //
  12. // Author:
  13. // C. Brent Thomas (a-brentt)
  14. //
  15. // Revision History:
  16. // 03 Feb 1998 - original
  17. //
  18. // Notes:
  19. // Clustering service and Terminal Services are mutually exclusive due to
  20. // a Product management decision regarding the lack of testing resources.
  21. // Sooner or later that restriction will be lifted.
  22. //
  23. /////////////////////////////////////////////////////////////////////////////
  24. #include <windows.h>
  25. #include <winbase.h>
  26. /////////////////////////////////////////////////////////////////////////////
  27. //++
  28. //
  29. // IsTerminalServicesInstalled
  30. //
  31. // Routine Description:
  32. // This function determines whether Terminal Services is installed.
  33. //
  34. // Arguments:
  35. // None
  36. //
  37. // Return Value:
  38. // TRUE - indicates that Terminal Services is installed.
  39. //
  40. //--
  41. /////////////////////////////////////////////////////////////////////////////
  42. BOOL IsTerminalServicesInstalled( void )
  43. {
  44. BOOL fReturnValue;
  45. OSVERSIONINFOEX osiv;
  46. ZeroMemory( &osiv, sizeof( OSVERSIONINFOEX ) );
  47. osiv.dwOSVersionInfoSize = sizeof( OSVERSIONINFOEX );
  48. osiv.wSuiteMask = VER_SUITE_TERMINAL;
  49. DWORDLONG dwlConditionMask;
  50. dwlConditionMask = (DWORDLONG) 0L;
  51. VER_SET_CONDITION( dwlConditionMask, VER_SUITENAME, VER_AND );
  52. fReturnValue = VerifyVersionInfo( &osiv,
  53. VER_SUITENAME,
  54. dwlConditionMask );
  55. return ( fReturnValue );
  56. }