添加VMware DMA设备 - DmaAddDevice
函数简介
添加 VMware DMA 设备,使用默认连接字符串快速添加 VMware 虚拟机作为 DMA 设备。(高级版功能,普通版无法使用)
接口名称
DmaAddDevice
DLL调用
int64_t OLA_CALL_TYPE DmaAddDevice(int64_t instance, int32_t vmId);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| vmId | 整数型 | VMware虚拟机ID |
示例
int64_t deviceId = DmaAddDevice(instance, 1);
if (deviceId >= 0) {
printf("设备添加成功,设备ID: %lld\n", deviceId);
} else {
printf("设备添加失败\n");
}
返回值
长整数型:成功返回设备ID (>=0),失败返回 -1。
