I know the code in C is this:
WCHAR string[] = L"string\0";
So I tried (in Python):
string = ctypes.create_unicode_buffer("String\0")
But this strips the Null character of or something.
If I use create_string_buffer it does work.
string = ctypes.create_string_buffer("String\0")
Now the the string has 2 Null characters at the end of it:
>>> string.raw
'String\x00\x00'
So why does this not work for unicode?
Edit:
This works (source: Python Ctypes Null Terminated String Block):
string = ctypes.wstring_at(ctypes.create_unicode_buffer(u'string\0'), 7)