msiQueryFeatureStateW 函数 (msi.h)

MsiQueryFeatureState 函数返回产品功能的已安装状态。

语法

INSTALLSTATE MsiQueryFeatureStateW(
  [in] LPCWSTR szProduct,
  [in] LPCWSTR szFeature
);

参数

[in] szProduct

指定包含相关功能的产品的产品代码。

[in] szFeature

标识感兴趣的功能。

返回值

含义
INSTALLSTATE_ABSENT
未安装该功能。
INSTALLSTATE_ADVERTISED
该功能已播发。
INSTALLSTATE_LOCAL
该功能已在本地安装。
INSTALLSTATE_SOURCE
该功能已安装为从源运行。
INSTALLSTATE_INVALIDARG
向该函数传递了无效参数。
INSTALLSTATE_UNKNOWN
产品代码或功能 ID 未知。
 
 

注解

MsiQueryFeatureState 函数不会验证该功能是否实际可访问。

注意

msi.h 标头将 MsiQueryFeatureState 定义为别名,该别名根据 UNICODE 预处理器常量的定义自动选择此函数的 ANSI 或 Unicode 版本。 将非特定编码别名的使用与非非特定编码的代码混合使用可能会导致不匹配,从而导致编译或运行时错误。 有关详细信息,请参阅 函数原型的约定

要求

要求
最低受支持的客户端 Windows Server 2012、Windows 8、Windows Server 2008 R2 或 Windows 7 上的 Windows Installer 5.0。 Windows Server 2008 或 Windows Vista 上的 Windows Installer 4.0 或 Windows Installer 4.5。 Windows Server 2003 或 Windows XP 上的 Windows Installer。 若要了解 Windows Installer 版本所需的最低 Windows Service Pack,请参阅 Windows Installer 运行时要求。
目标平台 Windows
标头 msi.h
Library Msi.lib
DLL Msi.dll

另请参阅

系统状态函数