查询路径是否受保护 - ProtectFileQueryProtectedPath
函数简介
查询路径是否受保护。(高级版功能,普通版无法使用)
接口名称
ProtectFileQueryProtectedPath
DLL调用
int32_t ProtectFileQueryProtectedPath(int64_t instance, string path, int32_t* mode);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| path | 字符串 | 要查询的文件或文件夹路径。 |
| mode | 整数型指针 | 输出参数,用于接收该路径的保护模式(可为NULL)。 |
示例
int64_t instance = CreateCOLAPlugInterFace();
int32_t mode = 0;
int32_t ok = ProtectFileQueryProtectedPath(instance, "C:\\Important\\file.txt", &mode);
if (ok == 1) {
printf("路径受保护,模式: %d\n", mode);
} else {
printf("路径未受保护或查询失败\n");
}
DestroyCOLAPlugInterFace(instance);
返回值
1-路径受保护, 0-路径未受保护或查询失败。
注意事项
- 需要驱动支持与管理员权限。
- mode参数可为NULL,如果不需要获取保护模式。
