C++ 如何通过 win32 api 检索文件权限和所有权

2023-10-17C/C++开发问题
0

本文介绍了C++ 如何通过 win32 api 检索文件权限和所有权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我一直在互联网上搜索如何使用 win32 api 检索文件的权限和所有权,但我没有答案.

I've been searching over the internet how to retrieve permissions and ownership of a file using win32 api, and yet I have no answer.

我是 win32 api 的新手,从互联网上阅读了一些指南,试图分析一些代码与此 api 相关联,但我仍然一无所知.

I'm new with the win32 api , read some guides from the internet, tried to analyze some code associating with this api and still I'm clueless.

你们能不能帮我提供一些建议或一些方向、技巧等.

Could you guys help me out with some piece of advice or some directions , tips etc.

很抱歉,我无法通过添加一些代码来更具体,我认为没有任何理由导入我自己的任何代码,因为唯一剩下的功能是检索此信息的功能,其余功能很简单(用户界面等).

I'm sorry that I can't be more specific than that by adding some code, I don't see any reason to import any code of my own since the only remaining function is the one retrieving this information and the rest is simple(User interface and etc).

推荐答案

参见 检索 NTFS 权限用 C++.但是,基本上,您调用 GetFileSecurity 获取文件的安全描述符.从中,您可以获得访问控制列表 (ACL) 以及所有者和权限.

See Retrieving NTFS Permissions with C++. But, basically, you call GetFileSecurity to get a security descriptor for the file. From that, you can get the access control list (ACL) and the owner and permissions.

这篇关于C++ 如何通过 win32 api 检索文件权限和所有权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

无法访问 C++ std::set 中对象的非常量成员函数
Unable to access non-const member functions of objects in C++ std::set(无法访问 C++ std::set 中对象的非常量成员函数)...
2024-08-14 C/C++开发问题
17

从 lambda 构造 std::function 参数
Constructing std::function argument from lambda(从 lambda 构造 std::function 参数)...
2024-08-14 C/C++开发问题
25

STL BigInt 类实现
STL BigInt class implementation(STL BigInt 类实现)...
2024-08-14 C/C++开发问题
3

使用 std::atomic 和 std::condition_variable 同步不可靠
Sync is unreliable using std::atomic and std::condition_variable(使用 std::atomic 和 std::condition_variable 同步不可靠)...
2024-08-14 C/C++开发问题
17

在 STL 中将列表元素移动到末尾
Move list element to the end in STL(在 STL 中将列表元素移动到末尾)...
2024-08-14 C/C++开发问题
9

为什么禁止对存储在 STL 容器中的类重载 operator&()?
Why is overloading operatoramp;() prohibited for classes stored in STL containers?(为什么禁止对存储在 STL 容器中的类重载 operatoramp;()?)...
2024-08-14 C/C++开发问题
6