---
title: GetProductVersion
description: "获取安装版本KVSIP产品信息，包含软件名称、软件版本信息。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengaccel/system-lib/ug-kvsip/kunpengaccel_kvsip_06_0029.html
sourcePath: /source/zh/kunpengaccel/system-lib/ug-kvsip/kunpengaccel_kvsip_06_0029.html
indexId: 17f559d4ff7635b728a1ef010839f9873b26d511be514759c13296163655dfbd75
---
# GetProductVersion

获取安装版本KVSIP产品信息，包含软件名称、软件版本信息。

函数接口声明如下：

KvsipResult KVSIP_GetProductVersion(KvsipProVersion *packageInfo);

#### 返回值

- 成功：返回KVSIP_STS_NO_ERR。
- 失败：返回错误码。


#### 错误码

| 错误码 | 描述 |
| --- | --- |
| KVSIP\_STS\_NULL\_PTR\_ERR | KvsipProVersion指针为空指针。 |


#### 示例

```
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "kvsip.h"
#include "vsip.h"
#include "vsip_type.h"

void GetProductVersionExample()
{
    KvsipProVersion versionGet;
    KvsipResult result = KVSIP_GetProductVersion(&versionGet);
    KvsipProVersion *version = &versionGet;
    if (result == KVSIP_STS_NO_ERR) {
        printf("%s\n", version->componentName);
        printf("%s\n", version->packageVersion);
    }
}

int main(void) {
    GetProductVersionExample();
    return 0;
}
```

运行结果：

```
Component Name: BoostKit-kvsip
Component Version: 1.7.0
```
