我有一个const字符串 - “testfilename.sys”,并且我想创建一个PUNICODE_STRING
来保存它。
我该怎么做?将wchar_t数组转换为PUNICODE_STRING
1
A
回答
2
你可能会觉得这篇博文有趣:How to correctly initialize a UNICODE_STRING。
1
As @David Heffernan指出,RtlInitUnicodeString是创建UNICODE_STRING结构的方法。
你的情况:
#include <Winternl.h>
[...]
UNICODE_STRING myUnicodeStr;
RtlInitUnicodeString(&myUnicodeStr, L"testfilename.sys");
一个PUNICODE_STRING
只是UNICODE_STRING*
。
0
在wdk中有RTL_CONSTANT_STRING宏,可以在编译时使用它来创建UNICODE_STRING。
相关问题
- 1. 将wchar_t转换为char C++
- 2. 将wchar_t转换为wstring
- 3. 将irr :: c8转换为wchar_t *
- 4. 将wchar_t转换为int
- 5. 如何将char数组转换为wchar_t数组?
- 6. 将函数从wchar_t数组转换为long int
- 7. 将字节数组的内容转换为wchar_t *
- 8. 转换为wchar_t为CHAR
- 9. 将const char *转换为常量wchar_t *
- 10. 如何将wchar_t **转换为char **?
- 11. 如何将PCWSTR转换为char []或wchar_t []
- 12. 如何将wchar_t *转换为wstring?
- 13. 如何将wchar_t *转换为字符串?
- 14. 如何将'wchar_t *'转换为'const char *'
- 15. 将int转换为常量wchar_t *
- 16. C++将unicode CString或wchar_t转换为LPBYTE
- 17. 如何将wchar_t *转换为std :: string? ?
- 18. 使用wsprintf将int转换为wchar_t *
- 19. 如何将wstring转换为wchar_t *? C++
- 20. 安全地将uint8_t转换为wchar_t
- 21. 将常量wchar_t *转换为WCHAR *
- 22. 如何将wchar_t(或wchar_t *或CORBA :: WChar *)转换为字符串?
- 23. 从wchar_t转换为int
- 24. wchar_t转换为字符
- 25. 转换为wchar_t到CFStringref
- 26. Wchar_t to string转换
- 27. 将json转换为数组php将数组转换为字符串转换
- 28. 将数组转换为数组数组
- 29. 如何为wchar_t *转换为const char *
- 30. 转换为wchar_t *为char * iOS上
网络搜索表明RtlInitUnicodeString是答案 – 2012-01-05 13:26:31
PUNICODE_STRING只是微软的(在我看来)习惯'typedef'指针的习惯,数据类型被称为'UNICODE_STRING'。 – unwind 2012-01-05 13:28:05
非常感谢你们俩! – sternr 2012-01-05 14:09:15