다음을 통해 공유


Product Suite 검색

다음 예제에서는 VerifyVersionInfo 함수를 사용하여 지정된 제품 제품군이 로컬 컴퓨터에 설치되어 있는지 여부를 확인합니다.

이 예제에서는 VER_AND 플래그를 사용합니다. 제품군 마스크에 두 개의 플래그가 지정된 경우 함수는 두 제품 제품군이 모두 있는 경우에만 TRUE 를 반환합니다. 예제가 VER_OR 플래그를 사용하도록 변경된 경우 두 제품 제품군이 있는 경우 VerifyVersionInfoTRUE 를 반환합니다.

#include <windows.h>
#include <stdio.h>

BOOL CheckProductSuite ( WORD wSuite ) 
{
  OSVERSIONINFOEX osvi;
  DWORDLONG dwlConditionMask = 0;

  // Initialize the OSVERSIONINFOEX structure.

  ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
  osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
  osvi.wSuiteMask = wSuite;

  // Set up the condition mask.

  VER_SET_CONDITION( dwlConditionMask, 
          VER_SUITENAME, VER_AND );

  // Perform the test.

  return VerifyVersionInfo(
          &osvi, 
          VER_SUITENAME,
          dwlConditionMask);
}

void main()
{
    if( CheckProductSuite(VER_SUITE_ENTERPRISE) )
        printf( "The system meets the requirements.\n" );
    else printf( "The system does not meet the requirements.\n");
}