gpt4 book ai didi

winapi - SetNamedSecurityInfo 采用可写路径;缓冲区应该有多大?

转载 作者:行者123 更新时间:2023-12-05 07:24:12 24 4
gpt4 key购买 nike

SetNamedSecurityInfo被定义为采用 LPTSTR,而不是 LPCTSTR。现在采用 LPTSTR 的标准 Win32 API 也有一些指示必要缓冲区长度的方法。有时这在签名中是明确的,有时它被记录为 MAX_PATH 或其他方式。 SetNamedSecurityInfo 不是这样。

老实说,我不知道为什么 SetNamedSecurityInfo 想要写入到那个缓冲区,但也许它会尝试就地规范化路径。但是我可能需要支持 32768 个字符?

最佳答案

正如您在文档中看到的SetNamedSecurityInfo

pObjectName

A pointer to a null-terminated string that specifies the name of the object for which to set security information.

这意味着将发送到函数中的缓冲区长度始终与缓冲区的字符串长度相关。

关于winapi - SetNamedSecurityInfo 采用可写路径;缓冲区应该有多大?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55577738/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com