添加受保护路径 - ProtectFileAddProtectedPath
函数简介
添加受保护路径。(高级版功能,普通版无法使用)
接口名称
ProtectFileAddProtectedPath
DLL调用
int32_t ProtectFileAddProtectedPath(int64_t instance, string path, int32_t mode, int32_t is_directory);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| path | 字符串 | 要保护的文件或文件夹路径。 |
| mode | 整数型 | 保护模式:0-全部拦截(不参考白名单), 1-允许白名单(只允许白名单的进程访问), 2-黑名单拦截(只拦截指定黑名单进程)。 |
| is_directory | 整数型 | 是否为目录 (1-目录, 0-文件)。 |
示例
int64_t instance = CreateCOLAPlugInterFace();
int32_t ok = ProtectFileAddProtectedPath(instance, "C:\\Important\\file.txt", 0, 0);
printf("ProtectFileAddProtectedPath: %d\n", ok);
DestroyCOLAPlugInterFace(instance);
返回值
1 成功,其他失败。
注意事项
- 需要驱动支持与管理员权限。
- 保护模式:0-全部拦截, 1-允许白名单, 2-拦截黑名单。
