c++ - 我需要从 GetNamedSecurityInfo API 中释放哪些返回参数?

标签 c++ winapi advapi32

当我调用 GetNamedSecurityInfo API 并且它成功了,MSDN 指出我需要在 ppSecurityDescriptor 上调用 LocalFree,但是 ppDaclppSacl?

最佳答案

根据 MSDN :

A pointer to a variable that receives a pointer to the owner SID in the security descriptor

A pointer to a variable that receives a pointer to the primary group SID in the returned security descriptor

A pointer to a variable that receives a pointer to the DACL in the returned security descriptor

A pointer to a variable that receives a pointer to the SACL in the returned security descriptor

those parameters will point to the corresponding parameters in the security descriptor returned in ppSecurityDescriptor.

您只需要释放 ppSecurityDescriptor,因为其他指针指向安全描述符中的字段。

关于c++ - 我需要从 GetNamedSecurityInfo API 中释放哪些返回参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14887038/

相关文章:

c++ - 访问另一个类的数据,该类的对象作为构造函数中的参数发送

c++ - 如何将文本更改为语音以及如何将字符插入字符数组

winapi - MSG 结构的时间成员采用什么格式?

c# - 在 C# 上登录用户后注销

c++ - 尝试从 dll 调用 extern "C"函数的链接器错误

c++ - Boost:bind 和 Boost::function

c++ - 为什么 Netbeans 不在我的断点处停止?

c++ - Win32/MFC 从客户端矩形获取窗口矩形

java - 如何使用 Java 和 JNA 写入 Windows 事件日志

python - 是什么让这个安全描述符变坏了?