有关 Microsoft 多字符串格式的详细信息
在其一些API函数 Microsoft 使用“多字符串”格式来指定字符串列表。
据我了解,多字符串是连接的空终止字符串的空终止缓冲区。但这也可以解释为字符串列表,由空字符分隔并以两个空字符结尾。
这里有一个例子。由以下项目组成的列表:
"apple", "banana", "orange"
变为:
apple\0banana\0orange\0\0
但现在我想知道:
空列表 将如何表示?
会是:
\0
或者:
\0\0
我未能找到准确的文档来澄清这一点。有什么线索吗?
In some of its API function Microsoft use the "multi-string" format to specify a list of strings.
As I understand it, a multi-string is a null-terminated buffer of concatenated null-terminated strings. But this can also be interpreted as a list of strings, separated by a null character and terminated by two null characters.
Here comes an example. A list composed of the following items:
"apple", "banana", "orange"
Becomes:
apple\0banana\0orange\0\0
But now I wonder:
How would an empty list be represented ?
Would it be:
\0
Or:
\0\0
I failed to found an accurate documentation that clarifies this. Any clue ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
\0
\0
它将是
\0
。Raymond Chen 在他的博客上描述了它的工作原理:字符串列表以空字符串终止。如果列表中的第一个字符串为空,则列表本身也为空。
It would be
\0
.Raymond Chen describes how this works on his blog: the list of strings is terminated by an empty string. If the first string in the list is empty, the list itself is empty.
如果您正在使用这些,很多年前,我编写了一个适用于它们的 STL 样式迭代器:
http: //noveltheory.com/iterators/Iterator_N3.htm
If you are working with these, many years ago, I wrote an STL style iterator which works on them:
http://noveltheory.com/iterators/Iterator_N3.htm